bianlz преди 8 месеца
ревизия
8b3940c21e
променени са 48 файла, в които са добавени 1337 реда и са изтрити 0 реда
  1. 38 0
      pangu-archetypes/pangu-archetype-sc/.gitignore
  2. 20 0
      pangu-archetypes/pangu-archetype-sc/README.md
  3. 0 0
      pangu-archetypes/pangu-archetype-sc/logs/sys-info.log
  4. 40 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-adapter/pom.xml
  5. 1 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-adapter/src/main/java/com/hrsk/pangu/adapter/package-info.java
  6. 27 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-app/pom.xml
  7. 1 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-app/src/main/java/com/hrsk/pangu/app/package-info.java
  8. 24 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-client/pom.xml
  9. 1 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-client/src/main/java/com/hrsk/pangu/client/package-info.java
  10. 20 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-domain/pom.xml
  11. 1 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-domain/src/main/java/com/hrsk/pangu/domain/package-info.java
  12. 43 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/pom.xml
  13. 1 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/package-info.java
  14. 1 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/repository/database/entity/package-info.java
  15. 1 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/repository/database/mapper/package-info.java
  16. 1 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/repository/database/package-info.java
  17. 1 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/repository/package-info.java
  18. 6 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/resources/db/data.sql
  19. 23 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/resources/db/schema.sql
  20. 18 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/resources/mybatis-config.xml
  21. 6 0
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/resources/mybatis/ExampleMapper.xml
  22. 101 0
      pangu-archetypes/pangu-archetype-sc/pom.xml
  23. 28 0
      pangu-archetypes/pangu-archetype-sc/start/pom.xml
  24. 31 0
      pangu-archetypes/pangu-archetype-sc/start/src/main/java/com/hrsk/pangu/Application.java
  25. 26 0
      pangu-archetypes/pangu-archetype-sc/start/src/main/resources/application-local.yaml
  26. 18 0
      pangu-archetypes/pangu-archetype-sc/start/src/main/resources/application.yaml
  27. 31 0
      pangu-archetypes/pangu-archetype-sc/start/src/main/resources/logback-spring.xml
  28. 38 0
      pangu-components/.gitignore
  29. 17 0
      pangu-components/README.md
  30. 38 0
      pangu-components/pangu-component-domain-starter/pom.xml
  31. 57 0
      pangu-components/pangu-component-domain-starter/src/main/java/com/hrsk/pangu/domain/ApplicationContextHelper.java
  32. 21 0
      pangu-components/pangu-component-domain-starter/src/main/java/com/hrsk/pangu/domain/DomainAutoConfiguration.java
  33. 14 0
      pangu-components/pangu-component-domain-starter/src/main/java/com/hrsk/pangu/domain/DomainFactory.java
  34. 20 0
      pangu-components/pangu-component-domain-starter/src/main/java/com/hrsk/pangu/domain/Entity.java
  35. 1 0
      pangu-components/pangu-component-domain-starter/src/main/resources/META-INF/spring.factories
  36. 20 0
      pangu-components/pangu-component-dto/pom.xml
  37. 67 0
      pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/BizScenario.java
  38. 39 0
      pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/ClientObject.java
  39. 12 0
      pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/Command.java
  40. 14 0
      pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/DTO.java
  41. 62 0
      pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/MultiResponse.java
  42. 96 0
      pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/PageQuery.java
  43. 124 0
      pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/PageResponse.java
  44. 12 0
      pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/Query.java
  45. 61 0
      pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/Response.java
  46. 11 0
      pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/Scope.java
  47. 43 0
      pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/SingleResponse.java
  48. 61 0
      pangu-components/pom.xml

+ 38 - 0
pangu-archetypes/pangu-archetype-sc/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 20 - 0
pangu-archetypes/pangu-archetype-sc/README.md

@@ -0,0 +1,20 @@
+
+# pangu-archetype-sc 
+
+maven archetype工程。
+
+## 构建&&安装archetype到本地maven
+
+mvn archetype:create-from-project
+
+cd target/generated-sources/archetype
+
+mvn install
+
+## 使用本地archetype创建工程
+
+mvn archetype:generate -DarchetypeCatalog=local
+
+## 使用本地模式进行开发
+
+在启动环境中添加spring.profiles.active=local

