Procházet zdrojové kódy

delete pangu-archetype-sc 删除sc骨架
add pangu-archetype-web-domain 添加slf4j-api依赖
add start 添加配置文件
add inf 添加配置文件
add pangu-component-dto 添加DTO模块
add pangu-component-domain-starter 添加DOMAIN模块
add pangu-component-tool 添加TOOL模块

bianlz před 3 měsíci
rodič
revize
e7f9920bb3
53 změnil soubory, kde provedl 997 přidání a 121 odebrání
  1. 0 23
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/resources/db/schema.sql
  2. 0 6
      pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/src/main/resources/mybatis/ExampleMapper.xml
  3. 1 1
      pangu-archetypes/pangu-archetype-web/README.md
  4. 0 0
      pangu-archetypes/pangu-archetype-web/logs/sys-info.log
  5. 1 0
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-adapter/src/main/java/com/hrsk/pangu/adapter/controller/package-info.java
  6. 0 0
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-adapter/src/main/java/com/hrsk/pangu/adapter/package-info.java
  7. 0 0
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-app/src/main/java/com/hrsk/pangu/app/package-info.java
  8. 4 7
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-client/pom.xml
  9. 0 0
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-client/src/main/java/com/hrsk/pangu/client/package-info.java
  10. 7 9
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-domain/pom.xml
  11. 0 0
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-domain/src/main/java/com/hrsk/pangu/domain/package-info.java
  12. 14 11
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-infrastructure/pom.xml
  13. 0 0
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/package-info.java
  14. 0 0
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/repository/database/entity/package-info.java
  15. 0 0
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/repository/database/mapper/package-info.java
  16. 0 0
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/repository/database/package-info.java
  17. 0 0
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-infrastructure/src/main/java/com/hrsk/pangu/infrastructure/repository/package-info.java
  18. 0 0
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-infrastructure/src/main/resources/db/data.sql
  19. 23 0
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-infrastructure/src/main/resources/db/schema.sql
  20. 0 0
      pangu-archetypes/pangu-archetype-web/pangu-archetype-web-infrastructure/src/main/resources/mybatis-config.xml
  21. 32 31
      pangu-archetypes/pangu-archetype-web/pom.xml
  22. 0 0
      pangu-archetypes/pangu-archetype-web/start/src/main/java/com/hrsk/pangu/Application.java
  23. 0 0
      pangu-archetypes/pangu-archetype-web/start/src/main/resources/application-local.yaml
  24. 0 0
      pangu-archetypes/pangu-archetype-web/start/src/main/resources/application.yaml
  25. 1 1
      pangu-archetypes/pangu-archetype-web/start/src/main/resources/logback-spring.xml
  26. 0 0
      pangu-component/.gitignore
  27. 17 0
      pangu-component/README.md
  28. 8 11
      pangu-component/pangu-component-domain-starter/pom.xml
  29. 57 0
      pangu-component/pangu-component-domain-starter/src/main/java/com/hrsk/pangu/domain/ApplicationContextHelper.java
  30. 21 0
      pangu-component/pangu-component-domain-starter/src/main/java/com/hrsk/pangu/domain/DomainAutoConfiguration.java
  31. 14 0
      pangu-component/pangu-component-domain-starter/src/main/java/com/hrsk/pangu/domain/DomainFactory.java
  32. 20 0
      pangu-component/pangu-component-domain-starter/src/main/java/com/hrsk/pangu/domain/Entity.java
  33. 1 0
      pangu-component/pangu-component-domain-starter/src/main/resources/META-INF/spring.factories
  34. 3 11
      pangu-component/pangu-component-dto/pom.xml
  35. 67 0
      pangu-component/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/BizScenario.java
  36. 39 0
      pangu-component/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/ClientObject.java
  37. 12 0
      pangu-component/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/Command.java
  38. 14 0
      pangu-component/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/DTO.java
  39. 62 0
      pangu-component/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/MultiResponse.java
  40. 96 0
      pangu-component/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/PageQuery.java
  41. 124 0
      pangu-component/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/PageResponse.java
  42. 12 0
      pangu-component/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/Query.java
  43. 61 0
      pangu-component/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/Response.java
  44. 11 0
      pangu-component/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/Scope.java
  45. 45 0
      pangu-component/pangu-component-dto/src/main/java/com/hrsk/pangu/dto/SingleResponse.java
  46. 3 10
      pangu-component/pangu-component-tool/pom.xml
  47. 40 0
      pangu-component/pangu-component-tool/src/main/java/com/hrsk/pangu/tool/exception/BaseException.java
  48. 30 0
      pangu-component/pangu-component-tool/src/main/java/com/hrsk/pangu/tool/exception/BizException.java
  49. 35 0
      pangu-component/pangu-component-tool/src/main/java/com/hrsk/pangu/tool/exception/BizPreconditions.java
  50. 34 0
      pangu-component/pangu-component-tool/src/main/java/com/hrsk/pangu/tool/exception/ExceptionFactory.java
  51. 30 0
      pangu-component/pangu-component-tool/src/main/java/com/hrsk/pangu/tool/exception/SysException.java
  52. 1 0
      pangu-component/pangu-component-tool/src/main/java/com/hrsk/pangu/tool/package-info.java
  53. 57 0
      pangu-component/pom.xml

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

@@ -1,23 +0,0 @@
-/* 本地模式,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='原型表';

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

@@ -1,6 +0,0 @@
-<?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>

+ 1 - 1
pangu-archetypes/pangu-archetype-sc/README.md → pangu-archetypes/pangu-archetype-web/README.md

@@ -1,5 +1,5 @@
 
-# pangu-archetype-sc 
+# pangu-archetype-sc
 
 maven archetype工程。
 

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


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

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

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


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


+ 4 - 7
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-client/pom.xml → pangu-archetypes/pangu-archetype-web/pangu-archetype-web-client/pom.xml

@@ -1,15 +1,13 @@
 <?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">
+<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>
+        <artifactId>pangu-archetype-web</artifactId>
         <version>1.0-SNAPSHOT</version>
     </parent>
 
-    <artifactId>pangu-archetype-sc-client</artifactId>
+    <artifactId>pangu-archetype-web-client</artifactId>
 
     <properties>
         <maven.compiler.source>8</maven.compiler.source>
@@ -23,5 +21,4 @@
             <artifactId>pangu-component-dto</artifactId>
         </dependency>
     </dependencies>
-
-</project>
+</project>

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


+ 7 - 9
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-domain/pom.xml → pangu-archetypes/pangu-archetype-web/pangu-archetype-web-domain/pom.xml

@@ -1,15 +1,13 @@
 <?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">
+<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>
+        <artifactId>pangu-archetype-web</artifactId>
         <version>1.0-SNAPSHOT</version>
     </parent>
 
-    <artifactId>pangu-archetype-sc-domain</artifactId>
+    <artifactId>pangu-archetype-web-domain</artifactId>
 
     <properties>
         <maven.compiler.source>8</maven.compiler.source>
@@ -24,11 +22,11 @@
         </dependency>
         <dependency>
             <groupId>com.hrsk.pangu</groupId>
-            <artifactId>pangu-component-dto</artifactId>
+            <artifactId>pangu-component-tool</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.hrsk.pangu</groupId>
-            <artifactId>pangu-component-tool</artifactId>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
         </dependency>
     </dependencies>
-</project>
+</project>

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


+ 14 - 11
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-infrastructure/pom.xml → pangu-archetypes/pangu-archetype-web/pangu-archetype-web-infrastructure/pom.xml

@@ -1,15 +1,13 @@
 <?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">
+<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>
+        <artifactId>pangu-archetype-web</artifactId>
         <version>1.0-SNAPSHOT</version>
     </parent>
 
-    <artifactId>pangu-archetype-sc-infrastructure</artifactId>
+    <artifactId>pangu-archetype-web-infrastructure</artifactId>
 
     <properties>
         <maven.compiler.source>8</maven.compiler.source>
@@ -20,19 +18,24 @@
     <dependencies>
         <dependency>
             <groupId>com.hrsk.pangu</groupId>
-            <artifactId>pangu-archetype-sc-domain</artifactId>
+            <artifactId>pangu-archetype-web-domain</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.hrsk.pangu</groupId>
+            <artifactId>pangu-archetype-web-client</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>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid-spring-boot-starter</artifactId>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>com.h2database</groupId>
@@ -40,4 +43,4 @@
             <scope>runtime</scope>
         </dependency>
     </dependencies>
-</project>
+</project>

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


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


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


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


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


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


+ 23 - 0
pangu-archetypes/pangu-archetype-web/pangu-archetype-web-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='原型表';

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


+ 32 - 31
pangu-archetypes/pangu-archetype-sc/pom.xml → pangu-archetypes/pangu-archetype-web/pom.xml

@@ -1,35 +1,36 @@
-<?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">
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<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>
+    <artifactId>pangu-archetype-web</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>
+
+    <description>惠融数科基于COLA构建的应用骨架</description>
 
     <properties>
         <maven.compiler.source>8</maven.compiler.source>
         <maven.compiler.target>8</maven.compiler.target>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 
+        <atlantis-component.version>1.0.0</atlantis-component.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>
-        <pangu-component.version>1.0.0</pangu-component.version>
     </properties>
 
+    <modules>
+        <module>start</module>
+        <module>pangu-archetype-web-app</module>
+        <module>pangu-archetype-web-adapter</module>
+        <module>pangu-archetype-web-client</module>
+        <module>pangu-archetype-web-infrastructure</module>
+        <module>pangu-archetype-web-domain</module>
+    </modules>
+
     <dependencies>
         <dependency>
             <groupId>org.projectlombok</groupId>
@@ -53,38 +54,38 @@
             </dependency>
             <dependency>
                 <groupId>com.hrsk.pangu</groupId>
-                <artifactId>pangu-component-bom</artifactId>
-                <version>${pangu-component.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
+                <artifactId>pangu-archetype-web-app</artifactId>
+                <version>1.0-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>com.hrsk.pangu</groupId>
-                <artifactId>pangu-archetype-sc-adapter</artifactId>
-                <version>${project.version}</version>
+                <artifactId>pangu-archetype-web-adapter</artifactId>
+                <version>1.0-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>com.hrsk.pangu</groupId>
-                <artifactId>pangu-archetype-sc-client</artifactId>
-                <version>${project.version}</version>
+                <artifactId>pangu-archetype-web-client</artifactId>
+                <version>1.0-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>com.hrsk.pangu</groupId>
-                <artifactId>pangu-archetype-sc-app</artifactId>
-                <version>${project.version}</version>
+                <artifactId>pangu-archetype-web-infrastructure</artifactId>
+                <version>1.0-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>com.hrsk.pangu</groupId>
-                <artifactId>pangu-archetype-sc-infrastructure</artifactId>
-                <version>${project.version}</version>
+                <artifactId>pangu-archetype-web-domain</artifactId>
+                <version>1.0-SNAPSHOT</version>
             </dependency>
+            <!-- 应用模块依赖-end -->
+
             <dependency>
                 <groupId>com.hrsk.pangu</groupId>
-                <artifactId>pangu-archetype-sc-domain</artifactId>
-                <version>${project.version}</version>
+                <artifactId>pangu-component-bom</artifactId>
+                <version>${atlantis-component.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
             </dependency>
-            <!-- 应用模块依赖-end -->
-
             <dependency>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-dependencies</artifactId>
@@ -105,4 +106,4 @@
         </dependencies>
     </dependencyManagement>
 
-</project>
+</project>

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


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


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


+ 1 - 1
pangu-archetypes/pangu-archetype-sc/start/src/main/resources/logback-spring.xml → pangu-archetypes/pangu-archetype-web/start/src/main/resources/logback-spring.xml

@@ -24,7 +24,7 @@
             <pattern>${log.pattern}</pattern>
         </encoder>
     </appender>
-    <logger name="com.bianlz.architecture.atlantis" level="info" />
+
     <root level="info">
         <appender-ref ref="console" />
     </root>

+ 0 - 0
pangu-archetypes/pangu-archetype-sc/.gitignore → pangu-component/.gitignore


+ 17 - 0
pangu-component/README.md

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

+ 8 - 11
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-adapter/pom.xml → pangu-component/pangu-component-domain-starter/pom.xml

@@ -5,11 +5,11 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>com.hrsk.pangu</groupId>
-        <artifactId>pangu-archetype-sc</artifactId>
-        <version>1.0-SNAPSHOT</version>
+        <artifactId>component-parent</artifactId>
+        <version>1.0.0</version>
     </parent>
 
-    <artifactId>pangu-archetype-sc-adapter</artifactId>
+    <artifactId>pangu-component-domain-starter</artifactId>
 
     <properties>
         <maven.compiler.source>8</maven.compiler.source>
@@ -19,22 +19,19 @@
 
     <dependencies>
         <dependency>
-            <groupId>com.hrsk.pangu</groupId>
-            <artifactId>pangu-archetype-sc-app</artifactId>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-autoconfigure</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
+            <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>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-thymeleaf</artifactId>
-        </dependency>
     </dependencies>
-
 </project>

+ 57 - 0
pangu-component/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("panguDomainApplicationContextHelper")
+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-component/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-component/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-component/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-component/pangu-component-domain-starter/src/main/resources/META-INF/spring.factories

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

+ 3 - 11
pangu-archetypes/pangu-archetype-sc/start/pom.xml → pangu-component/pangu-component-dto/pom.xml

@@ -5,11 +5,11 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>com.hrsk.pangu</groupId>
-        <artifactId>pangu-archetype-sc</artifactId>
-        <version>1.0-SNAPSHOT</version>
+        <artifactId>component-parent</artifactId>
+        <version>1.0.0</version>
     </parent>
 
-    <artifactId>start</artifactId>
+    <artifactId>pangu-component-dto</artifactId>
 
     <properties>
         <maven.compiler.source>8</maven.compiler.source>
@@ -17,12 +17,4 @@
         <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>

+ 67 - 0
pangu-component/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-component/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-component/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-component/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-component/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-component/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-component/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-component/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-component/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-component/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;
+}

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

@@ -0,0 +1,45 @@
+package com.hrsk.pangu.dto;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @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;
+    }
+
+}

+ 3 - 10
pangu-archetypes/pangu-archetype-sc/pangu-archetype-sc-app/pom.xml → pangu-component/pangu-component-tool/pom.xml

@@ -5,11 +5,11 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>com.hrsk.pangu</groupId>
-        <artifactId>pangu-archetype-sc</artifactId>
-        <version>1.0-SNAPSHOT</version>
+        <artifactId>component-parent</artifactId>
+        <version>1.0.0</version>
     </parent>
 
-    <artifactId>pangu-archetype-sc-app</artifactId>
+    <artifactId>pangu-component-tool</artifactId>
 
     <properties>
         <maven.compiler.source>8</maven.compiler.source>
@@ -17,11 +17,4 @@
         <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>

+ 40 - 0
pangu-component/pangu-component-tool/src/main/java/com/hrsk/pangu/tool/exception/BaseException.java

@@ -0,0 +1,40 @@
+package com.hrsk.pangu.tool.exception;
+
+/**
+ * @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 BaseException extends RuntimeException {
+
+    private static final long serialVersionUID = 1L;
+
+    private String errCode;
+
+    public BaseException(String errMessage) {
+        super(errMessage);
+    }
+
+    public BaseException(String errCode, String errMessage) {
+        super(errMessage);
+        this.errCode = errCode;
+    }
+
+    public BaseException(String errMessage, Throwable e) {
+        super(errMessage, e);
+    }
+
+    public BaseException(String errCode, String errMessage, Throwable e) {
+        super(errMessage, e);
+        this.errCode = errCode;
+    }
+
+    public String getErrCode() {
+        return errCode;
+    }
+
+    public void setErrCode(String errCode) {
+        this.errCode = errCode;
+    }
+
+}

+ 30 - 0
pangu-component/pangu-component-tool/src/main/java/com/hrsk/pangu/tool/exception/BizException.java

@@ -0,0 +1,30 @@
+package com.hrsk.pangu.tool.exception;
+
+/**
+ * @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 BizException extends BaseException {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final String DEFAULT_ERR_CODE = "BIZ_ERROR";
+
+    public BizException(String errMessage) {
+        super(DEFAULT_ERR_CODE, errMessage);
+    }
+
+    public BizException(String errCode, String errMessage) {
+        super(errCode, errMessage);
+    }
+
+    public BizException(String errMessage, Throwable e) {
+        super(DEFAULT_ERR_CODE, errMessage, e);
+    }
+
+    public BizException(String errorCode, String errMessage, Throwable e) {
+        super(errorCode, errMessage, e);
+    }
+
+}

+ 35 - 0
pangu-component/pangu-component-tool/src/main/java/com/hrsk/pangu/tool/exception/BizPreconditions.java

@@ -0,0 +1,35 @@
+package com.hrsk.pangu.tool.exception;
+
+
+/**
+ * @author: bianlanzhou
+ * @create: 2024-07-27 10:04
+ * @description: FROM GUAVA PRECONDITION,BIZ业务校验
+ **/
+public class BizPreconditions {
+    /**
+     * 验证参数
+     * @param expression 表达式
+     * @param errorMessage 错误信息
+     */
+    public static void checkArgument(boolean expression, String errorMessage) {
+        if (!expression) {
+            throw new BizException(errorMessage);
+        }
+    }
+
+    /**
+     * 验证不为空
+     * @param reference 入参
+     * @param errorMessage 错误信息
+     * @return T
+     * @param <T> T
+     */
+    public static <T> T checkNotNull(T reference,String errorMessage) {
+        if (reference == null) {
+            throw new BizException(errorMessage);
+        } else {
+            return reference;
+        }
+    }
+}

