作者 tangxvhui

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

... ... @@ -32,7 +32,7 @@ func (this *BulletinController) BulletinRelease() {
msg = protocol.BadRequestParam("1")
return
}
if !(request.Type == 1 || request.Type == 2) {
if !(request.Type == 0 || request.Type == 1) {
msg = protocol.BadRequestParam("1")
log.Error("type error :%v", request.Type)
return
... ...
... ... @@ -32,8 +32,8 @@ const (
)
const (
VisibleObject_User = 0
VisibleObject_Department = 1
VisibleObject_User = 2
)
func (t *AuditTemplate) TableName() string {
... ...
... ... @@ -134,7 +134,7 @@ type TemplateItem struct {
type VisibleObject struct {
Id string `json:"id"`
Name string `json:"name,omitempty"`
Type int `json:"type"` //1:部门 2:指定人员
Type int `json:"type"` //0:指定人员 1:部门
}
/*TemplateEditVisible */
... ...
... ... @@ -34,11 +34,7 @@ type QuestionContent struct {
Id int `json:"id"`
Content string `json:"content"`
}
type Cover struct {
Path string `json:"path"`
H int `json:"h"`
W int `json:"w"`
}
type Cover string
type BulletinReleaseResponse struct {
}
... ... @@ -87,7 +83,7 @@ type Receiver struct {
/*UpdateBulletin */
type UpdateBulletinRequest struct {
Id int `json:"id" valid:"Required"`
Type int `json:"type" valid:"Required"`
Type int `json:"type"`
Title string `json:"title" valid:"Required"`
Content string `json:"content" valid:"Required"`
AllowClose int `json:"allow_close"`
... ...
... ... @@ -36,9 +36,7 @@ func BulletinRelease(uid, companyId int64, request *protocol.BulletinReleaseRequ
Title: request.Title,
Type: int8(request.Type),
Content: request.Content,
Cover: request.Cover.Path,
H: request.Cover.H,
W: request.Cover.W,
Cover: string(request.Cover),
Receiver: string(receiver),
QuestionSwitch: int8(request.QuestionSwitch),
//AllowCondition: int8(request.AllowCondition),
... ... @@ -253,11 +251,7 @@ func GetBulletin(id int, companyId int64, request *protocol.GetBulletinRequest)
Content: bulletin.Content,
AllowClose: int(bulletin.AllowClose),
//AllowCondition: int(bulletin.AllowCondition),
Cover: protocol.Cover{
Path: bulletin.Cover,
W: bulletin.W,
H: bulletin.H,
},
Cover: protocol.Cover(bulletin.Cover),
}
if bulletin.QuestionSwitch == 1 {
if question, err = models.GetBulletinQuestionByBulletinId(bulletin.Id); err != nil {
... ... @@ -308,9 +302,7 @@ func UpdateBulletin(companyId int64, request *protocol.UpdateBulletinRequest) (r
bulletin.Title = request.Title
bulletin.Type = int8(request.Type)
bulletin.Content = request.Content
bulletin.Cover = request.Cover.Path
bulletin.H = request.Cover.H
bulletin.W = request.Cover.W
bulletin.Cover = string(request.Cover)
bulletin.Receiver = string(receiver)
bulletin.QuestionSwitch = int8(request.QuestionSwitch)
//bulletin.AllowCondition = int8(request.AllowCondition)
... ...