From aabf4510e05e88bad4c52656215199afcf7c5cca Mon Sep 17 00:00:00 2001 From: xjs <1294405880@qq.com> Date: Mon, 28 Feb 2022 21:21:03 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=B0=9A=E8=9E=8D=E5=AE=9D=E6=9C=8D=E5=8A=A1=E5=90=84=E4=B8=AA?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=8F=8A=E6=96=87=E4=BB=B6=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E5=92=8C=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/rebel.xml | 16 ++++ .../java/com/xjs/srb/core/XjsSrbCoreApp.java | 25 ++++++ .../core/controller/BorrowInfoController.java | 21 +++++ .../com/xjs/srb/core/entity/BorrowInfo.java | 67 ++++++++++++++++ .../xjs/srb/core/mapper/BorrowInfoMapper.java | 16 ++++ .../srb/core/service/IBorrowInfoService.java | 16 ++++ .../service/impl/BorrowInfoServiceImpl.java | 20 +++++ .../src/main/resources/banner.txt | 8 ++ .../src/main/resources/bootstrap.yml | 29 +++++++ .../src/main/resources/logback.xml | 76 +++++++++++++++++++ .../resources/mapper/BorrowInfoMapper.xml | 5 ++ .../src/main/resources/rebel.xml | 16 ++++ .../src/test/java/com/xjs/CodeGenerator.java | 43 +++++++++++ 13 files changed, 358 insertions(+) create mode 100644 xjs-business/xjs-business-srb/srb-service-base/src/main/resources/rebel.xml create mode 100644 xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/XjsSrbCoreApp.java create mode 100644 xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/controller/BorrowInfoController.java create mode 100644 xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/entity/BorrowInfo.java create mode 100644 xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/mapper/BorrowInfoMapper.java create mode 100644 xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/service/IBorrowInfoService.java create mode 100644 xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/service/impl/BorrowInfoServiceImpl.java create mode 100644 xjs-business/xjs-business-srb/srb-service-core/src/main/resources/banner.txt create mode 100644 xjs-business/xjs-business-srb/srb-service-core/src/main/resources/bootstrap.yml create mode 100644 xjs-business/xjs-business-srb/srb-service-core/src/main/resources/logback.xml create mode 100644 xjs-business/xjs-business-srb/srb-service-core/src/main/resources/mapper/BorrowInfoMapper.xml create mode 100644 xjs-business/xjs-business-srb/srb-service-core/src/main/resources/rebel.xml create mode 100644 xjs-business/xjs-business-srb/srb-service-core/src/test/java/com/xjs/CodeGenerator.java diff --git a/xjs-business/xjs-business-srb/srb-service-base/src/main/resources/rebel.xml b/xjs-business/xjs-business-srb/srb-service-base/src/main/resources/rebel.xml new file mode 100644 index 00000000..d6ace12b --- /dev/null +++ b/xjs-business/xjs-business-srb/srb-service-base/src/main/resources/rebel.xml @@ -0,0 +1,16 @@ + + + + + + srb-service-base + + + + + + + diff --git a/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/XjsSrbCoreApp.java b/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/XjsSrbCoreApp.java new file mode 100644 index 00000000..00c01ecc --- /dev/null +++ b/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/XjsSrbCoreApp.java @@ -0,0 +1,25 @@ +package com.xjs.srb.core; + +import com.ruoyi.common.security.annotation.EnableCustomConfig; +import com.ruoyi.common.security.annotation.EnableRyFeignClients; +import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableScheduling; + +/** + * 尚融宝core启动器 + * @author xiejs + * @since 2022-02-28 + */ +@SpringBootApplication +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableRyFeignClients +//这个服务开启boot内置定时任务 +@EnableScheduling +public class XjsSrbCoreApp { + public static void main(String[] args) { + SpringApplication.run(XjsSrbCoreApp.class, args); + } +} diff --git a/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/controller/BorrowInfoController.java b/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/controller/BorrowInfoController.java new file mode 100644 index 00000000..782cd2af --- /dev/null +++ b/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/controller/BorrowInfoController.java @@ -0,0 +1,21 @@ +package com.xjs.srb.core.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.stereotype.Controller; + +/** + *

+ * 借款信息表 前端控制器 + *

+ * + * @author xiejs + * @since 2022-02-28 + */ +@Controller +@RequestMapping("/core/borrowInfo") +public class BorrowInfoController { + +} + diff --git a/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/entity/BorrowInfo.java b/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/entity/BorrowInfo.java new file mode 100644 index 00000000..84b37339 --- /dev/null +++ b/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/entity/BorrowInfo.java @@ -0,0 +1,67 @@ +package com.xjs.srb.core.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + *

+ * 借款信息表 + *

+ * + * @author xiejs + * @since 2022-02-28 + */ +@Getter +@Setter +@TableName("borrow_info") +@ApiModel(value = "BorrowInfo对象", description = "借款信息表") +public class BorrowInfo implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("编号") + @TableId(value = "id") + private Long id; + + @ApiModelProperty("借款用户id") + private Long userId; + + @ApiModelProperty("借款金额") + private BigDecimal amount; + + @ApiModelProperty("借款期限") + private Integer period; + + @ApiModelProperty("年化利率") + private BigDecimal borrowYearRate; + + @ApiModelProperty("还款方式 1-等额本息 2-等额本金 3-每月还息一次还本 4-一次还本") + private Integer returnMethod; + + @ApiModelProperty("资金用途") + private Integer moneyUse; + + @ApiModelProperty("状态(0:未提交,1:审核中, 2:审核通过, -1:审核不通过)") + private Integer status; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("更新时间") + private LocalDateTime updateTime; + + @ApiModelProperty("逻辑删除(1:已删除,0:未删除)") + @TableLogic + private Boolean isDeleted; + + +} diff --git a/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/mapper/BorrowInfoMapper.java b/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/mapper/BorrowInfoMapper.java new file mode 100644 index 00000000..c01d6a4e --- /dev/null +++ b/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/mapper/BorrowInfoMapper.java @@ -0,0 +1,16 @@ +package com.xjs.srb.core.mapper; + +import com.xjs.srb.core.entity.BorrowInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 借款信息表 Mapper 接口 + *

+ * + * @author xiejs + * @since 2022-02-28 + */ +public interface BorrowInfoMapper extends BaseMapper { + +} diff --git a/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/service/IBorrowInfoService.java b/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/service/IBorrowInfoService.java new file mode 100644 index 00000000..ad7ce736 --- /dev/null +++ b/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/service/IBorrowInfoService.java @@ -0,0 +1,16 @@ +package com.xjs.srb.core.service; + +import com.xjs.srb.core.entity.BorrowInfo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 借款信息表 服务类 + *

+ * + * @author xiejs + * @since 2022-02-28 + */ +public interface IBorrowInfoService extends IService { + +} diff --git a/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/service/impl/BorrowInfoServiceImpl.java b/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/service/impl/BorrowInfoServiceImpl.java new file mode 100644 index 00000000..d0fa1645 --- /dev/null +++ b/xjs-business/xjs-business-srb/srb-service-core/src/main/java/com/xjs/srb/core/service/impl/BorrowInfoServiceImpl.java @@ -0,0 +1,20 @@ +package com.xjs.srb.core.service.impl; + +import com.xjs.srb.core.entity.BorrowInfo; +import com.xjs.srb.core.mapper.BorrowInfoMapper; +import com.xjs.srb.core.service.IBorrowInfoService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 借款信息表 服务实现类 + *

