Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-demo-base
Overview
Overview
Details
Activity
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
gic_demo
gic-demo-base
Commits
3ee116bd
Commit
3ee116bd
authored
Jun 04, 2019
by
朱瑞泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update doc
parent
b88b4c22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
1 deletions
+33
-1
README.md
README.md
+33
-1
No files found.
README.md
View file @
3ee116bd
# demo 工程说明
### 工程结构
!
[
](gic-demo-helper/src/main/resources/snapshot_01.png)
|模块 |子模块 |说明 |
| ------------ | ------------ | ------------ |
|gic-demo-pom |- |基础pom,项目组中只能有一个或是直接继承 gic-pom-base |
|gic-demo-base |gic-demo-base-api |基础api,项目组中只能有一个或是直接继承 gic-base-api |
| |gic-demo-common |常用工具扩展(仅含项目组专用),项目组中只能有一个或是直接继承 gic-commons |
| |gic-demo-config |常用配置扩展,项目分组中只能有一个或是直接继承 gic-platform-config |
| |gic-demo-helper |代码助手,主要用于生成代码,不限于MyBatis |
|gic-demo-project |gic-demo-project-api |模块 api |
| |gic-demo-project-service |模块 dubbo 服务 |
| |gic-demo-project-web |模块 web rest 服务 |
### 生成 mybatis model mapper xml
gic-demo-helper工程,配置generatorConfig_test.xml。
```
xml
...
...
@@ -59,7 +71,7 @@ public class GeneratorStartUp {
```
### 生成雪花id
未来 UniqueIdUtils 会集成到 gic-commons 4.x 里
手动生成
```
java
public
class
TestRun
{
public
static
void
main
(
String
[]
args
)
{
...
...
@@ -70,6 +82,26 @@ public class TestRun {
}
}
```
注解生成
```
java
public
class
TabGicDemoStore
{
/**
* 门店id
*/
@InjectId
(
InjectId
.
IdType
.
SNOWFLAKE
)
private
String
storeId
;
}
```
```
xml
<bean
class=
"org.mybatis.spring.SqlSessionFactoryBean"
id=
"sqlSessionFactory"
>
<property
name=
"plugins"
>
<array>
<!-- 自动生成id -->
<bean
class=
"com.gic.commons.plugin.mybatis.AutoIdInterceptor"
/>
</array>
</property>
</bean>
```
### sharding-jdbc 配置
1.
参照 sharding-jdbc 配置说明配置分表,保存到mongodb
...
...
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