From 7687eb13481a173867fc7418189b5d60f2a54b2d Mon Sep 17 00:00:00 2001 From: liuyes Date: Fri, 20 Dec 2019 21:03:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=B4=E6=98=8E=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pigx-visual/pigx-code/README.md | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 pigx-visual/pigx-code/README.md diff --git a/pigx-visual/pigx-code/README.md b/pigx-visual/pigx-code/README.md new file mode 100644 index 000000000..ea4825ff0 --- /dev/null +++ b/pigx-visual/pigx-code/README.md @@ -0,0 +1,45 @@ +## 使用说明 +``` +本模块是pigx-codegen的重写版本,使用dynamic-datasource实现,去除pigx-common-datasource依赖,功能未做扩展。 +``` +### pigx-code-dev.yml +``` +## spring security 配置 +security: + oauth2: + client: + client-id: ENC(gPFcUOmJm8WqM3k3eSqS0Q==) + client-secret: ENC(gPFcUOmJm8WqM3k3eSqS0Q==) + scope: server + resources: + static-locations: classpath:/static/,classpath:/views/ + +# 数据源 +spring: + datasource: + dynamic: + username: ${MYSQL-USER:root} + password: ${MYSQL-USER:root} + url: jdbc:mysql://${MYSQL-HOST:pigx-mysql}:${MYSQL-PORT:3306}/pigxx_codegen?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true + driverClassName: com.mysql.cj.jdbc.Driver + sql: select * from gen_datasource_conf + + +pigx: + tenant: + column: tenant_id + tables: + - sys_datasource_conf +``` +### 示例中的pigxx_codegen数据库及sql说明 +``` +pigxx_codegen数据库中gen_datasource_conf表必须存在一个name为master的数据库连接配置 + +INSERT INTO `gen_datasource_conf` VALUES ('8', 'master', 'jdbc:mysql://pigx-mysql:3306/pigxx_codegen?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true', 'root', 'ZkxR9PxP6sWvasdc9CG9Ww==', '2019-09-18 09:44:55', '2019-12-17 17:07:17', '0', null); +``` +### yml配置文件切换数据源 +``` +请参考:https://git.pig4cloud.com/pigx/pigx/src/liuyes_dev/pigx-visual/pigx-dynamic-datasource +``` +### 联系我 +QQ:55215085 \ No newline at end of file