feat 对接前端支付通道和方式

This commit is contained in:
xxm1995
2024-01-08 23:08:04 +08:00
parent a35c7010fc
commit cc81fdec87
10 changed files with 120 additions and 14 deletions

View File

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

View File

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

View File

@@ -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> {
/** 需要与系统中配置的枚举一致 */

View File

@@ -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());

View File

@@ -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());

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

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