Compare commits
2 Commits
354ce0dbd3
...
c0f0ea7f8d
| Author | SHA1 | Date |
|---|---|---|
|
|
c0f0ea7f8d | |
|
|
bfbc796461 |
|
|
@ -0,0 +1,172 @@
|
|||
package com.bonus.common.core.utils;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
|
||||
/**
|
||||
* 人脸识别 状态码
|
||||
*/
|
||||
@Data
|
||||
public class FaceCodeUtil {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public final static String ADD="add";
|
||||
/**
|
||||
* 刷新
|
||||
*/
|
||||
public final static String UPDATE="replace";
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public final static String DEL="delete";
|
||||
|
||||
/**
|
||||
* 已知个体的人脸识别
|
||||
*/
|
||||
public final static int code_00=30000;
|
||||
/**
|
||||
* 未知个体的人脸识别
|
||||
*/
|
||||
public final static int code_01=30001;
|
||||
/**
|
||||
* 操作成功
|
||||
*/
|
||||
public final static int code_02=30002;
|
||||
/**
|
||||
* 没有找到人脸数据库
|
||||
*/
|
||||
public final static int code_03=30003;
|
||||
/**
|
||||
* 30004
|
||||
*/
|
||||
public final static int code_04=30004;
|
||||
/**
|
||||
* 文件后缀无效
|
||||
*/
|
||||
public final static int code_05=30005;
|
||||
|
||||
/**
|
||||
* 不支持的输入文件类型
|
||||
*/
|
||||
public final static int code_06=30006;
|
||||
/**
|
||||
* 不支持的数据库更新类型
|
||||
*/
|
||||
public final static int code_07=30007;
|
||||
/**
|
||||
*图像中发现多张人脸
|
||||
*/
|
||||
public final static int code_08=30008;
|
||||
/**
|
||||
* 30009
|
||||
*/
|
||||
public final static int code_09=30009;
|
||||
/**
|
||||
* 人脸部分在画面外,向左或向右移动
|
||||
*/
|
||||
public final static int code_10=30010;
|
||||
/**
|
||||
* 人脸部分在画面外,向上或向下移动
|
||||
*/
|
||||
public final static int code_11=30011;
|
||||
/**
|
||||
* 图像中人脸向右旋
|
||||
*/
|
||||
public final static int code_12=30012;
|
||||
/**
|
||||
* 图像中人脸向左旋转
|
||||
*/
|
||||
public final static int code_13=30013;
|
||||
/**
|
||||
* 图像中人脸向上旋转
|
||||
*/
|
||||
public final static int code_14=30014;
|
||||
/**
|
||||
* 图像中人脸向下旋转
|
||||
*/
|
||||
public final static int code_15=30015;
|
||||
|
||||
/**
|
||||
* 图像中人脸分辨率低
|
||||
*/
|
||||
public final static int code_16=30016;
|
||||
|
||||
/**
|
||||
*图像中人脸清晰度差
|
||||
*/
|
||||
public final static int code_17=30017;
|
||||
/**
|
||||
*图像中未检测到人脸
|
||||
*/
|
||||
public final static int code_18=30018;
|
||||
/**
|
||||
* 身份已存在;
|
||||
*/
|
||||
public final static int code_19=30019;
|
||||
|
||||
|
||||
public static String getCodeString(Object obj){
|
||||
if(ObjectUtils.isEmpty(obj)){
|
||||
return "编码不存在";
|
||||
}
|
||||
int code=Integer.parseInt(obj.toString());
|
||||
switch (code){
|
||||
case code_00:
|
||||
return "已知个体的人脸识别";
|
||||
case code_01:
|
||||
return "未知个体的人脸识别";
|
||||
case code_02:
|
||||
return "图像处理成功";
|
||||
case code_03:
|
||||
return "没有找到人脸数据库";
|
||||
case code_04:
|
||||
return "文件路径无效";
|
||||
case code_05:
|
||||
return "文件后缀无效!";
|
||||
case code_06:
|
||||
return "不支持的输入文件类型!";
|
||||
case code_07:
|
||||
return "不支持的数据库更新类型!";
|
||||
case code_08:
|
||||
return "图像中发现多张人脸!";
|
||||
case code_09:
|
||||
return "光照条件差影响图像质量!";
|
||||
case code_10:
|
||||
return "人脸部分在画面外,向左或向右移动!";
|
||||
case code_11:
|
||||
return "人脸部分在画面外,向上或向下移动!";
|
||||
case code_12:
|
||||
return "图像中人脸向右旋转!";
|
||||
case code_13:
|
||||
return "图像中人脸向左旋转!";
|
||||
case code_14:
|
||||
return "图像中人脸向上旋转!";
|
||||
case code_15:
|
||||
return "图像中人脸向下旋转!";
|
||||
case code_16:
|
||||
return "图像中人脸分辨率低!";
|
||||
case code_17:
|
||||
return "图像中人脸清晰度差!";
|
||||
case code_18:
|
||||
return "图像中未检测到人脸!";
|
||||
case code_19:
|
||||
return "身份已存在!";
|
||||
default:
|
||||
return "人脸识别编码不存在,请联系郭乾坤!";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,336 @@
|
|||
package com.bonus.common.core.utils.http;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
public class HttpRequestHelper {
|
||||
|
||||
// 连接超时设置:5秒
|
||||
private static final int CONNECT_TIMEOUT = 50000;
|
||||
// 读取超时设置:5秒
|
||||
private static final int READ_TIMEOUT = 50000;
|
||||
|
||||
/**
|
||||
* 发送HTTP请求的通用方法
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param method 请求方法 (GET, POST, PUT, DELETE, PATCH)
|
||||
* @param body 请求体(适用于POST、PUT、PATCH)
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
private static String sendRequest(String baseUrl, String endpoint, String method, String body, Map<String, String> headers) {
|
||||
HttpURLConnection connection = null;
|
||||
try {
|
||||
// 创建URL对象并打开连接
|
||||
URL url = new URL(baseUrl + endpoint);
|
||||
connection = (HttpURLConnection) url.openConnection();
|
||||
|
||||
// 设置请求方法
|
||||
connection.setRequestMethod(method);
|
||||
|
||||
// 设置连接超时和读取超时时间
|
||||
connection.setConnectTimeout(CONNECT_TIMEOUT);
|
||||
connection.setReadTimeout(READ_TIMEOUT);
|
||||
|
||||
// 设置请求头
|
||||
if (headers != null) {
|
||||
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
||||
connection.setRequestProperty(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
// 如果请求体不为空,且方法是POST、PUT或PATCH,则写入请求体
|
||||
if (body != null && !body.isEmpty() && (method.equals("POST") || method.equals("PUT") || method.equals("PATCH"))) {
|
||||
connection.setDoOutput(true);
|
||||
try (OutputStream os = connection.getOutputStream()) {
|
||||
os.write(body.getBytes());
|
||||
os.flush();
|
||||
}
|
||||
}
|
||||
|
||||
// 连接服务器并检查响应代码
|
||||
int responseCode = connection.getResponseCode();
|
||||
if (responseCode != HttpURLConnection.HTTP_OK) {
|
||||
throw new RuntimeException("Request failed with response code: " + responseCode);
|
||||
}
|
||||
|
||||
// 获取输入流并读取响应内容
|
||||
StringBuilder response = new StringBuilder();
|
||||
try (BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
|
||||
String inputLine;
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
response.append(inputLine);
|
||||
}
|
||||
}
|
||||
|
||||
return response.toString();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
|
||||
} finally {
|
||||
if (connection != null) {
|
||||
connection.disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将表单数据转换为application/x-www-form-urlencoded格式的方法
|
||||
*
|
||||
* @param formData 表单数据
|
||||
* @return String 表单数据的URL编码格式
|
||||
*/
|
||||
private static String getFormBody(Map<String, String> formData) {
|
||||
try {
|
||||
StringJoiner sj = new StringJoiner("&");
|
||||
for (Map.Entry<String, String> entry : formData.entrySet()) {
|
||||
sj.add(URLEncoder.encode(entry.getKey(), "UTF-8") + "=" + URLEncoder.encode(entry.getValue(), "UTF-8"));
|
||||
}
|
||||
return sj.toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送GET请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String get(String baseUrl, String endpoint, Map<String, String> headers) {
|
||||
return sendRequest(baseUrl, endpoint, "GET", null, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送POST请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param body 请求体
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String post(String baseUrl, String endpoint, String body, Map<String, String> headers) {
|
||||
return sendRequest(baseUrl, endpoint, "POST", body, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送POST表单请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param formData 表单数据
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String postForm(String baseUrl, String endpoint, Map<String, String> formData, Map<String, String> headers) {
|
||||
headers.put("Content-Type", "application/x-www-form-urlencoded");
|
||||
String formBody = getFormBody(formData);
|
||||
return sendRequest(baseUrl, endpoint, "POST", formBody, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送POST JSON请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param jsonBody JSON格式的请求体
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String postJson(String baseUrl, String endpoint, String jsonBody, Map<String, String> headers) {
|
||||
headers.put("Content-Type", "application/json");
|
||||
return sendRequest(baseUrl, endpoint, "POST", jsonBody, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送POST XML请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param xmlBody XML格式的请求体
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String postXml(String baseUrl, String endpoint, String xmlBody, Map<String, String> headers) {
|
||||
headers.put("Content-Type", "application/xml");
|
||||
return sendRequest(baseUrl, endpoint, "POST", xmlBody, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送POST原始数据请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param rawBody 原始请求体
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String postRaw(String baseUrl, String endpoint, String rawBody, Map<String, String> headers) {
|
||||
return sendRequest(baseUrl, endpoint, "POST", rawBody, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送PUT请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param body 请求体
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String put(String baseUrl, String endpoint, String body, Map<String, String> headers) {
|
||||
return sendRequest(baseUrl, endpoint, "PUT", body, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送PUT表单请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param formData 表单数据
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String putForm(String baseUrl, String endpoint, Map<String, String> formData, Map<String, String> headers) {
|
||||
headers.put("Content-Type", "application/x-www-form-urlencoded");
|
||||
String formBody = getFormBody(formData);
|
||||
return sendRequest(baseUrl, endpoint, "PUT", formBody, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送PUT JSON请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param jsonBody JSON格式的请求体
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String putJson(String baseUrl, String endpoint, String jsonBody, Map<String, String> headers) {
|
||||
headers.put("Content-Type", "application/json");
|
||||
return sendRequest(baseUrl, endpoint, "PUT", jsonBody, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送PUT XML请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param xmlBody XML格式的请求体
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String putXml(String baseUrl, String endpoint, String xmlBody, Map<String, String> headers) {
|
||||
headers.put("Content-Type", "application/xml");
|
||||
return sendRequest(baseUrl, endpoint, "PUT", xmlBody, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送PUT原始数据请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param rawBody 原始请求体
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String putRaw(String baseUrl, String endpoint, String rawBody, Map<String, String> headers) {
|
||||
return sendRequest(baseUrl, endpoint, "PUT", rawBody, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送DELETE请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String delete(String baseUrl, String endpoint, Map<String, String> headers) {
|
||||
return sendRequest(baseUrl, endpoint, "DELETE", null, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送PATCH请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param body 请求体
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String patch(String baseUrl, String endpoint, String body, Map<String, String> headers) {
|
||||
return sendRequest(baseUrl, endpoint, "PATCH", body, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送PATCH表单请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param formData 表单数据
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String patchForm(String baseUrl, String endpoint, Map<String, String> formData, Map<String, String> headers) {
|
||||
headers.put("Content-Type", "application/x-www-form-urlencoded");
|
||||
String formBody = getFormBody(formData);
|
||||
return sendRequest(baseUrl, endpoint, "PATCH", formBody, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送PATCH JSON请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param jsonBody JSON格式的请求体
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String patchJson(String baseUrl, String endpoint, String jsonBody, Map<String, String> headers) {
|
||||
headers.put("Content-Type", "application/json");
|
||||
return sendRequest(baseUrl, endpoint, "PATCH", jsonBody, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送PATCH XML请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param xmlBody XML格式的请求体
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String patchXml(String baseUrl, String endpoint, String xmlBody, Map<String, String> headers) {
|
||||
headers.put("Content-Type", "application/xml");
|
||||
return sendRequest(baseUrl, endpoint, "PATCH", xmlBody, headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送PATCH原始数据请求
|
||||
*
|
||||
* @param baseUrl 基URL
|
||||
* @param endpoint 请求的端点
|
||||
* @param rawBody 原始请求体
|
||||
* @param headers 请求头
|
||||
* @return String 响应内容
|
||||
*/
|
||||
public static String patchRaw(String baseUrl, String endpoint, String rawBody, Map<String, String> headers) {
|
||||
return sendRequest(baseUrl, endpoint, "PATCH", rawBody, headers);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.bonus.common.core.utils.http;
|
||||
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
* @data 2023/1/5 15:14
|
||||
* @description 工具类
|
||||
*/
|
||||
public class HttpUtils {
|
||||
static RestTemplate client = new RestTemplate();
|
||||
/**
|
||||
* GET/POST 请求
|
||||
*
|
||||
* @param url 地址
|
||||
* @param params 参数
|
||||
* @param type 请求类型 false:GET,true:POST
|
||||
* @return 数据
|
||||
*/
|
||||
public static String sendRequest(String url, Object params, boolean type) {
|
||||
//新建Http头,add方法可以添加参数
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
//设置请求发送方式
|
||||
HttpMethod method = type ? HttpMethod.POST : HttpMethod.GET;
|
||||
//以表单的方式提交
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
//将请求头部和参数合成一个请求
|
||||
HttpEntity<Object> requestEntity = new HttpEntity<>(params, headers);
|
||||
//执行HTTP请求,将返回的结构使用String类格式化(可以设置为对应返回值格式的类)
|
||||
ResponseEntity<String> response = client.exchange(url, method, requestEntity, String.class);
|
||||
|
||||
return response.getBody();
|
||||
}
|
||||
}
|
||||
|
|
@ -23,12 +23,12 @@ public class SystemConfig {
|
|||
/**
|
||||
* 经度编码
|
||||
*/
|
||||
public final static String lat_code="经度";
|
||||
public final static String lat_code="纬度";
|
||||
|
||||
/**
|
||||
* 维度编码
|
||||
*/
|
||||
public final static String lon_code="维度";
|
||||
public final static String lon_code="经度";
|
||||
|
||||
/**
|
||||
* 施工配置范围
|
||||
|
|
|
|||
|
|
@ -354,8 +354,8 @@ public class BraceletServiceImpl implements BraceletService{
|
|||
}
|
||||
switch (entity.getDataCode()){
|
||||
case SystemConfig.dl_code:
|
||||
vo.setDl(stringBuffer.toString()); break;
|
||||
|
||||
vo.setDl(stringBuffer.toString());
|
||||
break;
|
||||
case SystemConfig.lat_code:
|
||||
vo.setLat(stringBuffer.toString());
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package com.bonus.bracelet.controller;
|
||||
|
||||
/**
|
||||
* 人脸识别控制层
|
||||
*/
|
||||
public class FaceInterController {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.bonus.bracelet.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
||||
public interface FaceInterService {
|
||||
/**
|
||||
* 人脸上传 /修改/删除
|
||||
*/
|
||||
public AjaxResult addFace(String image, String type, String id);
|
||||
|
||||
/**
|
||||
* 刷新人脸库
|
||||
*/
|
||||
public AjaxResult refreshFace();
|
||||
|
||||
|
||||
/**
|
||||
* 校验人脸
|
||||
*/
|
||||
public AjaxResult verifyFace(String image);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
package com.bonus.bracelet.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.nacos.shaded.com.google.common.collect.Maps;
|
||||
import com.bonus.bracelet.service.FaceInterService;
|
||||
import com.bonus.common.core.utils.FaceCodeUtil;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.http.HttpUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class FaceInterServiceImpl implements FaceInterService {
|
||||
|
||||
/**
|
||||
* 新增人脸库
|
||||
*/
|
||||
public final static String addFace="updatedb";
|
||||
|
||||
@Value("${face.path}")
|
||||
public String faceUrl;
|
||||
|
||||
/**
|
||||
* 刷新人脸库
|
||||
*/
|
||||
public final static String refresh="refreshdb";
|
||||
/**
|
||||
* 识别人脸库
|
||||
*/
|
||||
public final static String sbface="facerecognition";
|
||||
|
||||
|
||||
/**
|
||||
* 人脸信进行修改
|
||||
* @param image
|
||||
* @param type
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult addFace(String image, String type, String id) {
|
||||
Map<String,Object> result= Maps.newHashMap();
|
||||
try{
|
||||
Map<String,Object> map= Maps.newHashMap();
|
||||
map.put("img",image);
|
||||
map.put("optMode",type);
|
||||
map.put("uniqueKey",id);
|
||||
String msg= HttpUtils.sendRequest(faceUrl+addFace,JSON.toJSONString(map),true);
|
||||
if(StringUtils.isNotEmpty(msg)){
|
||||
JSONObject json=JSON.parseObject(msg);
|
||||
String code=json.getString("code");
|
||||
String eMsg=json.getString("msg");
|
||||
if("30002".equals(code)){
|
||||
result.put("code",200);
|
||||
}else {
|
||||
result.put("code",201);
|
||||
}
|
||||
String msgCN= FaceCodeUtil.getCodeString(code);
|
||||
result.put("msg",msgCN);
|
||||
result.put("eMsg",eMsg);
|
||||
}else{
|
||||
result.put("code",201);
|
||||
result.put("msg","人脸识别接口异常!请检查人脸服务!");
|
||||
}
|
||||
AjaxResult.success(result);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.error("人脸识别接口异常!请检查人脸服务!");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新图像库
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult refreshFace() {
|
||||
Map<String,Object> result= Maps.newHashMap();
|
||||
try{
|
||||
Map<String,Object> map= Maps.newHashMap();
|
||||
String msg= HttpUtils.sendRequest(faceUrl+refresh,JSON.toJSONString(map),true);
|
||||
if(StringUtils.isNotEmpty(msg)){
|
||||
JSONObject json=JSON.parseObject(msg);
|
||||
String code=json.getString("code");
|
||||
String eMsg=json.getString("msg");
|
||||
if("30002".equals(code)){
|
||||
result.put("code",200);
|
||||
result.put("msg","操作成功");
|
||||
}else {
|
||||
String msgCN= FaceCodeUtil.getCodeString(code);
|
||||
result.put("msg",msgCN);
|
||||
result.put("code",201);
|
||||
}
|
||||
result.put("eMsg",eMsg);
|
||||
}else{
|
||||
result.put("code",201);
|
||||
result.put("msg","人脸识别接口异常!请检查人脸服务!");
|
||||
}
|
||||
AjaxResult.success(result);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.error("人脸识别接口异常!请检查人脸服务!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult verifyFace(String image) {
|
||||
Map<String,Object> result= Maps.newHashMap();
|
||||
try{
|
||||
Map<String,Object> map= Maps.newHashMap();
|
||||
map.put("img",image);
|
||||
String msg= HttpUtils.sendRequest(faceUrl+sbface,JSON.toJSONString(map),true);
|
||||
if(StringUtils.isNotEmpty(msg)){
|
||||
JSONObject json=JSON.parseObject(msg);
|
||||
String code=json.getString("code");
|
||||
String eMsg=json.getString("msg");
|
||||
//识别成功返回的数据
|
||||
if("30000".equals(code)){
|
||||
JSONArray jsonArray=json.getJSONArray("data");
|
||||
Object key= jsonArray.get(0);
|
||||
result.put("code",201);
|
||||
result.put("userId",key);
|
||||
result.put("msg","人脸识别成功");
|
||||
}else{
|
||||
result.put("code",201);
|
||||
String msgCN= FaceCodeUtil.getCodeString(code);
|
||||
result.put("msg",msgCN);
|
||||
result.put("eMsg",eMsg);
|
||||
result.put("userId","-9999");
|
||||
}
|
||||
}else{
|
||||
result.put("code",201);
|
||||
result.put("msg","人脸识别接口异常!请检查人脸服务!");
|
||||
}
|
||||
AjaxResult.success(result);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.error("人脸识别接口异常!请检查人脸服务!");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -37,3 +37,6 @@ jasypt:
|
|||
password: Encrypt
|
||||
file:
|
||||
temp_file_path: L:\\tempFile
|
||||
face:
|
||||
path: http://192.168.0.14:18017/
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
12:10:09.711 [main] ERROR c.b.b.s.i.FaceInterServiceImpl - [addFace2,76] - com.alibaba.fastjson.JSONException: syntax error, pos 4, line 1, column 5None
|
||||
com.alibaba.fastjson.JSONException: syntax error, pos 4, line 1, column 5None
|
||||
at com.alibaba.fastjson.parser.DefaultJSONParser.parse(DefaultJSONParser.java:1507)
|
||||
at com.alibaba.fastjson.parser.DefaultJSONParser.parse(DefaultJSONParser.java:1390)
|
||||
at com.alibaba.fastjson.JSON.parse(JSON.java:181)
|
||||
at com.alibaba.fastjson.JSON.parse(JSON.java:191)
|
||||
at com.alibaba.fastjson.JSON.parse(JSON.java:147)
|
||||
at com.alibaba.fastjson.JSONObject.getJSONArray(JSONObject.java:160)
|
||||
at com.bonus.bracelet.service.impl.FaceInterServiceImpl.addFace2(FaceInterServiceImpl.java:70)
|
||||
at com.bonus.bracelet.service.impl.FaceInterServiceImpl.main(FaceInterServiceImpl.java:47)
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
13:52:28.522 [main] ERROR c.a.c.n.r.NacosServiceRegistry - [register,81] - nacos registry, bonus-app register failed...NacosRegistration{nacosDiscoveryProperties=NacosDiscoveryProperties{serverAddr='127.0.0.1:8848', username='nacos', password='Jjsp@nacos2023', endpoint='', namespace='ljzhgd', watchDelay=30000, logName='', service='bonus-app', weight=1.0, clusterName='DEFAULT', group='DEFAULT_GROUP', namingLoadCacheAtStart='false', metadata={IPv6=null, preserved.register.source=SPRING_CLOUD}, registerEnabled=true, ip='192.168.0.38', networkInterface='', port=18089, secure=false, accessKey='', secretKey='', heartBeatInterval=null, heartBeatTimeout=null, ipDeleteTimeout=null, instanceEnabled=true, ephemeral=true, failureToleranceEnabled=false}, ipDeleteTimeout=null, failFast=true}},
|
||||
com.alibaba.nacos.api.exception.NacosException: Client not connected, current status:STARTING
|
||||
at com.alibaba.nacos.common.remote.client.RpcClient.request(RpcClient.java:639)
|
||||
at com.alibaba.nacos.common.remote.client.RpcClient.request(RpcClient.java:619)
|
||||
at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.requestToServer(NamingGrpcClientProxy.java:356)
|
||||
at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.doRegisterService(NamingGrpcClientProxy.java:209)
|
||||
at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.registerService(NamingGrpcClientProxy.java:123)
|
||||
at com.alibaba.nacos.client.naming.remote.NamingClientProxyDelegate.registerService(NamingClientProxyDelegate.java:98)
|
||||
at com.alibaba.nacos.client.naming.NacosNamingService.registerInstance(NacosNamingService.java:152)
|
||||
at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:75)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.register(AbstractAutoServiceRegistration.java:232)
|
||||
at com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration.register(NacosAutoServiceRegistration.java:78)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.start(AbstractAutoServiceRegistration.java:133)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.bind(AbstractAutoServiceRegistration.java:98)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:86)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:47)
|
||||
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:178)
|
||||
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171)
|
||||
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145)
|
||||
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:430)
|
||||
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:387)
|
||||
at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:46)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:179)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:357)
|
||||
at java.lang.Iterable.forEach(Iterable.java:75)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:156)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:124)
|
||||
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:949)
|
||||
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:594)
|
||||
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
|
||||
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
|
||||
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1289)
|
||||
at com.bonus.app.BonusAppApplication.main(BonusAppApplication.java:16)
|
||||
13:52:29.090 [main] ERROR o.s.b.SpringApplication - [reportFailure,818] - Application run failed
|
||||
org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is java.lang.reflect.UndeclaredThrowableException
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:357)
|
||||
at java.lang.Iterable.forEach(Iterable.java:75)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:156)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:124)
|
||||
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:949)
|
||||
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:594)
|
||||
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
|
||||
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
|
||||
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1289)
|
||||
at com.bonus.app.BonusAppApplication.main(BonusAppApplication.java:16)
|
||||
Caused by: java.lang.reflect.UndeclaredThrowableException: null
|
||||
at org.springframework.util.ReflectionUtils.rethrowRuntimeException(ReflectionUtils.java:147)
|
||||
at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:83)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.register(AbstractAutoServiceRegistration.java:232)
|
||||
at com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration.register(NacosAutoServiceRegistration.java:78)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.start(AbstractAutoServiceRegistration.java:133)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.bind(AbstractAutoServiceRegistration.java:98)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:86)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:47)
|
||||
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:178)
|
||||
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171)
|
||||
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145)
|
||||
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:430)
|
||||
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:387)
|
||||
at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:46)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:179)
|
||||
... 14 common frames omitted
|
||||
Caused by: com.alibaba.nacos.api.exception.NacosException: Client not connected, current status:STARTING
|
||||
at com.alibaba.nacos.common.remote.client.RpcClient.request(RpcClient.java:639)
|
||||
at com.alibaba.nacos.common.remote.client.RpcClient.request(RpcClient.java:619)
|
||||
at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.requestToServer(NamingGrpcClientProxy.java:356)
|
||||
at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.doRegisterService(NamingGrpcClientProxy.java:209)
|
||||
at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.registerService(NamingGrpcClientProxy.java:123)
|
||||
at com.alibaba.nacos.client.naming.remote.NamingClientProxyDelegate.registerService(NamingClientProxyDelegate.java:98)
|
||||
at com.alibaba.nacos.client.naming.NacosNamingService.registerInstance(NacosNamingService.java:152)
|
||||
at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:75)
|
||||
... 27 common frames omitted
|
||||
13:52:28.522 [main] ERROR c.a.c.n.r.NacosServiceRegistry - [register,81] - nacos registry, bonus-app register failed...NacosRegistration{nacosDiscoveryProperties=NacosDiscoveryProperties{serverAddr='127.0.0.1:8848', username='nacos', password='Jjsp@nacos2023', endpoint='', namespace='ljzhgd', watchDelay=30000, logName='', service='bonus-app', weight=1.0, clusterName='DEFAULT', group='DEFAULT_GROUP', namingLoadCacheAtStart='false', metadata={IPv6=null, preserved.register.source=SPRING_CLOUD}, registerEnabled=true, ip='192.168.0.38', networkInterface='', port=18089, secure=false, accessKey='', secretKey='', heartBeatInterval=null, heartBeatTimeout=null, ipDeleteTimeout=null, instanceEnabled=true, ephemeral=true, failureToleranceEnabled=false}, ipDeleteTimeout=null, failFast=true}},
|
||||
com.alibaba.nacos.api.exception.NacosException: Client not connected, current status:STARTING
|
||||
at com.alibaba.nacos.common.remote.client.RpcClient.request(RpcClient.java:639)
|
||||
at com.alibaba.nacos.common.remote.client.RpcClient.request(RpcClient.java:619)
|
||||
at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.requestToServer(NamingGrpcClientProxy.java:356)
|
||||
at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.doRegisterService(NamingGrpcClientProxy.java:209)
|
||||
at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.registerService(NamingGrpcClientProxy.java:123)
|
||||
at com.alibaba.nacos.client.naming.remote.NamingClientProxyDelegate.registerService(NamingClientProxyDelegate.java:98)
|
||||
at com.alibaba.nacos.client.naming.NacosNamingService.registerInstance(NacosNamingService.java:152)
|
||||
at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:75)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.register(AbstractAutoServiceRegistration.java:232)
|
||||
at com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration.register(NacosAutoServiceRegistration.java:78)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.start(AbstractAutoServiceRegistration.java:133)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.bind(AbstractAutoServiceRegistration.java:98)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:86)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:47)
|
||||
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:178)
|
||||
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171)
|
||||
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145)
|
||||
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:430)
|
||||
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:387)
|
||||
at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:46)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:179)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:357)
|
||||
at java.lang.Iterable.forEach(Iterable.java:75)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:156)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:124)
|
||||
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:949)
|
||||
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:594)
|
||||
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
|
||||
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
|
||||
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1289)
|
||||
at com.bonus.app.BonusAppApplication.main(BonusAppApplication.java:16)
|
||||
13:52:29.090 [main] ERROR o.s.b.SpringApplication - [reportFailure,818] - Application run failed
|
||||
org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is java.lang.reflect.UndeclaredThrowableException
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:357)
|
||||
at java.lang.Iterable.forEach(Iterable.java:75)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:156)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:124)
|
||||
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:949)
|
||||
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:594)
|
||||
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
|
||||
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
|
||||
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1289)
|
||||
at com.bonus.app.BonusAppApplication.main(BonusAppApplication.java:16)
|
||||
Caused by: java.lang.reflect.UndeclaredThrowableException: null
|
||||
at org.springframework.util.ReflectionUtils.rethrowRuntimeException(ReflectionUtils.java:147)
|
||||
at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:83)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.register(AbstractAutoServiceRegistration.java:232)
|
||||
at com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration.register(NacosAutoServiceRegistration.java:78)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.start(AbstractAutoServiceRegistration.java:133)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.bind(AbstractAutoServiceRegistration.java:98)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:86)
|
||||
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:47)
|
||||
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:178)
|
||||
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171)
|
||||
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145)
|
||||
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:430)
|
||||
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:387)
|
||||
at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:46)
|
||||
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:179)
|
||||
... 14 common frames omitted
|
||||
Caused by: com.alibaba.nacos.api.exception.NacosException: Client not connected, current status:STARTING
|
||||
at com.alibaba.nacos.common.remote.client.RpcClient.request(RpcClient.java:639)
|
||||
at com.alibaba.nacos.common.remote.client.RpcClient.request(RpcClient.java:619)
|
||||
at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.requestToServer(NamingGrpcClientProxy.java:356)
|
||||
at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.doRegisterService(NamingGrpcClientProxy.java:209)
|
||||
at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.registerService(NamingGrpcClientProxy.java:123)
|
||||
at com.alibaba.nacos.client.naming.remote.NamingClientProxyDelegate.registerService(NamingClientProxyDelegate.java:98)
|
||||
at com.alibaba.nacos.client.naming.NacosNamingService.registerInstance(NacosNamingService.java:152)
|
||||
at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:75)
|
||||
... 27 common frames omitted
|
||||
Loading…
Reference in New Issue