+ 0 - 0
pangu-archetypes/pangu-archetype-sc/logs/sys-info.log


+ 40 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-adapter/pom.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.hrsk.pangu</groupId>
+        <artifactId>pangu-archetype-sc</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>pangu-archetype-sc-adapter</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.hrsk.pangu</groupId>
+            <artifactId>pangu-archetype-sc-app</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

+ 1 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-adapter/src/main/java/com/hrsk/pangu/adapter/package-info.java

@@ -0,0 +1 @@
+package com.hrsk.pangu.adapter;

+ 27 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-app/pom.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.hrsk.pangu</groupId>
+        <artifactId>pangu-archetype-sc</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>pangu-archetype-sc-app</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.hrsk.pangu</groupId>
+            <artifactId>pangu-archetype-sc-infrastructure</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

+ 1 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-app/src/main/java/com/hrsk/pangu/app/package-info.java

@@ -0,0 +1 @@
+package com.hrsk.pangu.app;

+ 24 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-client/pom.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.hrsk.pangu</groupId>
+        <artifactId>pangu-archetype-sc</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>pangu-archetype-sc-client</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+
+    </dependencies>
+
+</project>

+ 1 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-client/src/main/java/com/hrsk/pangu/client/package-info.java

@@ -0,0 +1 @@
+package com.hrsk.pangu.client;

+ 20 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-domain/pom.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.hrsk.pangu</groupId>
+        <artifactId>pangu-archetype-sc</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>pangu-archetype-sc-domain</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+</project>

+ 1 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-domain/src/main/java/com/hrsk/pangu/domain/package-info.java

@@ -0,0 +1 @@
+package com.hrsk.pangu.domain;

+ 43 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/pom.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.hrsk.pangu</groupId>
+        <artifactId>pangu-archetype-sc</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>pangu-archetype-sc-infrastructure</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.hrsk.pangu</groupId>
+            <artifactId>pangu-archetype-sc-domain</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+    </dependencies>
+</project>

+ 1 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/package-info.java

@@ -0,0 +1 @@
+package com.hrsk.pangu.infrastructure;

+ 1 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/repository/database/entity/package-info.java

@@ -0,0 +1 @@
+package com.hrsk.pangu.infrastructure.repository.database.entity;

+ 1 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/repository/database/mapper/package-info.java

@@ -0,0 +1 @@
+package com.hrsk.pangu.infrastructure.repository.database.mapper;

+ 1 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/repository/database/package-info.java

@@ -0,0 +1 @@
+package com.hrsk.pangu.infrastructure.repository.database;

+ 1 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/repository/package-info.java

@@ -0,0 +1 @@
+package com.hrsk.pangu.infrastructure.repository;

+ 6 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/resources/db/data.sql

@@ -0,0 +1,6 @@
+/*  本地模式,h2数据库数据初始化脚本 **/
+
+SET FOREIGN_KEY_CHECKS=0;
+
+INSERT INTO `tb_archetype` (`id`, `status`, `create_userid`, `create_username`, `modify_userid`, `modify_username`)
+VALUES (1, 'ok', '10000', 'admin', '10000', 'admin');

+ 23 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/resources/db/schema.sql

@@ -0,0 +1,23 @@
+/* 本地模式,h2数据库表结构初始化脚本**/
+SET NAMES utf8 ;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+SET FOREIGN_KEY_CHECKS=0;
+
+/** 样例原型表 **/
+DROP TABLE IF EXISTS `tb_archetype`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!50503 SET character_set_client = utf8mb4 */;
+CREATE TABLE `tb_archetype` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `status` varchar(20) NOT NULL COMMENT '状态:created=已创建,deleted=已删除。',
+  `create_userid` varchar(100) DEFAULT NULL COMMENT '创建人',
+  `create_username` varchar(100) DEFAULT NULL COMMENT '创建用户名',
+  `modify_userid` varchar(100) DEFAULT NULL COMMENT '修改人ID',
+  `modify_username` varchar(100) DEFAULT NULL COMMENT '修改人名称',
+  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='原型表';

