Explorar el Código

文旅分类字段信息,接口参数

root hace 3 años
padre
commit
8212bd3a19

+ 9 - 1
src/main/java/com/zhiqiyun/open/router/apis/PlaceApi.java

@@ -15,6 +15,7 @@ import com.zhiqiyun.open.core.service.PlaceCategoryService;
 import com.zhiqiyun.open.mvc.Result;
 import com.zhiqiyun.open.mvc.params.place.QueryPlaceCategoryParam;
 import com.zhiqiyun.open.router.request.category.CategoryOccupationRequest;
+import com.zhiqiyun.open.router.request.place.CategoryPageRequest;
 import com.zhiqiyun.open.router.request.place.CategoryRequest;
 import com.zhiqiyun.open.router.request.place.PlaceInfoRequest;
 import lombok.extern.slf4j.Slf4j;
@@ -45,6 +46,9 @@ public class PlaceApi {
         if (request.getIsShow() != null) {
             wrapper.eq("is_show", request.getIsShow());
         }
+        if (StringUtils.isNotBlank(request.getCode())) {
+            wrapper.like("category_id", request.getCode());
+        }
         wrapper.orderByDesc("sort_number");
         wrapper.orderByDesc("id");
         List<PlaceCategory> listData = this.placeCategoryService.list(wrapper);
@@ -52,7 +56,7 @@ public class PlaceApi {
     }
 
     @ServiceMethod(method = "list.place.category.page", title = "查询文旅场所分类分页")
-    public Result listPlaceCategoryPage(@RequestBody CategoryRequest request) {
+    public Result listPlaceCategoryPage(@RequestBody CategoryPageRequest request) {
         QueryWrapper<PlaceCategory> wrapper = new QueryWrapper<>();
         if (StringUtils.isNotBlank(request.getName())) {
             wrapper.like("name", request.getName());
@@ -60,6 +64,9 @@ public class PlaceApi {
         if (request.getIsShow() != null) {
             wrapper.eq("is_show", request.getIsShow());
         }
+        if (StringUtils.isNotBlank(request.getCode())) {
+            wrapper.like("category_id", request.getCode());
+        }
         Page<PlaceCategory> page = new Page<>(request.getCurrent(), request.getPageSize());
         page.addOrder(OrderItem.asc("sort_number"));
         page.addOrder(OrderItem.desc("id"));
@@ -68,6 +75,7 @@ public class PlaceApi {
         return Result.instance(Result.Code.SUCCESS).setData(resultData);
     }
 
+
     @ServiceMethod(method = "list.place.info.page", title = "查询文旅场所")
     public OapResponse listPlaceInfoPage(PlaceInfoRequest request) {
         QueryWrapper<PlaceBaseInfo> wrapper = new QueryWrapper<>();

+ 21 - 0
src/main/java/com/zhiqiyun/open/router/request/place/CategoryPageRequest.java

@@ -0,0 +1,21 @@
+package com.zhiqiyun.open.router.request.place;
+
+import com.dliyun.oap.framework.annotation.ServiceParamField;
+import com.dliyun.oap.framework.request.AbstractOapRequest;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.validation.constraints.NotNull;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class CategoryPageRequest extends CategoryRequest {
+
+    @NotNull
+    @ServiceParamField(describe = "页数")
+    private Integer current = 1;
+
+    @NotNull
+    @ServiceParamField(describe = "每页条数")
+    private Integer pageSize = 10;
+}

+ 2 - 7
src/main/java/com/zhiqiyun/open/router/request/place/CategoryRequest.java

@@ -16,11 +16,6 @@ public class CategoryRequest extends AbstractOapRequest {
     @ServiceParamField(describe = "是否展示 0、否 1、是")
     private Integer isShow;
 
-    @NotNull
-    @ServiceParamField(describe = "页数")
-    private Integer current = 1;
-
-    @NotNull
-    @ServiceParamField(describe = "每页条数")
-    private Integer pageSize = 10;
+    @ServiceParamField(describe = "编码")
+    private String code;
 }