字段转换
parent
fe1273cda1
commit
80b8e4a7a6
|
@ -9,6 +9,28 @@
|
||||||
<file url="file://$PROJECT_DIR$/cloud-port-remote/src/main/resources" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/cloud-port-remote/src/main/resources" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/cloud-port-server/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/cloud-port-server/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/cloud-port-server/src/main/resources" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/cloud-port-server/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart-common/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart-common/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-ali/data-mart-ali-client/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-ali/data-mart-ali-client/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-ali/data-mart-ali-server/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-ali/data-mart-ali-server/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-ali/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-ali/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-client/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-client/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-common/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-common/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-juhe/data-mart-juhe-client/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-juhe/data-mart-juhe-client/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-juhe/data-mart-juhe-server/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-juhe/data-mart-juhe-server/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-juhe/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-juhe/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-server/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/data-mart-server/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/data-mart/src/main/resources" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -7,6 +7,12 @@
|
||||||
<option value="$PROJECT_DIR$/pom.xml" />
|
<option value="$PROJECT_DIR$/pom.xml" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
|
<option name="ignoredFiles">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$/data-mart-common/pom.xml" />
|
||||||
|
<option value="$PROJECT_DIR$/data-mart/data-mart-client/pom.xml" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17 (2)" project-jdk-type="JavaSDK" />
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17 (2)" project-jdk-type="JavaSDK" />
|
||||||
</project>
|
</project>
|
File diff suppressed because one or more lines are too long
|
@ -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.muyu</groupId>
|
||||||
|
<artifactId>data-mart-ali</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>data-mart-ali-client</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
|
@ -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.muyu</groupId>
|
||||||
|
<artifactId>data-mart-ali</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>data-mart-ali-server</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.muyu.data.mart;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:DataMartAliApplication
|
||||||
|
* @Date:2024/9/5 22:34
|
||||||
|
* 阿里云客户端
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
public class DataMartAliApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(DataMartAliApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
server:
|
||||||
|
port: 99
|
|
@ -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.muyu</groupId>
|
||||||
|
<artifactId>data-mart</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>data-mart-ali</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>data-mart-ali-server</module>
|
||||||
|
<module>data-mart-ali-client</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-web</artifactId>
|
||||||
|
<version>6.1.8</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>data-mart-common</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?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.muyu</groupId>
|
||||||
|
<artifactId>data-mart</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>data-mart-common</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MybatisPlus代码自动生成器 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-generator</artifactId>
|
||||||
|
<version>3.5.7</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- 默认模板引擎 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.velocity</groupId>
|
||||||
|
<artifactId>velocity-engine-core</artifactId>
|
||||||
|
<version>2.3</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.muyu.data.mart.common;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart.common
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:BasicApi
|
||||||
|
* @Date:2024/9/6 9:29
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface BasicApi<REQ,RES> {
|
||||||
|
RES send(REQ req);
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.muyu.data.mart.domain.juhe;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.annotation.JSONField;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart.domain.juhe
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:JuHeResult
|
||||||
|
* @Date:2024/9/6 10:31
|
||||||
|
* 聚合返回结果集
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class JuHeResult<T> {
|
||||||
|
private String reason;
|
||||||
|
private T result;
|
||||||
|
@JSONField(name = "error_code")
|
||||||
|
public Integer errorCode;
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.muyu.data.mart.domain.realname;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart.domain.req
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:RealNameReq
|
||||||
|
* @Date:2024/9/5 22:15
|
||||||
|
* 实名认证请求
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class RealNameReq {
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 身份证
|
||||||
|
*/
|
||||||
|
private String idCard;
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.muyu.data.mart.domain.realname;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart.domain
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:RealNameResp
|
||||||
|
* @Date:2024/9/6 9:35
|
||||||
|
* 实名认证响应结果
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class RealNameResp {
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
private String mag;
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.muyu.data.mart.domain.realname.juhe;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.annotation.JSONField;
|
||||||
|
import com.muyu.data.mart.domain.realname.RealNameReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart.domain.juhe
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:RealNameResp
|
||||||
|
* @Date:2024/9/6 10:13
|
||||||
|
* 聚会请求
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class JuHeRealNameReq {
|
||||||
|
|
||||||
|
@JSONField(name = "idcard")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
@JSONField(name = "realname")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@JSONField(name = "orderid")
|
||||||
|
private int orderId;
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
public static JuHeRealNameReq realNameReqBuilder(RealNameReq realNameReq) {
|
||||||
|
return JuHeRealNameReq.builder()
|
||||||
|
.key("realNameReq.getKey()")
|
||||||
|
.idCard(realNameReq.getIdCard())
|
||||||
|
.orderId(0)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.muyu.data.mart.domain.realname.juhe;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.annotation.JSONField;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart.domain.realname.juhe
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:RealNameResp
|
||||||
|
* @Date:2024/9/6 10:25
|
||||||
|
* 聚合数据实名认证接口响应
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class JuHeRealNameResp {
|
||||||
|
|
||||||
|
|
||||||
|
// @JSONField(name = "error_code")
|
||||||
|
// private String errorCode;
|
||||||
|
// private String reason;
|
||||||
|
// private String result;
|
||||||
|
@JSONField(name = "idcard")
|
||||||
|
private String idCard;
|
||||||
|
@JSONField(name = "realname")
|
||||||
|
private String realName;
|
||||||
|
private Integer res;
|
||||||
|
}
|
|
@ -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.muyu</groupId>
|
||||||
|
<artifactId>data-mart-juhe</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>data-mart-juhe-client</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
|
@ -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.muyu</groupId>
|
||||||
|
<artifactId>data-mart-juhe</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>data-mart-juhe-server</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.muyu.data.mart;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:DataMartJuHeApplication
|
||||||
|
* @Date:2024/9/5 22:37
|
||||||
|
* 聚合客户端
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
public class DataMartJuHeApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(DataMartJuHeApplication.class,args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.muyu.data.mart.service.impl;
|
||||||
|
|
||||||
|
import com.muyu.data.mart.common.BasicApi;
|
||||||
|
import com.muyu.data.mart.domain.juhe.JuHeResult;
|
||||||
|
import com.muyu.data.mart.domain.realname.RealNameReq;
|
||||||
|
import com.muyu.data.mart.domain.realname.RealNameResp;
|
||||||
|
import com.muyu.data.mart.domain.realname.juhe.JuHeRealNameReq;
|
||||||
|
import com.muyu.data.mart.domain.realname.juhe.JuHeRealNameResp;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart.service.impl
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:RealNameServiceImpl
|
||||||
|
* @Date:2024/9/6 10:23
|
||||||
|
*
|
||||||
|
*聚合数据接口对接
|
||||||
|
*/
|
||||||
|
@Service("juhe-real-name")
|
||||||
|
public class RealNameServiceImpl implements BasicApi<RealNameReq, RealNameResp> {
|
||||||
|
/**
|
||||||
|
* 请求
|
||||||
|
* @param realNameReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public RealNameResp send(RealNameReq realNameReq) {
|
||||||
|
JuHeRealNameReq juHeRealNameReq = JuHeRealNameReq.realNameReqBuilder(realNameReq);
|
||||||
|
JuHeResult<JuHeRealNameResp> juHeRealNameRespJuHeResult = sendApi(juHeRealNameReq);
|
||||||
|
return RealNameResp.builder().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public JuHeResult<JuHeRealNameResp> sendApi(JuHeRealNameReq juHeRealNameReq){
|
||||||
|
|
||||||
|
return new JuHeResult<JuHeRealNameResp>(){{
|
||||||
|
setErrorCode(0);
|
||||||
|
setReason("成功");
|
||||||
|
setResult(
|
||||||
|
JuHeRealNameResp.builder()
|
||||||
|
.realName(juHeRealNameReq.getRealName())
|
||||||
|
.idCard(juHeRealNameReq.getIdCard())
|
||||||
|
.res(0)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
}};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
server:
|
||||||
|
port: 98
|
|
@ -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.muyu</groupId>
|
||||||
|
<artifactId>data-mart</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>data-mart-juhe</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>data-mart-juhe-server</module>
|
||||||
|
<module>data-mart-juhe-client</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-web</artifactId>
|
||||||
|
<version>6.1.8</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>data-mart-common</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?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.muyu</groupId>
|
||||||
|
<artifactId>data-mart</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>data-mart-server</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-web</artifactId>
|
||||||
|
<version>6.1.8</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>data-mart-common</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.muyu.data.mart;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart.controller
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:DataMartApplication
|
||||||
|
* @Date:2024/9/5 22:11
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
public class DataMartApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(DataMartApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.muyu.data.mart.controller;
|
||||||
|
|
||||||
|
import com.muyu.data.mart.domain.realname.RealNameReq;
|
||||||
|
import com.muyu.data.mart.service.TestService;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart.controller
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:TestController
|
||||||
|
* @Date:2024/9/5 22:12
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/test")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TestController {
|
||||||
|
|
||||||
|
private final TestService testService;
|
||||||
|
|
||||||
|
@PostMapping("/real/name")
|
||||||
|
public String realName(@RequestBody RealNameReq realNameReq){
|
||||||
|
testService.realName(realNameReq);
|
||||||
|
return "OK";
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.muyu.data.mart.remote;
|
||||||
|
|
||||||
|
import com.muyu.data.mart.common.BasicApi;
|
||||||
|
import com.muyu.data.mart.domain.realname.RealNameReq;
|
||||||
|
import com.muyu.data.mart.domain.realname.RealNameResp;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart.remote
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:JuHeRemoteService
|
||||||
|
* @Date:2024/9/6 14:43
|
||||||
|
* 聚合远程调用service
|
||||||
|
*/
|
||||||
|
@FeignClient(value = "ali",path = "/ali")
|
||||||
|
public interface AliRemoteService {
|
||||||
|
@PostMapping("/real/name")
|
||||||
|
RealNameResp realName(RealNameReq realNameReq);
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.muyu.data.mart.remote;
|
||||||
|
|
||||||
|
import com.muyu.data.mart.domain.realname.RealNameReq;
|
||||||
|
import com.muyu.data.mart.domain.realname.RealNameResp;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart.remote
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:JuHeRemoteService
|
||||||
|
* @Date:2024/9/6 14:43
|
||||||
|
* 聚合远程调用service
|
||||||
|
*/
|
||||||
|
@FeignClient(value = "ali",path = "/juhe")
|
||||||
|
public interface JuHeRemoteService {
|
||||||
|
@PostMapping("/real/name")
|
||||||
|
RealNameResp realName(RealNameReq realNameReq);
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.muyu.data.mart.service;
|
||||||
|
|
||||||
|
import com.muyu.data.mart.domain.realname.RealNameReq;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart.service
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:TestService
|
||||||
|
* @Date:2024/9/5 22:21
|
||||||
|
*/
|
||||||
|
public interface TestService {
|
||||||
|
/**
|
||||||
|
* 实名认证
|
||||||
|
* @param realNameReq 实名认证请求
|
||||||
|
*/
|
||||||
|
void realName(RealNameReq realNameReq);
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.muyu.data.mart.service.impl;
|
||||||
|
|
||||||
|
import com.muyu.data.mart.common.BasicApi;
|
||||||
|
import com.muyu.data.mart.domain.realname.RealNameReq;
|
||||||
|
import com.muyu.data.mart.domain.realname.RealNameResp;
|
||||||
|
import com.muyu.data.mart.remote.AliRemoteService;
|
||||||
|
import com.muyu.data.mart.remote.JuHeRemoteService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart.service.impl
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:RealNameServiceImpl
|
||||||
|
* @Date:2024/9/6 9:39
|
||||||
|
* 实名认证
|
||||||
|
*/
|
||||||
|
@Service("source-real-name")
|
||||||
|
public class RealNameServiceImpl implements BasicApi<RealNameReq, RealNameResp> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AliRemoteService aliRemoteService;
|
||||||
|
@Autowired
|
||||||
|
private JuHeRemoteService juHeRemoteService;
|
||||||
|
|
||||||
|
private static final Set<String> realNameSet = new HashSet<String>(){{
|
||||||
|
|
||||||
|
add("张三-12345678912345678");
|
||||||
|
add("李四-12345678912345678");
|
||||||
|
add("王五-12345678912345678");
|
||||||
|
add("赵六-123456712345678");
|
||||||
|
add("田七-12345678912345678");
|
||||||
|
add("张三-12345678912345678");
|
||||||
|
}};
|
||||||
|
/**
|
||||||
|
* 实名认证 请求
|
||||||
|
* @param realNameReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public RealNameResp send(RealNameReq realNameReq) {
|
||||||
|
if (realNameSet.add(realNameReq.getName()+realNameReq.getIdCard())){
|
||||||
|
return RealNameResp.builder()
|
||||||
|
.code("0")
|
||||||
|
.mag("验证成功")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
//主从辅
|
||||||
|
throw new RuntimeException("线路正在抢修中!!!");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.muyu.data.mart.service.impl;
|
||||||
|
|
||||||
|
import com.muyu.data.mart.domain.realname.RealNameReq;
|
||||||
|
import com.muyu.data.mart.service.TestService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:chaiyapeng
|
||||||
|
* @Package:com.muyu.data.mart.service.impl
|
||||||
|
* @Project:cloud-port
|
||||||
|
* @name:TestServuceImpl
|
||||||
|
* @Date:2024/9/5 22:23
|
||||||
|
* 测试实现类
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TestServuceImpl implements TestService {
|
||||||
|
/**
|
||||||
|
* 实名认证
|
||||||
|
* @param realNameReq 实名认证请求
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void realName(RealNameReq realNameReq) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
server:
|
||||||
|
port: 91
|
|
@ -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.muyu</groupId>
|
||||||
|
<artifactId>cloud-port</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>data-mart</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>data-mart-common</module>
|
||||||
|
<module>data-mart-server</module>
|
||||||
|
<module>data-mart-ali</module>
|
||||||
|
<module>data-mart-juhe</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.fastjson2</groupId>
|
||||||
|
<artifactId>fastjson2</artifactId>
|
||||||
|
<version>2.0.50</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
|
<version>3.1.2</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
2
pom.xml
2
pom.xml
|
@ -19,6 +19,7 @@
|
||||||
<module>cloud-port-common</module>
|
<module>cloud-port-common</module>
|
||||||
<module>cloud-port-remote</module>
|
<module>cloud-port-remote</module>
|
||||||
<module>cloud-port-server</module>
|
<module>cloud-port-server</module>
|
||||||
|
<module>data-mart</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -26,5 +27,4 @@
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
Loading…
Reference in New Issue