Skip to content

Commit

Permalink
Merge pull request #284 from ArtisanCloud/dev/michaelhu
Browse files Browse the repository at this point in the history
Dev/michaelhu
  • Loading branch information
Matrix-X authored Jun 22, 2024
2 parents a192258 + 616d29f commit 1b40481
Show file tree
Hide file tree
Showing 163 changed files with 4,241 additions and 2,148 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/go-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ jobs:
build-go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@v4
with:
go-version: 1.21

- name: Build
run: cd cmd/server && go build
run: go build cmd/server/powerx.go

6 changes: 3 additions & 3 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
env:
API_V3_KEY: ${{ secrets.API_V3_KEY }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Test
run: cd cmd/server && go test
run: go test cmd/server/powerx.go
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ powerx
!internal/uc/powerx
!cmd/server/powerx.go
/plugins
wechat
./wechat
1,640 changes: 1,640 additions & 0 deletions api.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api/admin.api
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "admin/common.api"
import "admin/department.api"
import "admin/position.api"
import "admin/employee.api"
import "admin/user.api"
import "admin/permission.api"
import "admin/auth.api"
import "admin/dictionary.api"
Expand Down
2 changes: 1 addition & 1 deletion api/admin.scrm.api
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import "admin/scrm/contactway.api"
//import "admin/scrm/customer.api"
//import "admin/scrm/contact.api"
// organzation
import "admin/scrm/organization/weworkemployee.api"
import "admin/scrm/organization/weworkuser.api"
import "admin/scrm/organization/weworkdepartment.api"
// app
import "admin/scrm/app/weworkgroup.api"
Expand Down
38 changes: 19 additions & 19 deletions api/admin/common.api
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ info(
@server(
group: admin/common
prefix: /api/v1/admin/common
middleware: EmployeeNoPermJWTAuth
middleware: UserNoPermJWTAuth
)

service PowerX {
@doc "员工Options远程搜索"
@handler GetEmployeeOptions
get /options/employees (GetEmployeeOptionsRequest) returns (GetEmployeeOptionsReply)
@handler GetUserOptions
get /options/users (GetUserOptionsRequest) returns (GetUserOptionsReply)

@doc "查询员工过滤条件"
@handler GetEmployeeQueryOptions
get /options/employee-query returns (GetEmployeeQueryOptionsReply)
@handler GetUserQueryOptions
get /options/user-query returns (GetUserQueryOptionsReply)

@doc "部门Options远程搜索"
@handler GetDepartmentOptions
Expand All @@ -33,15 +33,15 @@ service PowerX {
}

type (
GetEmployeeOptionsRequest struct {
GetUserOptionsRequest {
LikeName string `form:"likeName,optional"`
LikeEmail string `form:"likeEmail,optional"`
LikePhoneNumber string `form:"likePhoneNumber,optional"`
PageIndex int `form:"pageIndex,optional"`
PageSize int `form:"pageSize,optional"`
}

EmployeeOption struct {
UserOption {
Id int64 `json:"id"`
Avatar string `json:"avatar"`
Account string `json:"account"`
Expand All @@ -50,45 +50,45 @@ type (
PhoneNumber string `json:"phoneNumber"`
}

GetEmployeeOptionsReply struct {
List []EmployeeOption `json:"list"`
GetUserOptionsReply {
List []UserOption `json:"list"`
PageIndex int `json:"pageIndex"`
PageSize int `json:"pageSize"`
Total int64 `json:"total"`
}
)

type (
EmployeeQueryRoleOption {
UserQueryRoleOption {
RoleCode string `json:"roleCode"`
RoleName string `json:"roleName"`
}

EmployeeQueryDepartmentOption {
UserQueryDepartmentOption {
DepartmentId int64 `json:"departmentId"`
DepartmentName string `json:"departmentName"`
}

GetEmployeeQueryOptionsReply {
Roles []EmployeeQueryRoleOption `json:"roles"`
Departments []EmployeeQueryDepartmentOption `json:"departments"`
GetUserQueryOptionsReply {
Roles []UserQueryRoleOption `json:"roles"`
Departments []UserQueryDepartmentOption `json:"departments"`
}
)

type (
GetDepartmentOptionsRequest struct {
GetDepartmentOptionsRequest {
Ids []int64 `form:"ids,optional"`
LikeName string `form:"likeName,optional"`
PageIndex int `form:"pageIndex,optional"`
PageSize int `form:"pageSize,optional"`
}

DepartmentOption struct {
DepartmentOption {
Id int64 `json:"id"`
Name string `json:"name"`
}

GetDepartmentOptionsReply struct {
GetDepartmentOptionsReply {
List []DepartmentOption `json:"list"`
PageIndex int `json:"pageIndex"`
PageSize int `json:"pageSize"`
Expand All @@ -97,12 +97,12 @@ type (
)

type (
GetOptionsRequest struct {
GetOptionsRequest {
Type string `form:"type,optional"`
Search string `form:"search,optional"`
}

GetOptionsReply struct {
GetOptionsReply {
Options []map[string]interface{} `json:"options"`
}
)
Expand Down
36 changes: 18 additions & 18 deletions api/admin/crm/business/opportunity.api
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ info(
@server(
group: admin/crm/business/opportunity
prefix: /api/v1/admin/business
middleware: EmployeeJWTAuth
middleware: UserJWTAuth
)

service PowerX {
Expand All @@ -24,8 +24,8 @@ service PowerX {
post /opportunities (CreateOpportunityRequest) returns (CreateOpportunityReply)

@doc "为商机分配员工"
@handler AssignEmployeeToOpportunity
put /opportunities/:id/assign-employee (AssignEmployeeToOpportunityRequest) returns (AssignEmployeeToOpportunityReply)
@handler AssignUserToOpportunity
put /opportunities/:id/assign-user (AssignUserToOpportunityRequest) returns (AssignUserToOpportunityReply)

@doc "修改商机信息"
@handler UpdateOpportunity
Expand All @@ -37,7 +37,7 @@ service PowerX {
}

type (
GetOpportunityListRequest struct {
GetOpportunityListRequest {
Name string `form:"name,optional"`
Source string `form:"source,optional"`
Type string `form:"type,optional"`
Expand All @@ -47,22 +47,22 @@ type (
PageSize int `form:"pageSize,optional"`
}

Opportunity struct {
Opportunity {
Id int64 `json:"id"`
Name string `json:"name"`
Requirement string `json:"requirement"`
CustomerId int64 `json:"customerId"`
Probability float32 `json:"probability"`
Source string `json:"source"`
Type string `json:"type"`
EmployeeId int64 `json:"employeeId"`
UserId int64 `json:"userId"`
Stage string `json:"stage"`
ClosedDate string `json:"closedDate"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}

GetOpportunityListReply struct {
GetOpportunityListReply {
List []Opportunity `json:"list"`
PageIndex int `json:"pageIndex"`
PageSize int `json:"pageSize"`
Expand All @@ -71,58 +71,58 @@ type (
)

type (
CreateOpportunityRequest struct {
CreateOpportunityRequest {
Name string `json:"name"`
Requirement string `json:"requirement"`
CustomerId int64 `json:"customerId"`
Probability float32 `json:"probability,optional"`
Source string `json:"source,options=new_customer|old_customer_new_purchase|old_customer_repurchase|old_customer_upgrade"`
Type string `json:"type,options=trial_requirement|requirement_match|detailed_requirement_analysis|solution_provided|quotation|negotiation|closed_unsuccessful|closed_successful"`
EmployeeId int64 `json:"employeeId"`
UserId int64 `json:"userId"`
Stage string `json:"stage"`
}

CreateOpportunityReply struct {
CreateOpportunityReply {
Id int64 `json:"id"`
}
)

type (
AssignEmployeeToOpportunityRequest struct {
AssignUserToOpportunityRequest {
Id int64 `path:"id"`
EmployeeId int64 `json:"employeeId"`
UserId int64 `json:"userId"`
}

AssignEmployeeToOpportunityReply struct {
AssignUserToOpportunityReply {
Id int64 `json:"id"`
}
)

type (
UpdateOpportunityRequest struct {
UpdateOpportunityRequest {
Id int64 `path:"id"`
Name string `json:"name,optional"`
Requirement string `json:"requirement,optional"`
CustomerId int64 `json:"customerId,optional"`
Probability float32 `json:"probability,optional"`
Source string `json:"source,optional,options=new_customer|old_customer_new_purchase|old_customer_repurchase|old_customer_upgrade"`
Type string `json:"type,optional,options=trial_requirement|requirement_match|detailed_requirement_analysis|solution_provided|quotation|negotiation|closed_unsuccessful|closed_successful"`
EmployeeId int64 `json:"employeeId,optional"`
UserId int64 `json:"userId,optional"`
Stage string `json:"stage,optional"`
ClosedDate string `json:"closedDate,optional"`
}

UpdateOpportunityReply struct {
UpdateOpportunityReply {
*Opportunity
}
)

type (
DeleteOpportunityRequest struct {
DeleteOpportunityRequest {
Id int64 `path:"id"`
}

DeleteOpportunityReply struct {
DeleteOpportunityReply {
Id int64 `json:"id"`
}
)
12 changes: 6 additions & 6 deletions api/admin/crm/customerdomain/customer.api
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ info(
@server(
group: admin/crm/customerdomain/customer
prefix: /api/v1/admin/customerdomain
middleware: EmployeeJWTAuth
middleware: UserJWTAuth
)

service PowerX {
Expand Down Expand Up @@ -40,8 +40,8 @@ service PowerX {
delete /customers/:id (DeleteCustomerRequest) returns (DeleteCustomerReply)

@doc "为客户分配员工"
@handler AssignCustomerToEmployee
post /customers/:id/actions/employees (AssignCustomerToEmployeeRequest) returns (AssignCustomerToEmployeeReply)
@handler AssignCustomerToUser
post /customers/:id/actions/users (AssignCustomerToUserRequest) returns (AssignCustomerToUserReply)
}

type (
Expand Down Expand Up @@ -153,12 +153,12 @@ type (
)

type (
AssignCustomerToEmployeeRequest {
AssignCustomerToUserRequest {
Id string `path:"id"`
EmployeeId int64 `json:"employeeId"`
UserId int64 `json:"userId"`
}

AssignCustomerToEmployeeReply {
AssignCustomerToUserReply {
CustomerId int64 `json:"customerId"`
}
)
12 changes: 6 additions & 6 deletions api/admin/crm/customerdomain/lead.api
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ info(
@server(
group: admin/crm/customerdomain/leader
prefix: /api/v1/admin/customerdomain
middleware: EmployeeJWTAuth
middleware: UserJWTAuth
)

service PowerX {
Expand Down Expand Up @@ -40,8 +40,8 @@ service PowerX {
delete /leads/:id (DeleteLeadRequest) returns (DeleteLeadReply)

@doc "为线索分配员工"
@handler AssignLeadToEmployee
post /leads/:id/actions/employees (AssignLeadToEmployeeRequest) returns (AssignLeadToEmployeeReply)
@handler AssignLeadToUser
post /leads/:id/actions/users (AssignLeadToUserRequest) returns (AssignLeadToUserReply)
}

type (
Expand Down Expand Up @@ -151,12 +151,12 @@ type (
)

type (
AssignLeadToEmployeeRequest {
AssignLeadToUserRequest {
Id string `path:"id"`
EmployeeId int64 `json:"employeeId"`
UserId int64 `json:"userId"`
}

AssignLeadToEmployeeReply {
AssignLeadToUserReply {
LeadId int64 `json:"leadId"`
}
)
8 changes: 4 additions & 4 deletions api/admin/crm/customerdomain/registercode.api
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ info(
@server(
group: admin/crm/customerdomain/registercode
prefix: /api/v1/admin/customerdomain
middleware: EmployeeJWTAuth
middleware: UserJWTAuth
)

service PowerX {
Expand Down Expand Up @@ -142,12 +142,12 @@ type (
)

type (
AssignRegisterCodeToEmployeeRequest {
AssignRegisterCodeToUserRequest {
Id string `path:"id"`
EmployeeId int64 `json:"employeeId"`
UserId int64 `json:"userId"`
}

AssignRegisterCodeToEmployeeReply {
AssignRegisterCodeToUserReply {
RegisterCodeId int64 `json:"customerId"`
}
)
Loading

0 comments on commit 1b40481

Please sign in to comment.