正在显示
7 个修改的文件
包含
114 行增加
和
100 行删除
1 | ### 接口完成进度 | 1 | ### 接口完成进度 |
2 | 2 | ||
3 | | 功能 | 完成状态 | 时间 | 接口路径 | 请求方式 | | 3 | | 功能 | 完成状态 | 时间 | 接口路径 | 请求方式 | |
4 | -| ---------------- | ------------------ | --------------- | ------------------------------- | -------- | | 4 | +| ---------------- | ------------------ | --------------- | -------------------------- | -------- | |
5 | | 登录获取 token | 完成 | 2018/12/11 | /auth/login | post | | 5 | | 登录获取 token | 完成 | 2018/12/11 | /auth/login | post | |
6 | | 短信验证码 | 未开始 | | | | 6 | | 短信验证码 | 未开始 | | | |
7 | | 刷新 token | 完成 | 2018/12/11 | /v1/auth/refresh_token | get | | 7 | | 刷新 token | 完成 | 2018/12/11 | /v1/auth/refresh_token | get | |
8 | | 切换公司 | 完成 | 2018/12/11 | /v1/auth/change_company | post | | 8 | | 切换公司 | 完成 | 2018/12/11 | /v1/auth/change_company | post | |
9 | | 获取个人基础数据 | 未开始 | | /v1/auth/me | get | | 9 | | 获取个人基础数据 | 未开始 | | /v1/auth/me | get | |
10 | -| 获取角色列表 | 完成 | | /v1/rbac/:companyid/role | get | | ||
11 | -| 添加角色 | 完成 | 2019.11.26 | /v1/rbac/role | post | | ||
12 | -| 编辑角色 | 完成 | 2019.11.26 | /v1/rbac/role | put | | ||
13 | -| ~~删除角色~~ | ~~完成(待变更)~~ | ~~ 2019.11.26~~ | /v1/rbac/role | delete | | ||
14 | -| 删除角色 | 完成 | 2019.12.04 | /v1/rbac/role | delete | | ||
15 | -| 添加角色组 | 完成 | 2019.12.04 | /v1/rbac/role_group | post | | ||
16 | -| 编辑角色组 | 完成 | 2019.12.04 | /v1/rbac/role_group | put | | ||
17 | -| 删除角色组 | 完成 | 2019.12.04 | /v1/rbac/role_group | delete | | ||
18 | -| 获取部门列表 | 完成 | 2019.12.5 | /v1/company/department | get | | ||
19 | -| 添加部门 | 完成 | 2019.11.28 | /v1/company/department | post | | ||
20 | -| 编辑部门 | 完成 | 2019.11.29 | /v1/company/department | put | | ||
21 | -| ~~删除部门~~ | ~~完成(待变更)~~ | ~~2019.11.29~~ | ~~/v1/company/department~~ | delete | | ||
22 | -| 删除部门 | 完成 | 2019.12.2 | /v1/company/department | delete | | ||
23 | -| 获取职位列表 | 进行中 | | /v1/company/:companyid/position | get | | ||
24 | -| 添加职位 | 完成 | 2019.12.2 | /v1/company/position | post | | ||
25 | -| 编辑职位 | 完成 | 2019.12.2 | /v1/company/position | put | | ||
26 | -| 删除职位 | 完成 | 2019.12.2 | /v1/company/position | delete | | 10 | +| 获取角色列表 | 完成 | | /v1/rbac/role | get | |
11 | +| 添加角色 | 完成 | 2019.11.26 | /v1/rbac/role/add | post | | ||
12 | +| 编辑角色 | 完成 | 2019.11.26 | /v1/rbac/role/edit | post | | ||
13 | +| ~~删除角色~~ | ~~完成(待变更)~~ | ~~ 2019.11.26~~ | /v1/rbac/role/delete | post | | ||
14 | +| 删除角色 | 完成 | 2019.12.04 | /v1/rbac/role/delete | post | | ||
15 | +| 添加角色组 | 完成 | 2019.12.04 | /v1/rbac/role_group/add | post | | ||
16 | +| 编辑角色组 | 完成 | 2019.12.04 | /v1/rbac/role_group/edit | post | | ||
17 | +| 删除角色组 | 完成 | 2019.12.04 | /v1/rbac/role_group/delete | post | | ||
18 | +| 获取部门列表 | 完成 | 2019.12.5 | /v1/department | get | | ||
19 | +| 添加部门 | 完成 | 2019.11.28 | /v1/department/add | post | | ||
20 | +| 编辑部门 | 完成 | 2019.11.29 | /v1/department/edit | post | | ||
21 | +| ~~删除部门~~ | ~~完成(待变更)~~ | ~~2019.11.29~~ | ~~/v1/department~~ | post | | ||
22 | +| 删除部门 | 完成 | 2019.12.2 | /v1/department/delete | post | | ||
23 | +| 获取职位列表 | 进行中 | | /v1/position | get | | ||
24 | +| 添加职位 | 完成 | 2019.12.2 | /v1/position/add | post | | ||
25 | +| 编辑职位 | 完成 | 2019.12.2 | /v1/position/edit | post | | ||
26 | +| 删除职位 | 完成 | 2019.12.2 | /v1/position/delete | post | | ||
27 | | 添加员工 | 未开始 | | /v1/company/user | post | | 27 | | 添加员工 | 未开始 | | /v1/company/user | post | |
28 | -| 编辑员工 | 未开始 | | /v1/company/user | put | | ||
29 | -| 删除员工 | 未开始 | | /v1/company/user | delete | | 28 | +| 编辑员工 | 未开始 | | /v1/company/user | post | |
29 | +| 删除员工 | 未开始 | | /v1/company/user | post | | ||
30 | | 公告管理 | 未开始 | | | | | 30 | | 公告管理 | 未开始 | | | | |
31 | | 公告管理 | 未开始 | | | | | 31 | | 公告管理 | 未开始 | | | | |
32 | | 公告管理 | 未开始 | | | | | 32 | | 公告管理 | 未开始 | | | | |
@@ -6,7 +6,6 @@ import ( | @@ -6,7 +6,6 @@ import ( | ||
6 | "oppmg/models" | 6 | "oppmg/models" |
7 | "oppmg/protocol" | 7 | "oppmg/protocol" |
8 | serverbac "oppmg/services/rbac" | 8 | serverbac "oppmg/services/rbac" |
9 | - "strconv" | ||
10 | ) | 9 | ) |
11 | 10 | ||
12 | type RbacController struct { | 11 | type RbacController struct { |
@@ -31,6 +30,7 @@ func (c *RbacController) RoleAdd() { | @@ -31,6 +30,7 @@ func (c *RbacController) RoleAdd() { | ||
31 | msg = protocol.BadRequestParam("1") | 30 | msg = protocol.BadRequestParam("1") |
32 | return | 31 | return |
33 | } | 32 | } |
33 | + param.CompanyID = c.GetCompanyId() | ||
34 | if param.CompanyID <= 0 { | 34 | if param.CompanyID <= 0 { |
35 | log.Error("param.CompanyID <= 0") | 35 | log.Error("param.CompanyID <= 0") |
36 | msg = protocol.BadRequestParam("1") | 36 | msg = protocol.BadRequestParam("1") |
@@ -55,6 +55,7 @@ func (c *RbacController) RoleUpdate() { | @@ -55,6 +55,7 @@ func (c *RbacController) RoleUpdate() { | ||
55 | msg = protocol.BadRequestParam("1") | 55 | msg = protocol.BadRequestParam("1") |
56 | return | 56 | return |
57 | } | 57 | } |
58 | + param.CompanyID = c.GetCompanyId() | ||
58 | if param.CompanyID <= 0 { | 59 | if param.CompanyID <= 0 { |
59 | log.Error("param.CompanyID <= 0") | 60 | log.Error("param.CompanyID <= 0") |
60 | msg = protocol.BadRequestParam("1") | 61 | msg = protocol.BadRequestParam("1") |
@@ -79,6 +80,7 @@ func (c *RbacController) RoleDelete() { | @@ -79,6 +80,7 @@ func (c *RbacController) RoleDelete() { | ||
79 | msg = protocol.BadRequestParam("1") | 80 | msg = protocol.BadRequestParam("1") |
80 | return | 81 | return |
81 | } | 82 | } |
83 | + param.CompanyID = c.GetCompanyId() | ||
82 | if param.CompanyID <= 0 { | 84 | if param.CompanyID <= 0 { |
83 | log.Error("param.CompanyID <= 0") | 85 | log.Error("param.CompanyID <= 0") |
84 | msg = protocol.BadRequestParam("1") | 86 | msg = protocol.BadRequestParam("1") |
@@ -104,6 +106,7 @@ func (c *RbacController) RoleGroupAdd() { | @@ -104,6 +106,7 @@ func (c *RbacController) RoleGroupAdd() { | ||
104 | msg = protocol.BadRequestParam("1") | 106 | msg = protocol.BadRequestParam("1") |
105 | return | 107 | return |
106 | } | 108 | } |
109 | + param.CompanyID = c.GetCompanyId() | ||
107 | if param.CompanyID <= 0 { | 110 | if param.CompanyID <= 0 { |
108 | log.Error("param.CompanyID <= 0") | 111 | log.Error("param.CompanyID <= 0") |
109 | msg = protocol.BadRequestParam("1") | 112 | msg = protocol.BadRequestParam("1") |
@@ -129,6 +132,7 @@ func (c *RbacController) RoleGroupUpdate() { | @@ -129,6 +132,7 @@ func (c *RbacController) RoleGroupUpdate() { | ||
129 | msg = protocol.BadRequestParam("1") | 132 | msg = protocol.BadRequestParam("1") |
130 | return | 133 | return |
131 | } | 134 | } |
135 | + param.CompanyID = c.GetCompanyId() | ||
132 | if param.CompanyID <= 0 { | 136 | if param.CompanyID <= 0 { |
133 | log.Error("param.CompanyID <= 0") | 137 | log.Error("param.CompanyID <= 0") |
134 | msg = protocol.BadRequestParam("1") | 138 | msg = protocol.BadRequestParam("1") |
@@ -154,6 +158,7 @@ func (c *RbacController) RoleGroupDelete() { | @@ -154,6 +158,7 @@ func (c *RbacController) RoleGroupDelete() { | ||
154 | msg = protocol.BadRequestParam("1") | 158 | msg = protocol.BadRequestParam("1") |
155 | return | 159 | return |
156 | } | 160 | } |
161 | + param.CompanyID = c.GetCompanyId() | ||
157 | if param.CompanyID <= 0 { | 162 | if param.CompanyID <= 0 { |
158 | log.Error("param.CompanyID <= 0") | 163 | log.Error("param.CompanyID <= 0") |
159 | msg = protocol.BadRequestParam("1") | 164 | msg = protocol.BadRequestParam("1") |
@@ -166,15 +171,14 @@ func (c *RbacController) RoleGroupDelete() { | @@ -166,15 +171,14 @@ func (c *RbacController) RoleGroupDelete() { | ||
166 | } | 171 | } |
167 | 172 | ||
168 | // RoleList | 173 | // RoleList |
169 | -// @router /:companyid/role [get] | 174 | +// @router /role [get] |
170 | func (c *RbacController) RoleList() { | 175 | func (c *RbacController) RoleList() { |
171 | var msg *protocol.ResponseMessage | 176 | var msg *protocol.ResponseMessage |
172 | defer func() { | 177 | defer func() { |
173 | c.ResposeJson(msg) | 178 | c.ResposeJson(msg) |
174 | }() | 179 | }() |
175 | var companyid int64 | 180 | var companyid int64 |
176 | - param := c.Ctx.Input.Param(":companyid") | ||
177 | - companyid, _ = strconv.ParseInt(param, 10, 64) | 181 | + companyid = c.GetCompanyId() |
178 | if companyid <= 0 { | 182 | if companyid <= 0 { |
179 | msg = protocol.BadRequestParam("1") | 183 | msg = protocol.BadRequestParam("1") |
180 | return | 184 | return |
@@ -10,4 +10,5 @@ type RequestPageInfo struct { | @@ -10,4 +10,5 @@ type RequestPageInfo struct { | ||
10 | type ResponsePageInfo struct { | 10 | type ResponsePageInfo struct { |
11 | TotalPage int `json:"totalRow"` | 11 | TotalPage int `json:"totalRow"` |
12 | CurrentPage int `json:"pageNumber"` | 12 | CurrentPage int `json:"pageNumber"` |
13 | + // ListData interface{} `json:"list"` | ||
13 | } | 14 | } |
@@ -90,6 +90,7 @@ func SearchErr(code string) ErrorCode { | @@ -90,6 +90,7 @@ func SearchErr(code string) ErrorCode { | ||
90 | return errmessge.Search(code) | 90 | return errmessge.Search(code) |
91 | } | 91 | } |
92 | 92 | ||
93 | +//NewReturnResponse 控制层响应返回 | ||
93 | func NewReturnResponse(data interface{}, eRR error) (msg *ResponseMessage) { | 94 | func NewReturnResponse(data interface{}, eRR error) (msg *ResponseMessage) { |
94 | // var msg *ResponseMessage | 95 | // var msg *ResponseMessage |
95 | if eRR == nil { | 96 | if eRR == nil { |
@@ -104,6 +105,22 @@ func NewReturnResponse(data interface{}, eRR error) (msg *ResponseMessage) { | @@ -104,6 +105,22 @@ func NewReturnResponse(data interface{}, eRR error) (msg *ResponseMessage) { | ||
104 | return NewMesage("1") | 105 | return NewMesage("1") |
105 | } | 106 | } |
106 | 107 | ||
108 | +//BadRequestParam 控制层响应返回 | ||
107 | func BadRequestParam(code string) *ResponseMessage { | 109 | func BadRequestParam(code string) *ResponseMessage { |
108 | return NewMesage(code) | 110 | return NewMesage(code) |
109 | } | 111 | } |
112 | + | ||
113 | +//NewPageDataResponse 控制层分页数据响应返回 | ||
114 | +func NewPageDataResponse(data interface{}, eRR error) (msg *ResponseMessage) { | ||
115 | + if eRR != nil { | ||
116 | + if x, ok := eRR.(CustomErrParse); ok { | ||
117 | + return x.ParseToMessage() | ||
118 | + } | ||
119 | + return NewMesage("1") | ||
120 | + } | ||
121 | + msg = NewMesage("0") | ||
122 | + msg.Data = map[string]interface{}{ | ||
123 | + "gridResult": data, | ||
124 | + } | ||
125 | + return msg | ||
126 | +} |
@@ -13,25 +13,26 @@ func init() { | @@ -13,25 +13,26 @@ func init() { | ||
13 | beego.NSBefore(middleware.AllowOption), | 13 | beego.NSBefore(middleware.AllowOption), |
14 | beego.NSBefore(middleware.LogRequestData), | 14 | beego.NSBefore(middleware.LogRequestData), |
15 | beego.NSBefore(middleware.AuthToken), | 15 | beego.NSBefore(middleware.AuthToken), |
16 | - beego.NSNamespace("/company", | ||
17 | - beego.NSRouter("/department", &controllers.CompanyController{}, "get:DepartmentList"), | ||
18 | - beego.NSRouter("/department/:id([0-9]+)", &controllers.CompanyController{}, "get:DepartmentOne"), | ||
19 | - beego.NSRouter("/department", &controllers.CompanyController{}, "post:DepartmentAdd"), | ||
20 | - beego.NSRouter("/department", &controllers.CompanyController{}, "put:DepartmentUpdate"), | ||
21 | - beego.NSRouter("/department", &controllers.CompanyController{}, "delete:DepartmentDelete"), | ||
22 | - beego.NSRouter("/position", &controllers.CompanyController{}, "get:PositionList"), | ||
23 | - beego.NSRouter("/position", &controllers.CompanyController{}, "post:PositionAdd"), | ||
24 | - beego.NSRouter("/position", &controllers.CompanyController{}, "put:PositionEdit"), | ||
25 | - beego.NSRouter("/position", &controllers.CompanyController{}, "delete:PositionDelete"), | 16 | + beego.NSNamespace("/department", |
17 | + beego.NSRouter("/list", &controllers.CompanyController{}, "get:DepartmentList"), | ||
18 | + beego.NSRouter("/add", &controllers.CompanyController{}, "post:DepartmentAdd"), | ||
19 | + beego.NSRouter("/edit", &controllers.CompanyController{}, "post:DepartmentUpdate"), | ||
20 | + beego.NSRouter("/delete", &controllers.CompanyController{}, "post:DepartmentDelete"), | ||
21 | + ), | ||
22 | + beego.NSNamespace("position", | ||
23 | + beego.NSRouter("/list", &controllers.CompanyController{}, "get:PositionList"), | ||
24 | + beego.NSRouter("/add", &controllers.CompanyController{}, "post:PositionAdd"), | ||
25 | + beego.NSRouter("/edit", &controllers.CompanyController{}, "post:PositionEdit"), | ||
26 | + beego.NSRouter("/delete", &controllers.CompanyController{}, "post:PositionDelete"), | ||
26 | ), | 27 | ), |
27 | beego.NSNamespace("/rbac", | 28 | beego.NSNamespace("/rbac", |
28 | - beego.NSRouter("/role", &controllers.RbacController{}, "post:RoleAdd"), | ||
29 | - beego.NSRouter("/role", &controllers.RbacController{}, "put:RoleUpdate"), | ||
30 | - beego.NSRouter("/role", &controllers.RbacController{}, "delete:RoleDelete"), | ||
31 | - beego.NSRouter("/role_group", &controllers.RbacController{}, "post:RoleGroupAdd"), | ||
32 | - beego.NSRouter("/role_group", &controllers.RbacController{}, "put:RoleGroupUpdate"), | ||
33 | - beego.NSRouter("/role_group", &controllers.RbacController{}, "delete:RoleGroupDelete"), | ||
34 | - beego.NSRouter("/:companyid([0-9]+)/role", &controllers.RbacController{}, "get:RoleList"), | 29 | + beego.NSRouter("/role/add", &controllers.RbacController{}, "post:RoleAdd"), |
30 | + beego.NSRouter("/role/edit", &controllers.RbacController{}, "post:RoleUpdate"), | ||
31 | + beego.NSRouter("/role/delete", &controllers.RbacController{}, "post:RoleDelete"), | ||
32 | + beego.NSRouter("/role_group/add", &controllers.RbacController{}, "post:RoleGroupAdd"), | ||
33 | + beego.NSRouter("/role_group/edit", &controllers.RbacController{}, "post:RoleGroupUpdate"), | ||
34 | + beego.NSRouter("/role_group/delete", &controllers.RbacController{}, "post:RoleGroupDelete"), | ||
35 | + beego.NSRouter("/role", &controllers.RbacController{}, "get:RoleList"), | ||
35 | ), | 36 | ), |
36 | beego.NSNamespace("/auth", | 37 | beego.NSNamespace("/auth", |
37 | beego.NSRouter("/change_company", &controllers.AuthController{}, "post:ChangeCompany"), | 38 | beego.NSRouter("/change_company", &controllers.AuthController{}, "post:ChangeCompany"), |
@@ -31,7 +31,7 @@ token 的响应内容 | @@ -31,7 +31,7 @@ token 的响应内容 | ||
31 | - access_token 对应请求头的 x-mmm-accesstoken。expires_in 指的是 access_token 的到期时间(时间戳),客户端可以依此判断 access_token 到期时间,然后决定是否调用接口刷新 token。 | 31 | - access_token 对应请求头的 x-mmm-accesstoken。expires_in 指的是 access_token 的到期时间(时间戳),客户端可以依此判断 access_token 到期时间,然后决定是否调用接口刷新 token。 |
32 | - refresh_token 对应请求头的 x-mmm-refreshtoken。refresh_expires 指的是 refresh_token 的到期时间(时间戳),客户端可以依此判断 refresh_token 到期时间,然后决定是否退出重新登录。 | 32 | - refresh_token 对应请求头的 x-mmm-refreshtoken。refresh_expires 指的是 refresh_token 的到期时间(时间戳),客户端可以依此判断 refresh_token 到期时间,然后决定是否退出重新登录。 |
33 | - 刷新 toke 的依据是 refresh_token,如果 refresh_token 过期失效则只能退出系统重新登录。 | 33 | - 刷新 toke 的依据是 refresh_token,如果 refresh_token 过期失效则只能退出系统重新登录。 |
34 | -- 为应对客户端未主动刷新 token 的情况。当服务端发现 access_token 过期且 refresh_token 未过期时返回错误码【10026】,并附带刷新后的 token,影响的内容格式同上,客户端可依此刷新请求头。当服务端发现 refresh_token 过期时返回错误码【10024】,客户需要退出重新登录。 | 34 | +- 为应对客户端未主动刷新 token 的情况。当服务端发现 access_token 过期且 refresh_token 未过期时返回错误码【2】,并附带刷新后的 token,影响的内容格式同上,客户端可依此刷新请求头。当服务端发现 refresh_token 过期时返回错误码【3】,客户需要退出重新登录。 |
35 | 35 | ||
36 | --- | 36 | --- |
37 | 37 | ||
@@ -39,7 +39,7 @@ token 的响应内容 | @@ -39,7 +39,7 @@ token 的响应内容 | ||
39 | 39 | ||
40 | ```json | 40 | ```json |
41 | { | 41 | { |
42 | - "code": "错误码字符串", | 42 | + "code": "错误码数字", |
43 | "msg": "错误描述字符串", | 43 | "msg": "错误描述字符串", |
44 | "data": { | 44 | "data": { |
45 | "xxx": "any" | 45 | "xxx": "any" |
@@ -70,7 +70,7 @@ token 的响应内容 | @@ -70,7 +70,7 @@ token 的响应内容 | ||
70 | 70 | ||
71 | ```json | 71 | ```json |
72 | { | 72 | { |
73 | - "code": "00000", | 73 | + "code": 0, |
74 | "msg": "成功", | 74 | "msg": "成功", |
75 | "data": { | 75 | "data": { |
76 | "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NzYwNTM2OTAsImlhdCI6MTU3NjA1MTg4OCwiaXNzIjoibW1tX29wcG1nIiwibmJmIjoxNTc2MDUxODg4LCJ1aWQiOjEwLCJjb21wYW55X2lkIjoyfQ.R056B306_vO4UKfMRalncFULE5Z0phN4WOhS9PMwydc", | 76 | "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NzYwNTM2OTAsImlhdCI6MTU3NjA1MTg4OCwiaXNzIjoibW1tX29wcG1nIiwibmJmIjoxNTc2MDUxODg4LCJ1aWQiOjEwLCJjb21wYW55X2lkIjoyfQ.R056B306_vO4UKfMRalncFULE5Z0phN4WOhS9PMwydc", |
@@ -99,7 +99,7 @@ token 的响应内容 | @@ -99,7 +99,7 @@ token 的响应内容 | ||
99 | 99 | ||
100 | ```json | 100 | ```json |
101 | { | 101 | { |
102 | - "code": "00000", | 102 | + "code": 0, |
103 | "msg": "成功", | 103 | "msg": "成功", |
104 | "data": { | 104 | "data": { |
105 | "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NzYwNTM2OTAsImlhdCI6MTU3NjA1MTg4OCwiaXNzIjoibW1tX29wcG1nIiwibmJmIjoxNTc2MDUxODg4LCJ1aWQiOjEwLCJjb21wYW55X2lkIjoyfQ.R056B306_vO4UKfMRalncFULE5Z0phN4WOhS9PMwydc", | 105 | "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NzYwNTM2OTAsImlhdCI6MTU3NjA1MTg4OCwiaXNzIjoibW1tX29wcG1nIiwibmJmIjoxNTc2MDUxODg4LCJ1aWQiOjEwLCJjb21wYW55X2lkIjoyfQ.R056B306_vO4UKfMRalncFULE5Z0phN4WOhS9PMwydc", |
@@ -130,7 +130,7 @@ token 的响应内容 | @@ -130,7 +130,7 @@ token 的响应内容 | ||
130 | 130 | ||
131 | ```json | 131 | ```json |
132 | { | 132 | { |
133 | - "code": "00000", | 133 | + "code": 0, |
134 | "msg": "成功", | 134 | "msg": "成功", |
135 | "data": { | 135 | "data": { |
136 | "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NzYwNTM2OTAsImlhdCI6MTU3NjA1MTg4OCwiaXNzIjoibW1tX29wcG1nIiwibmJmIjoxNTc2MDUxODg4LCJ1aWQiOjEwLCJjb21wYW55X2lkIjoyfQ.R056B306_vO4UKfMRalncFULE5Z0phN4WOhS9PMwydc", | 136 | "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NzYwNTM2OTAsImlhdCI6MTU3NjA1MTg4OCwiaXNzIjoibW1tX29wcG1nIiwibmJmIjoxNTc2MDUxODg4LCJ1aWQiOjEwLCJjb21wYW55X2lkIjoyfQ.R056B306_vO4UKfMRalncFULE5Z0phN4WOhS9PMwydc", |
@@ -145,7 +145,6 @@ token 的响应内容 | @@ -145,7 +145,6 @@ token 的响应内容 | ||
145 | 145 | ||
146 | --- | 146 | --- |
147 | 147 | ||
148 | - | ||
149 | ## 公告 | 148 | ## 公告 |
150 | 149 | ||
151 | ### 添加公告 | 150 | ### 添加公告 |
@@ -156,33 +155,32 @@ token 的响应内容 | @@ -156,33 +155,32 @@ token 的响应内容 | ||
156 | 155 | ||
157 | ```json | 156 | ```json |
158 | { | 157 | { |
159 | - "type":2, | ||
160 | - "title":"标题", | ||
161 | - "content":"公告内容", | ||
162 | - "allow_close":0, | ||
163 | - "allow_condition":3, | ||
164 | - "question_switch":1, | ||
165 | - "receiver":["1","2"], | ||
166 | - "question": | ||
167 | - { | ||
168 | - "id":1, | ||
169 | - "type":1, | ||
170 | - "title":"今天星期几?", | ||
171 | - "content":[ | 158 | + "type": 2, |
159 | + "title": "标题", | ||
160 | + "content": "公告内容", | ||
161 | + "allow_close": 0, | ||
162 | + "allow_condition": 3, | ||
163 | + "question_switch": 1, | ||
164 | + "receiver": ["1", "2"], | ||
165 | + "question": { | ||
166 | + "id": 1, | ||
167 | + "type": 1, | ||
168 | + "title": "今天星期几?", | ||
169 | + "content": [ | ||
172 | { | 170 | { |
173 | - "id":1, | ||
174 | - "content":"星期1" | 171 | + "id": 1, |
172 | + "content": "星期1" | ||
175 | }, | 173 | }, |
176 | { | 174 | { |
177 | - "id":2, | ||
178 | - "content":"星期2" | 175 | + "id": 2, |
176 | + "content": "星期2" | ||
179 | } | 177 | } |
180 | ] | 178 | ] |
181 | }, | 179 | }, |
182 | - "cover":{ | ||
183 | - "path":"/xx/xx.img", | ||
184 | - "w":50, | ||
185 | - "h":70 | 180 | + "cover": { |
181 | + "path": "/xx/xx.img", | ||
182 | + "w": 50, | ||
183 | + "h": 70 | ||
186 | } | 184 | } |
187 | } | 185 | } |
188 | ``` | 186 | ``` |
@@ -213,7 +211,6 @@ obj.cover 封面 | @@ -213,7 +211,6 @@ obj.cover 封面 | ||
213 | 211 | ||
214 | --- | 212 | --- |
215 | 213 | ||
216 | - | ||
217 | ### 公告列表 | 214 | ### 公告列表 |
218 | 215 | ||
219 | - 请求路径 :/v1/bulletin/list | 216 | - 请求路径 :/v1/bulletin/list |
@@ -222,9 +219,9 @@ obj.cover 封面 | @@ -222,9 +219,9 @@ obj.cover 封面 | ||
222 | 219 | ||
223 | ```json | 220 | ```json |
224 | { | 221 | { |
225 | - "page":1, | ||
226 | - "page_size":20, | ||
227 | - "status":0 | 222 | + "page": 1, |
223 | + "page_size": 20, | ||
224 | + "status": 0 | ||
228 | } | 225 | } |
229 | ``` | 226 | ``` |
230 | 227 | ||
@@ -263,7 +260,6 @@ obj.status 状态 0-所有 1-下架 2-上架 | @@ -263,7 +260,6 @@ obj.status 状态 0-所有 1-下架 2-上架 | ||
263 | } | 260 | } |
264 | ``` | 261 | ``` |
265 | 262 | ||
266 | - | ||
267 | ### 公告详情 | 263 | ### 公告详情 |
268 | 264 | ||
269 | - 请求路径 :/v1/bulletin/:id | 265 | - 请求路径 :/v1/bulletin/:id |
@@ -271,8 +267,7 @@ obj.status 状态 0-所有 1-下架 2-上架 | @@ -271,8 +267,7 @@ obj.status 状态 0-所有 1-下架 2-上架 | ||
271 | - 请求 json: | 267 | - 请求 json: |
272 | 268 | ||
273 | ```json | 269 | ```json |
274 | -{ | ||
275 | -} | 270 | +{} |
276 | ``` | 271 | ``` |
277 | 272 | ||
278 | ``` | 273 | ``` |
@@ -327,7 +322,6 @@ obj.status 状态 0-所有 1-下架 2-上架 | @@ -327,7 +322,6 @@ obj.status 状态 0-所有 1-下架 2-上架 | ||
327 | } | 322 | } |
328 | ``` | 323 | ``` |
329 | 324 | ||
330 | - | ||
331 | ### 公告更新 | 325 | ### 公告更新 |
332 | 326 | ||
333 | - 请求路径 :/v1/bulletin/update | 327 | - 请求路径 :/v1/bulletin/update |
@@ -336,34 +330,33 @@ obj.status 状态 0-所有 1-下架 2-上架 | @@ -336,34 +330,33 @@ obj.status 状态 0-所有 1-下架 2-上架 | ||
336 | 330 | ||
337 | ```json | 331 | ```json |
338 | { | 332 | { |
339 | - "id":3, | ||
340 | - "type":2, | ||
341 | - "title":"测试公告3", | ||
342 | - "content":"今天发布了一则公告3", | ||
343 | - "allow_close":0, | ||
344 | - "allow_condition":2, | ||
345 | - "question_switch":1, | ||
346 | - "receiver":["1","2","3"], | ||
347 | - "question": | ||
348 | - { | ||
349 | - "id":2, | ||
350 | - "type":1, | ||
351 | - "title":"今天星期几?", | ||
352 | - "content":[ | 333 | + "id": 3, |
334 | + "type": 2, | ||
335 | + "title": "测试公告3", | ||
336 | + "content": "今天发布了一则公告3", | ||
337 | + "allow_close": 0, | ||
338 | + "allow_condition": 2, | ||
339 | + "question_switch": 1, | ||
340 | + "receiver": ["1", "2", "3"], | ||
341 | + "question": { | ||
342 | + "id": 2, | ||
343 | + "type": 1, | ||
344 | + "title": "今天星期几?", | ||
345 | + "content": [ | ||
353 | { | 346 | { |
354 | - "id":1, | ||
355 | - "content":"星期2" | 347 | + "id": 1, |
348 | + "content": "星期2" | ||
356 | }, | 349 | }, |
357 | { | 350 | { |
358 | - "id":2, | ||
359 | - "content":"星期3" | 351 | + "id": 2, |
352 | + "content": "星期3" | ||
360 | } | 353 | } |
361 | ] | 354 | ] |
362 | }, | 355 | }, |
363 | - "cover":{ | ||
364 | - "path":"/xx/xx.img", | ||
365 | - "w":50, | ||
366 | - "h":70 | 356 | + "cover": { |
357 | + "path": "/xx/xx.img", | ||
358 | + "w": 50, | ||
359 | + "h": 70 | ||
367 | } | 360 | } |
368 | } | 361 | } |
369 | ``` | 362 | ``` |
@@ -377,4 +370,3 @@ obj.status 状态 0-所有 1-下架 2-上架 | @@ -377,4 +370,3 @@ obj.status 状态 0-所有 1-下架 2-上架 | ||
377 | "data": null | 370 | "data": null |
378 | } | 371 | } |
379 | ``` | 372 | ``` |
380 | - |
-
请 注册 或 登录 后发表评论