From 9fc21c9593edb936106ebbf7cb6a5ee22eda7b3b Mon Sep 17 00:00:00 2001 From: sdhkjh <2450473462@qq.com> Date: Sat, 5 Oct 2024 21:33:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E4=BB=98=E5=BA=94=E7=94=A8?= =?UTF-8?q?=EF=BC=9A=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=9A=84=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=EF=BC=8C=E5=88=A0=E9=99=A4=E6=A0=B9=E6=8D=AEid=E5=92=8Cenabled?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pay/controller/PayAppController.java | 11 ++++----- .../java/com/skyeye/pay/entity/PayApp.java | 2 +- .../com/skyeye/pay/service/PayAppService.java | 3 --- .../pay/service/impl/PayAppServiceImpl.java | 23 +++++++++---------- .../service/impl/PayChannelServiceImpl.java | 5 ++-- 5 files changed, 18 insertions(+), 26 deletions(-) diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/controller/PayAppController.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/controller/PayAppController.java index 26393702..f8dada70 100644 --- a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/controller/PayAppController.java +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/controller/PayAppController.java @@ -46,18 +46,15 @@ public class PayAppController { } /** - * 更新支付应用的状态信息 + * 获取全部已启用的支付应用信息 * * @param inputObject 入参以及用户信息等获取对象 * @param outputObject 出参以及提示信息的返回值对象 */ - @ApiOperation(id = "updateEnabled", value = "更新支付应用的状态信息", method = "POST", allUse = "1") - @ApiImplicitParams({ - @ApiImplicitParam(id = "id", name = "id", value = "主键id", required = "required"), - @ApiImplicitParam(id = "enabled", name = "enabled", value = "状态", required = "required")}) + @ApiOperation(id = "queryAllEnabledList", value = "获取全部已启用的支付应用信息", method = "POST", allUse = "1") @RequestMapping("/post/PayAppController/updateEnabled") - public void updateEnabled(InputObject inputObject, OutputObject outputObject) { - payAppService.updateEnabled(inputObject, outputObject); + public void queryAllEnabledList(InputObject inputObject, OutputObject outputObject) { + payAppService.queryList(inputObject, outputObject); } /** diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/entity/PayApp.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/entity/PayApp.java index 3af6d08a..9aff8746 100644 --- a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/entity/PayApp.java +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/entity/PayApp.java @@ -34,7 +34,7 @@ public class PayApp extends BaseGeneralInfo { private String appKey; @TableField("enabled") - @ApiModelProperty(value = "状态", required = "required") + @ApiModelProperty(value = "状态1:启用,2:禁用", required = "required") private String enabled; @TableField("order_notify_url") diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/service/PayAppService.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/service/PayAppService.java index 72d9533f..cf68dd93 100644 --- a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/service/PayAppService.java +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/service/PayAppService.java @@ -5,8 +5,6 @@ package com.skyeye.pay.service; import com.skyeye.base.business.service.SkyeyeBusinessService; -import com.skyeye.common.object.InputObject; -import com.skyeye.common.object.OutputObject; import com.skyeye.pay.entity.PayApp; /** @@ -18,5 +16,4 @@ import com.skyeye.pay.entity.PayApp; * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 */ public interface PayAppService extends SkyeyeBusinessService { - void updateEnabled(InputObject inputObject, OutputObject outputObject); } diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/service/impl/PayAppServiceImpl.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/service/impl/PayAppServiceImpl.java index d6626198..4f7f92e7 100644 --- a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/service/impl/PayAppServiceImpl.java +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/service/impl/PayAppServiceImpl.java @@ -5,11 +5,14 @@ package com.skyeye.pay.service.impl; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.skyeye.annotation.service.SkyeyeService; import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl; import com.skyeye.common.constans.CommonConstants; +import com.skyeye.common.constans.CommonNumConstants; +import com.skyeye.common.enumeration.WhetherEnum; import com.skyeye.common.object.InputObject; import com.skyeye.common.object.OutputObject; import com.skyeye.common.util.mybatisplus.MybatisPlusUtil; @@ -19,6 +22,7 @@ import com.skyeye.pay.entity.PayApp; import com.skyeye.pay.service.PayAppService; import org.springframework.stereotype.Service; +import java.util.List; import java.util.Map; /** @@ -38,18 +42,6 @@ public class PayAppServiceImpl extends SkyeyeBusinessServiceImpl params = inputObject.getParams(); - String id = params.get("id").toString(); - String enabled = params.get("enabled").toString(); - verify(id); - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set(MybatisPlusUtil.toColumns(PayApp::getEnabled), enabled) - .eq(CommonConstants.ID, id); - update(updateWrapper); - refreshCache(id); - } private void verify(String id){ QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq(CommonConstants.ID, id); @@ -58,4 +50,11 @@ public class PayAppServiceImpl extends SkyeyeBusinessServiceImpl> queryDataList(InputObject inputObject) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(MybatisPlusUtil.toColumns(PayApp::getEnabled), CommonNumConstants.NUM_ONE); + List list = list(queryWrapper); + return JSONUtil.toList(JSONUtil.toJsonStr(list), null); + } } diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/service/impl/PayChannelServiceImpl.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/service/impl/PayChannelServiceImpl.java index 14cfc35c..d43d0565 100644 --- a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/service/impl/PayChannelServiceImpl.java +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/pay/service/impl/PayChannelServiceImpl.java @@ -9,10 +9,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.skyeye.annotation.service.SkyeyeService; import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl; import com.skyeye.common.constans.CommonConstants; -import com.skyeye.common.object.InputObject; import com.skyeye.exception.CustomException; import com.skyeye.pay.dao.PayChannelDao; -import com.skyeye.pay.entity.PayApp; import com.skyeye.pay.entity.PayChannel; import com.skyeye.pay.service.PayChannelService; import org.springframework.stereotype.Service; @@ -26,7 +24,7 @@ import org.springframework.stereotype.Service; * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 */ @Service -@SkyeyeService(name = "支付渠道",groupName = "支付渠道") +@SkyeyeService(name = "支付渠道", groupName = "支付渠道") public class PayChannelServiceImpl extends SkyeyeBusinessServiceImpl implements PayChannelService { @Override @@ -38,4 +36,5 @@ public class PayChannelServiceImpl extends SkyeyeBusinessServiceImpl