Quellcode durchsuchen

杰生项目生成

home vor 2 Jahren
Ursprung
Commit
9f34987e3d

+ 1 - 0
hx-api/pom.xml

@@ -23,6 +23,7 @@
 
     <modules>
         <module>iot-management-api</module>
+        <module>storage-api</module>
     </modules>
 
     <dependencyManagement>

+ 34 - 0
hx-api/storage-api/pom.xml

@@ -0,0 +1,34 @@
+<?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">
+    <parent>
+        <artifactId>hx-api</artifactId>
+        <groupId>com.fjhx</groupId>
+        <version>3.2.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>storage-api</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-starter-mybatis</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.fjhx</groupId>
+            <artifactId>hx-tool</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

+ 0 - 26
hx-common/code-generator/src/main/java/com/fjhx/modular/IotManage.java

@@ -1,26 +0,0 @@
-package com.fjhx.modular;
-
-import com.fjhx.generator.CodeGenerator;
-
-public class IotManage {
-
-    /**
-     * 针筒物联网管理端
-     * @param args
-     */
-    public static void main(String[] args) {
-
-        // 数据库名
-        CodeGenerator.DATABASE_NAME = "iot_management";
-        // 表名
-        CodeGenerator.INCLUDE = "bom_details";
-
-        CodeGenerator.MYSQL_URL = "127.0.0.1:3306";
-        CodeGenerator.USER_NAME = "root";
-        CodeGenerator.PASSWORD = "root";
-
-        CodeGenerator.execute();
-
-    }
-
-}

+ 3 - 0
hx-common/hx-tool/src/main/java/com/fjhx/utils/feign/UserClientUtil.java

@@ -14,6 +14,9 @@ import java.util.stream.Collectors;
 
 public class UserClientUtil {
 
+    /**
+     * 用户模块调用
+     */
     private static final IUserSearchClient userSearchClient = SpringUtil.getBean(IUserSearchClient.class);
 
     /**

+ 7 - 0
hx-serve/pom.xml

@@ -22,6 +22,7 @@
 
     <modules>
         <module>iot-management</module>
+        <module>storage</module>
     </modules>
 
     <dependencyManagement>
@@ -49,6 +50,12 @@
                 <version>${hx.version}</version>
             </dependency>
 
+            <dependency>
+                <groupId>com.fjhx</groupId>
+                <artifactId>storage-api</artifactId>
+                <version>${hx.version}</version>
+            </dependency>
+
         </dependencies>
     </dependencyManagement>
 

+ 61 - 0
hx-serve/storage/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">
+    <parent>
+        <artifactId>hx-serve</artifactId>
+        <groupId>com.fjhx</groupId>
+        <version>3.2.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>storage</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>com.fjhx</groupId>
+            <artifactId>hx-tool</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.fjhx</groupId>
+            <artifactId>storage-api</artifactId>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.xml</include>
+                </includes>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.3.1.RELEASE</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 27 - 0
hx-serve/storage/src/main/java/com/fjhx/StorageApplication.java

@@ -0,0 +1,27 @@
+package com.fjhx;
+
+import org.springblade.core.cloud.feign.EnableBladeFeign;
+import org.springblade.core.launch.BladeApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.scheduling.annotation.EnableAsync;
+
+/**
+ * 杰生模块启动器
+ */
+@EnableAsync
+@EnableBladeFeign
+@EnableDiscoveryClient
+@EnableCircuitBreaker
+@SpringBootApplication
+public class StorageApplication {
+
+    private static final String APP_NAME = "storage";
+
+    public static void main(String[] args) {
+        // 调用ApiConstant.Server赋值appName会出现单服务打包失败的情况
+        BladeApplication.run(APP_NAME, StorageApplication.class, args);
+    }
+
+}

+ 13 - 0
hx-serve/storage/src/main/resources/application-dev.yml

@@ -0,0 +1,13 @@
+# 服务器端口
+server:
+  port: 8300
+logging:
+  level:
+    org.springframework.data.mongodb.core: DEBUG
+# 数据源配置
+spring:
+  # 数据库
+  datasource:
+    url: ${blade.datasource.storage.dev.url}
+    username: ${blade.datasource.storage.dev.username}
+    password: ${blade.datasource.storage.dev.password}

+ 12 - 0
hx-serve/storage/src/main/resources/application-prod.yml

@@ -0,0 +1,12 @@
+# 服务器端口
+server:
+  port: 8300
+
+# 数据源配置
+spring:
+  # 数据库
+  datasource:
+    url: ${blade.datasource.storage.prod.url}
+    username: ${blade.datasource.storage.prod.username}
+    password: ${blade.datasource.storage.prod.password}
+

+ 11 - 0
hx-serve/storage/src/main/resources/application-test.yml

@@ -0,0 +1,11 @@
+# 服务器端口
+server:
+  port: 8300
+
+# 数据源配置
+spring:
+  # 数据库
+  datasource:
+    url: ${blade.datasource.storage.test.url}
+    username: ${blade.datasource.storage.test.username}
+    password: ${blade.datasource.storage.test.password}