Kaynağa Gözat

Merge branch 'master' of http://gogs.efunbox.cn:3000/Rankin/rankin

xuchaolang 6 yıl önce
ebeveyn
işleme
28d6e829ce

+ 3 - 2
rankin-cms-web/src/main/java/cn/rankin/cmsweb/controller/product/PosterController.java

@@ -3,6 +3,7 @@ package cn.rankin.cmsweb.controller.product;
 import cn.rankin.cmsweb.service.product.PosterServiceInterface;
 import cn.rankin.common.utils.api.model.APIResult;
 import cn.rankin.common.utils.api.page.Page;
+import cn.rankin.common.utils.util.BeanUtil;
 import cn.rankin.data.api.product.dto.PosterDTO;
 import cn.rankin.data.api.product.entity.Poster;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,8 +19,8 @@ public class PosterController {
     private PosterServiceInterface posterServiceInterface;
 
     @RequestMapping(value = "/list", method = RequestMethod.GET)
-    public APIResult<Page<Poster>> getPosterList(@Valid @RequestBody  PosterDTO posterDTO) {
-        return posterServiceInterface.search(posterDTO);
+    public APIResult<Page<Poster>> getPosterList(PosterDTO posterDTO) {
+        return posterServiceInterface.search(BeanUtil.convertToMap(posterDTO));
     }
 
     @RequestMapping(value = "/{id}", method = RequestMethod.GET)

+ 2 - 1
rankin-cms-web/src/main/java/cn/rankin/cmsweb/service/product/PosterServiceInterface.java

@@ -8,12 +8,13 @@ import org.springframework.cloud.netflix.feign.FeignClient;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
+import java.util.Map;
 
 @FeignClient(name = "${service.product.name}")
 public interface PosterServiceInterface {
 
     @RequestMapping(value = "/poster/list", method = RequestMethod.GET)
-    APIResult<Page<Poster>> search(@Valid @RequestBody  PosterDTO searchDTO);
+    APIResult<Page<Poster>> search(@RequestParam Map<String, Object> searchDTO);
 
     @RequestMapping(value = "/poster/{id}", method = RequestMethod.GET)
     APIResult<Poster> getPoster(@PathVariable("id") String id);

+ 4 - 2
rankin-product-service/src/main/java/cn/rankin/productservice/controller/PosterController.java

@@ -34,7 +34,7 @@ public class PosterController {
     private ProductRepository productRepository;
 
     @RequestMapping(value = "/list", method = RequestMethod.GET)
-    public APIResult<Page<Poster>> search(@Valid @RequestBody PosterDTO searchDTO) {
+    public APIResult<Page<Poster>> search(PosterDTO searchDTO) {
         Poster poster = new Poster();
 
 /*        String code = searchDTO.getCode();
@@ -48,7 +48,9 @@ public class PosterController {
         }*/
 
         poster.setStatus(searchDTO.getStatus());
-
+        poster.setMerchantId(searchDTO.getMerchantId());
+        poster.setPid(searchDTO.getPid());
+        poster.setStatus(searchDTO.getStatus());
         // sort
         LinkedHashMap<String, BaseOrderEnum> sort = new LinkedHashMap() { {
             this.put("gmtModified", BaseOrderEnum.DESC);