From 07d610f5816523687c8340c7dca06021cfaf111c Mon Sep 17 00:00:00 2001 From: chentaisen <14615430+chentaisen@user.noreply.gitee.com> Date: Tue, 20 Aug 2024 20:22:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/pay/domain/Rule.java | 11 +- .../OrderPayCustomerController.java | 150 --------------- .../muyu/pay/controller/RuleController.java | 16 ++ .../pay/mapper/OrderPayCustomerMapper.java | 15 -- .../com/muyu/pay/mapper/OrderPayMapper.java | 14 -- .../java/com/muyu/pay/mapper/RuleMapper.java | 7 + .../pay/service/OrderPayCustomerService.java | 52 ----- .../com/muyu/pay/service/OrderPayService.java | 22 --- .../com/muyu/pay/service/RuleService.java | 4 + .../impl/OrderPayCustomerServiceImpl.java | 180 ------------------ .../pay/service/impl/OrderPayServiceImpl.java | 30 --- .../pay/service/impl/RuleServiceImpl.java | 14 ++ .../src/main/resources/banner.txt | 2 + .../src/main/resources/bootstrap.yml | 54 ++++++ .../src/main/resources/logback/dev.xml | 74 +++++++ .../src/main/resources/logback/prod.xml | 81 ++++++++ .../src/main/resources/logback/test.xml | 81 ++++++++ 17 files changed, 342 insertions(+), 465 deletions(-) delete mode 100644 muyu-rule-server/src/main/java/com/muyu/pay/controller/OrderPayCustomerController.java create mode 100644 muyu-rule-server/src/main/java/com/muyu/pay/controller/RuleController.java delete mode 100644 muyu-rule-server/src/main/java/com/muyu/pay/mapper/OrderPayCustomerMapper.java delete mode 100644 muyu-rule-server/src/main/java/com/muyu/pay/mapper/OrderPayMapper.java create mode 100644 muyu-rule-server/src/main/java/com/muyu/pay/mapper/RuleMapper.java delete mode 100644 muyu-rule-server/src/main/java/com/muyu/pay/service/OrderPayCustomerService.java delete mode 100644 muyu-rule-server/src/main/java/com/muyu/pay/service/OrderPayService.java create mode 100644 muyu-rule-server/src/main/java/com/muyu/pay/service/RuleService.java delete mode 100644 muyu-rule-server/src/main/java/com/muyu/pay/service/impl/OrderPayCustomerServiceImpl.java delete mode 100644 muyu-rule-server/src/main/java/com/muyu/pay/service/impl/OrderPayServiceImpl.java create mode 100644 muyu-rule-server/src/main/java/com/muyu/pay/service/impl/RuleServiceImpl.java create mode 100644 muyu-rule-server/src/main/resources/banner.txt create mode 100644 muyu-rule-server/src/main/resources/bootstrap.yml create mode 100644 muyu-rule-server/src/main/resources/logback/dev.xml create mode 100644 muyu-rule-server/src/main/resources/logback/prod.xml create mode 100644 muyu-rule-server/src/main/resources/logback/test.xml diff --git a/muyu-rule-common/src/main/java/pay/domain/Rule.java b/muyu-rule-common/src/main/java/pay/domain/Rule.java index e7b2ef5..f1b39e0 100644 --- a/muyu-rule-common/src/main/java/pay/domain/Rule.java +++ b/muyu-rule-common/src/main/java/pay/domain/Rule.java @@ -1,39 +1,46 @@ package pay.domain; import com.muyu.common.core.web.domain.BaseEntity; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * @ClassName Rule - * @Description 描述 + * @Description 规则表 * @Author Chen * @Date 2024/8/20 11:40 */ @Data @AllArgsConstructor @NoArgsConstructor +@Tag(name = "规则") public class Rule extends BaseEntity { /** * 规则ID */ - private Integer id; + + private Long id; /** * 规则名称 */ + private String name; /** * 规则类型 */ + private String ruleType; /** * 是否激活 */ + private String isActivate; /** * 规则描述 */ + private String ruleDesc; } diff --git a/muyu-rule-server/src/main/java/com/muyu/pay/controller/OrderPayCustomerController.java b/muyu-rule-server/src/main/java/com/muyu/pay/controller/OrderPayCustomerController.java deleted file mode 100644 index 2b89633..0000000 --- a/muyu-rule-server/src/main/java/com/muyu/pay/controller/OrderPayCustomerController.java +++ /dev/null @@ -1,150 +0,0 @@ -package com.muyu.pay.controller; - -import com.dtflys.forest.springboot.annotation.ForestScannerRegister; -import com.muyu.cloud.pay.domain.OrderPayCustomer; -import com.muyu.cloud.pay.domain.req.CustomerListReq; -import com.muyu.cloud.pay.domain.req.OrderCustomerAddReq; -import com.muyu.cloud.pay.domain.req.OrderCustomerUpdReq; -import com.muyu.cloud.pay.domain.resp.CustomerResp; -import com.muyu.cloud.pay.service.OrderPayCustomerService; -import com.muyu.common.core.domain.Result; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.extern.log4j.Log4j2; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * @ClassName OrderPayCustomerController - * @Description 支付客户控制层 - * @Author Chen - * @Date 2024/8/5 21:22 - */ -@Log4j2 -@RestController -@RequestMapping("/customer") -@Tag(name = "客户控制层", description = "进行客户管理、查看等相关操作") -public class OrderPayCustomerController { - - public OrderPayCustomerController() { - log.info("forest扫描路径:{}", ForestScannerRegister.getBasePackages()); - } - - /** - * 客户业务层 - */ - @Autowired - private OrderPayCustomerService orderPayCustomerService; - - /** - * 查询所有的客户 - * - * @param customerListReq 客户列表请求参数 - * @return 客户列表 - */ - @RequestMapping(path = "/list", method = RequestMethod.POST) - @Operation(summary = "查看客户", description = "根据客户的名称、编码、是否开启等可以进行客户的筛选") - public Result> selectList( - @Validated @RequestBody CustomerListReq customerListReq) { - return Result.success( - orderPayCustomerService.selectList(customerListReq) - ); - } - - /** - * 获取所有客户的列表 - * - * @return客户集合 - */ - @GetMapping("/all") - @Operation(summary = "获取未接入的客户", description = "调用nacosAPI获取所有的微服务名称,作为支付中台的客户") - @Schema(description = "客户列表", defaultValue = "[\"客户1\",\"客户2\"]", type = "List") - public Result> getCustomerAllList() { - return Result.success( - orderPayCustomerService.getCustomerAllList() - ); - } - - /** - * 添加客户 - * - * @param orderCustomerAddReq 客户信息 - * @return 添加结果 - */ - @PostMapping - @Operation(summary = "客户信息添加", description = "添加支付平台客户信息,添加成功才可以使用支付类的产品") - public Result save(@Validated @RequestBody OrderCustomerAddReq orderCustomerAddReq) { - orderPayCustomerService.save(OrderPayCustomer.addBuild(orderCustomerAddReq)); - return Result.success(null, "操作成功"); - } - - /** - * 修改客户 - * - * @param orderCustomerUpdReq 修改客户请求信息 - * @return 修改结果 - */ - @PutMapping("/{orderCustomerId}") - @Operation(summary = "客户信息修改", description = "通过ID修改客户信息") - public Result update( - @Schema(title = "客户ID", type = "Long", defaultValue = "1", description = "修改客户信息需要依据的唯一条件") - @PathVariable("orderCustomerId") Long orderCustomerId, - @RequestBody @Validated OrderCustomerUpdReq orderCustomerUpdReq) { - orderPayCustomerService.updateById(OrderPayCustomer.updBuild(orderCustomerUpdReq, () -> orderCustomerId)); - return Result.success(null, "操作成功"); - } - - /** - * 删除客户 - * - * @param orderCustomerId 删除客户请求信息 - * @return 删除结果 - */ - @DeleteMapping("/{orderCustomerId}") - @Operation(summary = "客户信息删除", description = "通过ID删除客户信息") - public Result delete(@PathVariable("orderCustomerId") Long orderCustomerId) { - orderPayCustomerService.removeById(orderCustomerId); - return Result.success(null, "操作成功"); - } - - - /** - * 通过ID获取客户 - * - * @param orderCustomerId ID - * @return 客户信息 - */ - @GetMapping("/{orderCustomerId}") - @Operation(summary = "通过ID获取客户信息", description = "通过ID获取客户信息") - public Result findById(@PathVariable("orderCustomerId") Long orderCustomerId) { - return Result.success(orderPayCustomerService.getById(orderCustomerId), "操作成功"); - } - /** - * 通过ID禁用客户 - * - * @param orderCustomerId ID - * @return 客户信息 - */ - @GetMapping("/disable/{orderCustomerId}") - @Operation(summary = "通过ID禁用", description = "通过ID禁用客户,禁用之后禁止调用支付相关接口") - public Result disable(@PathVariable("orderCustomerId") Long orderCustomerId) { - this.orderPayCustomerService.disable(orderCustomerId); - return Result.success(null, "操作成功"); - } - /** - * 通过ID启用客户 - * - * @param orderCustomerId ID - * @return 客户信息 - */ - @GetMapping("/enable/{orderCustomerId}") - @Operation(summary = "通过ID启用客户", description = "通过ID启用客户,启用之后禁止调用支付相关接口") - public Result enable(@PathVariable("orderCustomerId") Long orderCustomerId) { - this.orderPayCustomerService.enable(orderCustomerId); - return Result.success(null, "操作成功"); - } -} diff --git a/muyu-rule-server/src/main/java/com/muyu/pay/controller/RuleController.java b/muyu-rule-server/src/main/java/com/muyu/pay/controller/RuleController.java new file mode 100644 index 0000000..d92ef54 --- /dev/null +++ b/muyu-rule-server/src/main/java/com/muyu/pay/controller/RuleController.java @@ -0,0 +1,16 @@ +package com.muyu.pay.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @ClassName RuleController + * @Description 规则控制层 + * @Author Chen + * @Date 2024/8/20 14:22 + */ +@RestController +@RequestMapping("/rule") +public class RuleController { + +} diff --git a/muyu-rule-server/src/main/java/com/muyu/pay/mapper/OrderPayCustomerMapper.java b/muyu-rule-server/src/main/java/com/muyu/pay/mapper/OrderPayCustomerMapper.java deleted file mode 100644 index 39a5d83..0000000 --- a/muyu-rule-server/src/main/java/com/muyu/pay/mapper/OrderPayCustomerMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.muyu.pay.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.muyu.cloud.pay.domain.OrderPayCustomer; -import org.apache.ibatis.annotations.Mapper; - -/** - * @ClassName OrderPayCustomerMapper - * @Description 支付服务/客户持久层 - * @Author Chen - * @Date 2024/8/5 21:12 - */ -@Mapper -public interface OrderPayCustomerMapper extends BaseMapper { -} diff --git a/muyu-rule-server/src/main/java/com/muyu/pay/mapper/OrderPayMapper.java b/muyu-rule-server/src/main/java/com/muyu/pay/mapper/OrderPayMapper.java deleted file mode 100644 index 3fa1689..0000000 --- a/muyu-rule-server/src/main/java/com/muyu/pay/mapper/OrderPayMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.muyu.pay.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.muyu.cloud.pay.domain.OrderPayInfo; -import org.apache.ibatis.annotations.Mapper; -/** - * @ClassName OrderPayCustomerMapper - * @Description 订单支付持久层 - * @Author Chen - * @Date 2024/8/5 21:12 - */ -@Mapper -public interface OrderPayMapper extends BaseMapper { -} diff --git a/muyu-rule-server/src/main/java/com/muyu/pay/mapper/RuleMapper.java b/muyu-rule-server/src/main/java/com/muyu/pay/mapper/RuleMapper.java new file mode 100644 index 0000000..5be1b75 --- /dev/null +++ b/muyu-rule-server/src/main/java/com/muyu/pay/mapper/RuleMapper.java @@ -0,0 +1,7 @@ +package com.muyu.pay.mapper; + +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface RuleMapper { +} diff --git a/muyu-rule-server/src/main/java/com/muyu/pay/service/OrderPayCustomerService.java b/muyu-rule-server/src/main/java/com/muyu/pay/service/OrderPayCustomerService.java deleted file mode 100644 index 2a69ce8..0000000 --- a/muyu-rule-server/src/main/java/com/muyu/pay/service/OrderPayCustomerService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.muyu.pay.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.muyu.cloud.pay.domain.OrderPayCustomer; -import com.muyu.cloud.pay.domain.req.CustomerListReq; -import com.muyu.cloud.pay.domain.resp.CustomerResp; - -import java.util.List; - -/** - * @ClassName OrderPayCustomerService - * @Description 支付客户业务层 - * @Author Chen - * @Date 2024/7/29 20:30 - */ -public interface OrderPayCustomerService extends IService { - /** - * 查询客户集合 - * - * @param customerListReq - * @return客户集合 - */ - public List selectList(CustomerListReq customerListReq); - - /** - * 获取所有的客户 - * - * @return 客户集合 - */ - List getCustomerAllList(); - - /** - * 禁用客户 - * - * @param orderCustomerId 客户ID - */ - void disable(Long orderCustomerId); - - /** - * 启用用户 - * - * @param orderCustomerId 客户Id - */ - void enable(Long orderCustomerId); - - /** - * 通过客户ID设置客户状态 - * @param orderCustomerId id - * @param status 状态 SysIsYesNo - */ - void settingStatus(Long orderCustomerId, String status); -} diff --git a/muyu-rule-server/src/main/java/com/muyu/pay/service/OrderPayService.java b/muyu-rule-server/src/main/java/com/muyu/pay/service/OrderPayService.java deleted file mode 100644 index 9816760..0000000 --- a/muyu-rule-server/src/main/java/com/muyu/pay/service/OrderPayService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.muyu.pay.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.muyu.cloud.pay.domain.OrderPayInfo; - -import java.util.List; - -/** - * @ClassName OrderPayCustomerMapper - * @Description 订单支付业务层 - * @Author Chen - * @Date 2024/8/5 21:12 - */ -public interface OrderPayService extends IService { - /** - * 根客户code和分页限制,查询结果 - * @param appCode 客户code - * @param limit 分页限制 - * @return 支付订单记录 - */ - List selectOrderPayByAppCodeAndLimit(String appCode, int limit); -} diff --git a/muyu-rule-server/src/main/java/com/muyu/pay/service/RuleService.java b/muyu-rule-server/src/main/java/com/muyu/pay/service/RuleService.java new file mode 100644 index 0000000..bc5b458 --- /dev/null +++ b/muyu-rule-server/src/main/java/com/muyu/pay/service/RuleService.java @@ -0,0 +1,4 @@ +package com.muyu.pay.service; + +public interface RuleService { +} diff --git a/muyu-rule-server/src/main/java/com/muyu/pay/service/impl/OrderPayCustomerServiceImpl.java b/muyu-rule-server/src/main/java/com/muyu/pay/service/impl/OrderPayCustomerServiceImpl.java deleted file mode 100644 index 6765c70..0000000 --- a/muyu-rule-server/src/main/java/com/muyu/pay/service/impl/OrderPayCustomerServiceImpl.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.muyu.pay.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.muyu.cloud.pay.domain.OrderPayCustomer; -import com.muyu.cloud.pay.domain.OrderPayInfo; -import com.muyu.cloud.pay.domain.req.CustomerListReq; -import com.muyu.cloud.pay.domain.resp.CustomerResp; -import com.muyu.cloud.pay.mapper.OrderPayCustomerMapper; -import com.muyu.cloud.pay.service.OrderPayCustomerService; -import com.muyu.cloud.pay.service.OrderPayService; -import com.muyu.common.core.enums.SystemYesNo; -import com.muyu.common.core.exception.ServiceException; -import com.muyu.common.core.utils.DateUtils; -import com.muyu.common.core.utils.StringUtils; -import com.muyu.common.nacos.service.NacosServerService; -import lombok.extern.log4j.Log4j2; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * @ClassName OrderPayCustomerServiceImpl - * @Description 支付客户业务层实现类 - * @Author Chen - * @Date 2024/8/5 21:18 - */ -@Log4j2 -@Service -public class OrderPayCustomerServiceImpl - extends ServiceImpl - implements OrderPayCustomerService { - @Autowired - private OrderPayService orderPayService; - - @Autowired - private NacosServerService nacosServerService; - - - /** - * 查询客户集合 - * - * @param customerListReq - * @return - */ - @Override - public List selectList(CustomerListReq customerListReq) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.like( - StringUtils.isNotEmpty(customerListReq.getAppName()), - OrderPayCustomer::getAppName, customerListReq.getAppName() - ); - queryWrapper.like( - StringUtils.isNotEmpty(customerListReq.getAppCode()), - OrderPayCustomer::getAppCode, customerListReq.getAppCode() - ); - queryWrapper.eq( - StringUtils.isNotEmpty(customerListReq.getStatus()), - OrderPayCustomer::getStatus, customerListReq.getStatus() - ); - List orderPayCustomerList = this.list(queryWrapper); - return orderPayCustomerList.stream() - .map(orderPayCustomer -> CustomerResp.customerBuild(orderPayCustomer, - () -> orderPayService.selectOrderPayByAppCodeAndLimit(orderPayCustomer.getAppCode(), 5) - .stream() - .map(OrderPayInfo::buildCustomerOrderPaySimpleResp) - .toList())) - .toList(); - } - - /** - * 获取所有的客户 - * - * @return客户集合 - */ - @Override - public List getCustomerAllList() { - List nacosServerAllList = nacosServerService.nacosServerAllList(); - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.select(OrderPayCustomer::getAppCode); - List orderPayCustomerList = this.list(queryWrapper); - Set customerSet = orderPayCustomerList.stream() - .map(OrderPayCustomer::getAppCode) - .collect(Collectors.toSet()); - - return nacosServerAllList.stream() - .filter(nacosServer -> !customerSet.contains(nacosServer)) - .toList(); - } - - @Override - public boolean removeById(Serializable id) { - OrderPayCustomer orderPayCustomer = this.getById(id); - if (orderPayCustomer==null){ - throw new ServiceException("客户不存在"); - } - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(OrderPayInfo::getAppCode,orderPayCustomer.getAppCode()); - queryWrapper.gt(OrderPayInfo::getCreateTime, DateUtils.addDays(new Date(),-7)); - long count = orderPayService.count(); - if (count>0){ - throw new RuntimeException( - StringUtils.format("客户:[{}],近七天还在使用,不可删除",orderPayCustomer.getAppName()) - ); - } - return super.removeById(id); - } - - /** - * 禁用客户 - * - * @param orderCustomerId 客户ID - */ - @Override - public void disable(Long orderCustomerId) { - this.settingStatus(orderCustomerId, SystemYesNo.NO.getCode()); - } - - /** - * 启用客户 - * - * @param orderCustomerId 客户Id - */ - @Override - public void enable(Long orderCustomerId) { - this.settingStatus(orderCustomerId, SystemYesNo.YES.getCode()); - } - - /** - * 通过客户ID设置客户状态 - * @param orderCustomerId id - * @param status 状态 SysIsYesNo - */ - public void settingStatus(Long orderCustomerId, String status) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(OrderPayCustomer::getId, orderCustomerId); - boolean isExists = this.exists(queryWrapper); - if (!isExists) { - throw new ServiceException("操作客户不存在"); - } - - if (!SystemYesNo.isCode(status)){ - throw new ServiceException("设置状态值违法"); - } - LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); - updateWrapper.eq(OrderPayCustomer::getId,orderCustomerId); - updateWrapper.set(OrderPayCustomer::getStatus,status); - this.update(updateWrapper); - } - - /** - * 获取所有的客户 - * - * @return客户集合 - */ - @Override - public boolean save(OrderPayCustomer orderPayCustomer) { - String appCode = orderPayCustomer.getAppCode(); - List nacosServerAllList = nacosServerService.nacosServerAllList(); - log.info("进行服务合法性判断:[{}->{}]", appCode, nacosServerAllList); - if (!nacosServerAllList.contains(appCode)) { - throw new ServiceException("客户编码违法"); - } - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(OrderPayCustomer::getAppCode, appCode); - long isAppCodeOnly = this.count(queryWrapper); - log.info("进行服务code唯一性校验:[{}--{}]", appCode, isAppCodeOnly); - if (isAppCodeOnly > 0) { - throw new ServiceException("客户编码重复"); - } - return super.save(orderPayCustomer); - } - -} diff --git a/muyu-rule-server/src/main/java/com/muyu/pay/service/impl/OrderPayServiceImpl.java b/muyu-rule-server/src/main/java/com/muyu/pay/service/impl/OrderPayServiceImpl.java deleted file mode 100644 index f5278a2..0000000 --- a/muyu-rule-server/src/main/java/com/muyu/pay/service/impl/OrderPayServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.muyu.pay.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.muyu.cloud.pay.domain.OrderPayInfo; -import com.muyu.cloud.pay.mapper.OrderPayMapper; -import com.muyu.cloud.pay.service.OrderPayService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * @ClassName OrderPayServiceImpl - * @Description 描述 - * @Author Chen - * @Date 2024/8/7 22:24 - */ -@Service -public class OrderPayServiceImpl extends ServiceImpl implements OrderPayService { - - @Override - public List selectOrderPayByAppCodeAndLimit(String appCode, int limit) { - LambdaQueryWrapper orderPayInfoWrapper = new LambdaQueryWrapper<>(); - orderPayInfoWrapper.eq(OrderPayInfo::getAppCode,appCode); - orderPayInfoWrapper.orderBy(true,false,OrderPayInfo::getCreateTime); - orderPayInfoWrapper.last("limit "+limit); - - return this.list(orderPayInfoWrapper); - } -} diff --git a/muyu-rule-server/src/main/java/com/muyu/pay/service/impl/RuleServiceImpl.java b/muyu-rule-server/src/main/java/com/muyu/pay/service/impl/RuleServiceImpl.java new file mode 100644 index 0000000..f40944d --- /dev/null +++ b/muyu-rule-server/src/main/java/com/muyu/pay/service/impl/RuleServiceImpl.java @@ -0,0 +1,14 @@ +package com.muyu.pay.service.impl; + +import com.muyu.pay.service.RuleService; +import org.springframework.stereotype.Service; + +/** + * @ClassName RuleServiceImpl + * @Description 描述 + * @Author Chen + * @Date 2024/8/20 14:19 + */ +@Service +public class RuleServiceImpl implements RuleService { +} diff --git a/muyu-rule-server/src/main/resources/banner.txt b/muyu-rule-server/src/main/resources/banner.txt new file mode 100644 index 0000000..0dd5eee --- /dev/null +++ b/muyu-rule-server/src/main/resources/banner.txt @@ -0,0 +1,2 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} diff --git a/muyu-rule-server/src/main/resources/bootstrap.yml b/muyu-rule-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..13cf1f4 --- /dev/null +++ b/muyu-rule-server/src/main/resources/bootstrap.yml @@ -0,0 +1,54 @@ +# Tomcat +server: + port: 9701 + +# nacos线上地址 +nacos: + addr: 21.12.2.1:8848 + user-name: nacos + password: nacos + namespace: cloud-2112 + +# Spring +spring: + + main: + allow-bean-definition-overriding: true + application: + # 应用名称 + name: cloud-pay + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: ${nacos.addr} + # nacos用户名 + username: ${nacos.user-name} + # nacos密码 + password: ${nacos.password} + # 命名空间 + namespace: ${nacos.namespace} + config: + # 服务注册地址 + server-addr: ${nacos.addr} + # nacos用户名 + username: ${nacos.user-name} + # nacos密码 + password: ${nacos.password} + # 命名空间 + namespace: ${nacos.namespace} + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + # 系统共享配置 + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + # 系统环境Config共享配置 + - application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + # xxl-job 配置文件 + - application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + # rabbit 配置文件 + - application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} diff --git a/muyu-rule-server/src/main/resources/logback/dev.xml b/muyu-rule-server/src/main/resources/logback/dev.xml new file mode 100644 index 0000000..46bc5c6 --- /dev/null +++ b/muyu-rule-server/src/main/resources/logback/dev.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 + + + + + + + + + + + + + + + + + + diff --git a/muyu-rule-server/src/main/resources/logback/prod.xml b/muyu-rule-server/src/main/resources/logback/prod.xml new file mode 100644 index 0000000..e9b5c61 --- /dev/null +++ b/muyu-rule-server/src/main/resources/logback/prod.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + ${log.sky.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + + + ERROR + + ACCEPT + + DENY + + + + + + + + ${log.sky.pattern} + + + + + + + + + + + + + + + + + + + + diff --git a/muyu-rule-server/src/main/resources/logback/test.xml b/muyu-rule-server/src/main/resources/logback/test.xml new file mode 100644 index 0000000..e9b5c61 --- /dev/null +++ b/muyu-rule-server/src/main/resources/logback/test.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + ${log.sky.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + + + ERROR + + ACCEPT + + DENY + + + + + + + + ${log.sky.pattern} + + + + + + + + + + + + + + + + + + + +