完善功能

This commit is contained in:
2025-07-16 15:16:40 +08:00
parent b2871ec0d2
commit f68a5b360b
123 changed files with 4643 additions and 931 deletions

View File

@ -0,0 +1,29 @@
package book
import (
"context"
v1 "server/api/book/v1"
"server/internal/model"
"server/internal/service"
)
func (c *ControllerV1) List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error) {
out, err := service.Book().List(ctx, &model.BookListIn{
Page: req.Page,
Size: req.Size,
Title: req.Title,
CategoryId: req.CategoryId,
AuthorId: req.AuthorId,
Status: req.Status,
IsRecommended: req.IsRecommended,
Sort: req.Sort,
})
if err != nil {
return nil, err
}
return &v1.ListRes{
Total: out.Total,
List: out.List,
}, nil
}