+ 34 - 0
pangu-component/pangu-component-tool/src/main/java/com/hrsk/pangu/tool/exception/ExceptionFactory.java

@@ -0,0 +1,34 @@
+package com.hrsk.pangu.tool.exception;
+
+/**
+ * @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 ExceptionFactory {
+
+    public static BizException bizException(String errorMessage) {
+        return new BizException(errorMessage);
+    }
+
+    public static BizException bizException(String errorCode, String errorMessage) {
+        return new BizException(errorCode, errorMessage);
+    }
+
+    public static com.hrsk.pangu.tool.exception.SysException sysException(String errorMessage) {
+        return new com.hrsk.pangu.tool.exception.SysException(errorMessage);
+    }
+
+    public static SysException sysException(String errorCode, String errorMessage) {
+        return new SysException(errorCode, errorMessage);
+    }
+
+    public static com.hrsk.pangu.tool.exception.SysException sysException(String errorMessage, Throwable e) {
+        return new SysException(errorMessage, e);
+    }
+
+    public static SysException sysException(String errorCode, String errorMessage, Throwable e) {
+        return new SysException(errorCode, errorMessage, e);
+    }
+
+}

+ 30 - 0
pangu-component/pangu-component-tool/src/main/java/com/hrsk/pangu/tool/exception/SysException.java

@@ -0,0 +1,30 @@
+package com.hrsk.pangu.tool.exception;
+
+/**
+ * @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 SysException extends BaseException {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final String DEFAULT_ERR_CODE = "SYS_ERROR";
+
+    public SysException(String errMessage) {
+        super(DEFAULT_ERR_CODE, errMessage);
+    }
+
+    public SysException(String errCode, String errMessage) {
+        super(errCode, errMessage);
+    }
+
+    public SysException(String errMessage, Throwable e) {
+        super(DEFAULT_ERR_CODE, errMessage, e);
+    }
+
+    public SysException(String errorCode, String errMessage, Throwable e) {
+        super(errorCode, errMessage, e);
+    }
+
+}

+ 1 - 0
pangu-component/pangu-component-tool/src/main/java/com/hrsk/pangu/tool/package-info.java

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

+ 57 - 0
pangu-component/pom.xml

@@ -0,0 +1,57 @@
+<?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>
+        <module>pangu-component-tool</module>
+        <module>pangu-component-bom</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>commons-cli</groupId>
+                <artifactId>commons-cli</artifactId>
+                <version>${commons-cli.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+</project>