update 交易记录处理平台未找到的订单添加启动方式判断

This commit is contained in:
Lemon
2023-11-04 09:01:29 +08:00
parent c3d3c9eb9b
commit c66e26b5f3
4 changed files with 85 additions and 7 deletions

View File

@@ -0,0 +1,51 @@
package com.jsowell.thirdparty.yongchengboche;
import com.alibaba.fastjson2.JSONObject;
import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.thirdparty.lianlian.common.CommonResult;
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
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;
import java.io.UnsupportedEncodingException;
import java.util.Map;
/**
* 甬城泊车controller
*
* @author Lemon
* @Date 2023/11/3 9:39:21
*/
@Anonymous
@RestController
@RequestMapping("/ycbc")
public class YCBCController extends BaseController {
@Autowired
private YCBCService ycbcService;
/**
* 获取token接口
* http://localhost:8080/zdl/v1/query_token
*/
@PostMapping("/v1/query_token")
public CommonResult<?> queryToken(@RequestBody CommonParamsDTO dto) {
logger.info("甬城泊车平台请求令牌 params:{}", JSONObject.toJSONString(dto));
try {
Map<String, String> map = ycbcService.generateToken(dto);
logger.info("甬城泊车平台请求令牌 result:{}", JSONObject.toJSONString(map));
return CommonResult.success(0, "请求令牌成功!", map.get("Data"), map.get("Sig"));
} catch (UnsupportedEncodingException e) {
logger.error("甬城泊车平台 请求令牌接口 异常");
return CommonResult.failed("获取token发生异常");
}
}
}