You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.2 KiB
34 lines
1.2 KiB
package article
|
|
|
|
import (
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
"github.com/gogf/gf/v2/os/gtime"
|
|
)
|
|
|
|
type ArticleReq struct {
|
|
g.Meta `path:"/addArticle" method:"post" tags:"添加文章"`
|
|
|
|
//Article表字段
|
|
UserId int64 `p:"userId" v:"required" dc:"用户 ID"`
|
|
ArticleTitle string `p:"articleTitle" dc:"文章标题"`
|
|
ArticleContent string `p:"articleContent" dc:"文章内容"`
|
|
VoteStatus int `p:"voteStatus" dc:"是否投票"`
|
|
//VotePoll表字段
|
|
ArticleId int64 `p:"articleId" dc:"文章ID"`
|
|
VoteTitle string `p:"voteTitle" dc:"投票标题"`
|
|
MultiOption int `p:"multiOption" dc:"是否多选"`
|
|
DeadlineTime *gtime.Time `p:"deadlineTime" dc:"截止时间"`
|
|
Status int `p:"status" dc:"投票活动状态" d:"1"`
|
|
//VoteOption表字段
|
|
VoteId int64 `p:"voteId" dc:"投票活动ID"`
|
|
OptionList []OptionList `p:"optionList" dc:"投票选项与第几个选项"`
|
|
}
|
|
|
|
type OptionList struct {
|
|
OptionIndex int `json:"optionIndex" v:"required" dc:"选项序号"`
|
|
OptionContent string `json:"optionContent" v:"required#选项不能为空" dc:"投票选项"`
|
|
}
|
|
|
|
type ArticleRes struct {
|
|
g.Meta `mime:"application/json"`
|
|
}
|