| | |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | 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.dao.domain.AlipayConfigEntity; |
| | | import com.sandu.ximon.admin.pay.alipay.UsrWxPayConfigService; |
| | | import com.sandu.ximon.dao.domain.AliConfigEntity; |
| | | import com.sandu.ximon.dao.domain.WxConfigEntity; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | public class UsrPayConfigCollector { |
| | | |
| | | private final UsrAlipayConfigService alipayConfigService; |
| | | private final UsrWxPayConfigService wxPayConfigService; |
| | | |
| | | |
| | | /** |
| | |
| | | if(configId==null){ |
| | | throw new BusinessException("id能为空"); |
| | | } |
| | | AlipayConfigEntity byId = alipayConfigService.getById(configId); |
| | | AliConfigEntity byId = alipayConfigService.getById(configId); |
| | | if(byId==null){ |
| | | throw new BusinessException("配置id错误或配置不存在"); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * wx配置添加 |
| | | * @param configParam |
| | | * @return |
| | | */ |
| | | @PostMapping("/addWxPayConfig") |
| | | public ResponseVO<Object> addAliPayConfig(@RequestBody WxpayConfigParam configParam) { |
| | | return ResponseUtil.success(wxPayConfigService.addWxPayConfig(configParam)); |
| | | } |
| | | |
| | | /** |
| | | * 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)); |
| | | } |
| | | |
| | | /** |
| | | * wx配置删除 |
| | | * @param configId |
| | | * @return |
| | | */ |
| | | @PostMapping("/deleteWxPayConfig/{configId}") |
| | | public ResponseVO<Object> deleteWxPayConfig(@PathVariable Long configId) { |
| | | return ResponseUtil.success(wxPayConfigService.deleteWxPayConfig(configId)); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param poleId |
| | | * @return |
| | | */ |
| | | @GetMapping("/getWxPayConfigByPoleId/{poleId}") |
| | | public ResponseVO<Object> getWxPayConfigByPoleId(@PathVariable Long poleId) { |
| | | return ResponseUtil.success(wxPayConfigService.getConfigByPoleId(poleId)); |
| | | } |
| | | |
| | | /** |
| | | *配置详情 |
| | | * @param configId |
| | | * @return |
| | | */ |
| | | @GetMapping("/getWxPayConfigById/{configId}") |
| | | public ResponseVO<Object> getWxPayConfigById(@PathVariable Integer configId) { |
| | | if(configId==null){ |
| | | throw new BusinessException("id能为空"); |
| | | } |
| | | WxConfigEntity byId = wxPayConfigService.getById(configId); |
| | | if(byId==null){ |
| | | throw new BusinessException("配置id错误或配置不存在"); |
| | | } |
| | | return ResponseUtil.success(byId); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/WxConfigList") |
| | | public ResponseVO<Object> WxConfigList(BaseConditionVO baseConditionVO) { |
| | | return ResponseUtil.success(wxPayConfigService.configList(baseConditionVO)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |