feat: 支付应用:增加获取启用状态的列表查询,删除根据id和enabled更新接口。

This commit is contained in:
sdhkjh 2024-10-05 21:33:06 +08:00
parent 5bd8ac3620
commit 9fc21c9593
5 changed files with 18 additions and 26 deletions

View file

@ -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);
}
/**

View file

@ -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")

View file

@ -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<PayApp> {
void updateEnabled(InputObject inputObject, OutputObject outputObject);
}

View file

@ -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<PayAppDao, PayA
verify(payApp.getId());
}
@Override
public void updateEnabled(InputObject inputObject, OutputObject outputObject) {
Map<String, Object> params = inputObject.getParams();
String id = params.get("id").toString();
String enabled = params.get("enabled").toString();
verify(id);
UpdateWrapper<PayApp> updateWrapper = new UpdateWrapper<>();
updateWrapper.set(MybatisPlusUtil.toColumns(PayApp::getEnabled), enabled)
.eq(CommonConstants.ID, id);
update(updateWrapper);
refreshCache(id);
}
private void verify(String id){
QueryWrapper<PayApp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(CommonConstants.ID, id);
@ -58,4 +50,11 @@ public class PayAppServiceImpl extends SkyeyeBusinessServiceImpl<PayAppDao, PayA
throw new CustomException("该支付应用信息不存在");
}
}
public List<Map<String, Object>> queryDataList(InputObject inputObject) {
QueryWrapper<PayApp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(MybatisPlusUtil.toColumns(PayApp::getEnabled), CommonNumConstants.NUM_ONE);
List<PayApp> list = list(queryWrapper);
return JSONUtil.toList(JSONUtil.toJsonStr(list), null);
}
}

View file

@ -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<PayChannelDao, PayChannel> implements PayChannelService {
@Override
@ -38,4 +36,5 @@ public class PayChannelServiceImpl extends SkyeyeBusinessServiceImpl<PayChannelD
throw new CustomException("该支付应用信息不存在");
}
}
}