Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
9
91isoft_spbt_project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王淑君
91isoft_spbt_project
Commits
bca88c36
Commit
bca88c36
authored
Dec 15, 2018
by
王淑君
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修缮
parent
414845b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
158 additions
and
30 deletions
+158
-30
readMe.md
readMe.md
+128
-0
application-dev.yml
src/main/resources/application-dev.yml
+30
-30
No files found.
readMe.md
View file @
bca88c36
...
...
@@ -175,3 +175,131 @@ http://localhost:8084/swagger-ui.html#/ 访问swaggerUI

# 91isoft_spbt
## 项目框架简介
| 版本 | 组件 | 描述 | 维护人 |
| ------------ | ------------ | ------------ |------------ |
| v1.0 | lombok | 简化冗余代码,连通编辑器和构建工具 | cy |
| v1.0 | ssm | springmvc+spring+mybatis+mybatis扩展 | cy |
| v1.0 | springboot | 简化spring配置 | cy |
| v1.0 | springfox-swagger2 | 在线api | cy |
| v1.0 | logback | 日志 | cy |
| v1.0 | jwt | json web token 身份验证 | cy |
| v1.0 | spring-security | 安全性框架 | cy |
## 编码规范
| 版本 | 维护人员 | 维护时间 | 主要内容 |
| ------------ | ------------ | ------------ | ------------ |
| v1.0 | 李丛阳 | 2018-12-14 | 基础结构搭建 |
### 数据库设计规范
| 编号 | 类型 | 标题 | 描述 |
| ------------ | ------------ | ------------ | ------------ |
| 1 | 表 | 表名 | 小写,单词之间使用下划线 |
| 2 | 表 | 表名 | 中间表使用r_间隔 eg: b_r_teacher_course |
| 3 | 表 | 表结构 | 主表必须要有6+字段(创建时间,修改时间等),中间表不需要 |
| 4 | 列 | 列名 | 小写,单词之间使用下划线 |
| 5 | 列 | 列名 | 每一列必须要有备注 |
| 6 | 列 | 状态列 | char(1) 或 varchar(1),备注要描述清楚状态 |
### 微服务编码规范
| 编号 | 类型 | 标题 | 描述 |
| ------------ | ------------ | ------------ | ------------ |
| 0 | 结构 | 目录规范 | 详见 91isoft_spbt_project|
| 1 | 接口 | 提供其它服务调用的接口要标明 | 模块要单独提出一个controller,requestMappeing使用/api/ 开头|
| 2 | 接口 | 返回值 | Result / GridModel|
| 3 | 接口 | 使用restful风格 | get post pust delete,/id/ |
| 4 | 接口 | requestMappeing命名规范 | queryUsers, queryUserByPagination, detail/businessId, delete/businessId, add, update/businessId |
| 5 | 接口 | swagger | controller api docs |
| 6 | 结构 | service dao | 注释,尽量复用 |
| 7 | 结构 | tcc | 分布式事务书写规范 |
| 8 | 结构 | entity | @Entity @Data @NoArgsConstructor @AllArgsConstructor @Table |
### sql规范
~~~
~
#!bin/bash
${basedir}/sql
-- db_init.sql
-- db_data.sql
-- db_clear.sql
-- date
-- db.bak.sql
-- db.alter.sql
~~~
~
## 模块开发
| 版本 | 模块 | 描述 | 缺省 | 能否改变状态
| ------------ | ------------ | ------------ |------------ |
| v1.0 | lombok | 分页组件 | 开启 | 否 |
| v1.0 | quartz | 定时任务 | 关闭 | 是 |
| v1.0 | redis | 缓存 | 关闭 | 是 |
| v1.0 | ssl | https | 关闭 | 是 |
| v1.0 | decryptParam | 报文加密 | 关闭 | 是 |
| v1.0 | entityParam | 参数格式验证 | 开启 | 是 |
| v1.0 | swagger2 | 测试工具 | 开启 | 是 |
| v1.0 | multipleDs | 多数据源 | 关闭 | 是 |
### redis
1. `application-dev.yml` 配置redis相关参数
2. `CyRedisConfigBean` 去掉 `@CyDoc(CyDocEnum.USELESS)` 开启`@ConfigurationProperties` `@Component`
3. `CyRedisConfig` 去掉 `@CyDoc(CyDocEnum.USELESS)` 开启`@Configuration`
4. `CyRedisServiceImpl` 去掉 `@CyDoc(CyDocEnum.USELESS)` 开启`@Service`
## ssl
1. 开启 application-dev.yml
~~~
~
ssl:
key-store: classpath:client1.p12
key-store-password: 123456
key-store-type: PKCS12
key-alias: client1
#并生成证书,client1.p12 放在resource下
~~~~
## 报文加密
1.
CyDecryptParamAspect.java 去掉
`@CyDoc(CyDocEnum.USELESS)`
2.
application-dev.yml 配置参数 decryptKey
3.
CyAopConfig 注入bean
`@Bean ...`
## 多数据源
1.
`application-dev.yml`
配置多数据源相关参数 参考
`power`
`pmiss`
2.
配置多数据源配置类 参考
`CyDruidProPmiss`
`CyDruidProPower`
3.
关闭
`CyDruidConfig`
注掉
`Configuration`
等, 开启
`@CyDoc(CyDocEnum.USELESS)`
4.
开启
`CyMultipleDruidConfig`
和
`CyTransactionConfig`
(关闭
`@CyDoc(CyDocEnum.USELESS)`
, 开启
`@Configuration`
等) , 并调整相关属性
## 自定义数据库日志
1.
`logback-spring.xml`
配置数据源相关参数
2.
service层
`extends CyBaseService`
使用
`this.dbInfo();`
`this.dbError();`
,可变参数,mess,title
## 定时任务
1.
`CyQuartzConfig.java`
关闭
`@CyDoc(CyDocEnum.USELESS)`
开启
`@Configuration`
## 参数格式验证
1.
`CyEntityParamAspect.java`
去掉
`@CyDoc(CyDocEnum.USELESS)`
2.
application-dev.yml 配置参数 entityParam
3.
CyAopConfig 注入bean
`@Bean ...`
## 测试工具
1.
`CySwagger2Config.java`
去掉
`@CyDoc(CyDocEnum.USELESS)`
开启
`@Configuration`
2.
application-dev.yml 配置参数 swagger2Config
src/main/resources/application-dev.yml
View file @
bca88c36
...
...
@@ -24,24 +24,24 @@ druid:
max-active
:
20
test-on-borrow
:
true
power
:
url
:
jdbc:mysql://127.0.0.1:3306/power?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
username
:
root
password
:
123456
initial-size
:
1
min-idle
:
1
max-active
:
20
test-on-borrow
:
true
driverClass
:
com.mysql.jdbc.Driver
pmiss
:
url
:
jdbc:mysql://127.0.0.1:3306/mall2?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
username
:
root
password
:
123456
initial-size
:
1
min-idle
:
1
max-active
:
20
test-on-borrow
:
true
driverClass
:
com.mysql.jdbc.Driver
#
power:
#
url: jdbc:mysql://127.0.0.1:3306/power?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
#
username: root
#
password: 123456
#
initial-size: 1
#
min-idle: 1
#
max-active: 20
#
test-on-borrow: true
#
driverClass: com.mysql.jdbc.Driver
#
pmiss:
#
url: jdbc:mysql://127.0.0.1:3306/mall2?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
#
username: root
#
password: 123456
#
initial-size: 1
#
min-idle: 1
#
max-active: 20
#
test-on-borrow: true
#
driverClass: com.mysql.jdbc.Driver
mybatis
:
...
...
@@ -80,17 +80,17 @@ spring:
charset
:
UTF-8
suffix
:
.ftl
template-loader-path
:
classpath:/templates/
redis
:
host
:
127.0.0.1
port
:
6379
pool
:
max-idle
:
50
max-active
:
1000
min-idle
:
5
max-wait
:
-1
database
:
0
password
:
123456
timeout
:
3600
#
redis:
#
host: 127.0.0.1
#
port: 6379
#
pool:
#
max-idle: 50
#
max-active: 1000
#
min-idle: 5
#
max-wait: -1
#
database: 0
#
password: 123456
#
timeout: 3600
springfox
:
documentation
:
swagger
:
...
...
@@ -116,7 +116,7 @@ cy:
multipleDs
:
false
quartz
:
false
redis
:
false
entityParam
:
fals
e
entityParam
:
tru
e
decryptParam
:
false
swagger2Config
:
true
security
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment