新增了获取系统商品列表-限制条数

This commit is contained in:
2024-06-05 14:12:53 +08:00
parent 9f6b54a6c4
commit ca629cdb2d
5 changed files with 130 additions and 2 deletions
+32
View File
@@ -300,3 +300,35 @@ func (r *Product) GetPlatformProductList(c *gin.Context) {
responses.OkWithData(productPlatforms, c)
}
// GetProductList 获取系统商品列表-限制条数
func (r *Product) GetProductList(c *gin.Context) {
productRequest := requests.ProductRequest{}
req := productRequest.GetProductList
if err := c.ShouldBind(&req); err != nil {
responses.FailWithMessage(err.Error(), c)
return
}
// 参数验证
if err := global.Validate.Struct(req); err != nil {
responses.FailWithMessage(utils.Translate(err), c)
return
}
productDao := dao.ProductDao{}
product, err := productDao.GetProductListSearch(req)
if err != nil {
responses.FailWithMessage(err.Error(), c)
return
}
// 处理返回值
getProductListResponses := dto.GetProductListDto(product)
if err != nil {
responses.FailWithMessage(err.Error(), c)
return
}
responses.OkWithData(getProductListResponses, c)
}
-1
View File
@@ -136,7 +136,6 @@ func (r *UserPatient) GetUserPatientList(c *gin.Context) {
userPatientDao := dao.UserPatientDao{}
userPatient, err := userPatientDao.GetUserPatientListSearch(req)
if err != nil {
responses.FailWithMessage(err.Error(), c)
return