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.
58 lines
2.5 KiB
58 lines
2.5 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 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:"是否投票"`
|
|
//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"`
|
|
//VoteOption表字段
|
|
VoteId int64 `p:"voteId" dc:"投票活动ID"`
|
|
OptionList []OptionList `p:"optionList" v:"required#选项不能为空" 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"`
|
|
}
|
|
|
|
//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:"投票选项"`
|
|
//}
|