|
|
@ -8,23 +8,20 @@ import ( |
|
|
|
type ArticleReq struct { |
|
|
|
g.Meta `path:"/addArticle" method:"post" tags:"添加文章"` |
|
|
|
|
|
|
|
//Article Article `json:"article"`
|
|
|
|
//VotePoll VotePoll `json:"votePoll"`
|
|
|
|
//VoteOption VoteOption `json:"voteOption"`
|
|
|
|
//Article表字段
|
|
|
|
UserId int64 `p:"userId" v:"required" dc:"用户 ID"` |
|
|
|
ArticleTitle string `p:"articleTitle" v:"required#标题不能为空" dc:"文章标题"` |
|
|
|
ArticleContent string `p:"articleContent" v:"required#内容不能为空" dc:"文章内容"` |
|
|
|
VoteStatus int `p:"voteStatus" v:"required" dc:"是否投票"` |
|
|
|
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" v:"required#投票标题不能为空|len:max=24#投票标题不能超过24个字" dc:"投票标题"` |
|
|
|
MultiOption int `p:"multiOption" v:"required" dc:"是否多选"` |
|
|
|
DeadlineTime *gtime.Time `p:"deadlineTime" v:"required" dc:"截止时间"` |
|
|
|
Status int `p:"status" v:"required" dc:"投票活动状态" d:"1"` |
|
|
|
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" v:"required#选项不能为空" dc:"投票选项与第几个选项"` |
|
|
|
OptionList []OptionList `p:"optionList" dc:"投票选项与第几个选项"` |
|
|
|
} |
|
|
|
|
|
|
|
type OptionList struct { |
|
|
@ -35,24 +32,3 @@ type OptionList struct { |
|
|
|
type ArticleRes struct { |
|
|
|
g.Meta `mime:"application/json"` |
|
|
|
} |
|
|
|
|
|
|
|
//type Article struct {
|
|
|
|
// g.Meta `mime:"application/json"`
|
|
|
|
// UserId int64 `p:"userId" v:"required" dc:"用户 ID"`
|
|
|
|
// ArticleTitle string `p:"articleTitle" v:"required#标题不能为空" dc:"文章标题"`
|
|
|
|
// ArticleContent string `p:"articleContent" v:"required#内容不能为空" dc:"文章内容"`
|
|
|
|
// VoteStatus int `p:"voteStatus" v:"required" dc:"是否投票"`
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//type VotePoll struct {
|
|
|
|
// g.Meta `mime:"application/json"`
|
|
|
|
// ArticleId int64 `p:"articleId" v:"required" dc:"文章ID"`
|
|
|
|
// VoteTitle string `p:"voteTitle" v:"required#投票标题不能为空|len:max=24#投票标题不能超过24个字" dc:"投票标题"`
|
|
|
|
// MultiOption int `p:"multiOption" v:"required" dc:"是否多选"`
|
|
|
|
// DeadlineTime *gtime.Time `p:"deadlineTime" v:"required" dc:"截止时间"`
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//type VoteOption struct {
|
|
|
|
// g.Meta `mime:"application/json"`
|
|
|
|
// OptionList []string `p:"optionList" v:"required#选项不能为空" dc:"投票选项"`
|
|
|
|
//}
|