【阅己书城】逆向生成代码

1、配置renren-generator

# application.yml

server:
  port: 80
# mysql
spring:
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    #MySQL配置
    driverClassName: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql:///:3306/yueji_pms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&useSSL=false
    username: root
    password: root
  jackson:
    time-zone: GMT+8
    date-format: yyyy-MM-dd HH:mm:ss
  resources:
    static-locations: classpath:/static/,classpath:/views/
mybatis-plus:
  mapperLocations: classpath:mapper/**/*.xml
pagehelper:
  reasonable: true
  supportMethodsArguments: true
  params: count=countSql
#指定数据库,可选值有【mysql、oracle、sqlserver、postgresql、mongodb】
renren:
  database: mysql

# generator.properties
#代码生成器,配置信息

mainPath=com.yueji
#包名
package=com.yueji
moduleName=product
#作者
author=yuueji
#Email
email=yuueji@163.com
#表前缀(类名不会包含表前缀)
tablePrefix=pms_

#类型转换,配置信息
tinyint=Integer
smallint=Integer
mediumint=Integer
int=Integer
integer=Integer
bigint=Long
float=Float
double=Double
decimal=BigDecimal
bit=Boolean

char=String
varchar=String
tinytext=String
text=String
mediumtext=String
longtext=String


date=Date
datetime=Date
timestamp=Date

NUMBER=Integer
INT=Integer
INTEGER=Integer
BINARY_INTEGER=Integer
LONG=String
FLOAT=Float
BINARY_FLOAT=Float
DOUBLE=Double
BINARY_DOUBLE=Double
DECIMAL=BigDecimal
CHAR=String
VARCHAR=String
VARCHAR2=String
NVARCHAR=String
NVARCHAR2=String
CLOB=String
BLOB=String
DATE=Date
DATETIME=Date
TIMESTAMP=Date
TIMESTAMP(6)=Date

int8=Long
int4=Integer
int2=Integer
numeric=BigDecimal

nvarchar=String

2、启动项目,访问localhost

3、选中,生成代码

4、将代码粘入product项目中

5、common工程导入以来,product依赖common

6、导入生成代码中需要的类

7、其他表的逆向生成与product基本相同

posted @ 2024-08-31 14:04  大列巴同学  阅读(3)  评论(0编辑  收藏  举报