|
@@ -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));
|