书籍列表接口新增参数
This commit is contained in:
23
internal/controller/author/author_v1_apply.go
Normal file
23
internal/controller/author/author_v1_apply.go
Normal file
@ -0,0 +1,23 @@
|
||||
package author
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
|
||||
"server/api/author/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Apply(ctx context.Context, req *v1.ApplyReq) (res *v1.ApplyRes, err error) {
|
||||
userId := g.RequestFromCtx(ctx).GetCtxVar("id").Int64()
|
||||
out, err := service.Author().Apply(ctx, &model.AuthorApplyIn{
|
||||
UserId: userId,
|
||||
PenName: req.PenName,
|
||||
Bio: req.Bio,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.ApplyRes{Success: out.Success, Msg: "Please wait patiently for the management review"}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user