Commit 3ee116bd by 朱瑞泽

update doc

parent b88b4c22
# demo 工程说明 # demo 工程说明
### 工程结构 ### 工程结构
![](gic-demo-helper/src/main/resources/snapshot_01.png) ![](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 ### 生成 mybatis model mapper xml
gic-demo-helper工程,配置generatorConfig_test.xml。 gic-demo-helper工程,配置generatorConfig_test.xml。
```xml ```xml
...@@ -59,7 +71,7 @@ public class GeneratorStartUp { ...@@ -59,7 +71,7 @@ public class GeneratorStartUp {
``` ```
### 生成雪花id ### 生成雪花id
未来 UniqueIdUtils 会集成到 gic-commons 4.x 里 手动生成
```java ```java
public class TestRun { public class TestRun {
public static void main(String[] args) { public static void main(String[] args) {
...@@ -70,6 +82,26 @@ public class TestRun { ...@@ -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 配置 ### sharding-jdbc 配置
1. 参照 sharding-jdbc 配置说明配置分表,保存到mongodb 1. 参照 sharding-jdbc 配置说明配置分表,保存到mongodb
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment