bulletin.go 2.7 KB
package protocol

/*BulletinRelease */
type BulletinReleaseRequest 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       []string `json:"receiver" valid:"Required"`
	Question       Question `json:"question"`
	Cover          Cover    `json:"cover" valid:"Required"`
}
type Question struct {
	Id      int               `json:"id"`
	Type    int               `json:"type" valid:"Required"`
	Title   string            `json:"title" valid:"Required"`
	Content []QuestionContent `json:"content" valid:"Required"`
}
type QuestionContent struct {
	Id      int
	Content string
}
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:上架
	Page     int  `json:"page"`
	PageSize int  `json:"page_size"`
}
type BulletinListResponse struct {
	List  []*BulletinItem `json:"list"`
	Total int
}

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

/*GetBulletin */
type GetBulletinRequest struct {
}
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       []string `json:"receiver" valid:"Required"`
	Question       Question `json:"question"`
	Cover          Cover    `json:"cover" valid:"Required"`
}

/*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 {
}