Merge branch 'fw-u8' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master
Conflicts: base-webapp/pom.xml pom.xml
This commit is contained in:
commit
2c7da04993
|
@ -0,0 +1,48 @@
|
|||
<?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>kangarooDataCenterV3</artifactId>
|
||||
<groupId>com.hzya.frame</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>fw-u8</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>${revision}</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.hzya.frame</groupId>
|
||||
<artifactId>base-service</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>${mysql-connector-java}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<mainClass>none</mainClass> <!-- 取消查找本项目下的Main方法:为了解决Unable to find main class的问题 -->
|
||||
<classifier>execute</classifier> <!-- 为了解决依赖模块找不到此模块中的类或属性 -->
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,89 @@
|
|||
package com.hzya.frame.u8.dto;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* @Description u8返回对象
|
||||
* @Author xiangerlin
|
||||
* @Date 2024/5/14 15:40
|
||||
**/
|
||||
public class U8ResponseDTO {
|
||||
@JSONField(name = "Flag")
|
||||
private String flag;
|
||||
@JSONField(name = "DataOne")
|
||||
private String dataOne;
|
||||
@JSONField(name = "DataTwo")
|
||||
private String dataTwo;
|
||||
@JSONField(name = "Msg")
|
||||
private String msg;
|
||||
|
||||
//如果co初始化失败,或者token不对的时候会返回这些信息
|
||||
private String code;
|
||||
private String success;
|
||||
private String message;
|
||||
private String data;
|
||||
|
||||
public String getFlag() {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setFlag(String flag) {
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public String getDataOne() {
|
||||
return dataOne;
|
||||
}
|
||||
|
||||
public void setDataOne(String dataOne) {
|
||||
this.dataOne = dataOne;
|
||||
}
|
||||
|
||||
public String getDataTwo() {
|
||||
return dataTwo;
|
||||
}
|
||||
|
||||
public void setDataTwo(String dataTwo) {
|
||||
this.dataTwo = dataTwo;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(String success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(String data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.hzya.frame.u8.util;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.u8.dto.U8ResponseDTO;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author xiangerlin
|
||||
* @Date 2024/5/14 15:30
|
||||
**/
|
||||
public class U8Util {
|
||||
|
||||
static Logger logger = LogManager.getLogger(U8Util.class);
|
||||
|
||||
//获取token
|
||||
public static String getToken() {
|
||||
String url = "http://127.0.0.1:51910/Api/Base/GetToken";
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("secretkey", "L1NhkDrQhtBDzTxFxPI0jxWcBzTBSPvaI5xZusRRi9ofS9d6ngxrj1erwbdjxtUT");
|
||||
logger.info("获取U8token参数:{}", jsonObject.toJSONString());
|
||||
String token = HttpRequest.post( url).body(jsonObject.toJSONString()).timeout(60000).execute().body();
|
||||
logger.info("token返回参数:{}", jsonObject.toJSONString());
|
||||
if (StrUtil.isNotEmpty(token)) {
|
||||
U8ResponseDTO u8ResponseDTO = JSONObject.parseObject(token, U8ResponseDTO.class);
|
||||
return u8ResponseDTO.getMessage();
|
||||
}
|
||||
return token;
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
|
||||
version="4.0">
|
||||
</web-app>
|
Loading…
Reference in New Issue