书籍列表接口新增参数
This commit is contained in:
24
internal/controller/recommend/recommend_v1_edit.go
Normal file
24
internal/controller/recommend/recommend_v1_edit.go
Normal file
@ -0,0 +1,24 @@
|
||||
package recommend
|
||||
|
||||
import (
|
||||
"context"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
|
||||
v1 "server/api/recommend/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Edit(ctx context.Context, req *v1.EditReq) (res *v1.EditRes, err error) {
|
||||
out, err := service.BookRecommendations().Update(ctx, &model.BookRecommendationsUpdateIn{
|
||||
Id: req.Id,
|
||||
BookId: req.BookId,
|
||||
Type: req.Type,
|
||||
CoverUrl: req.CoverUrl,
|
||||
SortOrder: req.SortOrder,
|
||||
Status: req.Status,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.EditRes{Success: out.Success}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user