+ 18 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/resources/mybatis-config.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- mybatis的配置文件 -->
+<!DOCTYPE configuration
+        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-config.dtd">
+<configuration>
+    <!-- 开启驼峰映射 ,否则查询结果不能转成resultType-->
+    <settings>
+        <setting name="mapUnderscoreToCamelCase" value="true"/>
+    </settings>
+    <typeAliases>
+        <!--项目DataObject对应的包名-->
+        <package name="com.hrsk.pangu.infrastructure.repository.database.entity"/>
+    </typeAliases>
+    <mappers>
+        <!--<mapper resource="mybatis/ExampleMapper.xml"/>-->
+    </mappers>
+</configuration>

+ 6 - 0
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/resources/mybatis/ExampleMapper.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="xx">
+
+</mapper>

+ 101 - 0
pangu-archetypes/pangu-archetype-sc/pom.xml

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.hrsk.pangu</groupId>
+    <artifactId>pangu-archetype-sc</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+    <modules>
+        <module>start</module>
+        <module>pangu-archetype-sc-adapter</module>
+        <module>pangu-archetype-sc-app</module>
+        <module>pangu-archetype-sc-client</module>
+        <module>pangu-archetype-sc-domain</module>
+        <module>pangu-archetype-sc-infrastructure</module>
+    </modules>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <pangu.components.version>1.0.0</pangu.components.version>
+
+        <spring-boot.version>2.7.6</spring-boot.version>
+        <spring-cloud-alibaba.version>2021.0.5.0</spring-cloud-alibaba.version>
+        <mybatis-starter.version>2.2.2</mybatis-starter.version>
+        <mybatis-plus.version>3.5.4.1</mybatis-plus.version>
+        <druid-starter.version>1.2.9</druid-starter.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <dependencyManagement>
+        <dependencies>
+            <!-- 应用模块依赖-start -->
+            <dependency>
+                <groupId>com.hrsk.pangu</groupId>
+                <artifactId>start</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.hrsk.pangu</groupId>
+                <artifactId>pangu-archetype-sc-adapter</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.hrsk.pangu</groupId>
+                <artifactId>pangu-archetype-sc-client</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.hrsk.pangu</groupId>
+                <artifactId>pangu-archetype-sc-app</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.hrsk.pangu</groupId>
+                <artifactId>pangu-archetype-sc-infrastructure</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.hrsk.pangu</groupId>
+                <artifactId>pangu-archetype-sc-domain</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <!-- 应用模块依赖-end -->
+
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring-boot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.mybatis.spring.boot</groupId>
+                <artifactId>mybatis-spring-boot-starter</artifactId>
+                <version>${mybatis-starter.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>druid-spring-boot-starter</artifactId>
+                <version>${druid-starter.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+</project>

+ 28 - 0
pangu-archetypes/pangu-archetype-sc/start/pom.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.hrsk.pangu</groupId>
+        <artifactId>pangu-archetype-sc</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>start</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.hrsk.pangu</groupId>
+            <artifactId>pangu-archetype-sc-adapter</artifactId>
+        </dependency>
+    </dependencies>
+
+
+</project>

+ 31 - 0
pangu-archetypes/pangu-archetype-sc/start/src/main/java/com/hrsk/pangu/Application.java

@@ -0,0 +1,31 @@
+package com.hrsk.pangu;
+
+import lombok.extern.slf4j.Slf4j;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@Slf4j
+@SpringBootApplication
+@MapperScan("com.hrsk.pangu.infrastructure.repository.database.mapper")
+public class Application {
+    /**
+     * main函数
+     * @param args 参数
+     */
+    public static void main(String[] args) {
+        launch(args);
+    }
+
+    /**
+     * 引导方法
+     * @param args 参数
+     */
+    private static void launch(String[] args){
+        log.info("Begin to start Spring Boot Application ......");
+        long startTime = System.currentTimeMillis();
+        SpringApplication.run(Application.class, args);
+        long endTime = System.currentTimeMillis();
+        log.info("Spring Boot Application has been started, Time used: "+ (endTime - startTime) + "ms" );
+    }
+}

+ 26 - 0
pangu-archetypes/pangu-archetype-sc/start/src/main/resources/application-local.yaml

@@ -0,0 +1,26 @@
+#spring
+spring:
+  sql:
+    init:
+      schema-locations: classpath:db/schema.sql
+      data-locations: classpath:db/data.sql
+      platform: H2
+      encoding: utf-8
+  h2:
+    console:
+      enabled: true
+      settings:
+        web-allow-others: true
+      path: /h2
+  datasource:
+    driver-class-name: org.h2.Driver
+    url: jdbc:h2:mem:atlantis;MODE=MYSQL;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=true;INIT=CREATE SCHEMA IF NOT EXISTS atlantis
+    username: sa
+    password:
+    type: com.zaxxer.hikari.HikariDataSource
+    hikari:
+      minimum-idle: 5
+      idle-timeout: 180000
+      auto-commit: true
+      connection-timeout: 30000
+      connection-test-query: select 1

+ 18 - 0
pangu-archetypes/pangu-archetype-sc/start/src/main/resources/application.yaml

@@ -0,0 +1,18 @@
+#server
+server:
+  port: 8081
+  servlet:
+    context-path: /
+#spring
+spring:
+  application:
+    name: xx-server
+  profiles:
+    active: local
+#mybatis
+mybatis:
+  config-location: classpath:mybatis-config.xml
+#pageHelper
+pagehelper:
+  helper-dialect: mysql
+

+ 31 - 0
pangu-archetypes/pangu-archetype-sc/start/src/main/resources/logback-spring.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <!-- 日志存放路径 -->
+    <property name="log.path" value="./logs" />
+    <!-- 日志输出格式 -->
+    <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+    <!-- 控制台输出 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+    <!-- 系统日志输出 -->
+    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/sys-info.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+            <fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+    <logger name="com.bianlz.architecture.atlantis" level="info" />
+    <root level="info">
+        <appender-ref ref="console" />
+    </root>
+</configuration>

+ 38 - 0
pangu-components/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 17 - 0
pangu-components/README.md

@@ -0,0 +1,17 @@
+# 组件工程
+此工程为组件工程,对于公共组件的升级都在此工程下,后续新的组件在创建后都需要在此处进行登记。
+
+## 组件登记
+
+### 1.pangu-component-domain-start
+    
+    DDD相关组件starter工程,提供DDD相关能力的组件。
+
+### 2.pangu-component-dto
+
+    DTO组件工程,提供数据传输对象标准。
+
+    
+    
+    
+

+ 38 - 0
pangu-components/pangu-component-domain-starter/pom.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.hrsk.pangu</groupId>
+        <artifactId>component-parent</artifactId>
+        <version>1.0.0</version>
+    </parent>
+
+    <artifactId>pangu-component-domain-starter</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-autoconfigure</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <!-- 测试包 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>

+ 57 - 0
pangu-components/pangu-component-domain-starter/src/main/java/com/hrsk/pangu/domain/ApplicationContextHelper.java

@@ -0,0 +1,57 @@
+package com.hrsk.pangu.domain;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+@Component("colaDomainApplicationContextHelper")
+public class ApplicationContextHelper implements ApplicationContextAware {
+    private static ApplicationContext applicationContext;
+
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+        ApplicationContextHelper.applicationContext = applicationContext;
+    }
+
+    public static <T> T getBean(Class<T> targetClz) {
+        T beanInstance = null;
+        //优先按type查
+        try {
+            beanInstance = (T)applicationContext.getBean(targetClz);
+        } catch (Exception e) {
+        }
+        //按name查
+        if (beanInstance == null) {
+            String simpleName = targetClz.getSimpleName();
+            //首字母小写
+            simpleName = Character.toLowerCase(simpleName.charAt(0)) + simpleName.substring(1);
+            beanInstance = (T)applicationContext.getBean(simpleName);
+        }
+        if (beanInstance == null) {
+            throw new RuntimeException("Component " + targetClz + " can not be found in Spring Container");
+        }
+        return beanInstance;
+    }
+
+    public static Object getBean(String claz) {
+        return ApplicationContextHelper.applicationContext.getBean(claz);
+    }
+
+    public static <T> T getBean(String name, Class<T> requiredType) {
+        return ApplicationContextHelper.applicationContext.getBean(name, requiredType);
+    }
+
+    public static <T> T getBean(Class<T> requiredType, Object... params) {
+        return ApplicationContextHelper.applicationContext.getBean(requiredType, params);
+    }
+
+    public static ApplicationContext getApplicationContext() {
+        return applicationContext;
+    }
+}

+ 21 - 0
pangu-components/pangu-component-domain-starter/src/main/java/com/hrsk/pangu/domain/DomainAutoConfiguration.java

@@ -0,0 +1,21 @@
+package com.hrsk.pangu.domain;
+
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+@Configuration
+public class DomainAutoConfiguration {
+
+    @Bean
+    @ConditionalOnMissingBean(ApplicationContextHelper.class)
+    public ApplicationContextHelper applicationContextHelper() {
+        return new ApplicationContextHelper();
+    }
+}

+ 14 - 0
pangu-components/pangu-component-domain-starter/src/main/java/com/hrsk/pangu/domain/DomainFactory.java

@@ -0,0 +1,14 @@
+package com.hrsk.pangu.domain;
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+public class DomainFactory {
+
+    public static <T> T create(Class<T> entityClz){
+        return ApplicationContextHelper.getBean(entityClz);
+    }
+
+}

+ 20 - 0
pangu-components/pangu-component-domain-starter/src/main/java/com/hrsk/pangu/domain/Entity.java

@@ -0,0 +1,20 @@
+package com.hrsk.pangu.domain;
+
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+import java.lang.annotation.*;
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+@Component
+@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+public @interface Entity {
+}

+ 1 - 0
pangu-components/pangu-component-domain-starter/src/main/resources/META-INF/spring.factories

@@ -0,0 +1 @@
+org.springframework.boot.autoconfigure.EnableAutoConfiguration =com.hrsk.pangu.domain.DomainAutoConfiguration

+ 20 - 0
pangu-components/pangu-component-dto/pom.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.hrsk.pangu</groupId>
+        <artifactId>component-parent</artifactId>
+        <version>1.0.0</version>
+    </parent>
+
+    <artifactId>pangu-component-dto</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+</project>

+ 67 - 0
pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/BizScenario.java

@@ -0,0 +1,67 @@
+package com.hrsk.pangu.dto;
+
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+public class BizScenario {
+    public final static String DEFAULT_BIZ_ID = "#defaultBizId#";
+    public final static String DEFAULT_USE_CASE = "#defaultUseCase#";
+    public final static String DEFAULT_SCENARIO = "#defaultScenario#";
+    private final static String DOT_SEPARATOR = ".";
+
+    /**
+     * bizId is used to identify a business, such as "tmall", it's nullable if there is only one biz
+     */
+    private String bizId = DEFAULT_BIZ_ID;
+
+    /**
+     * useCase is used to identify a use case, such as "placeOrder", can not be null
+     */
+    private String useCase = DEFAULT_USE_CASE;
+
+    /**
+     * scenario is used to identify a use case, such as "88vip","normal", can not be null
+     */
+    private String scenario = DEFAULT_SCENARIO;
+
+    /**
+     * For above case, the BizScenario will be "tmall.placeOrder.88vip",
+     * with this code, we can provide extension processing other than "tmall.placeOrder.normal" scenario.
+     *
+     * @return
+     */
+    public String getUniqueIdentity(){
+        return bizId + DOT_SEPARATOR + useCase + DOT_SEPARATOR + scenario;
+    }
+
+    public static BizScenario valueOf(String bizId, String useCase, String scenario){
+        BizScenario bizScenario = new BizScenario();
+        bizScenario.bizId = bizId;
+        bizScenario.useCase = useCase;
+        bizScenario.scenario = scenario;
+        return bizScenario;
+    }
+
+    public static BizScenario valueOf(String bizId, String useCase){
+        return BizScenario.valueOf(bizId, useCase, DEFAULT_SCENARIO);
+    }
+
+    public static BizScenario valueOf(String bizId){
+        return BizScenario.valueOf(bizId, DEFAULT_USE_CASE, DEFAULT_SCENARIO);
+    }
+
+    public static BizScenario newDefault(){
+        return BizScenario.valueOf(DEFAULT_BIZ_ID, DEFAULT_USE_CASE, DEFAULT_SCENARIO);
+    }
+
+    public String getIdentityWithDefaultScenario(){
+        return bizId + DOT_SEPARATOR + useCase + DOT_SEPARATOR + DEFAULT_SCENARIO;
+    }
+
+    public String getIdentityWithDefaultUseCase(){
+        return bizId + DOT_SEPARATOR + DEFAULT_USE_CASE + DOT_SEPARATOR + DEFAULT_SCENARIO;
+    }
+}

+ 39 - 0
pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/ClientObject.java

@@ -0,0 +1,39 @@
+package com.hrsk.pangu.dto;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+public abstract class ClientObject implements Serializable{
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * This is for extended values
+     */
+    protected Map<String, Object> extValues = new HashMap<String, Object>();
+
+    public Object getExtField(String key){
+        if(extValues != null){
+            return extValues.get(key);
+        }
+        return null;
+    }
+
+    public void putExtField(String fieldName, Object value){
+        this.extValues.put(fieldName, value);
+    }
+
+    public Map<String, Object> getExtValues() {
+        return extValues;
+    }
+
+    public void setExtValues(Map<String, Object> extValues) {
+        this.extValues = extValues;
+    }
+}

+ 12 - 0
pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/Command.java

@@ -0,0 +1,12 @@
+package com.hrsk.pangu.dto;
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+public abstract class Command extends DTO {
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 14 - 0
pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/DTO.java

@@ -0,0 +1,14 @@
+package com.hrsk.pangu.dto;
+
+import java.io.Serializable;
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+public abstract class DTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 62 - 0
pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/MultiResponse.java

@@ -0,0 +1,62 @@
+package com.hrsk.pangu.dto;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+public class MultiResponse<T> extends Response {
+
+    private static final long serialVersionUID = 1L;
+
+    private Collection<T> data;
+
+    public List<T> getData() {
+        if (null == data) {
+            return Collections.emptyList();
+        }
+        if (data instanceof List) {
+            return (List<T>) data;
+        }
+        return new ArrayList<>(data);
+    }
+
+    public void setData(Collection<T> data) {
+        this.data = data;
+    }
+
+    public boolean isEmpty() {
+        return data == null || data.isEmpty();
+    }
+
+    public boolean isNotEmpty() {
+        return !isEmpty();
+    }
+
+    public static MultiResponse buildSuccess() {
+        MultiResponse response = new MultiResponse();
+        response.setSuccess(true);
+        return response;
+    }
+
+    public static MultiResponse buildFailure(String errCode, String errMessage) {
+        MultiResponse response = new MultiResponse();
+        response.setSuccess(false);
+        response.setErrCode(errCode);
+        response.setErrMessage(errMessage);
+        return response;
+    }
+
+    public static <T> MultiResponse<T> of(Collection<T> data) {
+        MultiResponse<T> response = new MultiResponse<>();
+        response.setSuccess(true);
+        response.setData(data);
+        return response;
+    }
+
+}

+ 96 - 0
pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/PageQuery.java

@@ -0,0 +1,96 @@
+package com.hrsk.pangu.dto;
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+public abstract class PageQuery extends Query {
+    private static final long serialVersionUID = 1L;
+
+    public static final String ASC = "ASC";
+
+    public static final String DESC = "DESC";
+
+    private static final int DEFAULT_PAGE_SIZE = 10;
+
+    private int pageSize = DEFAULT_PAGE_SIZE;
+
+    private int pageIndex = 1;
+
+    private String orderBy;
+
+    private String orderDirection = DESC;
+
+    private String groupBy;
+
+    private boolean needTotalCount = true;
+
+    public int getPageIndex() {
+        if (pageIndex < 1) {
+            return 1;
+        }
+        return pageIndex;
+    }
+
+    public PageQuery setPageIndex(int pageIndex) {
+        this.pageIndex = pageIndex;
+        return this;
+    }
+
+    public int getPageSize() {
+        if (pageSize < 1) {
+            pageSize = DEFAULT_PAGE_SIZE;
+        }
+        return pageSize;
+    }
+
+    public PageQuery setPageSize(int pageSize) {
+        if (pageSize < 1) {
+            pageSize = DEFAULT_PAGE_SIZE;
+        }
+        this.pageSize = pageSize;
+        return this;
+    }
+
+    public int getOffset() {
+        return (getPageIndex() - 1) * getPageSize();
+    }
+
+    public String getOrderBy() {
+        return orderBy;
+    }
+
+    public PageQuery setOrderBy(String orderBy) {
+        this.orderBy = orderBy;
+        return this;
+    }
+
+    public String getOrderDirection() {
+        return orderDirection;
+    }
+
+    public PageQuery setOrderDirection(String orderDirection) {
+        if (ASC.equalsIgnoreCase(orderDirection) || DESC.equalsIgnoreCase(orderDirection)) {
+            this.orderDirection = orderDirection;
+        }
+        return this;
+    }
+
+    public String getGroupBy() {
+        return groupBy;
+    }
+
+    public void setGroupBy(String groupBy) {
+        this.groupBy = groupBy;
+    }
+
+    public boolean isNeedTotalCount() {
+        return needTotalCount;
+    }
+
+    public void setNeedTotalCount(boolean needTotalCount) {
+        this.needTotalCount = needTotalCount;
+    }
+
+}

+ 124 - 0
pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/PageResponse.java

@@ -0,0 +1,124 @@
+package com.hrsk.pangu.dto;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+public class PageResponse<T> extends Response {
+
+    private static final long serialVersionUID = 1L;
+
+    private int totalCount = 0;
+
+    private int pageSize = 1;
+
+    private int pageIndex = 1;
+
+    private Collection<T> data;
+
+    public int getTotalCount() {
+        return totalCount;
+    }
+
+    public void setTotalCount(int totalCount) {
+        this.totalCount = totalCount;
+    }
+
+    public int getPageSize() {
+        if (pageSize < 1) {
+            return 1;
+        }
+        return pageSize;
+    }
+
+    public void setPageSize(int pageSize) {
+        if (pageSize < 1) {
+            this.pageSize = 1;
+        } else {
+            this.pageSize = pageSize;
+        }
+    }
+
+    public int getPageIndex() {
+        if (pageIndex < 1) {
+            return 1;
+        }
+        return pageIndex;
+    }
+
+    public void setPageIndex(int pageIndex) {
+        if (pageIndex < 1) {
+            this.pageIndex = 1;
+        } else {
+            this.pageIndex = pageIndex;
+        }
+    }
+
+    public List<T> getData() {
+        if (null == data) {
+            return Collections.emptyList();
+        }
+        if (data instanceof List) {
+            return (List<T>) data;
+        }
+        return new ArrayList<>(data);
+    }
+
+    public void setData(Collection<T> data) {
+        this.data = data;
+    }
+
+    public int getTotalPages() {
+        return this.totalCount % this.pageSize == 0 ? this.totalCount
+            / this.pageSize : (this.totalCount / this.pageSize) + 1;
+    }
+
+    public boolean isEmpty() {
+        return data == null || data.isEmpty();
+    }
+
+    public boolean isNotEmpty() {
+        return !isEmpty();
+    }
+
+    public static PageResponse buildSuccess() {
+        PageResponse response = new PageResponse();
+        response.setSuccess(true);
+        return response;
+    }
+
+    public static PageResponse buildFailure(String errCode, String errMessage) {
+        PageResponse response = new PageResponse();
+        response.setSuccess(false);
+        response.setErrCode(errCode);
+        response.setErrMessage(errMessage);
+        return response;
+    }
+
+    public static <T> PageResponse<T> of(int pageSize, int pageIndex) {
+        PageResponse<T> response = new PageResponse<>();
+        response.setSuccess(true);
+        response.setData(Collections.emptyList());
+        response.setTotalCount(0);
+        response.setPageSize(pageSize);
+        response.setPageIndex(pageIndex);
+        return response;
+    }
+
+    public static <T> PageResponse<T> of(Collection<T> data, int totalCount, int pageSize, int pageIndex) {
+        PageResponse<T> response = new PageResponse<>();
+        response.setSuccess(true);
+        response.setData(data);
+        response.setTotalCount(totalCount);
+        response.setPageSize(pageSize);
+        response.setPageIndex(pageIndex);
+        return response;
+    }
+
+}

+ 12 - 0
pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/Query.java

@@ -0,0 +1,12 @@
+package com.hrsk.pangu.dto;
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+public abstract class Query extends Command {
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 61 - 0
pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/Response.java

@@ -0,0 +1,61 @@
+package com.hrsk.pangu.dto;
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+public class Response extends DTO {
+
+    private static final long serialVersionUID = 1L;
+
+    private boolean success;
+
+    private String errCode;
+
+    private String errMessage;
+
+    public boolean isSuccess() {
+        return success;
+    }
+
+    public void setSuccess(boolean success) {
+        this.success = success;
+    }
+
+    public String getErrCode() {
+        return errCode;
+    }
+
+    public void setErrCode(String errCode) {
+        this.errCode = errCode;
+    }
+
+    public String getErrMessage() {
+        return errMessage;
+    }
+
+    public void setErrMessage(String errMessage) {
+        this.errMessage = errMessage;
+    }
+
+    @Override
+    public String toString() {
+        return "Response [success=" + success + ", errCode=" + errCode + ", errMessage=" + errMessage + "]";
+    }
+
+    public static Response buildSuccess() {
+        Response response = new Response();
+        response.setSuccess(true);
+        return response;
+    }
+
+    public static Response buildFailure(String errCode, String errMessage) {
+        Response response = new Response();
+        response.setSuccess(false);
+        response.setErrCode(errCode);
+        response.setErrMessage(errMessage);
+        return response;
+    }
+
+}

+ 11 - 0
pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/Scope.java

@@ -0,0 +1,11 @@
+package com.hrsk.pangu.dto;
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+public abstract class Scope extends DTO {
+
+    private static final long serialVersionUID = 1L;
+}

+ 43 - 0
pangu-components/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/SingleResponse.java

@@ -0,0 +1,43 @@
+package com.hrsk.pangu.dto;
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-08-05 17:20
+ * @description: copy from https://github.com/alibaba/COLA/tree/COLA4.3.2?tab=readme-ov-file
+ **/
+public class SingleResponse<T> extends Response {
+
+    private static final long serialVersionUID = 1L;
+
+    private T data;
+
+    public T getData() {
+        return data;
+    }
+
+    public void setData(T data) {
+        this.data = data;
+    }
+
+    public static SingleResponse buildSuccess() {
+        SingleResponse response = new SingleResponse();
+        response.setSuccess(true);
+        return response;
+    }
+
+    public static SingleResponse buildFailure(String errCode, String errMessage) {
+        SingleResponse response = new SingleResponse();
+        response.setSuccess(false);
+        response.setErrCode(errCode);
+        response.setErrMessage(errMessage);
+        return response;
+    }
+
+    public static <T> SingleResponse<T> of(T data) {
+        SingleResponse<T> response = new SingleResponse<>();
+        response.setSuccess(true);
+        response.setData(data);
+        return response;
+    }
+
+}

+ 61 - 0
pangu-components/pom.xml

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.hrsk.pangu</groupId>
+    <artifactId>component-parent</artifactId>
+    <version>1.0.0</version>
+    <packaging>pom</packaging>
+    <modules>
+        <module>pangu-component-domain-starter</module>
+        <module>pangu-component-dto</module>
+    </modules>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
+        <spring.boot.version>2.7.5</spring.boot.version>
+        <fastjson.version>1.2.83</fastjson.version>
+        <commons-cli.version>1.5.0</commons-cli.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring.boot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>fastjson</artifactId>
+                <version>${fastjson.version}</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>commons-cli</groupId>
+                <artifactId>commons-cli</artifactId>
+                <version>${commons-cli.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+</project>