瀏覽代碼

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

root 3 年之前
父節點
當前提交
cfec726402

+ 5 - 8
src/main/java/com/zhiqiyun/open/router/apis/PlaceApi.java

@@ -6,22 +6,16 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dliyun.oap.framework.annotation.ServiceMethod;
 import com.dliyun.oap.framework.annotation.ServiceMethodBean;
 import com.dliyun.oap.framework.response.OapResponse;
-import com.zhiqiyun.open.annotation.Permission;
-import com.zhiqiyun.open.core.models.category.CategoryOccupation;
 import com.zhiqiyun.open.core.models.place.PlaceBaseInfo;
 import com.zhiqiyun.open.core.models.place.PlaceCategory;
 import com.zhiqiyun.open.core.service.PlaceBaseInfoService;
 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;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.List;
@@ -40,6 +34,9 @@ public class PlaceApi {
     @ServiceMethod(method = "list.place.category", title = "查询文旅场所分类")
     public OapResponse listPlaceCategory(CategoryRequest request) {
         QueryWrapper<PlaceCategory> wrapper = new QueryWrapper<>();
+        if (StringUtils.isNotBlank(request.getId())) {
+            wrapper.eq("id", request.getId());
+        }
         if (StringUtils.isNotBlank(request.getName())) {
             wrapper.like("name", request.getName());
         }
@@ -47,7 +44,7 @@ public class PlaceApi {
             wrapper.eq("is_show", request.getIsShow());
         }
         if (StringUtils.isNotBlank(request.getCode())) {
-            wrapper.like("category_id", request.getCode());
+            wrapper.eq("category_id", request.getCode());
         }
         wrapper.orderByDesc("sort_number");
         wrapper.orderByDesc("id");
@@ -65,7 +62,7 @@ public class PlaceApi {
             wrapper.eq("is_show", request.getIsShow());
         }
         if (StringUtils.isNotBlank(request.getCode())) {
-            wrapper.like("category_id", request.getCode());
+            wrapper.eq("category_id", request.getCode());
         }
         Page<PlaceCategory> page = new Page<>(request.getCurrent(), request.getPageSize());
         page.addOrder(OrderItem.asc("sort_number"));

+ 4 - 0
src/main/java/com/zhiqiyun/open/router/request/place/CategoryRequest.java

@@ -10,6 +10,10 @@ import javax.validation.constraints.NotNull;
 @EqualsAndHashCode(callSuper = true)
 @Data
 public class CategoryRequest extends AbstractOapRequest {
+
+    @ServiceParamField(describe = "ID")
+    private String id;
+
     @ServiceParamField(describe = "文旅场所分类名称(模糊查询)")
     private String name;