From cc81fdec87678d6583622bfcb170bc47ea51428d Mon Sep 17 00:00:00 2001 From: xxm1995 Date: Mon, 8 Jan 2024 23:08:04 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E5=AF=B9=E6=8E=A5=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E9=80=9A=E9=81=93=E5=92=8C=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/PayChannelInfoController.java | 35 ++++++++++++++++--- .../system/PayWayInfoController.java | 34 ++++++++++++++++-- .../system/payinfo/entity/PayWayInfo.java | 4 +++ .../service/PayChannelInfoService.java | 2 +- .../payinfo/service/PayWayInfoService.java | 2 +- .../dto/system/payinfo/PayChannelInfoDto.java | 21 ++++++++++- .../dto/system/payinfo/PayWayInfoDto.java | 16 +++++++-- .../system/payinfo/PayChannelInfoParam.java | 12 +++++++ .../param/system/payinfo/PayWayInfoParam.java | 5 ++- .../src/main/resources/application-dev.yml | 3 ++ 10 files changed, 120 insertions(+), 14 deletions(-) diff --git a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/system/PayChannelInfoController.java b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/system/PayChannelInfoController.java index 741a27054..a00e317c4 100644 --- a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/system/PayChannelInfoController.java +++ b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/system/PayChannelInfoController.java @@ -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> findAll(){ + return Res.ok(payChannelInfoService.findAll()); + } + + @Operation(summary = "根据ID获取") + @GetMapping("/findById") + public ResResult findById(Long id){ + return Res.ok(payChannelInfoService.findById(id)); + } + + @Operation(summary = "更新") + @PostMapping("/update") + public ResResult update(@RequestBody PayChannelInfoParam param){ + payChannelInfoService.update(param); + return Res.ok(); + } } diff --git a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/system/PayWayInfoController.java b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/system/PayWayInfoController.java index 4116b7179..a7b810484 100644 --- a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/system/PayWayInfoController.java +++ b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/system/PayWayInfoController.java @@ -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> findAll(){ + return Res.ok(payWayInfoService.findAll()); + } + + @Operation(summary = "根据ID获取") + @GetMapping("/findById") + public ResResult findById(Long id){ + return Res.ok(payWayInfoService.findById(id)); + } + + @Operation(summary = "更新") + @GetMapping("/update") + public ResResult update(@RequestBody PayWayInfoParam param){ + payWayInfoService.update(param); + return Res.ok(); + } } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/payinfo/entity/PayWayInfo.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/payinfo/entity/PayWayInfo.java index fa7858190..07cf0a427 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/payinfo/entity/PayWayInfo.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/payinfo/entity/PayWayInfo.java @@ -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 { /** 需要与系统中配置的枚举一致 */ diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/payinfo/service/PayChannelInfoService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/payinfo/service/PayChannelInfoService.java index cb2f79676..4ef271dba 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/payinfo/service/PayChannelInfoService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/payinfo/service/PayChannelInfoService.java @@ -29,7 +29,7 @@ public class PayChannelInfoService { /** * 列表 */ - public List list(){ + public List findAll(){ return manager.findAll().stream() .map(PayChannelInfo::toDto) .collect(Collectors.toList()); diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/payinfo/service/PayWayInfoService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/payinfo/service/PayWayInfoService.java index 5ee930ee7..e8b530e20 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/payinfo/service/PayWayInfoService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/payinfo/service/PayWayInfoService.java @@ -29,7 +29,7 @@ public class PayWayInfoService { /** * 列表 */ - public List list(){ + public List findAll(){ return manager.findAll().stream() .map(PayWayInfo::toDto) .collect(Collectors.toList()); diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/system/payinfo/PayChannelInfoDto.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/system/payinfo/PayChannelInfoDto.java index 0665ee6ce..baadd5786 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/system/payinfo/PayChannelInfoDto.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/system/payinfo/PayChannelInfoDto.java @@ -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; } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/system/payinfo/PayWayInfoDto.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/system/payinfo/PayWayInfoDto.java index 3303d4289..06bac6987 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/system/payinfo/PayWayInfoDto.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/system/payinfo/PayWayInfoDto.java @@ -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; } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/system/payinfo/PayChannelInfoParam.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/system/payinfo/PayChannelInfoParam.java index 7b298d6c9..b01fc7849 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/system/payinfo/PayChannelInfoParam.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/system/payinfo/PayChannelInfoParam.java @@ -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; } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/system/payinfo/PayWayInfoParam.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/system/payinfo/PayWayInfoParam.java index 652ecd19d..86be96076 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/system/payinfo/PayWayInfoParam.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/system/payinfo/PayWayInfoParam.java @@ -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; } diff --git a/daxpay-single/daxpay-single-start/src/main/resources/application-dev.yml b/daxpay-single/daxpay-single-start/src/main/resources/application-dev.yml index e60789da0..166cf51c5 100644 --- a/daxpay-single/daxpay-single-start/src/main/resources/application-dev.yml +++ b/daxpay-single/daxpay-single-start/src/main/resources/application-dev.yml @@ -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