Skip to content

Commit b9fa906

Browse files
committed
feat: 为创建帖子请求添加状态字段
在创建帖子时支持设置状态,将请求中的状态字段映射到帖子实体
1 parent 7f481bc commit b9fa906

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

internal/app/controller/post_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ func (pc PostController) CreatePost(c *gin.Context) {
142142
IsPasswd: req.IsPasswd,
143143
ColumnID: req.ColumnID,
144144
PassWord: req.Password,
145+
Status: req.Status,
145146
Time: req.Time,
146147
UnitPrice: uint(util.MoneyUtil.YuanToCents(req.UnitPrice)),
147148
People: req.People,

pkg/api/vo/post_request.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type CreatePostRequest struct {
2323
IsTop uint `form:"isTop" json:"isTop"`
2424
IsPasswd uint `form:"isPasswd" json:"isPasswd"`
2525
Password string `form:"password" json:"password"`
26+
Status uint `form:"status" json:"status"`
2627
Location string `form:"location" json:"location"`
2728
People string `form:"people" json:"people"`
2829
Time string `form:"time" json:"time"`

0 commit comments

Comments
 (0)