Skip to content

Commit

Permalink
GetCompanyMembersByStatusPath
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanJey committed Sep 19, 2024
1 parent bc9bef7 commit 6f4fbf7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/consts/api_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const (

///org/dev/v1/companies/{company_id}/depts/{dept_id}/members/{account_id}/weight
ChangeMemberDeptWeightPath = "/org/dev/v1/companies/%s/depts/%s/members/%s/weight"

// GetCompanyMembersByStatusPath 根据状态获取企业成员列表
GetCompanyMembersByStatusPath = "/org/dev/v1/companies/%s/members/dept?status=%s&offset=%s&limit=%s"
)

const (
Expand Down
11 changes: 11 additions & 0 deletions user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,24 @@ type ApiUser interface {
BatchEnableThirdMembers(operationID string, req api_req.BatchEnableThirdMembersReq) (*api_resp.CommonResp, error)
//ChangeMemberDeptWeightPath
ChangeMemberDeptWeightPath(operationID, deptId, accountId string, req api_req.ChangeMemberDeptWeightReq) (*api_resp.CommonResp, error)
GetCompanyMembersByStatusPath(operationID string, status, offset, limit string) (*api_resp.BatchGetCompanyMembersResp, error)
}
type User struct {
addr string
sign *sign.Sign
companyId string
}

func (u *User) GetCompanyMembersByStatusPath(operationID string, status, offset, limit string) (*api_resp.BatchGetCompanyMembersResp, error) {
resp := api_resp.BatchGetCompanyMembersResp{}
err := http_client.Get(operationID, fmt.Sprintf(u.addr+consts.GetCompanyMembersByStatusPath, u.companyId, status, offset, limit), nil, &resp, *u.sign)
if err != nil {
log.Error(operationID, "GetCompanyMembersByStatusPath err ", err.Error())
return nil, err
}
return &resp, nil
}

func (u *User) ChangeMemberDeptWeightPath(operationID, deptId, accountId string, req api_req.ChangeMemberDeptWeightReq) (*api_resp.CommonResp, error) {
resp := api_resp.CommonResp{}
err := http_client.Post(operationID, fmt.Sprintf(u.addr+consts.ChangeMemberDeptWeightPath, u.companyId, deptId, accountId), req, &resp, *u.sign)
Expand Down

0 comments on commit 6f4fbf7

Please sign in to comment.