Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-analysis
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.online.exam
pica-cloud-analysis
提交
da495bd2
提交
da495bd2
编写于
3月 05, 2024
作者:
xinxu.wang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'release' into 'master'
Release See merge request
!5
上级
72b524aa
1c93fdb1
流水线
#54800
已失败 于阶段
变更
2
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
317 行增加
和
269 行删除
+317
-269
pom.xml
server/pom.xml
+274
-265
HttpClient4Utils.java
...d/online/exam/analysis/server/utils/HttpClient4Utils.java
+43
-4
未找到文件。
server/pom.xml
浏览文件 @
da495bd2
<?xml version="1.0" encoding="UTF-8"?>
<?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"
<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"
>
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>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<parent>
<groupId>
com.pica.cloud.online.exam
</groupId>
<groupId>
com.pica.cloud.online.exam
</groupId>
<artifactId>
pica-cloud-analysis
</artifactId>
<artifactId>
pica-cloud-analysis
</artifactId>
<version>
1.0.0
</version>
<version>
1.0.0
</version>
</parent>
</parent>
<groupId>
com.pica.cloud.online.exam
</groupId>
<groupId>
com.pica.cloud.online.exam
</groupId>
<artifactId>
pica-cloud-analysis-server
</artifactId>
<artifactId>
pica-cloud-analysis-server
</artifactId>
<name>
pica-cloud-analysis-server
</name>
<name>
pica-cloud-analysis-server
</name>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
<properties>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.target>
1.8
</maven.compiler.target>
<maven.compiler.target>
1.8
</maven.compiler.target>
<java.version>
1.8
</java.version>
<java.version>
1.8
</java.version>
<spring-cloud.version>
Edgware.SR4
</spring-cloud.version>
<spring-cloud.version>
Edgware.SR4
</spring-cloud.version>
<spring-boot.version>
1.5.14.RELEASE
</spring-boot.version>
<spring-boot.version>
1.5.14.RELEASE
</spring-boot.version>
</properties>
</properties>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
<exclusions>
<exclusions>
<exclusion>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-logging
</artifactId>
<artifactId>
spring-boot-starter-logging
</artifactId>
</exclusion>
</exclusion>
</exclusions>
</exclusions>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
<exclusions>
<exclusions>
<exclusion>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-logging
</artifactId>
<artifactId>
spring-boot-starter-logging
</artifactId>
</exclusion>
</exclusion>
</exclusions>
</exclusions>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
1.3.2
</version>
<version>
1.3.2
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-config
</artifactId>
<artifactId>
spring-cloud-starter-config
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-feign
</artifactId>
<artifactId>
spring-cloud-starter-feign
</artifactId>
</dependency>
</dependency>
<!--<dependency>-->
<!--<dependency>-->
<!--<groupId>org.springframework.cloud</groupId>-->
<!--<groupId>org.springframework.cloud</groupId>-->
<!--<artifactId>spring-cloud-starter-hystrix</artifactId>-->
<!--<artifactId>spring-cloud-starter-hystrix</artifactId>-->
<!--</dependency>-->
<!--</dependency>-->
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-devtools
</artifactId>
<artifactId>
spring-boot-devtools
</artifactId>
<scope>
runtime
</scope>
<scope>
runtime
</scope>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.pica.cloud.foundation
</groupId>
<groupId>
com.pica.cloud.foundation
</groupId>
<artifactId>
pica-cloud-service-starter
</artifactId>
<artifactId>
pica-cloud-service-starter
</artifactId>
<version>
1.0.2
</version>
<version>
1.0.2
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.pica.cloud.foundation
</groupId>
<groupId>
com.pica.cloud.foundation
</groupId>
<artifactId>
pica-cloud-entity
</artifactId>
<artifactId>
pica-cloud-entity
</artifactId>
<version>
1.3.2
</version>
<version>
1.3.2
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
2.8.0
</version>
<version>
2.8.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.8.0
</version>
<version>
2.8.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
redis.clients
</groupId>
<groupId>
redis.clients
</groupId>
<artifactId>
jedis
</artifactId>
<artifactId>
jedis
</artifactId>
<version>
2.9.0
</version>
<version>
2.9.0
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.pica.cloud.foundation
</groupId>
<dependency>
<artifactId>
pica-cloud-redis
</artifactId>
<groupId>
com.zaxxer
</groupId>
<version>
1.2.6-SNAPSHOT
</version>
<artifactId>
HikariCP
</artifactId>
</dependency>
<version>
3.1.0
</version>
</dependency>
<dependency>
<groupId>
com.zaxxer
</groupId>
<dependency>
<artifactId>
HikariCP
</artifactId>
<groupId>
io.springfox
</groupId>
<version>
3.1.0
</version>
<artifactId>
springfox-swagger2
</artifactId>
</dependency>
<version>
2.8.0
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<dependency>
<artifactId>
springfox-swagger2
</artifactId>
<groupId>
io.springfox
</groupId>
<version>
2.8.0
</version>
<artifactId>
springfox-swagger-ui
</artifactId>
</dependency>
<version>
2.8.0
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<dependency>
<artifactId>
springfox-swagger-ui
</artifactId>
<groupId>
mysql
</groupId>
<version>
2.8.0
</version>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
<version>
5.1.39
</version>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<dependency>
<artifactId>
mysql-connector-java
</artifactId>
<groupId>
org.springframework.cloud
</groupId>
<version>
5.1.39
</version>
<artifactId>
spring-cloud-starter-stream-rabbit
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
com.pica.cloud.online.exam
</groupId>
<artifactId>
spring-cloud-starter-stream-rabbit
</artifactId>
<artifactId>
pica-cloud-analysis-common
</artifactId>
</dependency>
<version>
1.1.0
</version>
<scope>
compile
</scope>
<dependency>
</dependency>
<groupId>
com.pica.cloud.online.exam
</groupId>
<artifactId>
pica-cloud-analysis-common
</artifactId>
<dependency>
<version>
1.1.0
</version>
<groupId>
org.unidal.framework
</groupId>
<scope>
compile
</scope>
<artifactId>
foundation-service
</artifactId>
</dependency>
<version>
4.1.1
</version>
</dependency>
<dependency>
<groupId>
com.dianping.cat
</groupId>
<dependency>
<artifactId>
cat-core
</artifactId>
<groupId>
com.pica.cloud.foundation
</groupId>
<version>
2.0.0
</version>
<artifactId>
pica-cloud-redis
</artifactId>
</dependency>
<version>
1.4.0
</version>
<dependency>
<exclusions>
<groupId>
com.dianping.cat
</groupId>
<exclusion>
<artifactId>
cat-client
</artifactId>
<artifactId>
jedis
</artifactId>
<version>
2.0.0
</version>
<groupId>
redis.clients
</groupId>
</dependency>
</exclusion>
<dependency>
</exclusions>
<groupId>
org.unidal.framework
</groupId>
</dependency>
<artifactId>
foundation-service
</artifactId>
<dependency>
<version>
4.1.1
</version>
<artifactId>
jedis
</artifactId>
</dependency>
<groupId>
redis.clients
</groupId>
</dependencies>
<version>
3.1.0
</version>
</dependency>
<dependencyManagement>
<dependency>
<dependencies>
<groupId>
com.alibaba
</groupId>
<dependency>
<artifactId>
fastjson
</artifactId>
<groupId>
org.springframework.cloud
</groupId>
<version>
1.2.73
</version>
<artifactId>
spring-cloud-dependencies
</artifactId>
</dependency>
<version>
${spring-cloud.version}
</version>
<type>
pom
</type>
</dependencies>
<scope>
import
</scope>
</dependency>
<dependencyManagement>
<dependencies>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<artifactId>
spring-cloud-dependencies
</artifactId>
<version>
${spring-boot.version}
</version>
<version>
${spring-cloud.version}
</version>
<type>
pom
</type>
<type>
pom
</type>
<scope>
import
</scope>
<scope>
import
</scope>
</dependency>
</dependency>
</dependencies>
</dependencyManagement>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<repositories>
<artifactId>
spring-boot-starter-parent
</artifactId>
<repository>
<version>
${spring-boot.version}
</version>
<id>
nexus
</id>
<type>
pom
</type>
<url>
http://192.168.110.42:8082/repository/maven-public/
</url>
<scope>
import
</scope>
<releases>
</dependency>
<enabled>
true
</enabled>
</dependencies>
<updatePolicy>
never
</updatePolicy>
</dependencyManagement>
</releases>
<snapshots>
<repositories>
<enabled>
true
</enabled>
<repository>
<updatePolicy>
always
</updatePolicy>
<id>
nexus
</id>
</snapshots>
<url>
http://192.168.110.42:8082/repository/maven-public/
</url>
</repository>
<releases>
</repositories>
<enabled>
true
</enabled>
<pluginRepositories>
<updatePolicy>
never
</updatePolicy>
<pluginRepository>
</releases>
<id>
nexus
</id>
<snapshots>
<url>
http://192.168.110.42:8082/repository/maven-public/
</url>
<enabled>
true
</enabled>
<releases>
<updatePolicy>
always
</updatePolicy>
<enabled>
true
</enabled>
</snapshots>
<updatePolicy>
never
</updatePolicy>
</repository>
</releases>
</repositories>
<snapshots>
<pluginRepositories>
<enabled>
true
</enabled>
<pluginRepository>
<updatePolicy>
always
</updatePolicy>
<id>
nexus
</id>
</snapshots>
<url>
http://192.168.110.42:8082/repository/maven-public/
</url>
</pluginRepository>
<releases>
</pluginRepositories>
<enabled>
true
</enabled>
<updatePolicy>
never
</updatePolicy>
<build>
</releases>
<finalName>
pica-cloud-analysis-server
</finalName>
<snapshots>
<enabled>
true
</enabled>
<plugins>
<updatePolicy>
always
</updatePolicy>
<plugin>
</snapshots>
<groupId>
org.springframework.boot
</groupId>
</pluginRepository>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</pluginRepositories>
<executions>
<execution>
<build>
<goals>
<finalName>
pica-cloud-analysis-server
</finalName>
<goal>
repackage
</goal>
</goals>
<plugins>
</execution>
<plugin>
</executions>
<groupId>
org.springframework.boot
</groupId>
</plugin>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<plugin>
<version>
2.4.3
</version>
<groupId>
org.mybatis.generator
</groupId>
<executions>
<artifactId>
mybatis-generator-maven-plugin
</artifactId>
<execution>
<version>
1.3.5
</version>
<goals>
<dependencies>
<goal>
repackage
</goal>
<dependency>
</goals>
<groupId>
mysql
</groupId>
</execution>
<artifactId>
mysql-connector-java
</artifactId>
</executions>
<version>
5.1.39
</version>
</plugin>
</dependency>
<plugin>
<dependency>
<groupId>
org.mybatis.generator
</groupId>
<groupId>
org.mybatis.generator
</groupId>
<artifactId>
mybatis-generator-maven-plugin
</artifactId>
<artifactId>
mybatis-generator-core
</artifactId>
<version>
1.3.5
</version>
<version>
1.3.2
</version>
<dependencies>
</dependency>
<dependency>
</dependencies>
<groupId>
mysql
</groupId>
<executions>
<artifactId>
mysql-connector-java
</artifactId>
<execution>
<version>
5.1.39
</version>
<id>
Generate MyBatis Artifacts
</id>
</dependency>
<phase>
package
</phase>
<dependency>
<goals>
<groupId>
org.mybatis.generator
</groupId>
<goal>
generate
</goal>
<artifactId>
mybatis-generator-core
</artifactId>
</goals>
<version>
1.3.2
</version>
</execution>
</dependency>
</executions>
</dependencies>
<configuration>
<executions>
<verbose>
true
</verbose>
<execution>
<overwrite>
true
</overwrite>
<id>
Generate MyBatis Artifacts
</id>
<configurationFile>
src/main/resources/mybatis-generator.xml
</configurationFile>
<phase>
package
</phase>
</configuration>
<goals>
</plugin>
<goal>
generate
</goal>
</plugins>
</goals>
</build>
</execution>
</project>
</executions>
<configuration>
<verbose>
true
</verbose>
<overwrite>
true
</overwrite>
<configurationFile>
src/main/resources/mybatis-generator.xml
</configurationFile>
</configuration>
</plugin>
</plugins>
</build>
</project>
server/src/main/java/com/pica/cloud/online/exam/analysis/server/utils/HttpClient4Utils.java
浏览文件 @
da495bd2
package
com
.
pica
.
cloud
.
online
.
exam
.
analysis
.
server
.
utils
;
package
com
.
pica
.
cloud
.
online
.
exam
.
analysis
.
server
.
utils
;
import
org.apache.http.Consts
;
import
org.apache.http.NameValuePair
;
import
org.apache.http.NameValuePair
;
import
org.apache.http.client.HttpClient
;
import
org.apache.http.client.HttpClient
;
import
org.apache.http.client.config.RequestConfig
;
import
org.apache.http.client.config.RequestConfig
;
...
@@ -15,11 +16,9 @@ import org.slf4j.Logger;
...
@@ -15,11 +16,9 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.nio.charset.Charset
;
import
java.nio.charset.Charset
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author wuminghao
* @author wuminghao
...
@@ -69,6 +68,7 @@ public class HttpClient4Utils {
...
@@ -69,6 +68,7 @@ public class HttpClient4Utils {
UrlEncodedFormEntity
postEntity
=
new
UrlEncodedFormEntity
(
formParams
,
encoding
);
UrlEncodedFormEntity
postEntity
=
new
UrlEncodedFormEntity
(
formParams
,
encoding
);
httpPost
.
setEntity
(
postEntity
);
httpPost
.
setEntity
(
postEntity
);
}
}
// httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
CloseableHttpResponse
response
=
null
;
CloseableHttpResponse
response
=
null
;
try
{
try
{
response
=
(
CloseableHttpResponse
)
httpClient
.
execute
(
httpPost
);
response
=
(
CloseableHttpResponse
)
httpClient
.
execute
(
httpPost
);
...
@@ -86,4 +86,43 @@ public class HttpClient4Utils {
...
@@ -86,4 +86,43 @@ public class HttpClient4Utils {
}
}
return
resp
;
return
resp
;
}
}
public
static
void
main
(
String
[]
s
)
{
HttpClient
httpClient
=
HttpClient4Utils
.
createHttpClient
(
200
,
200
,
2000
,
2000
,
2000
);
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
/**
* 1. 设置公共参数
*/
params
.
put
(
"secretId"
,
"f437763dcf0a4096948b0cfbaebd668b"
);
params
.
put
(
"businessId"
,
"7065ac9c9cf4472fbf44fe3f90a03624"
);
params
.
put
(
"version"
,
"v1"
);
params
.
put
(
"timestamp"
,
String
.
valueOf
(
System
.
currentTimeMillis
()));
params
.
put
(
"nonce"
,
String
.
valueOf
(
new
Random
().
nextInt
()));
/**
* 2. 设置私有参数
*/
// params.put("dataId", "ebfcad1c-pica-490c-b4de-e784c2691768");
params
.
put
(
"name"
,
"韦少峰"
);
params
.
put
(
"cardNo"
,
"440624198310214613"
);
/**
* 3. 生成签名信息
*/
try
{
String
signature
=
SignatureUtils
.
genSignature
(
"6cc930e9e481fce8e5d3da30dddf74c4"
,
params
);
params
.
put
(
"signature"
,
signature
);
}
catch
(
UnsupportedEncodingException
e
)
{
logger
.
error
(
"processString"
,
e
);
}
/**
* 4. 发送HTTP请求
*/
System
.
out
.
println
(
sendPost
(
httpClient
,
"https://verify.dun.163.com/v1/idcard/check"
,
params
,
Consts
.
UTF_8
));
}
}
}
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录