...
|
...
|
@@ -121,13 +121,10 @@ func (c *UserController) GetUserData() { |
|
|
|
|
|
//EditUserPermission 编辑用户的权限数据
|
|
|
func (c *UserController) EditUserPermission() {
|
|
|
type PartnerList struct {
|
|
|
Id int64 `json:"id"`
|
|
|
}
|
|
|
type UserDetailParam struct {
|
|
|
Id int64 `json:"id"`
|
|
|
PermissionType []int64 `json:"permissionType"`
|
|
|
CheckedPartner []PartnerList `json:"checkedPartner"` //合伙人
|
|
|
Id int64 `json:"id"`
|
|
|
PermissionType []int64 `json:"permissionType"`
|
|
|
CheckedPartner []int64 `json:"checkedPartner"` //合伙人
|
|
|
}
|
|
|
var (
|
|
|
param UserDetailParam
|
...
|
...
|
@@ -140,17 +137,11 @@ func (c *UserController) EditUserPermission() { |
|
|
}
|
|
|
companyId := c.GetUserCompany()
|
|
|
newUserService := userService.NewUsersService(nil)
|
|
|
var (
|
|
|
partnerIds = make([]int64, len(param.CheckedPartner))
|
|
|
)
|
|
|
for _, v := range param.CheckedPartner {
|
|
|
partnerIds = append(partnerIds, v.Id)
|
|
|
}
|
|
|
err = newUserService.EditUserPermission(userCommand.EditUserPermissionCommand{
|
|
|
Id: param.Id,
|
|
|
CompanyId: companyId,
|
|
|
PermissionType: param.PermissionType,
|
|
|
CheckedPartner: partnerIds,
|
|
|
CheckedPartner: param.CheckedPartner,
|
|
|
})
|
|
|
if err != nil {
|
|
|
c.ResponseError(err)
|
...
|
...
|
|