This commit is contained in:
2024-10-16 20:46:46 +08:00
parent fdfdbb5ff6
commit 185b8aef90
14 changed files with 546 additions and 306 deletions

View File

@@ -2,6 +2,7 @@ package productlogic
import (
"context"
"tianyuan-api/apps/sentinel/internal/model"
"tianyuan-api/pkg/sqlutil"
"tianyuan-api/apps/sentinel/internal/svc"
@@ -25,7 +26,10 @@ func NewGetProductPageListLogic(ctx context.Context, svcCtx *svc.ServiceContext)
}
func (l *GetProductPageListLogic) GetProductPageList(in *sentinel.PageListRequest) (*sentinel.ProductResponse, error) {
products, total, err := l.svcCtx.ProductsModel.FindProductsList(l.ctx, in.Page, in.PageSize)
products, total, err := l.svcCtx.ProductsModel.FindProductsList(l.ctx, in.Page, in.PageSize, &model.ProductFilter{
IsVisible: &in.IsVisible,
ProductName: in.ProductName,
})
if err != nil {
return nil, err
}