| | |
| | | import cc.mrbird.febs.pay.model.HeaderDto; |
| | | import cc.mrbird.febs.pay.service.WxFaPiaoService; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @PostMapping(value = "/lwPayConfig") |
| | | @ControllerEndpoint(operation = "保存LWPAY配置") |
| | | public FebsResponse lwPayConfig(LwPayConfigDto dto) { |
| | | if (StrUtil.isBlank(dto.getMemberId())) { |
| | | return new FebsResponse().fail().message("商户号不能为空"); |
| | | } |
| | | if (StrUtil.isBlank(dto.getSecretKey())) { |
| | | return new FebsResponse().fail().message("签名密钥不能为空"); |
| | | } |
| | | if (StrUtil.isBlank(dto.getNotifyUrl())) { |
| | | return new FebsResponse().fail().message("回调地址不能为空"); |
| | | } |
| | | if (StrUtil.isBlank(dto.getReturnUrl())) { |
| | | return new FebsResponse().fail().message("跳转地址不能为空"); |
| | | } |
| | | commonService.addDataDic("LWPAY_CONFIG", "MEMBER_ID", dto.getMemberId(), "LWPAY商户号", false); |
| | | commonService.addDataDic("LWPAY_CONFIG", "SECRET_KEY", dto.getSecretKey(), "LWPAY签名密钥", false); |
| | | commonService.addDataDic("LWPAY_CONFIG", "NOTIFY_URL", dto.getNotifyUrl(), "LWPAY异步回调地址", false); |
| | | commonService.addDataDic("LWPAY_CONFIG", "RETURN_URL", dto.getReturnUrl(), "LWPAY支付完成跳转地址", false); |
| | | return new FebsResponse().success().message("保存成功"); |
| | | } |
| | | |
| | | @PostMapping(value = "/tokenviewConfig") |
| | | @ControllerEndpoint(operation = "保存Tokenview配置") |
| | | public FebsResponse tokenviewConfig(TokenviewConfigDto dto) { |
| | | if (StrUtil.isBlank(dto.getWebhookSecret())) { |
| | | return new FebsResponse().fail().message("签名密钥不能为空"); |
| | | } |
| | | if (StrUtil.isBlank(dto.getTrc20UsdtAddress())) { |
| | | return new FebsResponse().fail().message("收款地址不能为空"); |
| | | } |
| | | commonService.addDataDic("TOKENVIEW_CONFIG", "WEBHOOK_SECRET", dto.getWebhookSecret(), "Tokenview Webhook签名密钥", false); |
| | | commonService.addDataDic("TOKENVIEW_CONFIG", "TRC20_USDT_ADDRESS", dto.getTrc20UsdtAddress(), "TRC20 USDT收款地址", false); |
| | | return new FebsResponse().success().message("保存成功"); |
| | | } |
| | | |
| | | @PostMapping(value = "/salesService") |
| | | @ControllerEndpoint(operation = "保存售后服务配置") |
| | | public FebsResponse salesService(SalesServiceDto dto) { |
| | | if (StrUtil.isBlank(dto.getWhatsApp())) { |
| | | return new FebsResponse().fail().message("WhatsApp不能为空"); |
| | | } |
| | | if (StrUtil.isBlank(dto.getPhone())) { |
| | | return new FebsResponse().fail().message("联系电话不能为空"); |
| | | } |
| | | if (StrUtil.isBlank(dto.getEmail())) { |
| | | return new FebsResponse().fail().message("联系邮箱不能为空"); |
| | | } |
| | | if (StrUtil.isBlank(dto.getAddress())) { |
| | | return new FebsResponse().fail().message("联系地址不能为空"); |
| | | } |
| | | if (StrUtil.isBlank(dto.getWorkingHours())) { |
| | | return new FebsResponse().fail().message("工作时间不能为空"); |
| | | } |
| | | commonService.addDataDic("SALES_SERVICE", "WHATSAPP", dto.getWhatsApp(), "WhatsApp号码", false); |
| | | commonService.addDataDic("SALES_SERVICE", "PHONE", dto.getPhone(), "联系电话", false); |
| | | commonService.addDataDic("SALES_SERVICE", "EMAIL", dto.getEmail(), "联系邮箱", false); |
| | | commonService.addDataDic("SALES_SERVICE", "ADDRESS", dto.getAddress(), "联系地址", false); |
| | | commonService.addDataDic("SALES_SERVICE", "WORKINGHOURS", dto.getWorkingHours(), "工作时间", false); |
| | | return new FebsResponse().success().message("保存成功"); |
| | | } |
| | | |
| | | @PostMapping(value = "/agentAmountSetSetting") |
| | | public FebsResponse agentAmountSetSetting(AdminAgentAmountDto adminAgentAmountDto) { |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |