新增 软杰道闸系统对接

This commit is contained in:
Lemon
2023-09-22 14:40:09 +08:00
parent dff9271288
commit 098768249b
4 changed files with 190 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
package com.jsowell.ruanjie;
import com.alibaba.fastjson2.JSON;
import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.response.RestApiResponse;
import com.jsowell.pile.dto.ruanjie.UseCouponDTO;
import com.jsowell.thirdparty.ruanjie.service.RJService;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 软杰controller
*
* @author Lemon
* @Date 2023/9/22 9:00
*/
@Anonymous
@RestController
@RequestMapping("/ruanjie")
public class RJController extends BaseController {
@Autowired
private RJService rjService;
@PostMapping("/useCoupon")
public RestApiResponse<?> useCoupon(@RequestBody UseCouponDTO dto) {
logger.info("软杰--使用优惠券 params:{}", JSON.toJSONString(dto));
RestApiResponse<?> response = null;
try {
String result = rjService.useCoupon(dto);
response = new RestApiResponse<>(result);
} catch (Exception e) {
logger.error("软杰--使用优惠券 error, ", e);
response = new RestApiResponse<>(e);
}
logger.info("软杰--使用优惠券 result:{}", response);
return response;
}
}