Parcourir la source

Merge remote-tracking branch 'origin/dev' into dev

赵冬冬 il y a 4 ans
Parent
commit
59d3091698

+ 3 - 0
carbon-h5/carbon-h5-common/src/main/java/com/hcloud/microserver/h5/facade/carbon/entity/GoodsCredentialInfo.java

@@ -1,5 +1,7 @@
 package com.hcloud.microserver.h5.facade.carbon.entity;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -33,6 +35,7 @@ public class GoodsCredentialInfo {
 
     private String createUser;
 
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
     private Date createTime;
 
     private CustomerInfo customerInfo;

+ 8 - 8
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/CustomerCarbonValController.java

@@ -13,13 +13,11 @@ import com.hcloud.microserver.h5.service.CustomerCarbonValService;
 import com.hcloud.microserver.h5.service.CustomerService;
 import io.swagger.annotations.*;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.validation.Valid;
-
 @RestController
 @RequestMapping("/wap/carbonVal")
 @Api(tags = "购碳量信息接口",description = "购碳量信息接口")
@@ -35,12 +33,14 @@ public class CustomerCarbonValController extends CarbonBaseController {
             @ApiImplicitParam(name = "type",value = "类型 1:企业排行榜 2:个人排行榜", dataType = "int")
     })
     @ApiResponse(code =0,message = "查询成功")
-    @PostMapping("/getCustomerCarbonValRank")
-    public ResponseBase getCustomerCarbonValRank(@RequestBody @Valid CustomerCarbonValRankForm form){
-        if (form.getType() < 1 || form.getType() > 2){
+    @GetMapping("/getCustomerCarbonValRank")
+    public ResponseBase getCustomerCarbonValRank(@RequestParam("type") Integer type){
+        if (type < 1 || type > 2){
             throw new GlobalException(ResultEnum.FAILURE.getCode(),"查询排行类型错误!");
         }
-
+        CustomerCarbonValRankForm form = new CustomerCarbonValRankForm();
+        form.setType(type);
+        //获取当前登录用户
         CustomerInfoForm customerInfo = customerService.getCurrentMember();
         if (customerInfo == null) {
             return responseError(new ResultVO(ResultEnum.TOKEN_EXPIRED));