MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / Withdraw

Method Withdraw

internal/api/post.go:121–139  ·  view source on GitHub ↗

Withdraw 撤回帖子

(ctx *gin.Context)

Source from the content-addressed store, hash-verified

119
120// Withdraw 撤回帖子
121func (ph *PostHandler) Withdraw(ctx *gin.Context) {
122 var req req.WithDrawReq
123 if err := ctx.ShouldBindJSON(&req); err != nil {
124 apiresponse.ErrorWithMessage(ctx, "无效的请求参数")
125 return
126 }
127
128 uc, ok := requireUser(ctx)
129 if !ok {
130 return
131 }
132
133 if err := ph.svc.Withdraw(ctx, req.PostId, uc.Uid); err != nil {
134 apiresponse.ErrorWithMessage(ctx, err.Error())
135 return
136 }
137
138 apiresponse.SuccessWithData(ctx, req.PostId)
139}
140
141// List 获取个人帖子列表
142func (ph *PostHandler) List(ctx *gin.Context) {

Callers

nothing calls this directly

Calls 4

ErrorWithMessageFunction · 0.92
SuccessWithDataFunction · 0.92
requireUserFunction · 0.85
WithdrawMethod · 0.65

Tested by

no test coverage detected