Commit 716ab0fe by 程裕兵

feat:api

parent dd13617c
......@@ -6,7 +6,6 @@ import com.jiejing.fitness.finance.api.cashier.request.GetBrandCashierByIdReques
import com.jiejing.fitness.finance.api.cashier.request.ListBrandCashierByOrderNoRequest;
import com.jiejing.fitness.finance.api.cashier.request.PageBrandCashierRequest;
import com.jiejing.fitness.finance.api.cashier.vo.BrandCashierRecordVO;
import com.jiejing.fitness.finance.api.merchant.BrandMerchantApi;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.springframework.cloud.openfeign.FeignClient;
......
......@@ -53,10 +53,6 @@ public interface BrandMerchantApi {
@PostMapping(value = "/private/brandMerchant/bindXcxAppId")
JsonResult<BrandMerchantBindXcxAppIdVO> bindXcxAppId(BindBrandMerchantXcxAppIdRequest request);
@ApiOperation(value = "校验微信小程序appId绑定结果", tags = {TAG})
@PostMapping(value = "/private/brandMerchant/checkBindXcxAppId")
JsonResult<BrandMerchantBindXcxAppIdVO> checkBindXcxAppId(BindBrandMerchantXcxAppIdRequest request);
@ApiOperation(value = "授权子渠道", tags = {TAG})
@PostMapping(value = "/private/brandMerchant/authSubChannel")
JsonResult<BrandMerchantAuthSubChannelVO> authSubChannel(AuthBrandMerchantSubChannelRequest request);
......
......@@ -57,12 +57,6 @@ public class BrandMerchantApiFallback implements FallbackFactory<BrandMerchantAp
}
@Override
public JsonResult<BrandMerchantBindXcxAppIdVO> checkBindXcxAppId(
BindBrandMerchantXcxAppIdRequest request) {
return JsonResult.rpcError();
}
@Override
public JsonResult<BrandMerchantAuthSubChannelVO> authSubChannel(
AuthBrandMerchantSubChannelRequest request) {
return JsonResult.rpcError();
......
......@@ -86,15 +86,6 @@ public class BrandMerchantController implements BrandMerchantApi {
return JsonResult.success(brandMerchantService.bindXcxAppId(request.getBrandId(), request.getAppId()));
}
@ApiOperation(value = "校验微信小程序appId绑定结果", tags = {TAG})
@PostMapping(value = "/private/brandMerchant/checkBindXcxAppId")
@Override
public JsonResult<BrandMerchantBindXcxAppIdVO> checkBindXcxAppId(
@RequestBody @Valid BindBrandMerchantXcxAppIdRequest request) {
return JsonResult.success(
brandMerchantService.checkBindXcxAppId(request.getBrandId(), request.getAppId()));
}
@ApiOperation(value = "授权子渠道", tags = {TAG})
@PostMapping(value = "/private/brandMerchant/authSubChannel")
@Override
......
......@@ -20,6 +20,7 @@ public enum FinanceErrorEnums implements BaseBizError {
NOT_SUPPORT_METHOD("不支持的方法"),
NOT_SUPPORT_TYPE("不支持的类型"),
CHANNEL_NOT_OPEN("未开通当前支付通道"),
MERCHANT_NOT_OPEN("未进件"),
NOT_SUPPORT_FILE_TYPE("不支持的文件类型"),
;
......
......@@ -68,15 +68,6 @@ public interface BrandMerchantService {
BrandMerchantBindXcxAppIdVO bindXcxAppId(Long brandId, String appId);
/**
* 绑定小程序AppId结果
*
* @param brandId 品牌ID
* @param appId 小程序appId
* @return 结果
*/
BrandMerchantBindXcxAppIdVO checkBindXcxAppId(Long brandId, String appId);
/**
* 授权子渠道
*
* @param brandId 品牌ID
......
......@@ -39,7 +39,6 @@ import com.jiejing.paycenter.common.model.Legal;
import com.jiejing.paycenter.common.model.License;
import com.jiejing.paycenter.common.model.ResourceInfo;
import com.jiejing.paycenter.common.model.SubChannelAuthInfo;
import com.jiejing.paycenter.common.model.SubChannelConfigInfo;
import com.jiejing.paycenter.common.model.SubChannelInfo;
import com.jiejing.studio.api.studio.vo.StudioVO;
import java.util.ArrayList;
......@@ -473,13 +472,4 @@ public class MerchantConvert {
.collect(Collectors.toList());
}
public static BrandMerchantBindXcxAppIdVO convertBrandBindWxAppIdApply(
List<SubChannelConfigInfo> configs, String appId) {
SubChannelConfigInfo config = Optional.ofNullable(configs).orElse(new ArrayList<>(1)).stream()
.filter(e -> e.getAppId().equals(appId)).findFirst().orElse(new SubChannelConfigInfo());
return BrandMerchantBindXcxAppIdVO.builder()
.state(config.getState())
.failMessage(config.getFailMessage())
.build();
}
}
......@@ -161,6 +161,9 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
@Override
public BrandMerchantBindXcxAppIdVO bindXcxAppId(Long brandId, String appId) {
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(brandId, channel);
if (null == relation) {
throw new BizException(FinanceErrorEnums.MERCHANT_NOT_OPEN);
}
ConfigSubChannelVO vo = merchantRpcService.bindAppIdWxXcxOffline(channel, IdWorker.getIdStr(),
relation.getMerchantId(), appId);
......@@ -170,13 +173,6 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
}
@Override
public BrandMerchantBindXcxAppIdVO checkBindXcxAppId(Long brandId, String appId) {
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(brandId, channel);
MerchantVO merchant = merchantRpcService.getByMerchantId(relation.getMerchantId());
return MerchantConvert.convertBrandBindWxAppIdApply(merchant.getSubChannelConfigs(), appId);
}
@Override
public BrandMerchantAuthSubChannelVO authSubChannel(Long brandId, SubChannelEnums subChannel,
SubChannelAuthTypeEnums authType) {
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(brandId, channel);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment