作者 唐旭辉

添加模型

@@ -86,6 +86,7 @@ func (c *RbacController) RoleDelete() { @@ -86,6 +86,7 @@ func (c *RbacController) RoleDelete() {
86 } 86 }
87 87
88 err := serverbac.RoleDelete(param) 88 err := serverbac.RoleDelete(param)
  89 +
89 msg = protocol.NewReturnResponse(nil, err) 90 msg = protocol.NewReturnResponse(nil, err)
90 return 91 return
91 } 92 }
@@ -158,6 +159,7 @@ func (c *RbacController) RoleGroupDelete() { @@ -158,6 +159,7 @@ func (c *RbacController) RoleGroupDelete() {
158 msg = protocol.BadRequestParam("1") 159 msg = protocol.BadRequestParam("1")
159 return 160 return
160 } 161 }
  162 +
161 err := serverbac.RoleGroupDelete(param) 163 err := serverbac.RoleGroupDelete(param)
162 msg = protocol.NewReturnResponse(nil, err) 164 msg = protocol.NewReturnResponse(nil, err)
163 return 165 return
@@ -87,6 +87,6 @@ func GetUserCompanyBy(userid int64, companyId int64) (*UserCompany, error) { @@ -87,6 +87,6 @@ func GetUserCompanyBy(userid int64, companyId int64) (*UserCompany, error) {
87 } 87 }
88 88
89 func GetUserCompanyByUser(userid int64) ([]UserCompany, error) { 89 func GetUserCompanyByUser(userid int64) ([]UserCompany, error) {
90 - datasql := `` 90 + // datasql := ``
91 return nil, nil 91 return nil, nil
92 } 92 }
  1 +# 机会导向管理后台接口
  2 +
  3 +## 全局统一设定
  4 +
  5 +### 请求头指定要求的字段
  6 +
  7 +| 字段 | 说明 |
  8 +| ------------------ | ---------------------------- |
  9 +| x-mmm-accesstoken | 发起请求时使用时校验用 token |
  10 +| x-mmm-refreshtoken | 刷新 token 时使用的 token |
  11 +
  12 +- 备注 :token 使用 jwt 进行处理.其中包含有 user_id、company_id 的数据,登录时获取
  13 +
  14 +### 通用响应结构
  15 +
  16 +```json
  17 +{
  18 + "code": "错误码字符串",
  19 + "msg": "错误描述字符串",
  20 + "data": {
  21 + "xxx": "any"
  22 + }
  23 +}
  24 +```
  25 +
  26 +- 备注:data 中的内容根据各接口实际情况确定
  27 +
  28 +## 认证相关
  29 +
  30 +### 登录
  31 +
  32 +- 请求路径 :/auth/login
  33 +- 请求方式 :POST
  34 +- 请求 json:
  35 +
  36 +```json
  37 +{
  38 + "account": "账号",
  39 + "password": "密码"
  40 +}
  41 +```
  42 +
  43 +- 响应 json
  44 +
  45 +```json
  46 +{
  47 + "access_token": "xxxxx",
  48 + "expires_in": 1576033744852,
  49 + "refresh_token": "xxxxx",
  50 + "refresh_expires": 1576033744852
  51 +}
  52 +```
  53 +
  54 +- 备注 该请求无需指定请求头