【功能优化】支付:支付应用,增加 appKey 标识,用于不同接入方的标识

This commit is contained in:
YunaiV 2024-08-18 16:31:14 +08:00
parent 1dadfb8fba
commit 126aa1b40a

View File

@ -44,7 +44,7 @@ public class PayAppServiceImpl implements PayAppService {
@Override @Override
public Long createApp(PayAppCreateReqVO createReqVO) { public Long createApp(PayAppCreateReqVO createReqVO) {
// 验证 appKey 是否重复 // 验证 appKey 是否重复
validateEmailUnique(null, createReqVO.getAppKey()); validateAppKeyUnique(null, createReqVO.getAppKey());
// 插入 // 插入
PayAppDO app = PayAppConvert.INSTANCE.convert(createReqVO); PayAppDO app = PayAppConvert.INSTANCE.convert(createReqVO);
@ -58,14 +58,14 @@ public class PayAppServiceImpl implements PayAppService {
// 校验存在 // 校验存在
validateAppExists(updateReqVO.getId()); validateAppExists(updateReqVO.getId());
// 验证 appKey 是否重复 // 验证 appKey 是否重复
validateEmailUnique(updateReqVO.getId(), updateReqVO.getAppKey()); validateAppKeyUnique(updateReqVO.getId(), updateReqVO.getAppKey());
// 更新 // 更新
PayAppDO updateObj = PayAppConvert.INSTANCE.convert(updateReqVO); PayAppDO updateObj = PayAppConvert.INSTANCE.convert(updateReqVO);
appMapper.updateById(updateObj); appMapper.updateById(updateObj);
} }
void validateEmailUnique(Long id, String appKey) { void validateAppKeyUnique(Long id, String appKey) {
PayAppDO app = appMapper.selectByAppKey(appKey); PayAppDO app = appMapper.selectByAppKey(appKey);
if (app == null) { if (app == null) {
return; return;