| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.execption.BusinessException; |
| | | 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.admin.pay.wxpay.UsrWxPayConfigService; |
| | | import com.sandu.ximon.dao.domain.AliConfigEntity; |
| | | import com.sandu.ximon.dao.domain.WxConfigEntity; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/16 10:32 |
| | | * @Version 1.0 |
| | | * ç¨æ·æ¯ä»åæ°é
ç½®ç¸å
³ |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/v1/payconfig") |
| | | public class UsrPayConfigController { |
| | | |
| | | private final UsrAlipayConfigService alipayConfigService; |
| | | private final UsrWxPayConfigService wxPayConfigService; |
| | | |
| | | |
| | | /** |
| | | * æ¯ä»å®é
置添å |
| | | * |
| | | * @param configParam |
| | | * @return |
| | | */ |
| | | @PostMapping("/addAliPayConfig") |
| | | public ResponseVO<Object> addAliPayConfig(@RequestBody AlipayConfigParam configParam) { |
| | | return ResponseUtil.success(alipayConfigService.addAliPayConfig(configParam)); |
| | | } |
| | | |
| | | /** |
| | | * æ¯ä»å®é
ç½®æ´æ¹ |
| | | * |
| | | * @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)); |
| | | } |
| | | |
| | | /** |
| | | * æ¯ä»å®é
ç½®å é¤ |
| | | * |
| | | * @param configId |
| | | * @return |
| | | */ |
| | | @PostMapping("/deleteAliPayConfig/{configId}") |
| | | public ResponseVO<Object> deleteAliPayConfig(@PathVariable Integer configId) { |
| | | return ResponseUtil.success(alipayConfigService.deleteAliPayConfig(configId)); |
| | | } |
| | | |
| | | /** |
| | | * @param poleId |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAliPayConfigByPoleId/{poleId}") |
| | | public ResponseVO<Object> getAliPayConfigByPoleId(@PathVariable Long poleId) { |
| | | return ResponseUtil.success(alipayConfigService.getConfigByPoleId(poleId)); |
| | | } |
| | | |
| | | /** |
| | | * é
置详æ
|
| | | * |
| | | * @param configId |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAliPayConfigById/{configId}") |
| | | public ResponseVO<Object> getAliPayConfigById(@PathVariable Integer configId) { |
| | | if (configId == null) { |
| | | throw new BusinessException("idè½ä¸ºç©º"); |
| | | } |
| | | AliConfigEntity byId = alipayConfigService.getById(configId); |
| | | 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)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 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 |
| | | , @RequestParam(value = "keyword", required = false) String keyword) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | return ResponseUtil.success(wxPayConfigService.configList(baseConditionVO, keyword)); |
| | | } |
| | | |
| | | |
| | | } |