From 7a1b0a6eee113f8e7e743806f60f5ca510e6536f Mon Sep 17 00:00:00 2001 From: simonzhangsz Date: Sat, 23 Nov 2024 12:25:07 +0800 Subject: [PATCH] wfc pay module init --- .vscode/settings.json | 1 + .../wfc/common/log/enums/BusinessType.java | 7 +- wfc-modules/wfc-pay/pom.xml | 107 ++++++++ .../java/org/wfc/pay/WfcPayApplication.java | 25 ++ .../pay/controller/CreditCardController.java | 77 ++++++ .../wfc/pay/controller/PayPalController.java | 73 +++++ .../java/org/wfc/pay/domain/CreditCard.java | 111 ++++++++ .../main/java/org/wfc/pay/domain/PayPal.java | 256 ++++++++++++++++++ .../java/org/wfc/pay/domain/vo/MetaVo.java | 106 ++++++++ .../java/org/wfc/pay/domain/vo/RouterVo.java | 148 ++++++++++ .../org/wfc/pay/domain/vo/TreeSelect.java | 60 ++++ .../org/wfc/pay/mapper/CreditCardMapper.java | 44 +++ .../java/org/wfc/pay/mapper/PayPalMapper.java | 43 +++ .../wfc/pay/service/ICreditCardService.java | 43 +++ .../org/wfc/pay/service/IPayPalService.java | 43 +++ .../service/impl/CreditCardServiceImpl.java | 74 +++++ .../pay/service/impl/PayPalServiceImpl.java | 63 +++++ .../wfc-pay/src/main/resources/banner.txt | 10 + .../wfc-pay/src/main/resources/bootstrap.yml | 27 ++ .../wfc-pay/src/main/resources/logback.xml | 74 +++++ .../resources/mapper/pay/CreditCardMapper.xml | 117 ++++++++ .../resources/mapper/pay/PayPalMapper.xml | 103 +++++++ 22 files changed, 1611 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json create mode 100644 wfc-modules/wfc-pay/pom.xml create mode 100644 wfc-modules/wfc-pay/src/main/java/org/wfc/pay/WfcPayApplication.java create mode 100644 wfc-modules/wfc-pay/src/main/java/org/wfc/pay/controller/CreditCardController.java create mode 100644 wfc-modules/wfc-pay/src/main/java/org/wfc/pay/controller/PayPalController.java create mode 100644 wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/CreditCard.java create mode 100644 wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/PayPal.java create mode 100644 wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/vo/MetaVo.java create mode 100644 wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/vo/RouterVo.java create mode 100644 wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/vo/TreeSelect.java create mode 100644 wfc-modules/wfc-pay/src/main/java/org/wfc/pay/mapper/CreditCardMapper.java create mode 100644 wfc-modules/wfc-pay/src/main/java/org/wfc/pay/mapper/PayPalMapper.java create mode 100644 wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/ICreditCardService.java create mode 100644 wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/IPayPalService.java create mode 100644 wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/impl/CreditCardServiceImpl.java create mode 100644 wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/impl/PayPalServiceImpl.java create mode 100644 wfc-modules/wfc-pay/src/main/resources/banner.txt create mode 100644 wfc-modules/wfc-pay/src/main/resources/bootstrap.yml create mode 100644 wfc-modules/wfc-pay/src/main/resources/logback.xml create mode 100644 wfc-modules/wfc-pay/src/main/resources/mapper/pay/CreditCardMapper.xml create mode 100644 wfc-modules/wfc-pay/src/main/resources/mapper/pay/PayPalMapper.xml diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/wfc-common/wfc-common-log/src/main/java/org/wfc/common/log/enums/BusinessType.java b/wfc-common/wfc-common-log/src/main/java/org/wfc/common/log/enums/BusinessType.java index 88b6211..88406cf 100644 --- a/wfc-common/wfc-common-log/src/main/java/org/wfc/common/log/enums/BusinessType.java +++ b/wfc-common/wfc-common-log/src/main/java/org/wfc/common/log/enums/BusinessType.java @@ -1,7 +1,7 @@ package org.wfc.common.log.enums; /** - * 业务操作类型 + * Business type defination * * @author ruoyi */ @@ -12,6 +12,11 @@ public enum BusinessType */ OTHER, + /** + * Get + */ + SELECT, + /** * 新增 */ diff --git a/wfc-modules/wfc-pay/pom.xml b/wfc-modules/wfc-pay/pom.xml new file mode 100644 index 0000000..da16a79 --- /dev/null +++ b/wfc-modules/wfc-pay/pom.xml @@ -0,0 +1,107 @@ + + + + org.wfc + wfc-modules + 3.6.4 + + 4.0.0 + + wfc-modules-pay + + + wfc-modules-pay + + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + com.mysql + mysql-connector-j + + + + + org.wfc + wfc-common-datasource + + + + + org.wfc + wfc-common-datascope + + + + + org.wfc + wfc-common-log + + + + + org.wfc + wfc-common-swagger + + + + + com.stripe + stripe-java + 20.0.0 + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + \ No newline at end of file diff --git a/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/WfcPayApplication.java b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/WfcPayApplication.java new file mode 100644 index 0000000..32e746a --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/WfcPayApplication.java @@ -0,0 +1,25 @@ +package org.wfc.pay; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.wfc.common.security.annotation.EnableCustomConfig; +import org.wfc.common.security.annotation.EnableRyFeignClients; +import org.wfc.common.swagger.annotation.EnableCustomSwagger2; + +/** + * Pay module + * + * @author wfc + */ +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableRyFeignClients +@SpringBootApplication +public class WfcPayApplication +{ + public static void main(String[] args) + { + SpringApplication.run(WfcPayApplication.class, args); + System.out.println("(♥◠‿◠)ノ゙ Pay module startup ლ(´ڡ`ლ)゙ \n"); + } +} diff --git a/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/controller/CreditCardController.java b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/controller/CreditCardController.java new file mode 100644 index 0000000..0ce9643 --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/controller/CreditCardController.java @@ -0,0 +1,77 @@ +package org.wfc.pay.controller; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.wfc.common.core.web.controller.BaseController; +import org.wfc.common.core.web.domain.AjaxResult; +import org.wfc.common.core.web.page.TableDataInfo; +import org.wfc.common.log.annotation.Log; +import org.wfc.common.log.enums.BusinessType; +import org.wfc.common.security.annotation.RequiresPermissions; +import org.wfc.pay.domain.CreditCard; +import org.wfc.pay.service.ICreditCardService; + +/** + * Credit card pay controller + * + * @author simon + */ +@RestController +@RequestMapping("/creditCard") +public class CreditCardController extends BaseController +{ + @Autowired + private ICreditCardService ccPayService; + + /** + * 根据参数编号获取详细信息 + */ + @GetMapping(value = "/{userId}") + public AjaxResult getInfo(@PathVariable Long userId) + { + return success(ccPayService.selectCreditCardInfoByUserId(userId)); + } + + /** + * 新增参数配置 + */ + @RequiresPermissions("pay:creditCard:add") + @Log(title = "参数管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody CreditCard creditCardInfo) + { + return toAjax(ccPayService.insertCreditCardInfo(creditCardInfo)); + } + + /** + * 修改参数配置 + */ + @RequiresPermissions("pay:creditCard:edit") + @Log(title = "参数管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody CreditCard creditCardInfo) + { + return toAjax(ccPayService.updateCreditCardInfo(creditCardInfo)); + } + + /** + * 删除参数配置 + */ + @RequiresPermissions("pay:creditCard:remove") + @Log(title = "参数管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) + { + ccPayService.deleteCreditCardInfoById(id); + return success(); + } +} diff --git a/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/controller/PayPalController.java b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/controller/PayPalController.java new file mode 100644 index 0000000..881762f --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/controller/PayPalController.java @@ -0,0 +1,73 @@ +package org.wfc.pay.controller; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.wfc.common.core.web.controller.BaseController; +import org.wfc.common.core.web.domain.AjaxResult; +import org.wfc.common.log.annotation.Log; +import org.wfc.common.log.enums.BusinessType; +import org.wfc.common.security.annotation.RequiresPermissions; +import org.wfc.pay.domain.PayPal; +import org.wfc.pay.service.IPayPalService; + + +/** + * Paypal controller + * + * @author wfc + */ +@RestController +@RequestMapping("/paypal") +public class PayPalController extends BaseController +{ + @Autowired + private IPayPalService paypalService; + + /** + * PayPal + */ + @RequiresPermissions("pay:paypalInfo:query") + @Log(title = "paypal info management", businessType = BusinessType.OTHER) + @GetMapping("/{userId}") + public AjaxResult query(@PathVariable Long userId) { + return success(paypalService.selectPayPalInfoByUserId(userId)); + } + + /** + * PayPal + */ + @RequiresPermissions("pay:paypalInfo:add") + @Log(title = "paypal info management", businessType = BusinessType.INSERT) + @PostMapping("/{paypal}") + public AjaxResult add(@PathVariable PayPal paypal) + { + return toAjax(paypalService.insertPayPalInfo(paypal)); + } + + /** + * PayPal + */ + @RequiresPermissions("pay:paypalInfo:edit") + @Log(title = "paypal info management", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + public AjaxResult edit(@PathVariable Long id) { + return toAjax(paypalService.updatePayPalInfoById(id)); + } + + /** + * PayPal + */ + @RequiresPermissions("pay:paypalInfo:remove") + @Log(title = "paypal info management", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) { + paypalService.deletePayPalInfoById(id); + return success(); + } +} diff --git a/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/CreditCard.java b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/CreditCard.java new file mode 100644 index 0000000..1023f56 --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/CreditCard.java @@ -0,0 +1,111 @@ +package org.wfc.pay.domain; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.wfc.common.core.annotation.Excel; +import org.wfc.common.core.annotation.Excel.ColumnType; +import org.wfc.common.core.web.domain.BaseEntity; + +/** + * 参数配置表 sys_config + * + * @author ruoyi + */ +public class CreditCard extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 参数主键 */ + @Excel(name = "参数主键", cellType = ColumnType.NUMERIC) + private Long configId; + + /** 参数名称 */ + @Excel(name = "参数名称") + private String configName; + + /** 参数键名 */ + @Excel(name = "参数键名") + private String configKey; + + /** 参数键值 */ + @Excel(name = "参数键值") + private String configValue; + + /** 系统内置(Y是 N否) */ + @Excel(name = "系统内置", readConverterExp = "Y=是,N=否") + private String configType; + + public Long getConfigId() + { + return configId; + } + + public void setConfigId(Long configId) + { + this.configId = configId; + } + + @NotBlank(message = "参数名称不能为空") + @Size(min = 0, max = 100, message = "参数名称不能超过100个字符") + public String getConfigName() + { + return configName; + } + + public void setConfigName(String configName) + { + this.configName = configName; + } + + @NotBlank(message = "参数键名长度不能为空") + @Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符") + public String getConfigKey() + { + return configKey; + } + + public void setConfigKey(String configKey) + { + this.configKey = configKey; + } + + @NotBlank(message = "参数键值不能为空") + @Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符") + public String getConfigValue() + { + return configValue; + } + + public void setConfigValue(String configValue) + { + this.configValue = configValue; + } + + public String getConfigType() + { + return configType; + } + + public void setConfigType(String configType) + { + this.configType = configType; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("configId", getConfigId()) + .append("configName", getConfigName()) + .append("configKey", getConfigKey()) + .append("configValue", getConfigValue()) + .append("configType", getConfigType()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/PayPal.java b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/PayPal.java new file mode 100644 index 0000000..079c1a7 --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/PayPal.java @@ -0,0 +1,256 @@ +package org.wfc.pay.domain; + +import org.wfc.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +/** + * 菜单权限表 sys_menu + * + * @author wfc + */ +public class PayPal extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 菜单ID */ + private Long menuId; + + /** 菜单名称 */ + private String menuName; + + /** 父菜单名称 */ + private String parentName; + + /** 父菜单ID */ + private Long parentId; + + /** 显示顺序 */ + private Integer orderNum; + + /** 路由地址 */ + private String path; + + /** 组件路径 */ + private String component; + + /** 路由参数 */ + private String query; + + /** 是否为外链(0是 1否) */ + private String isFrame; + + /** 是否缓存(0缓存 1不缓存) */ + private String isCache; + + /** 类型(M目录 C菜单 F按钮) */ + private String menuType; + + /** 显示状态(0显示 1隐藏) */ + private String visible; + + /** 菜单状态(0正常 1停用) */ + private String status; + + /** 权限字符串 */ + private String perms; + + /** 菜单图标 */ + private String icon; + + /** 菜单key */ + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getMenuId() + { + return menuId; + } + + public void setMenuId(Long menuId) + { + this.menuId = menuId; + } + + @NotBlank(message = "菜单名称不能为空") + @Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符") + public String getMenuName() + { + return menuName; + } + + public void setMenuName(String menuName) + { + this.menuName = menuName; + } + + public String getParentName() + { + return parentName; + } + + public void setParentName(String parentName) + { + this.parentName = parentName; + } + + public Long getParentId() + { + return parentId; + } + + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + @NotNull(message = "显示顺序不能为空") + public Integer getOrderNum() + { + return orderNum; + } + + public void setOrderNum(Integer orderNum) + { + this.orderNum = orderNum; + } + + @Size(min = 0, max = 200, message = "路由地址不能超过200个字符") + public String getPath() + { + return path; + } + + public void setPath(String path) + { + this.path = path; + } + + @Size(min = 0, max = 200, message = "组件路径不能超过255个字符") + public String getComponent() + { + return component; + } + + public void setComponent(String component) + { + this.component = component; + } + + public String getQuery() + { + return query; + } + + public void setQuery(String query) + { + this.query = query; + } + + public String getIsFrame() + { + return isFrame; + } + + public void setIsFrame(String isFrame) + { + this.isFrame = isFrame; + } + + public String getIsCache() + { + return isCache; + } + + public void setIsCache(String isCache) + { + this.isCache = isCache; + } + + @NotBlank(message = "菜单类型不能为空") + public String getMenuType() + { + return menuType; + } + + public void setMenuType(String menuType) + { + this.menuType = menuType; + } + + public String getVisible() + { + return visible; + } + + public void setVisible(String visible) + { + this.visible = visible; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + @Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符") + public String getPerms() + { + return perms; + } + + public void setPerms(String perms) + { + this.perms = perms; + } + + public String getIcon() + { + return icon; + } + + public void setIcon(String icon) + { + this.icon = icon; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("menuId", getMenuId()) + .append("menuName", getMenuName()) + .append("parentId", getParentId()) + .append("orderNum", getOrderNum()) + .append("path", getPath()) + .append("component", getComponent()) + .append("isFrame", getIsFrame()) + .append("IsCache", getIsCache()) + .append("menuType", getMenuType()) + .append("visible", getVisible()) + .append("status ", getStatus()) + .append("perms", getPerms()) + .append("icon", getIcon()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("name", getName()) + .toString(); + } +} diff --git a/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/vo/MetaVo.java b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/vo/MetaVo.java new file mode 100644 index 0000000..8bed02d --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/vo/MetaVo.java @@ -0,0 +1,106 @@ +package org.wfc.pay.domain.vo; + +import org.wfc.common.core.utils.StringUtils; + +/** + * 路由显示信息 + * + * @author wfc + */ +public class MetaVo +{ + /** + * 设置该路由在侧边栏和面包屑中展示的名字 + */ + private String title; + + /** + * 设置该路由的图标,对应路径src/assets/icons/svg + */ + private String icon; + + /** + * 设置为true,则不会被 缓存 + */ + private boolean noCache; + + /** + * 内链地址(http(s)://开头) + */ + private String link; + + public MetaVo() + { + } + + public MetaVo(String title, String icon) + { + this.title = title; + this.icon = icon; + } + + public MetaVo(String title, String icon, boolean noCache) + { + this.title = title; + this.icon = icon; + this.noCache = noCache; + } + + public MetaVo(String title, String icon, String link) + { + this.title = title; + this.icon = icon; + this.link = link; + } + + public MetaVo(String title, String icon, boolean noCache, String link) + { + this.title = title; + this.icon = icon; + this.noCache = noCache; + if (StringUtils.ishttp(link)) + { + this.link = link; + } + } + + public boolean isNoCache() + { + return noCache; + } + + public void setNoCache(boolean noCache) + { + this.noCache = noCache; + } + + public String getTitle() + { + return title; + } + + public void setTitle(String title) + { + this.title = title; + } + + public String getIcon() + { + return icon; + } + + public void setIcon(String icon) + { + this.icon = icon; + } + + public String getLink() + { + return link; + } + + public void setLink(String link) + { + this.link = link; + } +} diff --git a/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/vo/RouterVo.java b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/vo/RouterVo.java new file mode 100644 index 0000000..254a476 --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/vo/RouterVo.java @@ -0,0 +1,148 @@ +package org.wfc.pay.domain.vo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import java.util.List; + +/** + * 路由配置信息 + * + * @author wfc + */ +@JsonInclude(JsonInclude.Include.NON_EMPTY) +public class RouterVo +{ + /** + * 路由名字 + */ + private String name; + + /** + * 路由地址 + */ + private String path; + + /** + * 是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现 + */ + private boolean hideInMenu; + + /** + * 重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 + */ + private String redirect; + + /** + * 组件地址 + */ + private String component; + + /** + * 路由参数:如 {"id": 1, "name": "ry"} + */ + private String query; + + /** + * 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 + */ + private Boolean alwaysShow; + + /** + * 其他元素 + */ + private MetaVo meta; + + /** + * 子路由 + */ + private List children; + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getPath() + { + return path; + } + + public void setPath(String path) + { + this.path = path; + } + + public boolean getHideInMenu() + { + return hideInMenu; + } + + public void setHideInMenu(boolean hideInMenu) + { + this.hideInMenu = hideInMenu; + } + + public String getRedirect() + { + return redirect; + } + + public void setRedirect(String redirect) + { + this.redirect = redirect; + } + + public String getComponent() + { + return component; + } + + public void setComponent(String component) + { + this.component = component; + } + + public String getQuery() + { + return query; + } + + public void setQuery(String query) + { + this.query = query; + } + + public Boolean getAlwaysShow() + { + return alwaysShow; + } + + public void setAlwaysShow(Boolean alwaysShow) + { + this.alwaysShow = alwaysShow; + } + + public MetaVo getMeta() + { + return meta; + } + + public void setMeta(MetaVo meta) + { + this.meta = meta; + } + + public List getChildren() + { + return children; + } + + public void setChildren(List children) + { + this.children = children; + } +} diff --git a/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/vo/TreeSelect.java b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/vo/TreeSelect.java new file mode 100644 index 0000000..2383bff --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/domain/vo/TreeSelect.java @@ -0,0 +1,60 @@ +package org.wfc.pay.domain.vo; + +import java.io.Serializable; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonInclude; + +/** + * Treeselect树结构实体类 + * + * @author wfc + */ +public class TreeSelect implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 节点ID */ + private Long id; + + /** 节点名称 */ + private String label; + + /** 子节点 */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children; + + public TreeSelect() + { + + } + + public Long getId() + { + return id; + } + + public void setId(Long id) + { + this.id = id; + } + + public String getLabel() + { + return label; + } + + public void setLabel(String label) + { + this.label = label; + } + + public List getChildren() + { + return children; + } + + public void setChildren(List children) + { + this.children = children; + } +} diff --git a/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/mapper/CreditCardMapper.java b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/mapper/CreditCardMapper.java new file mode 100644 index 0000000..dcc9f40 --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/mapper/CreditCardMapper.java @@ -0,0 +1,44 @@ +package org.wfc.pay.mapper; + +import java.util.List; +import org.wfc.pay.domain.CreditCard; + +/** + * 参数配置 数据层 + * + * @author simon + */ +public interface CreditCardMapper +{ + /** + * 通过ID查询配置 + * + * @param id 参数ID + * @return 参数配置信息 + */ + public CreditCard selectCreditCardInfoByUserId(Long id); + + /** + * 新增参数配置 + * + * @param creditCard 参数配置信息 + * @return 结果 + */ + public int insertCreditCardInfo(CreditCard creditCard); + + /** + * 修改参数配置 + * + * @param creditCard 参数配置信息 + * @return 结果 + */ + public int updateCreditCardInfo(CreditCard creditCard); + + /** + * 删除参数配置 + * + * @param id 参数ID + * @return 结果 + */ + public void deleteCreditCardInfoById(Long id); +} \ No newline at end of file diff --git a/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/mapper/PayPalMapper.java b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/mapper/PayPalMapper.java new file mode 100644 index 0000000..6f1e034 --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/mapper/PayPalMapper.java @@ -0,0 +1,43 @@ +package org.wfc.pay.mapper; + +import org.wfc.pay.domain.PayPal; + +/** + * Paypal mapper + * + * @author wfc + */ +public interface PayPalMapper +{ + /** + * select paypal info by user id + * + * @param userId user id + * @return paypal information + */ + public PayPal selectPayPalInfoByUserId(Long userId); + + /** + * select PayPal pay information by user ID + * + * @param userId user ID + * @return PayPal pay information + */ + public int insertPayPalInfo(PayPal paypal); + + /** + * select PayPal pay information by user ID + * + * @param userId user ID + * @return PayPal pay information + */ + public int updatePayPalInfoById(Long id); + + /** + * select PayPal pay information by user ID + * + * @param userId user ID + * @return PayPal pay information + */ + public void deletePayPalInfoById(Long id); +} diff --git a/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/ICreditCardService.java b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/ICreditCardService.java new file mode 100644 index 0000000..c7e70a6 --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/ICreditCardService.java @@ -0,0 +1,43 @@ +package org.wfc.pay.service; + +import org.wfc.pay.domain.CreditCard; + +/** + * Credit card pay service layer + * + * @author wfc + */ +public interface ICreditCardService +{ + /** + * select credit card information + * + * @param userId User ID + * @return Credit card info + */ + public CreditCard selectCreditCardInfoByUserId(Long userId); + + /** + * insert credit card + * + * @param creditCard User ID + * @return Credit card info + */ + public int insertCreditCardInfo(CreditCard creditCard); + + /** + * update credit card + * + * @param creditCard User ID + * @return Credit card info + */ + public int updateCreditCardInfo(CreditCard creditCard); + + /** + * update credit card + * + * @param creditCard User ID + * @return void + */ + public void deleteCreditCardInfoById(Long id); +} diff --git a/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/IPayPalService.java b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/IPayPalService.java new file mode 100644 index 0000000..7ef764a --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/IPayPalService.java @@ -0,0 +1,43 @@ +package org.wfc.pay.service; + +import org.wfc.pay.domain.PayPal; + +/** + * Paypal pay service layer + * + * @author wfc + */ +public interface IPayPalService +{ + /** + * select PayPal pay information by user ID + * + * @param userId user ID + * @return PayPal pay information + */ + public PayPal selectPayPalInfoByUserId(Long userId); + + /** + * select PayPal pay information by user ID + * + * @param userId user ID + * @return PayPal pay information + */ + public int insertPayPalInfo(PayPal paypal); + + /** + * select PayPal pay information by user ID + * + * @param userId user ID + * @return PayPal pay information + */ + public int updatePayPalInfoById(Long id); + + /** + * select PayPal pay information by user ID + * + * @param userId user ID + * @return PayPal pay information + */ + public void deletePayPalInfoById(Long id); +} diff --git a/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/impl/CreditCardServiceImpl.java b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/impl/CreditCardServiceImpl.java new file mode 100644 index 0000000..64e0add --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/impl/CreditCardServiceImpl.java @@ -0,0 +1,74 @@ +package org.wfc.pay.service.impl; + +import java.util.Collection; +import java.util.List; +import javax.annotation.PostConstruct; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.wfc.common.core.constant.CacheConstants; +import org.wfc.common.core.constant.UserConstants; +import org.wfc.common.core.exception.ServiceException; +import org.wfc.common.core.text.Convert; +import org.wfc.common.core.utils.StringUtils; +import org.wfc.common.redis.service.RedisService; +import org.wfc.pay.domain.CreditCard; +import org.wfc.pay.mapper.CreditCardMapper; +import org.wfc.pay.service.ICreditCardService; + +/** + * 参数配置 服务层实现 + * + * @author ruoyi + */ +@Service +public class CreditCardServiceImpl implements ICreditCardService +{ + @Autowired + private CreditCardMapper creditCardMapper; + + /** + * 查询参数配置信息 + * + * @param creditCardId 参数配置ID + * @return 参数配置信息 + */ + public CreditCard selectCreditCardInfoByUserId(Long userId) + { + //CreditCard creditCardInfo = new CreditCard(); + return creditCardMapper.selectCreditCardInfoByUserId(userId); + } + + /** + * 新增参数配置 + * + * @param creditCard 参数配置信息 + * @return 结果 + */ + public int insertCreditCardInfo(CreditCard creditCard) + { + int row = creditCardMapper.insertCreditCardInfo(creditCard); + return row; + } + + /** + * 修改参数配置 + * + * @param creditCard 参数配置信息 + * @return 结果 + */ + public int updateCreditCardInfo(CreditCard creditCard) + { + int row = creditCardMapper.updateCreditCardInfo(creditCard); + return row; + } + + /** + * 删除参数信息 + * + * @param id 需要删除的参数ID + */ + public void deleteCreditCardInfoById(Long id) + { + creditCardMapper.deleteCreditCardInfoById(id); + } +} diff --git a/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/impl/PayPalServiceImpl.java b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/impl/PayPalServiceImpl.java new file mode 100644 index 0000000..755dcf0 --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/java/org/wfc/pay/service/impl/PayPalServiceImpl.java @@ -0,0 +1,63 @@ +package org.wfc.pay.service.impl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.wfc.pay.mapper.PayPalMapper; +import org.wfc.pay.service.IPayPalService; +import org.wfc.pay.domain.PayPal; + +/** + * PayPal service implementation + * + * @author wfc + */ +@Service +public class PayPalServiceImpl implements IPayPalService +{ + @Autowired + private PayPalMapper paypalMapper; + + /** + * Select Paypal information by user ID + * + * @param userId user ID + * @return 结果 + */ + @Override + public PayPal selectPayPalInfoByUserId(Long userId) { + return paypalMapper.selectPayPalInfoByUserId(userId); + } + + /** + * Select Paypal information by user ID + * + * @param userId user ID + * @return 结果 + */ + @Override + public int insertPayPalInfo(PayPal paypal) { + return paypalMapper.insertPayPalInfo(paypal); + } + + /** + * Select Paypal information by user ID + * + * @param userId user ID + * @return 结果 + */ + @Override + public int updatePayPalInfoById(Long id) { + return paypalMapper.updatePayPalInfoById(id); + } + + /** + * update credit card + * + * @param creditCard User ID + * @return void + */ + @Override + public void deletePayPalInfoById(Long id) { + paypalMapper.deletePayPalInfoById(id); + } +} diff --git a/wfc-modules/wfc-pay/src/main/resources/banner.txt b/wfc-modules/wfc-pay/src/main/resources/banner.txt new file mode 100644 index 0000000..87f05e9 --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/resources/banner.txt @@ -0,0 +1,10 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} + __ _ + / _| | | +__ __| |_ ___ ______ ___ _ _ ___ | |_ ___ _ __ ___ +\ \ /\ / /| _| / __||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \ + \ V V / | | | (__ \__ \| |_| |\__ \| |_ | __/| | | | | | + \_/\_/ |_| \___| |___/ \__, ||___/ \__| \___||_| |_| |_| + __/ | + |___/ \ No newline at end of file diff --git a/wfc-modules/wfc-pay/src/main/resources/bootstrap.yml b/wfc-modules/wfc-pay/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..a416b24 --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/resources/bootstrap.yml @@ -0,0 +1,27 @@ +# Tomcat +server: + port: 9401 + +# Spring +spring: + application: + # 应用名称 + name: wfc-pay + profiles: + # 环境配置 + active: '@profileName@' + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 192.168.2.248:8848 + namespace: '@nacosNamespace@' + config: + # 配置中心地址 + server-addr: 192.168.2.248:8848 + namespace: '@nacosNamespace@' + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} diff --git a/wfc-modules/wfc-pay/src/main/resources/logback.xml b/wfc-modules/wfc-pay/src/main/resources/logback.xml new file mode 100644 index 0000000..93b5bb5 --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/resources/logback.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wfc-modules/wfc-pay/src/main/resources/mapper/pay/CreditCardMapper.xml b/wfc-modules/wfc-pay/src/main/resources/mapper/pay/CreditCardMapper.xml new file mode 100644 index 0000000..3320dd5 --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/resources/mapper/pay/CreditCardMapper.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark + from sys_config + + + + + + + and config_id = #{configId} + + + and config_key = #{configKey} + + + + + + + + + + + + + + insert into sys_config ( + config_name, + config_key, + config_value, + config_type, + create_by, + remark, + create_time + )values( + #{configName}, + #{configKey}, + #{configValue}, + #{configType}, + #{createBy}, + #{remark}, + sysdate() + ) + + + + update sys_config + + config_name = #{configName}, + config_key = #{configKey}, + config_value = #{configValue}, + config_type = #{configType}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where config_id = #{configId} + + + + delete from credit_card where user_id = #{userId} + + + + delete from sys_config where config_id in + + #{configId} + + + + \ No newline at end of file diff --git a/wfc-modules/wfc-pay/src/main/resources/mapper/pay/PayPalMapper.xml b/wfc-modules/wfc-pay/src/main/resources/mapper/pay/PayPalMapper.xml new file mode 100644 index 0000000..9d3fcbd --- /dev/null +++ b/wfc-modules/wfc-pay/src/main/resources/mapper/pay/PayPalMapper.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select d.dept_id, d.parent_id, d.ancestors, d.remark, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time + from sys_dept d + + + + + + insert into sys_dept( + dept_id, + parent_id, + dept_name, + ancestors, + order_num, + leader, + phone, + email, + status, + create_by, + remark, + create_time + )values( + #{deptId}, + #{parentId}, + #{deptName}, + #{ancestors}, + #{orderNum}, + #{leader}, + #{phone}, + #{email}, + #{status}, + #{createBy}, + #{remark}, + sysdate() + ) + + + + update sys_dept + + parent_id = #{parentId}, + dept_name = #{deptName}, + ancestors = #{ancestors}, + order_num = #{orderNum}, + leader = #{leader}, + phone = #{phone}, + email = #{email}, + status = #{status}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where dept_id = #{id} + + + + update sys_dept set del_flag = '2' where dept_id = #{id} + + + \ No newline at end of file