+ * + * @author xiejs + * @since 2022-02-28 + */ +@Service +public class BorrowInfoServiceImpl extends ServiceImpl implements IBorrowInfoService { + +} diff --git a/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/banner.txt b/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/banner.txt new file mode 100644 index 00000000..6f3fceaa --- /dev/null +++ b/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/banner.txt @@ -0,0 +1,8 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} +____ ___ ____. _________ _____.___._____.___.________ _________ +\ \/ / | |/ _____/ \__ | |\__ | |\______ \ / _____/ + \ / | |\_____ \ ______ / | | / | | | | \ \_____ \ + / \/\__| |/ \ /_____/ \____ | \____ | | ` \/ \ +/___/\ \________/_______ / / ______| / ______|/_______ /_______ / + \_/ \/ \/ \/ \/ \/ diff --git a/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/bootstrap.yml b/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/bootstrap.yml new file mode 100644 index 00000000..ec998042 --- /dev/null +++ b/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/bootstrap.yml @@ -0,0 +1,29 @@ +# Tomcat +server: + port: 9950 + +# Spring +spring: + application: + # 应用名称 + name: srb-service-core + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 127.0.0.1:8848 + config: + # 配置中心地址 + server-addr: 127.0.0.1:8848 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + #配置组 + group: xjs + #命名空间 + namespace: xjs-666 diff --git a/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/logback.xml b/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/logback.xml new file mode 100644 index 00000000..ed47182b --- /dev/null +++ b/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/logback.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + ${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/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/mapper/BorrowInfoMapper.xml b/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/mapper/BorrowInfoMapper.xml new file mode 100644 index 00000000..105c9eed --- /dev/null +++ b/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/mapper/BorrowInfoMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/rebel.xml b/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/rebel.xml new file mode 100644 index 00000000..3fdee43d --- /dev/null +++ b/xjs-business/xjs-business-srb/srb-service-core/src/main/resources/rebel.xml @@ -0,0 +1,16 @@ + + + + + + srb-service-core + + + + + + + diff --git a/xjs-business/xjs-business-srb/srb-service-core/src/test/java/com/xjs/CodeGenerator.java b/xjs-business/xjs-business-srb/srb-service-core/src/test/java/com/xjs/CodeGenerator.java new file mode 100644 index 00000000..b5a8f3d7 --- /dev/null +++ b/xjs-business/xjs-business-srb/srb-service-core/src/test/java/com/xjs/CodeGenerator.java @@ -0,0 +1,43 @@ +package com.xjs; + +import com.baomidou.mybatisplus.generator.FastAutoGenerator; +import com.baomidou.mybatisplus.generator.config.OutputFile; +import com.baomidou.mybatisplus.generator.engine.VelocityTemplateEngine; +import org.junit.jupiter.api.Test; + +import java.util.Collections; + +public class CodeGenerator { + + @Test + public void genCode() { + + FastAutoGenerator.create("jdbc:mysql://localhost:3306/xjs-srb-core?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8", + "root", "root") + .globalConfig(builder -> { + builder.author("xiejs") // 设置作者 + .enableSwagger() // 开启 swagger 模式 + .fileOverride() // 覆盖已生成文件 + .outputDir("D:\\Dev\\IdeaPerject\\GitHub\\RuoYi-Cloud\\xjs-business\\xjs-business-srb\\srb-service-core\\src\\main\\java"); // 指定输出目录 + }) + .packageConfig(builder -> { + builder.parent("com.xjs.srb") // 设置父包名 + .moduleName("core") // 设置父包模块名 + .pathInfo(Collections.singletonMap(OutputFile.mapperXml, "D:\\Dev\\IdeaPerject\\GitHub\\RuoYi-Cloud\\xjs-business\\xjs-business-srb\\srb-service-core\\src\\main\\resources\\mapper")); // 设置mapperXml生成路径 + }) + .strategyConfig(builder -> { + builder.addInclude("borrow_info") + .entityBuilder() + .enableLombok() + .logicDeleteColumnName("is_deleted") + .build() + ; // 设置需要生成的表名 + //.addTablePrefix("t_", "c_"); // 设置过滤表前缀 + }) + + .templateEngine(new VelocityTemplateEngine()) // 使用Freemarker引擎模板,默认的是Velocity引擎模板 + .execute(); + + } + +} \ No newline at end of file