增加支付配置详情接口
This commit is contained in:
parent
fd500bbd0d
commit
649b7f9bcb
|
|
@ -7,6 +7,7 @@ import com.mdd.admin.validate.setting.SettingPayMethodValidate;
|
||||||
import com.mdd.admin.vo.setting.SettingPaymentMethodVo;
|
import com.mdd.admin.vo.setting.SettingPaymentMethodVo;
|
||||||
import com.mdd.common.core.AjaxResult;
|
import com.mdd.common.core.AjaxResult;
|
||||||
import com.mdd.common.entity.setting.DevPayConfig;
|
import com.mdd.common.entity.setting.DevPayConfig;
|
||||||
|
import com.mdd.common.validator.annotation.IDMust;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
@ -32,11 +33,18 @@ public class SettingPaymentController {
|
||||||
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@ApiOperation(value="支付配置列表")
|
@ApiOperation(value="支付配置列表")
|
||||||
public AjaxResult<Object> list() {
|
public AjaxResult<List<DevPayConfig>> list() {
|
||||||
List<DevPayConfig> list = iSettingPaymentService.list();
|
List<DevPayConfig> list = iSettingPaymentService.list();
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperation(value="支付配置详情")
|
||||||
|
public AjaxResult<Object> detail(@Validated @IDMust() @RequestParam("id") Integer id) {
|
||||||
|
DevPayConfig vo = iSettingPaymentService.detail(id);
|
||||||
|
return AjaxResult.success(vo);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/editConfig")
|
@PostMapping("/editConfig")
|
||||||
@ApiOperation(value="支付配置编辑")
|
@ApiOperation(value="支付配置编辑")
|
||||||
public AjaxResult<Object> editConfig(@Validated @RequestBody SettingPayConfigValidate configValidate) {
|
public AjaxResult<Object> editConfig(@Validated @RequestBody SettingPayConfigValidate configValidate) {
|
||||||
|
|
|
||||||
|
|
@ -12,12 +12,45 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface ISettingPaymentService {
|
public interface ISettingPaymentService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付方式
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @return List<List<SettingPaymentMethodVo>>
|
||||||
|
*/
|
||||||
List<List<SettingPaymentMethodVo>> method();
|
List<List<SettingPaymentMethodVo>> method();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置列表
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @return List<DevPayConfig>
|
||||||
|
*/
|
||||||
List<DevPayConfig> list();
|
List<DevPayConfig> list();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置详情
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @param id 主键
|
||||||
|
* @return SettingPaymentMethodVo
|
||||||
|
*/
|
||||||
|
DevPayConfig detail(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑支付配置
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @param configValidate 参数
|
||||||
|
*/
|
||||||
void editConfig(SettingPayConfigValidate configValidate);
|
void editConfig(SettingPayConfigValidate configValidate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑支付方式
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @param methodValidate 参数
|
||||||
|
*/
|
||||||
void editMethod(SettingPayMethodValidate methodValidate);
|
void editMethod(SettingPayMethodValidate methodValidate);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import com.mdd.common.mapper.setting.DevPayConfigMapper;
|
||||||
import com.mdd.common.mapper.setting.DevPayWayMapper;
|
import com.mdd.common.mapper.setting.DevPayWayMapper;
|
||||||
import com.mdd.common.util.MapUtils;
|
import com.mdd.common.util.MapUtils;
|
||||||
import com.mdd.common.util.UrlUtils;
|
import com.mdd.common.util.UrlUtils;
|
||||||
import io.swagger.models.auth.In;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
@ -36,6 +35,12 @@ public class SettingPaymentServiceImpl implements ISettingPaymentService {
|
||||||
@Resource
|
@Resource
|
||||||
DevPayWayMapper devPayWayMapper;
|
DevPayWayMapper devPayWayMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付配置方式
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @return List<List<SettingPaymentMethodVo>>
|
||||||
|
*/
|
||||||
public List<List<SettingPaymentMethodVo>> method() {
|
public List<List<SettingPaymentMethodVo>> method() {
|
||||||
List<DevPayWay> lists = devPayWayMapper.selectList(null);
|
List<DevPayWay> lists = devPayWayMapper.selectList(null);
|
||||||
|
|
||||||
|
|
@ -97,6 +102,27 @@ public class SettingPaymentServiceImpl implements ISettingPaymentService {
|
||||||
return devPayConfigs;
|
return devPayConfigs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付配置详情
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @param id 主键
|
||||||
|
* @return DevPayConfig
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DevPayConfig detail(Integer id) {
|
||||||
|
DevPayConfig devPayConfig = devPayConfigMapper.selectOne(
|
||||||
|
new QueryWrapper<DevPayConfig>()
|
||||||
|
.eq("id", id)
|
||||||
|
.last("limit 1"));
|
||||||
|
|
||||||
|
devPayConfig.setName(PaymentEnum.getPayWayMsg(devPayConfig.getWay()));
|
||||||
|
devPayConfig.setShowName(devPayConfig.getName());
|
||||||
|
devPayConfig.setParams(MapUtils.jsonToMap(devPayConfig.getParams().toString()));
|
||||||
|
devPayConfig.setIcon(UrlUtils.toAbsoluteUrl(devPayConfig.getIcon()));
|
||||||
|
return devPayConfig;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付配置编辑
|
* 支付配置编辑
|
||||||
*
|
*
|
||||||
|
|
@ -124,6 +150,12 @@ public class SettingPaymentServiceImpl implements ISettingPaymentService {
|
||||||
devPayConfigMapper.updateById(devPayConfig);
|
devPayConfigMapper.updateById(devPayConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付方式编辑
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @param methodValidate 参数
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void editMethod(SettingPayMethodValidate methodValidate) {
|
public void editMethod(SettingPayMethodValidate methodValidate) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.mdd.admin.vo.setting;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SettingPaymentDetailVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -2,8 +2,12 @@ package com.mdd.admin.vo.setting;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class SettingPaymentMethodVo {
|
public class SettingPaymentMethodVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue