Skip to content

Commit

Permalink
refact(user): change employee to user
Browse files Browse the repository at this point in the history
  • Loading branch information
Matrix-X committed May 30, 2024
1 parent d527cf8 commit e4d6a1f
Show file tree
Hide file tree
Showing 150 changed files with 2,065 additions and 1,981 deletions.
328 changes: 328 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
28 changes: 14 additions & 14 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 struct {
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 struct {
Id int64 `json:"id"`
Avatar string `json:"avatar"`
Account string `json:"account"`
Expand All @@ -50,28 +50,28 @@ type (
PhoneNumber string `json:"phoneNumber"`
}

GetEmployeeOptionsReply struct {
List []EmployeeOption `json:"list"`
GetUserOptionsReply struct {
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"`
}
)

Expand Down
18 changes: 9 additions & 9 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 Down Expand Up @@ -55,7 +55,7 @@ type (
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"`
Expand All @@ -78,7 +78,7 @@ type (
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"`
}

Expand All @@ -88,12 +88,12 @@ type (
)

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

AssignEmployeeToOpportunityReply struct {
AssignUserToOpportunityReply struct {
Id int64 `json:"id"`
}
)
Expand All @@ -107,7 +107,7 @@ type (
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"`
}
Expand Down
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"`
}
)
8 changes: 4 additions & 4 deletions api/admin/crm/market/brandstory.api
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ info(
@server(
group: admin/crm/market/brandstory
prefix: /api/v1/admin/market
middleware: EmployeeJWTAuth
middleware: UserJWTAuth
)

service PowerX {
Expand Down Expand Up @@ -50,7 +50,7 @@ type (


StoreArtisan {
EmployeeId int64 `json:"employeeId,optional"`
UserId int64 `json:"userId,optional"`
Name string `json:"name,optional"`
Level int8 `json:"level,optional"`
Gender bool `json:"gender,optional"`
Expand All @@ -69,7 +69,7 @@ type (
Store {
Id int64 `json:"id,optional"`
Name string `json:"name"`
StoreEmployeeId int64 `json:"storeEmployeeId,optional"`
StoreUserId int64 `json:"storeUserId,optional"`
ContactNumber string `json:"contactNumber"`
Email string `json:"email,optional"`
Address string `json:"address"`
Expand Down Expand Up @@ -152,7 +152,7 @@ type (
type (
AssignStoreManagerRequest {
Id int64 `path:"id"`
EmployeeId int64 `json:"employeeId"`
UserId int64 `json:"userId"`
}

AssignStoreManagerReply {
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/market/media.api
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ info(
@server(
group: admin/crm/market/media
prefix: /api/v1/admin/market
middleware: EmployeeJWTAuth
middleware: UserJWTAuth
)

service PowerX {
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/market/mgm.api
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ info(
@server(
group: admin/crm/market/mgm
prefix: /api/v1/admin/market
middleware: EmployeeJWTAuth
middleware: UserJWTAuth
)

service PowerX {
Expand Down
8 changes: 4 additions & 4 deletions api/admin/crm/market/store.api
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ info(
@server(
group: admin/crm/market/store
prefix: /api/v1/admin/market
middleware: EmployeeJWTAuth
middleware: UserJWTAuth
)

service PowerX {
Expand Down Expand Up @@ -50,7 +50,7 @@ type (
}

StoreArtisan {
EmployeeId int64 `json:"employeeId,optional"`
UserId int64 `json:"userId,optional"`
Name string `json:"name,optional"`
Level int8 `json:"level,optional"`
Gender bool `json:"gender,optional"`
Expand All @@ -69,7 +69,7 @@ type (
Store {
Id int64 `json:"id,optional"`
Name string `json:"name"`
StoreEmployeeId int64 `json:"storeEmployeeId,optional"`
StoreUserId int64 `json:"storeUserId,optional"`
ContactNumber string `json:"contactNumber"`
Email string `json:"email,optional"`
Address string `json:"address"`
Expand Down Expand Up @@ -152,7 +152,7 @@ type (
type (
AssignStoreManagerRequest {
Id int64 `path:"id"`
EmployeeId int64 `json:"employeeId"`
UserId int64 `json:"userId"`
}

AssignStoreManagerReply {
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/membership/membership.api
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ info(
@server(
group: admin/crm/membership
prefix: /api/v1/admin/membership
middleware: EmployeeJWTAuth
middleware: UserJWTAuth
)

service PowerX {
Expand Down
4 changes: 2 additions & 2 deletions api/admin/crm/product/artisan.api
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ info(
@server(
group: admin/crm/product/artisan
prefix: /api/v1/admin/product
middleware: EmployeeJWTAuth
middleware: UserJWTAuth
)

service PowerX {
Expand Down Expand Up @@ -50,7 +50,7 @@ type (

Artisan {
Id int64 `json:"id,optional"`
EmployeeId int64 `json:"employeeId,optional"`
UserId int64 `json:"userId,optional"`
Name string `json:"name,optional"`
Level int8 `json:"level"`
Gender bool `json:"gender,optional"`
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/product/pricebook.api
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ info(
@server(
group: admin/crm/product/pricebook
prefix: /api/v1/admin/product
middleware: EmployeeJWTAuth
middleware: UserJWTAuth
)

service PowerX {
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/product/pricebookentry.api
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ info(
@server(
group: admin/crm/product/pricebookentry
prefix: /api/v1/admin/product
middleware: EmployeeJWTAuth
middleware: UserJWTAuth
)

service PowerX {
Expand Down
Loading

0 comments on commit e4d6a1f

Please sign in to comment.