bulletin.go 3.8 KB
package protocol

const (
	BulletinUnRelease = 1 //下架
	BulletinRelease   = 2 //上架
)

const (
	QuestionSingleSelect = 0 //单选
	QuestionMultiSelect  = 1 //多选
)

/*BulletinRelease */
type BulletinReleaseRequest struct {
	Id         int    `json:"id"`
	Type       int    `json:"type"`
	Title      string `json:"title" valid:"Required"`
	Content    string `json:"content" valid:"Required"`
	AllowClose int    `json:"allow_close"`
	//AllowCondition int      `json:"allow_condition"`
	QuestionSwitch int             `json:"question_switch"`
	Receiver       []VisibleObject `json:"receiver"`
	Question       Question        `json:"question"`
	Cover          Cover           `json:"cover"`
	IsPublish      int             `json:"is_publish"` //是否直接发布 0:否 1:直接发布
}
type Question struct {
	Id      int               `json:"id"`
	Type    int               `json:"type"`
	Title   string            `json:"title" `
	Content []QuestionContent `json:"content" valid:"Required"`
}
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 BulletinReleaseResponse struct {
}

/*BulletinList */
type BulletinListRequest struct {
	Status int8 `json:"status"` //1:待上架 2:上架
	RequestPageInfo
}
type BulletinListResponse struct {
	List []*BulletinItem `json:"lists"`
	//Total int
	ResponsePageInfo
}

type BulletinItem struct {
	Id       int             `json:"id"`
	Type     int8            `json:"type"`
	Title    string          `json:"title"`
	Status   int8            `json:"status"`
	Receiver []VisibleObject `json:"receiver" valid:"Required"`
	CreateAt string          `json:"time"`
}

/*GetBulletin */
type GetBulletinRequest struct {
	Id int `json:"id"`
}
type GetBulletinResponse struct {
	Id         int    `json:"id"`
	Type       int    `json:"type" valid:"Required"`
	Title      string `json:"title" valid:"Required"`
	Content    string `json:"content" valid:"Required"`
	AllowClose int    `json:"allow_close"`
	//AllowCondition int        `json:"allow_condition"`
	QuestionSwitch int             `json:"question_switch"`
	Receiver       []VisibleObject `json:"receiver" valid:"Required"`
	Question       Question        `json:"question"`
	Cover          Cover           `json:"cover" valid:"Required"`
}

type Receiver struct {
	Id       int64  `json:"id"`
	NickName string `json:"name"`
}

/*UpdateBulletin */
type UpdateBulletinRequest struct {
	Id         int    `json:"id" valid:"Required"`
	Type       int    `json:"type" valid:"Required"`
	Title      string `json:"title" valid:"Required"`
	Content    string `json:"content" valid:"Required"`
	AllowClose int    `json:"allow_close"`
	//AllowCondition int      `json:"allow_condition"`
	QuestionSwitch int      `json:"question_switch"`
	Receiver       []string `json:"receiver" valid:"Required"`
	Question       Question `json:"question"`
	Cover          Cover    `json:"cover" valid:"Required"`
}
type UpdateBulletinResponse struct {
}

/*OperateBulletin */
type OperateBulletinRequest struct {
	Id      int `json:"id" valid:"Required"`
	CmdType int `json:"cmd_type" valid:"Required"` //1:下架 2.上架
}
type OperateBulletinResponse struct {
}

/*BulletinFeedbacks 反馈详情*/
type BulletinFeedbacksRequest struct {
	RequestPageInfo
	Id int `json:"id" valid:"Required"` //公告编号
}
type BulletinFeedbacksResponse struct {
	ResponsePageInfo
	List []FeedBackItem `json:"lists"`
}

type FeedBackItem struct {
	Time    int64  `json:"time"`
	Name    string `json:"name"`
	Content string `json:"content"`
}

type Answer struct {
	VoteResults []int  `json:"voteResults"`
	EditContent string `json:"editContent"`
}

/*ExportFeedBacks */
type ExportFeedBacksRequest struct {
	Id int `json:"id"` //公告编号
}
type ExportFeedBacksResponse struct {
}