mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-25 05:24:50 +00:00
feat 对接前端支付通道和方式
This commit is contained in:
@@ -1,20 +1,45 @@
|
||||
package cn.bootx.platform.daxpay.admin.controller.system;
|
||||
|
||||
import cn.bootx.platform.common.core.rest.Res;
|
||||
import cn.bootx.platform.common.core.rest.ResResult;
|
||||
import cn.bootx.platform.daxpay.service.core.system.payinfo.service.PayChannelInfoService;
|
||||
import cn.bootx.platform.daxpay.service.dto.system.payinfo.PayChannelInfoDto;
|
||||
import cn.bootx.platform.daxpay.service.param.system.payinfo.PayChannelInfoParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* 支付通道信息
|
||||
* @author xxm
|
||||
* @since 2024/1/8
|
||||
*/
|
||||
@Tag(name = "")
|
||||
@Tag(name = "支付通道信息")
|
||||
@RestController
|
||||
@RequestMapping("/")
|
||||
@RequestMapping("/pay/channel/info")
|
||||
@RequiredArgsConstructor
|
||||
public class PayChannelInfoController {
|
||||
private final PayChannelInfoService payChannelInfoService;
|
||||
|
||||
@Operation(summary = "查询全部")
|
||||
@GetMapping("/findAll")
|
||||
public ResResult<List<PayChannelInfoDto>> findAll(){
|
||||
return Res.ok(payChannelInfoService.findAll());
|
||||
}
|
||||
|
||||
@Operation(summary = "根据ID获取")
|
||||
@GetMapping("/findById")
|
||||
public ResResult<PayChannelInfoDto> findById(Long id){
|
||||
return Res.ok(payChannelInfoService.findById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新")
|
||||
@PostMapping("/update")
|
||||
public ResResult<Void> update(@RequestBody PayChannelInfoParam param){
|
||||
payChannelInfoService.update(param);
|
||||
return Res.ok();
|
||||
}
|
||||
}
|
||||
|
@@ -1,20 +1,48 @@
|
||||
package cn.bootx.platform.daxpay.admin.controller.system;
|
||||
|
||||
import cn.bootx.platform.common.core.rest.Res;
|
||||
import cn.bootx.platform.common.core.rest.ResResult;
|
||||
import cn.bootx.platform.daxpay.service.core.system.payinfo.service.PayWayInfoService;
|
||||
import cn.bootx.platform.daxpay.service.dto.system.payinfo.PayWayInfoDto;
|
||||
import cn.bootx.platform.daxpay.service.param.system.payinfo.PayWayInfoParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* 支付方式管理
|
||||
* @author xxm
|
||||
* @since 2024/1/8
|
||||
*/
|
||||
@Tag(name = "")
|
||||
@Tag(name = "支付方式管理")
|
||||
@RestController
|
||||
@RequestMapping("/")
|
||||
@RequestMapping("/pay/way/info")
|
||||
@RequiredArgsConstructor
|
||||
public class PayWayInfoController {
|
||||
private final PayWayInfoService payWayInfoService;
|
||||
|
||||
@Operation(summary = "获取全部")
|
||||
@GetMapping("/findAll")
|
||||
public ResResult<List<PayWayInfoDto>> findAll(){
|
||||
return Res.ok(payWayInfoService.findAll());
|
||||
}
|
||||
|
||||
@Operation(summary = "根据ID获取")
|
||||
@GetMapping("/findById")
|
||||
public ResResult<PayWayInfoDto> findById(Long id){
|
||||
return Res.ok(payWayInfoService.findById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新")
|
||||
@GetMapping("/update")
|
||||
public ResResult<Void> update(@RequestBody PayWayInfoParam param){
|
||||
payWayInfoService.update(param);
|
||||
return Res.ok();
|
||||
}
|
||||
}
|
||||
|
@@ -5,8 +5,10 @@ import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity;
|
||||
import cn.bootx.platform.daxpay.service.core.system.payinfo.convert.PayWayInfoConvert;
|
||||
import cn.bootx.platform.daxpay.service.dto.system.payinfo.PayWayInfoDto;
|
||||
import cn.bootx.table.modify.annotation.DbColumn;
|
||||
import cn.bootx.table.modify.annotation.DbTable;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -20,6 +22,8 @@ import lombok.experimental.Accessors;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@DbTable(comment = "支付方式")
|
||||
@TableName("pay_way_info")
|
||||
public class PayWayInfo extends MpBaseEntity implements EntityBaseFunction<PayWayInfoDto> {
|
||||
|
||||
/** 需要与系统中配置的枚举一致 */
|
||||
|
@@ -29,7 +29,7 @@ public class PayChannelInfoService {
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
public List<PayChannelInfoDto> list(){
|
||||
public List<PayChannelInfoDto> findAll(){
|
||||
return manager.findAll().stream()
|
||||
.map(PayChannelInfo::toDto)
|
||||
.collect(Collectors.toList());
|
||||
|
@@ -29,7 +29,7 @@ public class PayWayInfoService {
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
public List<PayWayInfoDto> list(){
|
||||
public List<PayWayInfoDto> findAll(){
|
||||
return manager.findAll().stream()
|
||||
.map(PayWayInfo::toDto)
|
||||
.collect(Collectors.toList());
|
||||
|
@@ -14,7 +14,26 @@ import lombok.experimental.Accessors;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "")
|
||||
@Schema(title = "支付通道信息")
|
||||
public class PayChannelInfoDto extends BaseDto {
|
||||
|
||||
/** 需要与系统中配置的枚举一致 */
|
||||
@Schema(description = "代码")
|
||||
private String code;
|
||||
|
||||
/** 需要与系统中配置的枚举一致 */
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/** logo图片 */
|
||||
@Schema(description = "logo图片")
|
||||
private Long iconId;
|
||||
|
||||
/** 卡牌背景色 */
|
||||
@Schema(description = "卡牌背景色")
|
||||
private String bgColor;
|
||||
|
||||
/** 备注 */
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
}
|
||||
|
@@ -7,13 +7,25 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
*
|
||||
* 支付方式信息
|
||||
* @author xxm
|
||||
* @since 2024/1/8
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "")
|
||||
@Schema(title = "支付方式信息")
|
||||
public class PayWayInfoDto extends BaseDto {
|
||||
|
||||
/** 需要与系统中配置的枚举一致 */
|
||||
@Schema(description = "代码")
|
||||
private String code;
|
||||
|
||||
/** 需要与系统中配置的枚举一致 */
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/** 备注 */
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
}
|
||||
|
@@ -16,4 +16,16 @@ public class PayChannelInfoParam {
|
||||
|
||||
@Schema(description= "主键")
|
||||
private Long id;
|
||||
|
||||
/** logo图片 */
|
||||
@Schema(description = "logo图片")
|
||||
private Long iconId;
|
||||
|
||||
/** 卡牌背景色 */
|
||||
@Schema(description = "卡牌背景色")
|
||||
private String bgColor;
|
||||
|
||||
/** 备注 */
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
}
|
||||
|
@@ -11,9 +11,12 @@ import lombok.experimental.Accessors;
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "")
|
||||
@Schema(title = "支付方式信息")
|
||||
public class PayWayInfoParam {
|
||||
|
||||
@Schema(description= "主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
}
|
||||
|
@@ -140,6 +140,9 @@ bootx:
|
||||
data-perm:
|
||||
# 需要符合AES密钥的要求
|
||||
field-decrypt-key: "UCrtxSCwYZNCIlav"
|
||||
# 文件上传
|
||||
file-upload:
|
||||
server-url: http://127.0.0.1:9000
|
||||
# 自动建表
|
||||
table-modify:
|
||||
update-type: update
|
||||
|
Reference in New Issue
Block a user