书籍列表接口新增参数
This commit is contained in:
22
internal/controller/book/book_v1_book_set_hot.go
Normal file
22
internal/controller/book/book_v1_book_set_hot.go
Normal file
@ -0,0 +1,22 @@
|
||||
package book
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "server/api/book/v1"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) BookSetHot(ctx context.Context, req *v1.BookSetHotReq) (res *v1.BookSetHotRes, err error) {
|
||||
out, err := service.Book().SetHot(ctx, &model.BookSetHotIn{
|
||||
Id: req.Id,
|
||||
IsHot: req.IsHot,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.BookSetHotRes{
|
||||
Success: out.Success,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user