相关方代码提交

master
zhangyu 2024-05-22 09:45:19 +08:00
commit 73acd3fc67
12 changed files with 444 additions and 0 deletions

33
.gitignore vendored 100644
View File

@ -0,0 +1,33 @@
*.class
*/logs
.mvn/
*.md
#package files
*.war
*.ear
#kdiff3 ignore
target/
#eclipse ignore
.settings/
.project
.classpath
#idea
.idea/
/idea/
*.ipr
*.iml
*.iws
# temp file
*.log
*.cache
*.diff
*.patch
*.tmp
*.versionsBackup

View File

@ -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">
<parent>
<groupId>com.hbt.sass</groupId>
<artifactId>hbt-related-parties</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hbt-related-parties-api</artifactId>
<dependencies>
<!-- hbt Common Security -->
<dependency>
<groupId>com.hbt.onreal</groupId>
<artifactId>hbt-onreal-common-security</artifactId>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,25 @@
package com.hbt.related.parties.api.factory;
import com.hbt.common.core.domain.R;
import com.hbt.related.parties.api.remoteRelatedPartiesService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
/**
* RelatedParties
*
* @author hbt
*/
@Component
@Slf4j
public class RemoteRelatedPartiesFallbackFactory implements FallbackFactory<remoteRelatedPartiesService>
{
@Override
public remoteRelatedPartiesService create(Throwable throwable)
{
log.error("RelatedParties服务调用失败:{}", throwable.getMessage());
return () -> R.fail("调用失败:" + throwable.getMessage());
}
}

View File

@ -0,0 +1,23 @@
package com.hbt.related.parties.api;
import com.hbt.common.core.domain.R;
import com.hbt.related.parties.api.factory.RemoteRelatedPartiesFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
/**
* hbt-related-parties
*
* @author hbt
*/
@FeignClient(contextId = "remoteRelatedPartiesService", value = "hbt-related-parties", fallbackFactory = RemoteRelatedPartiesFallbackFactory.class)
public interface remoteRelatedPartiesService
{
/**
*
*
* @return
*/
@GetMapping(value = "/relatedParties/action")
R<String> action() ;
}

View File

@ -0,0 +1,4 @@
FROM 119.45.158.12:5000/mini-java8:latest
COPY target/hbt-related-parties-biz-1.0-SNAPSHOT.jar /app/app.jar
ENV NACOSIP=""
ENTRYPOINT ["sh","-c","java -Dnacos.ip=$NACOSIP -jar /app/app.jar"]

View File

@ -0,0 +1,126 @@
<?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>
<groupId>com.hbt.sass</groupId>
<artifactId>hbt-related-parties</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hbt-related-parties-biz</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!-- 依赖hbt-paas-api-bpm -->
<dependency>
<groupId>com.hbt.onreal</groupId>
<artifactId>hbt-paas-api-bpm</artifactId>
</dependency>
<!-- 依赖easyword -->
<dependency>
<groupId>com.sushengren</groupId>
<artifactId>easyword</artifactId>
<version>1.1.5</version>
<exclusions>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.2</version>
</dependency>
<!-- SpringCloud Ailibaba Nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud Ailibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Ailibaba Sentinel -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- hbt Common DataSource -->
<dependency>
<groupId>com.hbt.onreal</groupId>
<artifactId>hbt-onreal-common-datasource</artifactId>
</dependency>
<!-- hbt Common Security -->
<dependency>
<groupId>com.hbt.onreal</groupId>
<artifactId>hbt-onreal-common-security</artifactId>
</dependency>
<!-- hbt Common Swagger -->
<dependency>
<groupId>com.hbt.onreal</groupId>
<artifactId>hbt-onreal-common-swagger</artifactId>
</dependency>
<!-- hbt Common log -->
<dependency>
<groupId>com.hbt.onreal</groupId>
<artifactId>hbt-onreal-common-log</artifactId>
</dependency>
<dependency>
<groupId>com.hbt.sass</groupId>
<artifactId>hbt-corporate-info-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- Swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.hbt.sass</groupId>
<artifactId>hbt-corporate-info-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,23 @@
package com.hbt.related.parties;
import com.hbt.common.security.annotation.EnableCustomConfig;
import com.hbt.common.security.annotation.EnableRyFeignClients;
import com.hbt.common.swagger.annotation.EnableCustomSwagger2;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
/**
* ,
*/
@EnableCustomConfig
@SpringCloudApplication
@EnableCustomSwagger2
@EnableRyFeignClients
public class RelatedPartiesApplication {
public static void main(String[] args)
{
SpringApplication.run(RelatedPartiesApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 相关方管理服务启动成功 ლ(´ڡ`ლ)゙ ");
}
}

View File

@ -0,0 +1,8 @@
Spring Boot Version: ${spring-boot.version}
Spring Application Name: ${spring.application.name}
_ _ _
| | | | | |
| |__ | |__ | |_ ______ ___ __ _ ___ ___
| '_ \| '_ \| __|______/ __| / _` | / __| / __|
| | | | |_) | |_ \__ \ | (_| | \__ \ \__ \
|_| |_|_.__/ \__| |___/ \__,_| |___/ |___/

View File

@ -0,0 +1,16 @@
# Spring
spring:
cloud:
nacos:
username: nacos
password: zkhbt888
discovery:
# 服务注册地址
server-addr: ${nacos.ip}:8848
config:
# 配置中心地址
server-addr: ${nacos.ip}:8848
# 配置文件格式
file_extension: yml
# 共享配置
shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file_extension}

View File

@ -0,0 +1,14 @@
# Tomcat
server:
port: 9405
# Spring
spring:
application:
# 应用名称
name: hbt-related-parties-zy
profiles:
# 环境配置
active: dev
nacos:
ip: 192.168.1.211

View File

@ -0,0 +1,18 @@
package com.hbt.related.parties;
import com.alibaba.fastjson2.JSONObject;
import com.hbt.common.core.utils.SpringUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@SpringBootTest
@RunWith(SpringJUnit4ClassRunner.class)
public class EventTest {
@Autowired
private ApplicationContext applicationContext;
}

126
pom.xml 100644
View File

@ -0,0 +1,126 @@
<?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.hbt.sass</groupId>
<artifactId>hbt-related-parties</artifactId>
<version>1.0-SNAPSHOT</version>
<description>hbt-work-ticket</description>
<modules>
<module>hbt-related-parties-api</module>
<module>hbt-related-parties-biz</module>
</modules>
<packaging>pom</packaging>
<properties>
<hbt-cloud.version>3.7.0-SNAPSHOT</hbt-cloud.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-boot.version>2.7.7</spring-boot.version>
</properties>
<repositories>
<repository>
<id>central</id>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
<repository>
<id>maven-public</id>
<url>http://81.70.119.104:8081/repository/maven-public/</url>
<releases>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>maven-public</id>
<url>http://81.70.119.104:8081/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>maven-public</id>
<url>http://81.70.119.104:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>maven-public</id>
<url>http://81.70.119.104:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<dependencyManagement>
<dependencies>
<!-- hbt-cloud 中定义的包不需要再定义 -->
<dependency>
<groupId>com.hbt.onreal</groupId>
<artifactId>hbt-onreal</artifactId>
<version>${hbt-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.hbt.sass</groupId>
<artifactId>hbt-related-parties-api</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>