package com.nova.sankuai.controller.v2;
|
|
import com.nova.sankuai.domain.api.huizhixin.*;
|
import com.nova.sankuai.domain.api.huizhixin.vo.*;
|
import com.nova.sankuai.infra.config.CommonException;
|
import com.nova.sankuai.service.IHzxService;
|
import io.swagger.annotations.Api;
|
import lombok.AllArgsConstructor;
|
import lombok.extern.slf4j.Slf4j;
|
import org.apache.commons.lang.StringUtils;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.Objects;
|
|
/**
|
* @Description 汇智信Controller
|
* @Author CWR
|
* @Date 2022/4/4 16:02
|
*/
|
@Api(tags = "汇智信")
|
@RestController
|
@RequestMapping(value = "/api/v2/hzx")
|
@AllArgsConstructor
|
@Slf4j
|
public class HzxV2Controller {
|
|
private final IHzxService hzxService;
|
|
|
/**
|
* 获取订单信息
|
*
|
* @param vo
|
* @return
|
*/
|
@PostMapping("/load_apply_ext_info")
|
public EncryptResponse orderInfo (@RequestBody RequestVo vo) throws Exception{
|
if (vo == null
|
|| StringUtils.isEmpty(vo.getContent())
|
|| StringUtils.isEmpty(vo.getSign())) {
|
throw new CommonException("参数错误");
|
}
|
return this.hzxService.orderInfo(vo);
|
}
|
|
/**
|
* 汇智信回调
|
*/
|
@PostMapping("/hzxCallBak")
|
public CallbackVo callBack(@RequestBody RequestVo vo) throws Exception {
|
if (Objects.isNull(vo)
|
|| StringUtils.isEmpty(vo.getContent())
|
|| StringUtils.isEmpty(vo.getSign())) {
|
throw new CommonException("参数错误");
|
}
|
return hzxService.callBack(vo);
|
}
|
|
}
|