作者 yangfu

Merge branch 'dev' of http://gitlab.fjmaimaimai.com/mmm-go/oppmg into dev

# Conflicts:
#	models/user_company.go
#	services/auth/auth.go
@@ -48,12 +48,20 @@ func (this *BaseController) ResposeJson(msg *protocol.ResponseMessage) { @@ -48,12 +48,20 @@ func (this *BaseController) ResposeJson(msg *protocol.ResponseMessage) {
48 func (this *BaseController) GetCompanyId() int64 { 48 func (this *BaseController) GetCompanyId() int64 {
49 v := this.Ctx.Input.GetData(protocol.HeaderCompanyid) 49 v := this.Ctx.Input.GetData(protocol.HeaderCompanyid)
50 companyid, _ := strconv.ParseInt(fmt.Sprint(v), 10, 64) 50 companyid, _ := strconv.ParseInt(fmt.Sprint(v), 10, 64)
  51 +
  52 + if beego.BConfig.RunMode != "prod" && companyid == 0 {
  53 + companyid, _ = strconv.ParseInt(this.Ctx.Input.Header("x-mmm-cid"), 10, 64)
  54 + }
51 return companyid 55 return companyid
52 } 56 }
53 57
54 func (this *BaseController) GetUserId() int64 { 58 func (this *BaseController) GetUserId() int64 {
55 v := this.Ctx.Input.GetData(protocol.HeaderUserid) 59 v := this.Ctx.Input.GetData(protocol.HeaderUserid)
56 userid, _ := strconv.ParseInt(fmt.Sprint(v), 10, 64) 60 userid, _ := strconv.ParseInt(fmt.Sprint(v), 10, 64)
  61 +
  62 + if beego.BConfig.RunMode != "prod" && userid == 0 {
  63 + userid, _ = strconv.ParseInt(this.Ctx.Input.Header("x-mmm-uid"), 10, 64)
  64 + }
57 return userid 65 return userid
58 } 66 }
59 67
@@ -31,9 +31,9 @@ func (this *BulletinController) BulletinRelease() { @@ -31,9 +31,9 @@ func (this *BulletinController) BulletinRelease() {
31 msg = protocol.BadRequestParam("1") 31 msg = protocol.BadRequestParam("1")
32 return 32 return
33 } 33 }
34 - if request.Type != 1 || request.Type != 2 { 34 + if !(request.Type == 1 || request.Type == 2) {
35 msg = protocol.BadRequestParam("1") 35 msg = protocol.BadRequestParam("1")
36 - log.Error("type error :", request.Type) 36 + log.Error("type error :%v", request.Type)
37 return 37 return
38 } 38 }
39 if b, m := this.Valid(request); !b { 39 if b, m := this.Valid(request); !b {
@@ -79,15 +79,15 @@ func (this *BulletinController) GetBulletin() { @@ -79,15 +79,15 @@ func (this *BulletinController) GetBulletin() {
79 this.ResposeJson(msg) 79 this.ResposeJson(msg)
80 }() 80 }()
81 var request *protocol.GetBulletinRequest 81 var request *protocol.GetBulletinRequest
82 - if err := json.Unmarshal(this.Ctx.Input.RequestBody, &request); err != nil {  
83 - log.Error("json 解析失败", err)  
84 - msg = protocol.BadRequestParam("1")  
85 - return  
86 - }  
87 - if b, m := this.Valid(request); !b {  
88 - msg = m  
89 - return  
90 - } 82 + //if err := json.Unmarshal(this.Ctx.Input.RequestBody, &request); err != nil {
  83 + // log.Error("json 解析失败", err)
  84 + // msg = protocol.BadRequestParam("1")
  85 + // return
  86 + //}
  87 + //if b, m := this.Valid(request); !b {
  88 + // msg = m
  89 + // return
  90 + //}
91 param := this.Ctx.Input.Param(":id") 91 param := this.Ctx.Input.Param(":id")
92 id, _ := strconv.ParseInt(param, 10, 64) 92 id, _ := strconv.ParseInt(param, 10, 64)
93 if id == 0 { 93 if id == 0 {
@@ -2,6 +2,7 @@ package middleware @@ -2,6 +2,7 @@ package middleware
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
  5 + "github.com/astaxie/beego"
5 "oppmg/common/log" 6 "oppmg/common/log"
6 "oppmg/protocol" 7 "oppmg/protocol"
7 serveauth "oppmg/services/auth" 8 serveauth "oppmg/services/auth"
@@ -53,6 +54,9 @@ var LogRequestData = func(ctx *context.Context) { @@ -53,6 +54,9 @@ var LogRequestData = func(ctx *context.Context) {
53 //AuthToken Before Router 54 //AuthToken Before Router
54 var AuthToken = func(ctx *context.Context) { 55 var AuthToken = func(ctx *context.Context) {
55 log.Debug("执行中间件AuthToken") 56 log.Debug("执行中间件AuthToken")
  57 + if beego.BConfig.RunMode != "prod" {
  58 + return
  59 + }
56 var ( 60 var (
57 storetoken redisdata.RedisLoginToken 61 storetoken redisdata.RedisLoginToken
58 msg *protocol.ResponseMessage 62 msg *protocol.ResponseMessage
@@ -83,14 +83,14 @@ func DeleteBulletin(id int) (err error) { @@ -83,14 +83,14 @@ func DeleteBulletin(id int) (err error) {
83 } 83 }
84 84
85 func GetBulletins(companyId int64, status int8, page, pageSize int) (v []*Bulletin, total int, err error) { 85 func GetBulletins(companyId int64, status int8, page, pageSize int) (v []*Bulletin, total int, err error) {
86 - sql := "select * from bulletin where (status=? or ?==0) and company_id =? order by create_at desc limit ?,?" 86 + sql := "select * from bulletin where (status=? or ?=0) and company_id =? order by create_at desc limit ?,?"
87 o := orm.NewOrm() 87 o := orm.NewOrm()
88 - if _, err = o.Raw(sql, status, companyId, page-1, pageSize).QueryRows(&v); err != nil { 88 + if _, err = o.Raw(sql, status, status, companyId, page-1, pageSize).QueryRows(&v); err != nil {
89 return 89 return
90 } 90 }
91 91
92 - sqlTotal := "select count(1) from bulletin where (status=? or ?==0) and company_id =?"  
93 - if _, err = o.Raw(sqlTotal, status, companyId).QueryRows(&total); err != nil { 92 + sqlTotal := "select count(1) from bulletin where (status=? or ?=0) and company_id =?"
  93 + if err = o.Raw(sqlTotal, status, status, companyId).QueryRow(&total); err != nil {
94 return 94 return
95 } 95 }
96 return 96 return
@@ -15,8 +15,6 @@ type BulletinQuestion struct { @@ -15,8 +15,6 @@ type BulletinQuestion struct {
15 Content string `orm:"column(content);size(2000);null" description:"内容"` 15 Content string `orm:"column(content);size(2000);null" description:"内容"`
16 CreateAt time.Time `orm:"column(create_at);type(timestamp);null" description:"创建时间"` 16 CreateAt time.Time `orm:"column(create_at);type(timestamp);null" description:"创建时间"`
17 UpdateAt time.Time `orm:"column(update_at);type(timestamp);null" description:"更新时间"` 17 UpdateAt time.Time `orm:"column(update_at);type(timestamp);null" description:"更新时间"`
18 - MustRead int8 `orm:"column(must_read);null" description:"公告内容看完才可以关闭 1:是 0:否"`  
19 - MustAnswer int8 `orm:"column(must_answer);null" description:"回答完问题才可以关闭 1:是 0:否"`  
20 } 18 }
21 19
22 func (t *BulletinQuestion) TableName() string { 20 func (t *BulletinQuestion) TableName() string {
@@ -110,7 +110,7 @@ func getUserNameByIds(ids []int64) ([]User, error) { @@ -110,7 +110,7 @@ func getUserNameByIds(ids []int64) ([]User, error) {
110 o := orm.NewOrm() 110 o := orm.NewOrm()
111 _, err = o.QueryTable(&User{}). 111 _, err = o.QueryTable(&User{}).
112 Filter("id__in", ids). 112 Filter("id__in", ids).
113 - Filter("delete_at", time.Unix(0, 0)).All(&users) 113 + Filter("delete_at", 0).All(&users)
114 114
115 if err == orm.ErrNoRows { 115 if err == orm.ErrNoRows {
116 return users, nil 116 return users, nil
1 package protocol 1 package protocol
2 2
  3 +const (
  4 + BulletinUnRelease = 1 //下架
  5 + BulletinRelease = 2 //上架
  6 +)
  7 +
  8 +const (
  9 + QuestionSingleSelect = 0 //单选
  10 + QuestionMultiSelect = 1 //多选
  11 +)
  12 +
3 /*BulletinRelease */ 13 /*BulletinRelease */
4 type BulletinReleaseRequest struct { 14 type BulletinReleaseRequest struct {
5 Id int `json:"id"` 15 Id int `json:"id"`
@@ -20,11 +30,11 @@ type Question struct { @@ -20,11 +30,11 @@ type Question struct {
20 Content []QuestionContent `json:"content" valid:"Required"` 30 Content []QuestionContent `json:"content" valid:"Required"`
21 } 31 }
22 type QuestionContent struct { 32 type QuestionContent struct {
23 - Id int  
24 - Content string 33 + Id int `json:"id" valid:"Required"`
  34 + Content string `json:"content" valid:"Required"`
25 } 35 }
26 type Cover struct { 36 type Cover struct {
27 - Path string `json:"path"` 37 + Path string `json:"path" valid:"Required"`
28 H int `json:"h"` 38 H int `json:"h"`
29 W int `json:"w"` 39 W int `json:"w"`
30 } 40 }
@@ -47,7 +57,7 @@ type BulletinItem struct { @@ -47,7 +57,7 @@ type BulletinItem struct {
47 Type int8 `json:"type"` 57 Type int8 `json:"type"`
48 Title string `json:"title"` 58 Title string `json:"title"`
49 Status int8 `json:"status"` 59 Status int8 `json:"status"`
50 - Receiver []string `json:"receiver" valid:"Required"` 60 + Receiver []Receiver `json:"receiver" valid:"Required"`
51 CreateAt string `json:"time"` 61 CreateAt string `json:"time"`
52 } 62 }
53 63
@@ -62,11 +72,16 @@ type GetBulletinResponse struct { @@ -62,11 +72,16 @@ type GetBulletinResponse struct {
62 AllowClose int `json:"allow_close"` 72 AllowClose int `json:"allow_close"`
63 AllowCondition int `json:"allow_condition"` 73 AllowCondition int `json:"allow_condition"`
64 QuestionSwitch int `json:"question_switch"` 74 QuestionSwitch int `json:"question_switch"`
65 - Receiver []string `json:"receiver" valid:"Required"` 75 + Receiver []Receiver `json:"receiver" valid:"Required"`
66 Question Question `json:"question"` 76 Question Question `json:"question"`
67 Cover Cover `json:"cover" valid:"Required"` 77 Cover Cover `json:"cover" valid:"Required"`
68 } 78 }
69 79
  80 +type Receiver struct {
  81 + Id int64 `json:"id"`
  82 + NickName string `json:"name"`
  83 +}
  84 +
70 /*UpdateBulletin */ 85 /*UpdateBulletin */
71 type UpdateBulletinRequest struct { 86 type UpdateBulletinRequest struct {
72 Id int `json:"id" valid:"Required"` 87 Id int `json:"id" valid:"Required"`
@@ -38,10 +38,10 @@ func init() { @@ -38,10 +38,10 @@ func init() {
38 beego.NSRouter("/refresh_token", &controllers.AuthController{}, "get:RefreshToken"), 38 beego.NSRouter("/refresh_token", &controllers.AuthController{}, "get:RefreshToken"),
39 ), 39 ),
40 beego.NSNamespace("/bulletin", 40 beego.NSNamespace("/bulletin",
41 - beego.NSRouter("/release", &controllers.BulletinController{}, "post:BulletinRelease"), 41 + beego.NSRouter("/add", &controllers.BulletinController{}, "post:BulletinRelease"),
42 beego.NSRouter("/list", &controllers.BulletinController{}, "post:BulletinList"), 42 beego.NSRouter("/list", &controllers.BulletinController{}, "post:BulletinList"),
43 beego.NSRouter("/:id([0-9]+)", &controllers.BulletinController{}, "get:GetBulletin"), 43 beego.NSRouter("/:id([0-9]+)", &controllers.BulletinController{}, "get:GetBulletin"),
44 - beego.NSRouter("/update", &controllers.BulletinController{}, "get:UpdateBulletin"), 44 + beego.NSRouter("/update", &controllers.BulletinController{}, "post:UpdateBulletin"),
45 ), 45 ),
46 ) 46 )
47 47
@@ -37,6 +37,7 @@ func BulletinRelease(uid, companyId int64, request *protocol.BulletinReleaseRequ @@ -37,6 +37,7 @@ func BulletinRelease(uid, companyId int64, request *protocol.BulletinReleaseRequ
37 CompanyId: companyId, 37 CompanyId: companyId,
38 CreateAt: time.Now(), 38 CreateAt: time.Now(),
39 UpdateAt: time.Now(), 39 UpdateAt: time.Now(),
  40 + Status: protocol.BulletinUnRelease,
40 } 41 }
41 42
42 orm := orm2.NewOrm() 43 orm := orm2.NewOrm()
@@ -55,6 +56,11 @@ func BulletinRelease(uid, companyId int64, request *protocol.BulletinReleaseRequ @@ -55,6 +56,11 @@ func BulletinRelease(uid, companyId int64, request *protocol.BulletinReleaseRequ
55 log.Error(err.Error()) 56 log.Error(err.Error())
56 return 57 return
57 } 58 }
  59 + if !(request.Question.Type == protocol.QuestionSingleSelect || request.Question.Type == protocol.QuestionMultiSelect) {
  60 + err = protocol.NewErrWithMessage("1")
  61 + log.Error("BulletinRelease:Question.Type error:%v", request.Question.Type)
  62 + return
  63 + }
58 bulletinQuestion = &models.BulletinQuestion{ 64 bulletinQuestion = &models.BulletinQuestion{
59 BulletinId: int(id), 65 BulletinId: int(id),
60 Type: int8(request.Question.Type), 66 Type: int8(request.Question.Type),
@@ -86,6 +92,7 @@ func BulletinList(uid, companyId int64, request *protocol.BulletinListRequest) ( @@ -86,6 +92,7 @@ func BulletinList(uid, companyId int64, request *protocol.BulletinListRequest) (
86 if request.PageSize == 0 { 92 if request.PageSize == 0 {
87 request.PageSize = 20 93 request.PageSize = 20
88 } 94 }
  95 + rsp = &protocol.BulletinListResponse{}
89 if list, total, err = models.GetBulletins(companyId, request.Status, request.Page, request.PageSize); err != nil { 96 if list, total, err = models.GetBulletins(companyId, request.Status, request.Page, request.PageSize); err != nil {
90 log.Error(err.Error()) 97 log.Error(err.Error())
91 return 98 return
@@ -93,7 +100,7 @@ func BulletinList(uid, companyId int64, request *protocol.BulletinListRequest) ( @@ -93,7 +100,7 @@ func BulletinList(uid, companyId int64, request *protocol.BulletinListRequest) (
93 if len(list) == 0 { 100 if len(list) == 0 {
94 return 101 return
95 } 102 }
96 - rsp = &protocol.BulletinListResponse{} 103 + rsp.Total = total
97 for i := range list { 104 for i := range list {
98 bulletin := list[i] 105 bulletin := list[i]
99 item := &protocol.BulletinItem{ 106 item := &protocol.BulletinItem{
@@ -101,8 +108,6 @@ func BulletinList(uid, companyId int64, request *protocol.BulletinListRequest) ( @@ -101,8 +108,6 @@ func BulletinList(uid, companyId int64, request *protocol.BulletinListRequest) (
101 Type: bulletin.Type, 108 Type: bulletin.Type,
102 Title: bulletin.Title, 109 Title: bulletin.Title,
103 Status: int8(bulletin.Status), 110 Status: int8(bulletin.Status),
104 - //TODO:user  
105 - Receiver: []string{},  
106 CreateAt: bulletin.CreateAt.Format("2006-01-02 15:04:05"), 111 CreateAt: bulletin.CreateAt.Format("2006-01-02 15:04:05"),
107 } 112 }
108 if item.Receiver, err = getUsersName(bulletin.Receiver); err != nil { 113 if item.Receiver, err = getUsersName(bulletin.Receiver); err != nil {
@@ -111,7 +116,7 @@ func BulletinList(uid, companyId int64, request *protocol.BulletinListRequest) ( @@ -111,7 +116,7 @@ func BulletinList(uid, companyId int64, request *protocol.BulletinListRequest) (
111 } 116 }
112 rsp.List = append(rsp.List, item) 117 rsp.List = append(rsp.List, item)
113 } 118 }
114 - rsp.Total = total 119 +
115 return 120 return
116 } 121 }
117 122
@@ -131,13 +136,16 @@ func getUsers(idsstr string) (v []models.User, err error) { @@ -131,13 +136,16 @@ func getUsers(idsstr string) (v []models.User, err error) {
131 return models.GetUserNameByIds(ids) 136 return models.GetUserNameByIds(ids)
132 } 137 }
133 138
134 -func getUsersName(idsStr string) (v []string, err error) { 139 +func getUsersName(idsStr string) (v []protocol.Receiver, err error) {
135 var users []models.User 140 var users []models.User
136 if users, err = getUsers(idsStr); err != nil { 141 if users, err = getUsers(idsStr); err != nil {
137 return 142 return
138 } 143 }
139 for i := range users { 144 for i := range users {
140 - v = append(v, users[i].NickName) 145 + v = append(v, protocol.Receiver{
  146 + Id: users[i].Id,
  147 + NickName: users[i].NickName,
  148 + })
141 } 149 }
142 return 150 return
143 } 151 }
@@ -178,6 +186,7 @@ func GetBulletin(id int, companyId int64, request *protocol.GetBulletinRequest) @@ -178,6 +186,7 @@ func GetBulletin(id int, companyId int64, request *protocol.GetBulletinRequest)
178 } 186 }
179 rsp.QuestionSwitch = int(bulletin.QuestionSwitch) 187 rsp.QuestionSwitch = int(bulletin.QuestionSwitch)
180 rsp.Question = protocol.Question{ 188 rsp.Question = protocol.Question{
  189 + Id: question.Id,
181 Type: int(question.Type), 190 Type: int(question.Type),
182 Title: question.Title, 191 Title: question.Title,
183 } 192 }
@@ -238,12 +247,18 @@ func UpdateBulletin(companyId int64, request *protocol.UpdateBulletinRequest) (r @@ -238,12 +247,18 @@ func UpdateBulletin(companyId int64, request *protocol.UpdateBulletinRequest) (r
238 log.Error(err.Error()) 247 log.Error(err.Error())
239 return 248 return
240 } 249 }
  250 + if bulletinQuestion.BulletinId != bulletin.Id {
  251 + err = protocol.NewErrWithMessage("1")
  252 + log.Error("UpdateBulletin:BulletinId not equal:(%v!=%v)", bulletinQuestion.BulletinId, bulletin.Id)
  253 + return
  254 + }
241 if questionContent, err = json.Marshal(request.Question.Content); err != nil { 255 if questionContent, err = json.Marshal(request.Question.Content); err != nil {
242 log.Error(err.Error()) 256 log.Error(err.Error())
243 return 257 return
244 } 258 }
245 bulletinQuestion.Content = string(questionContent) 259 bulletinQuestion.Content = string(questionContent)
246 bulletinQuestion.Type = int8(request.Question.Type) 260 bulletinQuestion.Type = int8(request.Question.Type)
  261 + bulletinQuestion.UpdateAt = time.Now()
247 if err = models.UpdateBulletinQuestionById(bulletinQuestion); err != nil { 262 if err = models.UpdateBulletinQuestionById(bulletinQuestion); err != nil {
248 log.Error(err.Error()) 263 log.Error(err.Error())
249 return 264 return
@@ -122,3 +122,237 @@ @@ -122,3 +122,237 @@
122 - 备注:切换公司实际是变更 token 信息 122 - 备注:切换公司实际是变更 token 信息
123 123
124 --- 124 ---
  125 +
  126 +
  127 +## 公告
  128 +
  129 +### 添加公告
  130 +
  131 +- 请求路径 :/v1/bulletin/add
  132 +- 请求方式 :post
  133 +- 请求 json:
  134 +
  135 +```json
  136 +{
  137 + "type":2,
  138 + "title":"标题",
  139 + "content":"公告内容",
  140 + "allow_close":0,
  141 + "allow_condition":3,
  142 + "question_switch":1,
  143 + "receiver":["1","2"],
  144 + "question":
  145 + {
  146 + "id":1,
  147 + "type":1,
  148 + "title":"今天星期几?",
  149 + "content":[
  150 + {
  151 + "id":1,
  152 + "content":"星期1"
  153 + },
  154 + {
  155 + "id":2,
  156 + "content":"星期2"
  157 + }
  158 + ]
  159 + },
  160 + "cover":{
  161 + "path":"/xx/xx.img",
  162 + "w":50,
  163 + "h":70
  164 + }
  165 +}
  166 +```
  167 +
  168 +```
  169 +obj.type 公告类型(1图+跳转链接、2纯文本)
  170 +obj.title 标题
  171 +obj.content 公告内容
  172 +obj.allow_close 允许关闭公告(0允许,1禁止)
  173 +obj.allow_condition 关闭条件 (1(bit 0):公告内容查看完 2(bit 1):回答完问题)
  174 +obj.question_switch 设置问题开关 (是否有问题) 1:是 0:否
  175 +obj.receiver 接收者
  176 +obj.question.type 类型:0-单选,1-多选
  177 +obj.question.title 标题
  178 +obj.question.content 问题选项
  179 +obj.cover 封面
  180 +```
  181 +
  182 +- 响应 json
  183 +
  184 +```json
  185 +{
  186 + "code": "00000",
  187 + "msg": "成功",
  188 + "data": {}
  189 +}
  190 +```
  191 +
  192 +---
  193 +
  194 +
  195 +### 公告列表
  196 +
  197 +- 请求路径 :/v1/bulletin/list
  198 +- 请求方式 :post
  199 +- 请求 json:
  200 +
  201 +```json
  202 +{
  203 + "page":1,
  204 + "page_size":20,
  205 + "status":0
  206 +}
  207 +```
  208 +
  209 +```
  210 +obj.status 状态 0-所有 1-下架 2-上架
  211 +```
  212 +
  213 +- 响应 json
  214 +
  215 +```json
  216 +{
  217 + "code": "00000",
  218 + "msg": "成功",
  219 + "data": {
  220 + "list": [
  221 + {
  222 + "id": 5,
  223 + "type": 2,
  224 + "title": "测试公告",
  225 + "status": 1,
  226 + "receiver": [
  227 + {
  228 + "id": 1,
  229 + "name": "Jennifer Clark"
  230 + },
  231 + {
  232 + "id": 2,
  233 + "name": "邓娱婷1208"
  234 + }
  235 + ],
  236 + "time": "2019-12-11 17:11:43"
  237 + }
  238 + ],
  239 + "Total": 2
  240 + }
  241 +}
  242 +```
  243 +
  244 +
  245 +### 公告详情
  246 +
  247 +- 请求路径 :/v1/bulletin/:id
  248 +- 请求方式 :get
  249 +- 请求 json:
  250 +
  251 +```json
  252 +{
  253 +}
  254 +```
  255 +
  256 +```
  257 +obj.status 状态 0-所有 1-下架 2-上架
  258 +```
  259 +
  260 +- 响应 json
  261 +
  262 +```json
  263 +{
  264 + "code": "00000",
  265 + "msg": "成功",
  266 + "data": {
  267 + "id": 5,
  268 + "type": 2,
  269 + "title": "测试公告",
  270 + "content": "今天发布了一则公告",
  271 + "allow_close": 0,
  272 + "allow_condition": 3,
  273 + "question_switch": 1,
  274 + "receiver": [
  275 + {
  276 + "id": 1,
  277 + "name": "Jennifer Clark"
  278 + },
  279 + {
  280 + "id": 2,
  281 + "name": "邓娱婷1208"
  282 + }
  283 + ],
  284 + "question": {
  285 + "id": 4,
  286 + "type": 1,
  287 + "title": "今天星期几?",
  288 + "content": [
  289 + {
  290 + "id": 1,
  291 + "content": "星期1"
  292 + },
  293 + {
  294 + "id": 2,
  295 + "content": "星期2"
  296 + }
  297 + ]
  298 + },
  299 + "cover": {
  300 + "path": "/xx/xx.img",
  301 + "h": 70,
  302 + "w": 50
  303 + }
  304 + }
  305 +}
  306 +```
  307 +
  308 +
  309 +### 公告更新
  310 +
  311 +- 请求路径 :/v1/bulletin/update
  312 +- 请求方式 :post
  313 +- 请求 json:
  314 +
  315 +```json
  316 +{
  317 + "id":3,
  318 + "type":2,
  319 + "title":"测试公告3",
  320 + "content":"今天发布了一则公告3",
  321 + "allow_close":0,
  322 + "allow_condition":2,
  323 + "question_switch":1,
  324 + "receiver":["1","2","3"],
  325 + "question":
  326 + {
  327 + "id":2,
  328 + "type":1,
  329 + "title":"今天星期几?",
  330 + "content":[
  331 + {
  332 + "id":1,
  333 + "content":"星期2"
  334 + },
  335 + {
  336 + "id":2,
  337 + "content":"星期3"
  338 + }
  339 + ]
  340 + },
  341 + "cover":{
  342 + "path":"/xx/xx.img",
  343 + "w":50,
  344 + "h":70
  345 + }
  346 +}
  347 +```
  348 +
  349 +- 响应 json
  350 +
  351 +```json
  352 +{
  353 + "code": "00000",
  354 + "msg": "成功",
  355 + "data": null
  356 +}
  357 +```
  358 +