mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
updateupdate 创建企业用户
This commit is contained in:
@@ -3,7 +3,7 @@ package com.jsowell.web.controller.pile;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import com.jsowell.adapay.dto.AdapayMemberInfoDTO;
|
||||
import com.jsowell.adapay.dto.CreateCorpMemberDTO;
|
||||
import com.jsowell.adapay.dto.CreateSettleAccountDTO;
|
||||
import com.jsowell.adapay.dto.UpdateAccountConfigDTO;
|
||||
import com.jsowell.adapay.service.AdapayMemberService;
|
||||
import com.jsowell.adapay.vo.AdapayAccountBalanceVO;
|
||||
@@ -11,13 +11,11 @@ import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.common.core.domain.AjaxResult;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
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.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@@ -28,26 +26,27 @@ public class AdapayMemberController extends BaseController {
|
||||
private AdapayMemberService adapayMemberService;
|
||||
|
||||
/**
|
||||
* 创建汇付会员接口
|
||||
* http://localhost:8080/adapay/member/createAdapayMember
|
||||
* 创建结算账户
|
||||
* http://localhost:8080/adapay/member/createSettleAccount
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/createAdapayMember")
|
||||
public AjaxResult createAdapayMember(@RequestBody AdapayMemberInfoDTO dto) {
|
||||
logger.info("创建汇付会员接口 param:{}", JSON.toJSONString(dto));
|
||||
@PostMapping("/createSettleAccount")
|
||||
public AjaxResult createSettleAccount(CreateSettleAccountDTO dto) {
|
||||
logger.info("创建结算账户接口 param:{}", JSON.toJSONString(dto));
|
||||
AjaxResult result;
|
||||
try {
|
||||
adapayMemberService.createMember(dto);
|
||||
adapayMemberService.createSettleAccount(dto);
|
||||
result = AjaxResult.success();
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("创建汇付会员接口warn", e);
|
||||
logger.warn("创建结算账户接口warn", e);
|
||||
result = AjaxResult.error(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.warn("创建汇付会员接口error", e);
|
||||
result = AjaxResult.error("创建汇付会员接口异常");
|
||||
logger.warn("创建结算账户接口error", e);
|
||||
result = AjaxResult.error("创建结算账户接口异常:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询汇付会员接口
|
||||
* http://localhost:8080/adapay/member/selectAdapayMember
|
||||
@@ -118,21 +117,5 @@ public class AdapayMemberController extends BaseController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建企业用户
|
||||
* http://localhost:8080/adapay/member/createCorpMember
|
||||
*/
|
||||
@PostMapping("/createCorpMember")
|
||||
public AjaxResult createCorpMember(@Validated @RequestBody CreateCorpMemberDTO dto) {
|
||||
logger.info("创建企业用户 param:{}", JSON.toJSONString(dto));
|
||||
AjaxResult result;
|
||||
try {
|
||||
adapayMemberService.createCorpMember(dto);
|
||||
result = AjaxResult.success();
|
||||
} catch (BaseAdaPayException | IOException e) {
|
||||
logger.error("查询汇付账户余额error", e);
|
||||
result = AjaxResult.error();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user