作者 tangxvhui

接口改动

@@ -161,6 +161,10 @@ func (c *AdminUserController) ListAdminUser() { @@ -161,6 +161,10 @@ func (c *AdminUserController) ListAdminUser() {
161 "id": adminusers[i].Id, 161 "id": adminusers[i].Id,
162 "account": adminusers[i].Account, 162 "account": adminusers[i].Account,
163 "permission": permissionTypes, 163 "permission": permissionTypes,
  164 + "statue": 0,
  165 + }
  166 + if adminusers[i].IsUsable {
  167 + m["statue"] = 1
164 } 168 }
165 listData = append(listData, m) 169 listData = append(listData, m)
166 } 170 }
@@ -172,6 +176,7 @@ func (c *AdminUserController) ForbiddenAdminUser() { @@ -172,6 +176,7 @@ func (c *AdminUserController) ForbiddenAdminUser() {
172 //用与适配前端定义的数据结构 176 //用与适配前端定义的数据结构
173 type Paramter struct { 177 type Paramter struct {
174 Id int64 `json:"id"` 178 Id int64 `json:"id"`
  179 + Statue int `json:"statue"`
175 } 180 }
176 var ( 181 var (
177 param Paramter 182 param Paramter
@@ -183,7 +188,17 @@ func (c *AdminUserController) ForbiddenAdminUser() { @@ -183,7 +188,17 @@ func (c *AdminUserController) ForbiddenAdminUser() {
183 return 188 return
184 } 189 }
185 newAdminUserService := adminuserservice.NewAdminUserService(nil) 190 newAdminUserService := adminuserservice.NewAdminUserService(nil)
186 - err = newAdminUserService.UpdateAdminIsUsable(param.Id, false) 191 + var isUsable bool
  192 + if param.Statue == 1 {
  193 + isUsable = true
  194 + } else if param.Statue == 0 {
  195 + isUsable = false
  196 + } else {
  197 + c.ResponseError(errors.New("参数错误"))
  198 + return
  199 + }
  200 +
  201 + err = newAdminUserService.UpdateAdminIsUsable(param.Id, isUsable)
187 if err != nil { 202 if err != nil {
188 c.ResponseError(err) 203 c.ResponseError(err)
189 return 204 return