作者 yangfu

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

# Conflicts:
#	models/user_company.go
#	services/auth/auth.go
@@ -2,7 +2,6 @@ package middleware @@ -2,7 +2,6 @@ package middleware
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 - "github.com/astaxie/beego"  
6 "oppmg/common/log" 5 "oppmg/common/log"
7 "oppmg/protocol" 6 "oppmg/protocol"
8 serveauth "oppmg/services/auth" 7 serveauth "oppmg/services/auth"
@@ -19,10 +19,10 @@ type Bulletin struct { @@ -19,10 +19,10 @@ type Bulletin struct {
19 QuestionSwitch int8 `orm:"column(question_switch);null" description:"设置问题开关 (是否有问题)"` 19 QuestionSwitch int8 `orm:"column(question_switch);null" description:"设置问题开关 (是否有问题)"`
20 CreateAt time.Time `orm:"column(create_at);type(timestamp);null" description:"创建时间"` 20 CreateAt time.Time `orm:"column(create_at);type(timestamp);null" description:"创建时间"`
21 UpdateAt time.Time `orm:"column(update_at);type(timestamp);null" description:"更新时间"` 21 UpdateAt time.Time `orm:"column(update_at);type(timestamp);null" description:"更新时间"`
22 - AllowClose int8 `orm:"column(allow_close);null" description:"允许关闭公告(0允许,1禁止)"`  
23 - AllowCondition int8 `orm:"column(allow_condition);null" description:"关闭条件 (1(bit 0):公告内容查看完 2(bit 1):回答完问题)"`  
24 - CompanyId int64 `orm:"column(company_id);null" description:"公司Id"`  
25 - Status uint8 `orm:"column(status)" description:"状态 1-下架 2-上架"` 22 + AllowClose int8 `orm:"column(allow_close);null" description:"允许关闭公告(0允许关闭窗口,1阅读完才能关闭,2选项打勾后才能关闭)"`
  23 + //AllowCondition int8 `orm:"column(allow_condition);null" description:"关闭条件 (1(bit 0):公告内容查看完 2(bit 1):回答完问题)"`
  24 + CompanyId int64 `orm:"column(company_id);null" description:"公司Id"`
  25 + Status uint8 `orm:"column(status)" description:"状态 1-下架 2-上架"`
26 } 26 }
27 27
28 func (t *Bulletin) TableName() string { 28 func (t *Bulletin) TableName() string {
@@ -12,12 +12,12 @@ const ( @@ -12,12 +12,12 @@ const (
12 12
13 /*BulletinRelease */ 13 /*BulletinRelease */
14 type BulletinReleaseRequest struct { 14 type BulletinReleaseRequest struct {
15 - Id int `json:"id"`  
16 - Type int `json:"type" valid:"Required"`  
17 - Title string `json:"title" valid:"Required"`  
18 - Content string `json:"content" valid:"Required"`  
19 - AllowClose int `json:"allow_close"`  
20 - AllowCondition int `json:"allow_condition"` 15 + Id int `json:"id"`
  16 + Type int `json:"type" valid:"Required"`
  17 + Title string `json:"title" valid:"Required"`
  18 + Content string `json:"content" valid:"Required"`
  19 + AllowClose int `json:"allow_close"`
  20 + //AllowCondition int `json:"allow_condition"`
21 QuestionSwitch int `json:"question_switch"` 21 QuestionSwitch int `json:"question_switch"`
22 Receiver []string `json:"receiver" valid:"Required"` 22 Receiver []string `json:"receiver" valid:"Required"`
23 Question Question `json:"question"` 23 Question Question `json:"question"`
@@ -65,12 +65,12 @@ type BulletinItem struct { @@ -65,12 +65,12 @@ type BulletinItem struct {
65 type GetBulletinRequest struct { 65 type GetBulletinRequest struct {
66 } 66 }
67 type GetBulletinResponse struct { 67 type GetBulletinResponse struct {
68 - Id int `json:"id"`  
69 - Type int `json:"type" valid:"Required"`  
70 - Title string `json:"title" valid:"Required"`  
71 - Content string `json:"content" valid:"Required"`  
72 - AllowClose int `json:"allow_close"`  
73 - AllowCondition int `json:"allow_condition"` 68 + Id int `json:"id"`
  69 + Type int `json:"type" valid:"Required"`
  70 + Title string `json:"title" valid:"Required"`
  71 + Content string `json:"content" valid:"Required"`
  72 + AllowClose int `json:"allow_close"`
  73 + //AllowCondition int `json:"allow_condition"`
74 QuestionSwitch int `json:"question_switch"` 74 QuestionSwitch int `json:"question_switch"`
75 Receiver []Receiver `json:"receiver" valid:"Required"` 75 Receiver []Receiver `json:"receiver" valid:"Required"`
76 Question Question `json:"question"` 76 Question Question `json:"question"`
@@ -84,12 +84,12 @@ type Receiver struct { @@ -84,12 +84,12 @@ type Receiver struct {
84 84
85 /*UpdateBulletin */ 85 /*UpdateBulletin */
86 type UpdateBulletinRequest struct { 86 type UpdateBulletinRequest struct {
87 - Id int `json:"id" valid:"Required"`  
88 - Type int `json:"type" valid:"Required"`  
89 - Title string `json:"title" valid:"Required"`  
90 - Content string `json:"content" valid:"Required"`  
91 - AllowClose int `json:"allow_close"`  
92 - AllowCondition int `json:"allow_condition"` 87 + Id int `json:"id" valid:"Required"`
  88 + Type int `json:"type" valid:"Required"`
  89 + Title string `json:"title" valid:"Required"`
  90 + Content string `json:"content" valid:"Required"`
  91 + AllowClose int `json:"allow_close"`
  92 + //AllowCondition int `json:"allow_condition"`
93 QuestionSwitch int `json:"question_switch"` 93 QuestionSwitch int `json:"question_switch"`
94 Receiver []string `json:"receiver" valid:"Required"` 94 Receiver []string `json:"receiver" valid:"Required"`
95 Question Question `json:"question"` 95 Question Question `json:"question"`
@@ -32,12 +32,12 @@ func BulletinRelease(uid, companyId int64, request *protocol.BulletinReleaseRequ @@ -32,12 +32,12 @@ func BulletinRelease(uid, companyId int64, request *protocol.BulletinReleaseRequ
32 W: request.Cover.W, 32 W: request.Cover.W,
33 Receiver: string(receiver), 33 Receiver: string(receiver),
34 QuestionSwitch: int8(request.QuestionSwitch), 34 QuestionSwitch: int8(request.QuestionSwitch),
35 - AllowCondition: int8(request.AllowCondition),  
36 - AllowClose: int8(request.AllowClose),  
37 - CompanyId: companyId,  
38 - CreateAt: time.Now(),  
39 - UpdateAt: time.Now(),  
40 - Status: protocol.BulletinUnRelease, 35 + //AllowCondition: int8(request.AllowCondition),
  36 + AllowClose: int8(request.AllowClose),
  37 + CompanyId: companyId,
  38 + CreateAt: time.Now(),
  39 + UpdateAt: time.Now(),
  40 + Status: protocol.BulletinUnRelease,
41 } 41 }
42 42
43 orm := orm2.NewOrm() 43 orm := orm2.NewOrm()
@@ -167,12 +167,12 @@ func GetBulletin(id int, companyId int64, request *protocol.GetBulletinRequest) @@ -167,12 +167,12 @@ func GetBulletin(id int, companyId int64, request *protocol.GetBulletinRequest)
167 } 167 }
168 rsp = &protocol.GetBulletinResponse{} 168 rsp = &protocol.GetBulletinResponse{}
169 rsp = &protocol.GetBulletinResponse{ 169 rsp = &protocol.GetBulletinResponse{
170 - Id: bulletin.Id,  
171 - Type: int(bulletin.Type),  
172 - Title: bulletin.Title,  
173 - Content: bulletin.Content,  
174 - AllowClose: int(bulletin.AllowClose),  
175 - AllowCondition: int(bulletin.AllowCondition), 170 + Id: bulletin.Id,
  171 + Type: int(bulletin.Type),
  172 + Title: bulletin.Title,
  173 + Content: bulletin.Content,
  174 + AllowClose: int(bulletin.AllowClose),
  175 + //AllowCondition: int(bulletin.AllowCondition),
176 Cover: protocol.Cover{ 176 Cover: protocol.Cover{
177 Path: bulletin.Cover, 177 Path: bulletin.Cover,
178 W: bulletin.W, 178 W: bulletin.W,
@@ -233,7 +233,7 @@ func UpdateBulletin(companyId int64, request *protocol.UpdateBulletinRequest) (r @@ -233,7 +233,7 @@ func UpdateBulletin(companyId int64, request *protocol.UpdateBulletinRequest) (r
233 bulletin.W = request.Cover.W 233 bulletin.W = request.Cover.W
234 bulletin.Receiver = string(receiver) 234 bulletin.Receiver = string(receiver)
235 bulletin.QuestionSwitch = int8(request.QuestionSwitch) 235 bulletin.QuestionSwitch = int8(request.QuestionSwitch)
236 - bulletin.AllowCondition = int8(request.AllowCondition) 236 + //bulletin.AllowCondition = int8(request.AllowCondition)
237 bulletin.AllowClose = int8(request.AllowClose) 237 bulletin.AllowClose = int8(request.AllowClose)
238 bulletin.UpdateAt = time.Now() 238 bulletin.UpdateAt = time.Now()
239 if err = models.UpdateBulletinById(bulletin); err != nil { 239 if err = models.UpdateBulletinById(bulletin); err != nil {
@@ -160,7 +160,6 @@ token 的响应内容 @@ -160,7 +160,6 @@ token 的响应内容
160 "title":"标题", 160 "title":"标题",
161 "content":"公告内容", 161 "content":"公告内容",
162 "allow_close":0, 162 "allow_close":0,
163 - "allow_condition":3,  
164 "question_switch":1, 163 "question_switch":1,
165 "receiver":["1","2"], 164 "receiver":["1","2"],
166 "question": 165 "question":
@@ -191,8 +190,7 @@ token 的响应内容 @@ -191,8 +190,7 @@ token 的响应内容
191 obj.type 公告类型(1图+跳转链接、2纯文本) 190 obj.type 公告类型(1图+跳转链接、2纯文本)
192 obj.title 标题 191 obj.title 标题
193 obj.content 公告内容 192 obj.content 公告内容
194 -obj.allow_close 允许关闭公告(0允许,1禁止)  
195 -obj.allow_condition 关闭条件 (1(bit 0):公告内容查看完 2(bit 1):回答完问题) 193 +obj.allow_close 允许关闭公告(0允许关闭窗口,1阅读完才能关闭,2选项打勾后才能关闭)
196 obj.question_switch 设置问题开关 (是否有问题) 1:是 0:否 194 obj.question_switch 设置问题开关 (是否有问题) 1:是 0:否
197 obj.receiver 接收者 195 obj.receiver 接收者
198 obj.question.type 类型:0-单选,1-多选 196 obj.question.type 类型:0-单选,1-多选
@@ -291,7 +289,6 @@ obj.status 状态 0-所有 1-下架 2-上架 @@ -291,7 +289,6 @@ obj.status 状态 0-所有 1-下架 2-上架
291 "title": "测试公告", 289 "title": "测试公告",
292 "content": "今天发布了一则公告", 290 "content": "今天发布了一则公告",
293 "allow_close": 0, 291 "allow_close": 0,
294 - "allow_condition": 3,  
295 "question_switch": 1, 292 "question_switch": 1,
296 "receiver": [ 293 "receiver": [
297 { 294 {
@@ -341,7 +338,6 @@ obj.status 状态 0-所有 1-下架 2-上架 @@ -341,7 +338,6 @@ obj.status 状态 0-所有 1-下架 2-上架
341 "title":"测试公告3", 338 "title":"测试公告3",
342 "content":"今天发布了一则公告3", 339 "content":"今天发布了一则公告3",
343 "allow_close":0, 340 "allow_close":0,
344 - "allow_condition":2,  
345 "question_switch":1, 341 "question_switch":1,
346 "receiver":["1","2","3"], 342 "receiver":["1","2","3"],
347 "question": 343 "question":