| | |
| | | import com.sandu.ximon.admin.param.AlipayConfigParam; |
| | | import com.sandu.ximon.admin.param.WxpayConfigParam; |
| | | import com.sandu.ximon.admin.pay.alipay.UsrAlipayConfigService; |
| | | import com.sandu.ximon.admin.pay.alipay.UsrWxPayConfigService; |
| | | import com.sandu.ximon.admin.pay.wxpay.UsrWxPayConfigService; |
| | | import com.sandu.ximon.admin.security.PermissionConfig; |
| | | import com.sandu.ximon.dao.domain.AliConfigEntity; |
| | | import com.sandu.ximon.dao.domain.WxConfigEntity; |
| | | import com.sandu.ximon.dao.enums.MenuEnum; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | private final UsrAlipayConfigService alipayConfigService; |
| | | private final UsrWxPayConfigService wxPayConfigService; |
| | | private PermissionConfig permissionConfig; |
| | | |
| | | |
| | | /** |
| | | * 支付宝配置添加 |
| | | * |
| | | * @param configParam |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 支付宝配置更改 |
| | | * |
| | | * @param configId |
| | | * @param configParam |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateAliPayConfig/{configId}") |
| | | public ResponseVO<Object> updateAliPayConfig(@PathVariable Integer configId, @RequestBody AlipayConfigParam configParam) { |
| | | return ResponseUtil.success(alipayConfigService.updateAliPayConfig(configId,configParam)); |
| | | return ResponseUtil.success(alipayConfigService.updateAliPayConfig(configId, configParam)); |
| | | } |
| | | |
| | | /** |
| | | * 支付宝配置删除 |
| | | * |
| | | * @param configId |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param poleId |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | *配置详情 |
| | | * 配置详情 |
| | | * |
| | | * @param configId |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAliPayConfigById/{configId}") |
| | | public ResponseVO<Object> getAliPayConfigById(@PathVariable Integer configId) { |
| | | if(configId==null){ |
| | | if (configId == null) { |
| | | throw new BusinessException("id能为空"); |
| | | } |
| | | AliConfigEntity byId = alipayConfigService.getById(configId); |
| | | if(byId==null){ |
| | | if (byId == null) { |
| | | throw new BusinessException("配置id错误或配置不存在"); |
| | | } |
| | | return ResponseUtil.success(byId); |
| | |
| | | @GetMapping("/aliConfigList") |
| | | public ResponseVO<Object> aliConfigList(BaseConditionVO baseConditionVO |
| | | , @RequestParam(value = "keyword", required = false) String keyword) { |
| | | return ResponseUtil.success(alipayConfigService.configList(baseConditionVO,keyword)); |
| | | return ResponseUtil.success(alipayConfigService.configList(baseConditionVO, keyword)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * wx配置添加 |
| | | * |
| | | * @param configParam |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * wx配置更改 |
| | | * |
| | | * @param configId |
| | | * @param configParam |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateWxPayConfig/{configId}") |
| | | public ResponseVO<Object> updateAliPayConfig(@PathVariable Long configId, @RequestBody WxpayConfigParam configParam) { |
| | | return ResponseUtil.success(wxPayConfigService.updateWxPayConfig(configId,configParam)); |
| | | return ResponseUtil.success(wxPayConfigService.updateWxPayConfig(configId, configParam)); |
| | | } |
| | | |
| | | /** |
| | | * wx配置删除 |
| | | * |
| | | * @param configId |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param poleId |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | *配置详情 |
| | | * 配置详情 |
| | | * |
| | | * @param configId |
| | | * @return |
| | | */ |
| | | @GetMapping("/getWxPayConfigById/{configId}") |
| | | public ResponseVO<Object> getWxPayConfigById(@PathVariable Integer configId) { |
| | | if(configId==null){ |
| | | if (configId == null) { |
| | | throw new BusinessException("id能为空"); |
| | | } |
| | | WxConfigEntity byId = wxPayConfigService.getById(configId); |
| | | if(byId==null){ |
| | | if (byId == null) { |
| | | throw new BusinessException("配置id错误或配置不存在"); |
| | | } |
| | | return ResponseUtil.success(byId); |
| | |
| | | @GetMapping("/WxConfigList") |
| | | public ResponseVO<Object> WxConfigList(BaseConditionVO baseConditionVO |
| | | , @RequestParam(value = "keyword", required = false) String keyword) { |
| | | if (!permissionConfig.check(MenuEnum.PAY_CONFIG.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | return ResponseUtil.success(wxPayConfigService.configList(baseConditionVO,keyword)); |
| | | return ResponseUtil.success(wxPayConfigService.configList(baseConditionVO, keyword)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |