refactor: 商品分页列表重构

This commit is contained in:
Ray.Hao 2024-06-03 22:08:06 +08:00
parent a2a2ba3742
commit 49597f7b0f
6 changed files with 4 additions and 28 deletions

View File

@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
* @author haoxr
* @since 2021/1/4
**/
@Tag(name = "Admin-商品SPU接口")
@Tag(name = "Admin-商品接口")
@RestController
@RequestMapping("/api/v1/spu")
@RequiredArgsConstructor

View File

@ -18,7 +18,7 @@ import java.util.List;
* @author Ray Hao
* @since 2022/2/5
*/
@Tag(name = "App-商品分类")
@Tag(name = "【App】商品分类")
@RestController("appCategoryController")
@RequestMapping("/app-api/v1/categories")
@RequiredArgsConstructor

View File

@ -11,12 +11,13 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "App-商品接口")
@Tag(name = "【App】商品接口")
@RestController
@RequestMapping("/app-api/v1/product")
@RequiredArgsConstructor

View File

@ -21,10 +21,5 @@ public class SpuPageQuery extends BasePageQuery {
@Schema(description="商品分类ID")
private Long categoryId;
@Schema(description="排序字段名")
private String sortField;
@Schema(description="排序规则(asc:升序;desc:降序)")
private String sort;
}

View File

@ -20,31 +20,15 @@ public class SpuPageVO {
private String name;
private Long categoryId;
private Long brandId;
private Long originPrice;
private Long price;
private Integer sales;
private String imgUrl;
private String[] album;
private String unit;
private String description;
private String detail;
private Integer status;
private String categoryName;
private String brandName;
private List<Sku> skuList;
}

View File

@ -10,9 +10,7 @@
t1.id,
t1.name,
t1.img_url,
t1.price,
t1.unit,
t1.detail,
t1.description,
t3.NAME categoryName,
t4.NAME brandName
@ -26,10 +24,8 @@
<if test="queryParams.categoryId!=null">
AND t1.category_id =#{queryParams.categoryId}
</if>
</where>
ORDER BY
t1.update_time DESC,
t1.create_time DESC
</select>