添加 连线客api
This commit is contained in:
@@ -0,0 +1,139 @@
|
||||
package com.zbkj.common.constants;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/13
|
||||
*/
|
||||
public class LxkOpenApiConstant {
|
||||
/**
|
||||
* 物流管理
|
||||
*/
|
||||
public static class ExpressManage {
|
||||
/**
|
||||
* 物流查询
|
||||
*/
|
||||
public static final String QUERY_EXPRESS = "app/tms/express/v1/queryExpress";
|
||||
/**
|
||||
* 查询物流消耗记录
|
||||
*/
|
||||
public static final String EXPRESS_RECORD = "app/tms/express/v1/express/record";
|
||||
/**
|
||||
* 物流套餐数量
|
||||
*/
|
||||
public static final String EXPRESS_INFO_COUNT = "app/tms/express/v1/express/info/count";
|
||||
}
|
||||
|
||||
/**
|
||||
* 短信API管理
|
||||
*/
|
||||
public static class SmsManage {
|
||||
/**
|
||||
* 发送短信
|
||||
*/
|
||||
public static final String SENDSMS = "app/tms/sms/v1/sendSms";
|
||||
/**
|
||||
* 发送营销短信
|
||||
*/
|
||||
public static final String SEND_YX_SMS = "app/tms/sms/v1/sendYxSms";
|
||||
/**
|
||||
* 查询短信消耗记录
|
||||
*/
|
||||
public static final String SMS_RECORD = "app/tms/sms/v1/sms/record";
|
||||
/**
|
||||
* 短信套餐数量
|
||||
*/
|
||||
public static final String SMS_INFO_COUNT = "app/tms/sms/v1/sms/info/count";
|
||||
}
|
||||
|
||||
/**
|
||||
* GEO管理
|
||||
*/
|
||||
public static class GeoManage {
|
||||
/**
|
||||
* 经纬度解析地址
|
||||
*/
|
||||
public static final String PARSE_LATLNG = "app/tms/geo/v1/parse/latlng";
|
||||
/**
|
||||
* 地址解析经纬度
|
||||
*/
|
||||
public static final String PARSE_ADDRESS = "app/tms/geo/v1/parse/address";
|
||||
/**
|
||||
* GEO消耗记录
|
||||
*/
|
||||
public static final String GEO_RECORD = "app/tms/geo/v1/geo/record";
|
||||
/**
|
||||
* GEO套餐数量
|
||||
*/
|
||||
public static final String GEO_INFO_COUNT = "app/tms/geo/v1/geo/info/count";
|
||||
}
|
||||
|
||||
/**
|
||||
* 人脸管理
|
||||
*/
|
||||
public static class FaceManage {
|
||||
/**
|
||||
* 金融级人脸对比验证
|
||||
*/
|
||||
public static final String FACE_V1_FACE = "app/tms/face/v1/face";
|
||||
/**
|
||||
* 金融级人脸验证加强版
|
||||
*/
|
||||
public static final String FACE_V1_FACEPLUS = "app/tms/face/v1/facePlus";
|
||||
/**
|
||||
* 普通人脸对比验证
|
||||
*/
|
||||
public static final String FACE_V1_FACECOMPARE = "app/tms/face/v1/faceCompare";
|
||||
/**
|
||||
* 查询金融人脸消耗记录
|
||||
*/
|
||||
public static final String FACE_V1_FACEPLUS_RECORD = "app/tms/face/v1/facePlus/record";
|
||||
/**
|
||||
* 金融级人脸套餐数量
|
||||
*/
|
||||
public static final String FACEPLUS_INFO_COUNT = "app/tms/face/v1/facePlus/info/count";
|
||||
}
|
||||
|
||||
/**
|
||||
* 实名管理
|
||||
*/
|
||||
public static class IdCardManage {
|
||||
/**
|
||||
* 实名认证
|
||||
*/
|
||||
public static final String VERIFY_IDCARD = "app/tms/idcard/v1/verify/idcard";
|
||||
/**
|
||||
* 实名消耗记录
|
||||
*/
|
||||
public static final String IDCARD_RECORD = "app/tms/idcard/v1/verify/idcard/record";
|
||||
/**
|
||||
* 实名套餐数量
|
||||
*/
|
||||
public static final String IDCARD_INFO_COUNT = "app/tms/idcard/v1/verify/idcard/info/count";
|
||||
}
|
||||
|
||||
/**
|
||||
* 敏感词管理
|
||||
*/
|
||||
public static class SensitiveWordsManage {
|
||||
/**
|
||||
* 敏感词识别接口
|
||||
*/
|
||||
public static final String VERIFY_WORDS = "/app/tms/words/v1/verify/words";
|
||||
/**
|
||||
* 敏感词消耗记录
|
||||
*/
|
||||
public static final String WORDS_RECORD = "/app/tms/words/v1/verify/words/record";
|
||||
/**
|
||||
* 敏感词套餐数量
|
||||
*/
|
||||
public static final String WORDS_INFO_COUNT = "/app/tms/words/v1/verify/words/info/count";
|
||||
}
|
||||
|
||||
|
||||
public static class FreeAPI {
|
||||
/**
|
||||
* 获取IP
|
||||
*/
|
||||
public static final String IP_URL = "/app/tms/free/v1/getIp";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.zbkj.common.model.lxkopenapi;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 普通人脸对比验证请求体
|
||||
*
|
||||
* @author huahua
|
||||
*/
|
||||
@Data
|
||||
public class FaceCompareRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
private String idCardNo;
|
||||
|
||||
/**
|
||||
* 人脸图片地址,只支持jpg格式的文件
|
||||
*/
|
||||
@NotBlank(message = "人脸图片地址不能为空")
|
||||
private String faceUrl;
|
||||
|
||||
/**
|
||||
* 人脸图片地址,只支持jpg格式的文件
|
||||
*/
|
||||
@NotBlank(message = "人脸图片地址2不能为空")
|
||||
private String faceUrlSecond;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.zbkj.common.model.lxkopenapi;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 金融级人脸对比验证
|
||||
*
|
||||
* @author huahua
|
||||
*/
|
||||
@Data
|
||||
public class FaceFaceRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
@NotBlank(message = "身份证号码不能为空")
|
||||
private String idCardNo;
|
||||
|
||||
/**
|
||||
* 人脸图片地址,只支持jpg格式的文件
|
||||
*/
|
||||
@NotBlank(message = "人脸图片地址不能为空")
|
||||
private String faceUrl;
|
||||
|
||||
/**
|
||||
* 人脸图片地址,只支持jpg格式的文件
|
||||
*/
|
||||
@NotBlank(message = "人脸图片地址2不能为空")
|
||||
private String faceUrlSecond;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.zbkj.common.model.lxkopenapi;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 金融级人脸验证加强版请求体
|
||||
*
|
||||
* @author huahua
|
||||
*/
|
||||
@Data
|
||||
public class FacePlusRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
@NotBlank(message = "身份证号码不能为空")
|
||||
private String idCardNo;
|
||||
|
||||
/**
|
||||
* 人脸图片地址,只支持jpg格式的文件
|
||||
*/
|
||||
@NotBlank(message = "人脸图片地址不能为空")
|
||||
private String faceUrl;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.zbkj.common.model.lxkopenapi;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 经纬度解析地址
|
||||
*
|
||||
* @author huahua
|
||||
*/
|
||||
@Data
|
||||
public class GeoLatLngRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 纬度(GCJ02坐标系)
|
||||
*/
|
||||
private String lat;
|
||||
|
||||
/**
|
||||
* 经度(GCJ02坐标系)
|
||||
*/
|
||||
private String lng;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.zbkj.common.model.lxkopenapi;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 分页查询实体类
|
||||
*
|
||||
* @author huahua
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PageQueryRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 分页大小
|
||||
*/
|
||||
private Integer pageSize;
|
||||
|
||||
/**
|
||||
* 当前页数
|
||||
*/
|
||||
private Integer pageNum;
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
private String orderByColumn;
|
||||
|
||||
/**
|
||||
* 排序的方向desc或者asc
|
||||
*/
|
||||
private String isAsc;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.zbkj.common.model.lxkopenapi;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 物流查询实体类
|
||||
*
|
||||
* @author huahua
|
||||
*/
|
||||
@Data
|
||||
public class QueryExpressRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 必填 快递单号 【顺丰和丰网请输入单号 : 收件人或寄件人手机号后四位。例如:123456789:1234】
|
||||
*/
|
||||
@NotBlank(message = "快递单号不能为空")
|
||||
private String no;
|
||||
|
||||
/**
|
||||
* 快递类型,可选
|
||||
*/
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.zbkj.common.model.lxkopenapi;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 短信发送实体类
|
||||
*
|
||||
* @author huahua
|
||||
*/
|
||||
@Data
|
||||
public class SmsSendRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 短信参数
|
||||
*/
|
||||
private JSONObject paramMap;
|
||||
|
||||
/**
|
||||
* 模版
|
||||
*/
|
||||
@NotBlank(message = "模版不能为空")
|
||||
private String templateId;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
private String mobile;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.zbkj.common.model.lxkopenapi;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 实名认证请求体
|
||||
*
|
||||
* @author huahua
|
||||
*/
|
||||
@Data
|
||||
public class VerifyIdCardRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
@NotBlank(message = "身份证不能为空")
|
||||
private String idCardNo;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zbkj.common.model.lxkopenapi;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 敏感词识别接口请求体
|
||||
*
|
||||
* @author huahua
|
||||
*/
|
||||
@Data
|
||||
public class VerifyWordsRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 检测的文本
|
||||
*/
|
||||
@NotBlank(message = "检测的文本不能为空")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* type取值【单选或多选以','分隔】:0、全部检测 1、检测黄赌毒色情等非法信息 2、检测政治、宗教敏感或不良言论。
|
||||
* 3、检测人身攻击,低俗辱骂 4、检测游戏、论坛等发广告、推广等 999、低俗英文或其他敏感词。
|
||||
*/
|
||||
@NotBlank(message = "type不能为空")
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.zbkj.common.response.lxkopenapi;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author heyi
|
||||
* 2023/10/24
|
||||
*/
|
||||
@Data
|
||||
public class BaseResponse {
|
||||
|
||||
/**
|
||||
* 是否成功
|
||||
*/
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
private String msg;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.zbkj.common.response.lxkopenapi.Idcard;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class IdCard {
|
||||
|
||||
/**
|
||||
* 认证通过状态 true:通过,false 未通过
|
||||
*/
|
||||
private Boolean success;
|
||||
|
||||
private String msg;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.zbkj.common.response.lxkopenapi.Idcard;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class IdCardResult {
|
||||
|
||||
/**
|
||||
* 消息状态码
|
||||
*/
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 返回
|
||||
*/
|
||||
private IdCard data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.zbkj.common.response.lxkopenapi.express;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class ExpressResult {
|
||||
|
||||
|
||||
/**
|
||||
* 是否成功
|
||||
*/
|
||||
private Boolean success;
|
||||
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
|
||||
/**
|
||||
* 快递返回
|
||||
*/
|
||||
private ExpressResultModel expressResultModel;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.zbkj.common.response.lxkopenapi.express;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author heyi
|
||||
* 2023/6/12
|
||||
*/
|
||||
@Data
|
||||
public class ExpressResultModel {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String number;
|
||||
|
||||
|
||||
/**
|
||||
* 快递类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 快递物流节点返回值
|
||||
*/
|
||||
private List<LogisticsResultListVo> list;
|
||||
|
||||
|
||||
/**
|
||||
* 0:快递收件(揽件)1.在途中 2.正在派件 3.已签收 4.派送失败 5.疑难件 6.退件签收
|
||||
*/
|
||||
private String deliverystatus;
|
||||
|
||||
|
||||
/**
|
||||
* 1.是否签收
|
||||
*/
|
||||
private String issign;
|
||||
|
||||
|
||||
/**
|
||||
* 快递公司名称
|
||||
*/
|
||||
private String expName;
|
||||
|
||||
|
||||
/**
|
||||
* 快递公司官网
|
||||
*/
|
||||
private String expSite;
|
||||
|
||||
|
||||
/**
|
||||
* 快递公司电话
|
||||
*/
|
||||
private String expPhone;
|
||||
|
||||
/**
|
||||
* 快递员 或 快递站(没有则为空)
|
||||
*/
|
||||
private String courier;
|
||||
|
||||
|
||||
/**
|
||||
* 快递员电话 (没有则为空)
|
||||
*/
|
||||
private String courierPhone;
|
||||
|
||||
/**
|
||||
* 快递轨迹信息最新时间
|
||||
*/
|
||||
private String updateTime;
|
||||
|
||||
|
||||
/**
|
||||
* 发货到收货消耗时长 (截止最新轨迹)
|
||||
*/
|
||||
private String takeTime;
|
||||
|
||||
|
||||
/**
|
||||
* 快递公司LOGO
|
||||
*/
|
||||
private String logo;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zbkj.common.response.lxkopenapi.express;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 快递轨迹
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
public class LogisticsResultListVo {
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
private String time;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.zbkj.common.response.lxkopenapi.express;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class QueryExpressResult {
|
||||
|
||||
/**
|
||||
* 是否成功
|
||||
*/
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 返回
|
||||
*/
|
||||
private ExpressResult data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.zbkj.common.response.lxkopenapi.face;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class Face {
|
||||
|
||||
/**
|
||||
* 认证通过状态 true:通过,false 未通过
|
||||
*/
|
||||
private Boolean success;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.zbkj.common.response.lxkopenapi.face;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class FaceResult {
|
||||
|
||||
/**
|
||||
* 消息状态码
|
||||
*/
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 返回
|
||||
*/
|
||||
private Face data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.zbkj.common.response.lxkopenapi.free;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* IP返回值
|
||||
*
|
||||
* @author heyi
|
||||
* 2023/10/24
|
||||
*/
|
||||
@Data
|
||||
public class IpInfoResult {
|
||||
|
||||
/**
|
||||
* IP
|
||||
*/
|
||||
private String ip;
|
||||
|
||||
|
||||
/**
|
||||
* 城市信息
|
||||
*/
|
||||
private String cityInfo;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.zbkj.common.response.lxkopenapi.free;
|
||||
|
||||
import com.zbkj.common.response.lxkopenapi.BaseResponse;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class IpResult extends BaseResponse {
|
||||
|
||||
|
||||
/**
|
||||
* 返回
|
||||
*/
|
||||
private IpInfoResult data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zbkj.common.response.lxkopenapi.geo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class AddressGeo {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Boolean success;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 地名
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private Double lng;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private Double lat;
|
||||
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
private String district;
|
||||
|
||||
/**
|
||||
* 街道
|
||||
*/
|
||||
private String street;
|
||||
|
||||
/**
|
||||
* streetNumber
|
||||
*/
|
||||
private String streetNumber;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.zbkj.common.response.lxkopenapi.geo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class AddressGeoResult {
|
||||
|
||||
/**
|
||||
* 消息状态码
|
||||
*/
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 地址to坐标系
|
||||
*/
|
||||
private AddressGeo data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.zbkj.common.response.lxkopenapi.record;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class CommonInfoCount {
|
||||
|
||||
/**
|
||||
* 剩余数量
|
||||
*/
|
||||
private Integer leftCount;
|
||||
|
||||
/**
|
||||
* 使用数量
|
||||
*/
|
||||
private Integer usedCount;
|
||||
|
||||
/**
|
||||
* 总数量
|
||||
*/
|
||||
private Integer count;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.zbkj.common.response.lxkopenapi.record;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class CommonInfoCountResult {
|
||||
|
||||
/**
|
||||
* 消息状态码
|
||||
*/
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 返回
|
||||
*/
|
||||
private CommonInfoCount data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.zbkj.common.response.lxkopenapi.record;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class UserPackageRecord {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 使用时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 已购买的资源包ID
|
||||
*/
|
||||
private Integer packageUserId;
|
||||
|
||||
/**
|
||||
* 资源包ID
|
||||
*/
|
||||
private Integer packageId;
|
||||
|
||||
/**
|
||||
* 调用状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 第三方信息
|
||||
*/
|
||||
private String resultInfo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.zbkj.common.response.lxkopenapi.record;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class UserPackageRecordResult {
|
||||
|
||||
/**
|
||||
* 消息状态码
|
||||
*/
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 总记录数
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
/**
|
||||
* 返回
|
||||
*/
|
||||
private List<UserPackageRecord> rows;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.zbkj.common.response.lxkopenapi.sms;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class SendMesgResult {
|
||||
|
||||
/**
|
||||
* 消息状态码
|
||||
*/
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 返回
|
||||
*/
|
||||
private SmsResult data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.zbkj.common.response.lxkopenapi.sms;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class SmsResult {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Boolean success;
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
private String msg;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.zbkj.common.response.lxkopenapi.words;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class VerifyWords {
|
||||
|
||||
/**
|
||||
* 调用是否成功
|
||||
*/
|
||||
private Boolean success;
|
||||
|
||||
/**
|
||||
* -1: 要审核的文本或地址为空
|
||||
* 01: 不存在关键字
|
||||
* 02: 存在关键字
|
||||
* 03: type传值范围错误
|
||||
*/
|
||||
private String status;
|
||||
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 敏感词集合
|
||||
*/
|
||||
private List<VerifyWordsItem> wordResultItems;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zbkj.common.response.lxkopenapi.words;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class VerifyWordsItem {
|
||||
|
||||
/**
|
||||
* 1 黄赌毒及色情非法信息,2 政治、宗教等不良敏感话题,3 低俗辱骂 4 乱发广告 999 英文骂人等其他敏感词
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 敏感词
|
||||
*/
|
||||
private List<String> words;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.zbkj.common.response.lxkopenapi.words;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huahua
|
||||
* 2023/9/14
|
||||
*/
|
||||
@Data
|
||||
public class VerifyWordsResult {
|
||||
|
||||
/**
|
||||
* 消息状态码
|
||||
*/
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 返回
|
||||
*/
|
||||
private VerifyWords data;
|
||||
|
||||
}
|
||||
@@ -42,13 +42,13 @@ spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/car_server?characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: root
|
||||
password: 123456
|
||||
url: jdbc:mysql://121.199.24.205:9104/diyouzhijia?characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: diyouzhijia
|
||||
password: diyouzhijia123456
|
||||
redis:
|
||||
host: 127.0.0.1 #地址
|
||||
port: 6379 #端口
|
||||
password: 'xxxxxxxxx'
|
||||
host: 121.199.24.205 #地址
|
||||
port: 9106 #端口
|
||||
password: lxk@asLXdwxqp097762
|
||||
timeout: 30000 # 连接超时时间(毫秒)
|
||||
database: 1 #默认数据库
|
||||
jedis:
|
||||
|
||||
@@ -0,0 +1,662 @@
|
||||
package com.zbkj.service.service;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.zbkj.common.config.properties.SmsProperties;
|
||||
import com.zbkj.common.constants.LxkOpenApiConstant;
|
||||
import com.zbkj.common.model.lxkopenapi.*;
|
||||
import com.zbkj.common.response.lxkopenapi.Idcard.IdCardResult;
|
||||
import com.zbkj.common.response.lxkopenapi.express.QueryExpressResult;
|
||||
import com.zbkj.common.response.lxkopenapi.face.FaceResult;
|
||||
import com.zbkj.common.response.lxkopenapi.free.IpInfoResult;
|
||||
import com.zbkj.common.response.lxkopenapi.free.IpResult;
|
||||
import com.zbkj.common.response.lxkopenapi.geo.AddressGeoResult;
|
||||
import com.zbkj.common.response.lxkopenapi.record.CommonInfoCountResult;
|
||||
import com.zbkj.common.response.lxkopenapi.record.UserPackageRecordResult;
|
||||
import com.zbkj.common.response.lxkopenapi.sms.SendMesgResult;
|
||||
import com.zbkj.common.response.lxkopenapi.words.VerifyWordsResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class LxkOpenApiService {
|
||||
|
||||
private static final String HTTPS_URL_PREFIX = "https://saasmall.lianxianke.cn/lxk-api/";
|
||||
@Autowired
|
||||
private SmsProperties lxkOpenApiProperties;
|
||||
|
||||
private String getHttpsUrl(String openServiceApi) {
|
||||
return String.format("%s%s", HTTPS_URL_PREFIX, openServiceApi);
|
||||
}
|
||||
|
||||
private String getHttpsPageURL(String openServiceApi, Integer pageSize, Integer pageNum, String orderByColumn, String isAsc) {
|
||||
return String.format("%s%s?pageSize=%s&pageNum=%s&orderByColumn=%s&isAsc=%s",
|
||||
HTTPS_URL_PREFIX, openServiceApi, pageSize, pageNum, orderByColumn, isAsc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 物流查询 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getQueryExpressURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.ExpressManage.QUERY_EXPRESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物流消耗记录 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getExpressRecordURL(Integer pageSize, Integer pageNum, String orderByColumn, String isAsc) {
|
||||
return getHttpsPageURL(LxkOpenApiConstant.ExpressManage.EXPRESS_RECORD, pageSize, pageNum, orderByColumn, isAsc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 物流套餐数量 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getExpressInfoCountURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.ExpressManage.EXPRESS_INFO_COUNT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送短信 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getSmsSendMesssageURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.SmsManage.SENDSMS);
|
||||
}
|
||||
|
||||
private String getSmsSendYxMesssageURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.SmsManage.SEND_YX_SMS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询短信消耗记录 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getSmsRecordURL(Integer pageSize, Integer pageNum, String orderByColumn, String isAsc) {
|
||||
return getHttpsPageURL(LxkOpenApiConstant.SmsManage.SMS_RECORD, pageSize, pageNum, orderByColumn, isAsc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 短信套餐数量 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getSmsInfoCountURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.SmsManage.SMS_INFO_COUNT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 经纬度解析地址 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getParseLatlngURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.GeoManage.PARSE_LATLNG);
|
||||
}
|
||||
|
||||
/**
|
||||
* 地址解析经纬度 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getParseAddressURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.GeoManage.PARSE_ADDRESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* GEO消耗记录 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getGeoRecordURL(Integer pageSize, Integer pageNum, String orderByColumn, String isAsc) {
|
||||
return getHttpsPageURL(LxkOpenApiConstant.GeoManage.GEO_RECORD, pageSize, pageNum, orderByColumn, isAsc);
|
||||
}
|
||||
|
||||
/**
|
||||
* GEO套餐数量 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getGeoInfoCountURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.GeoManage.GEO_INFO_COUNT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金融级人脸对比验证 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getFaceFaceURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.FaceManage.FACE_V1_FACE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金融级人脸验证加强版 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getFacePlusURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.FaceManage.FACE_V1_FACEPLUS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通人脸对比验证 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getFaceCompareURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.FaceManage.FACE_V1_FACECOMPARE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询金融人脸消耗记录 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getFacePlusRecordURL(Integer pageSize, Integer pageNum, String orderByColumn, String isAsc) {
|
||||
return getHttpsPageURL(LxkOpenApiConstant.FaceManage.FACE_V1_FACEPLUS_RECORD, pageSize, pageNum, orderByColumn, isAsc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金融级人脸套餐数量 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getFacePlusInfoCountURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.FaceManage.FACEPLUS_INFO_COUNT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实名认证 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getIdVerifyIdCardURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.IdCardManage.VERIFY_IDCARD);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实名消耗记录 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getIdCardRecordURL(Integer pageSize, Integer pageNum, String orderByColumn, String isAsc) {
|
||||
return getHttpsPageURL(LxkOpenApiConstant.IdCardManage.IDCARD_RECORD, pageSize, pageNum, orderByColumn, isAsc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实名套餐数量 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getIdCardInfoCountURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.IdCardManage.IDCARD_INFO_COUNT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 敏感词识别接口 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getVerifyWordsURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.SensitiveWordsManage.VERIFY_WORDS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 敏感词消耗记录 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getWordsRecordURL(Integer pageSize, Integer pageNum, String orderByColumn, String isAsc) {
|
||||
return getHttpsPageURL(LxkOpenApiConstant.SensitiveWordsManage.WORDS_RECORD, pageSize, pageNum, orderByColumn, isAsc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 敏感词套餐数量 URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getWordsInfoCountURL() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.SensitiveWordsManage.WORDS_INFO_COUNT);
|
||||
}
|
||||
|
||||
|
||||
private String getApiIpUrl() {
|
||||
return getHttpsUrl(LxkOpenApiConstant.FreeAPI.IP_URL);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物流
|
||||
*
|
||||
* @param queryExpressRequest
|
||||
* @return
|
||||
*/
|
||||
public QueryExpressResult queryExpress(QueryExpressRequest queryExpressRequest) {
|
||||
String httpsUrl = getQueryExpressURL();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
if (StrUtil.isNotBlank(queryExpressRequest.getType())) {
|
||||
jsonObject.put("type", queryExpressRequest.getType());
|
||||
}
|
||||
jsonObject.put("no", queryExpressRequest.getNo());
|
||||
log.info("查询物流,请求参数:{}", jsonObject);
|
||||
String result = HttpUtil.createPost(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.contentType("application/json")
|
||||
.body(jsonObject.toJSONString(0)).execute().body();
|
||||
return JSONUtil.toBean(result, QueryExpressResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物流消耗记录
|
||||
*
|
||||
* @param pageQueryRequest
|
||||
* @return
|
||||
*/
|
||||
public UserPackageRecordResult expressRecord(PageQueryRequest pageQueryRequest) {
|
||||
String httpsUrl = getExpressRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc());
|
||||
String result = HttpUtil.createGet(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.execute()
|
||||
.charset("utf-8")
|
||||
.body();
|
||||
return JSONUtil.toBean(result, UserPackageRecordResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 物流套餐数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public CommonInfoCountResult expressInfoCount() {
|
||||
String httpsUrl = getExpressInfoCountURL();
|
||||
String result = HttpUtil.createGet(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.execute()
|
||||
.charset("utf-8")
|
||||
.body();
|
||||
return JSONUtil.toBean(result, CommonInfoCountResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送营销短信
|
||||
*
|
||||
* @param smsSendRequest
|
||||
* @return
|
||||
*/
|
||||
public SendMesgResult smsSendYxMesssage(SmsSendRequest smsSendRequest) {
|
||||
String httpsUrl = getSmsSendYxMesssageURL();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("mobile", smsSendRequest.getMobile());
|
||||
jsonObject.put("smsSignId", lxkOpenApiProperties.getSmsSignId());
|
||||
jsonObject.put("templateId", smsSendRequest.getTemplateId());
|
||||
jsonObject.put("paramMap", smsSendRequest.getParamMap());
|
||||
String result = HttpUtil.createPost(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.contentType("application/json")
|
||||
.body(jsonObject.toJSONString(0)).execute().body();
|
||||
return JSONUtil.toBean(result, SendMesgResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送短信
|
||||
*
|
||||
* @param smsSendRequest
|
||||
* @return
|
||||
*/
|
||||
public SendMesgResult smsSendMesssage(SmsSendRequest smsSendRequest) {
|
||||
String httpsUrl = getSmsSendMesssageURL();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("mobile", smsSendRequest.getMobile());
|
||||
jsonObject.put("smsSignId", lxkOpenApiProperties.getSmsSignId());
|
||||
jsonObject.put("templateId", smsSendRequest.getTemplateId());
|
||||
jsonObject.put("paramMap", smsSendRequest.getParamMap());
|
||||
String result = HttpUtil.createPost(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.contentType("application/json")
|
||||
.body(jsonObject.toJSONString(0)).execute().body();
|
||||
return JSONUtil.toBean(result, SendMesgResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询短信消耗记录
|
||||
*
|
||||
* @param pageQueryRequest
|
||||
* @return
|
||||
*/
|
||||
public UserPackageRecordResult smsRecord(PageQueryRequest pageQueryRequest) {
|
||||
String httpsUrl = getSmsRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc());
|
||||
String result = HttpUtil.createGet(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.execute()
|
||||
.charset("utf-8")
|
||||
.body();
|
||||
return JSONUtil.toBean(result, UserPackageRecordResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 短信套餐数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public CommonInfoCountResult smsInfoCount() {
|
||||
String httpsUrl = getSmsInfoCountURL();
|
||||
String result = HttpUtil.createGet(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.execute()
|
||||
.charset("utf-8")
|
||||
.body();
|
||||
return JSONUtil.toBean(result, CommonInfoCountResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 经纬度解析地址
|
||||
*
|
||||
* @param geoLatLngRequest
|
||||
* @return
|
||||
*/
|
||||
public AddressGeoResult parseLatlng(GeoLatLngRequest geoLatLngRequest) {
|
||||
String httpsUrl = getParseLatlngURL();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("lng", geoLatLngRequest.getLng());
|
||||
jsonObject.put("lat", geoLatLngRequest.getLat());
|
||||
String result = HttpUtil.createPost(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.contentType("application/json")
|
||||
.body(jsonObject.toJSONString(0)).execute().body();
|
||||
return JSONUtil.toBean(result, AddressGeoResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 地址解析经纬度
|
||||
*
|
||||
* @param address 地址
|
||||
* @return
|
||||
*/
|
||||
public AddressGeoResult parseAddress(String address) {
|
||||
String httpsUrl = getParseAddressURL();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("address", address);
|
||||
String result = HttpUtil.createPost(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.contentType("application/json")
|
||||
.body(jsonObject.toJSONString(0)).execute().body();
|
||||
return JSONUtil.toBean(result, AddressGeoResult.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询GEO消耗记录
|
||||
*
|
||||
* @param pageQueryRequest
|
||||
* @return
|
||||
*/
|
||||
public UserPackageRecordResult geoRecord(PageQueryRequest pageQueryRequest) {
|
||||
String httpsUrl = getGeoRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc());
|
||||
String result = HttpUtil.createGet(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.execute()
|
||||
.charset("utf-8")
|
||||
.body();
|
||||
return JSONUtil.toBean(result, UserPackageRecordResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* GEO套餐数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public CommonInfoCountResult geoInfoCount() {
|
||||
String httpsUrl = getGeoInfoCountURL();
|
||||
String result = HttpUtil.createGet(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.execute()
|
||||
.charset("utf-8")
|
||||
.body();
|
||||
return JSONUtil.toBean(result, CommonInfoCountResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金融级人脸对比验证
|
||||
*
|
||||
* @param faceFaceRequest
|
||||
* @return
|
||||
*/
|
||||
public FaceResult faceFace(FaceFaceRequest faceFaceRequest) {
|
||||
String httpsUrl = getFaceFaceURL();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("faceUrl", faceFaceRequest.getFaceUrl());
|
||||
jsonObject.put("faceUrl2", faceFaceRequest.getFaceUrlSecond());
|
||||
jsonObject.put("idCardNo", faceFaceRequest.getIdCardNo());
|
||||
jsonObject.put("name", faceFaceRequest.getName());
|
||||
String result = HttpUtil.createPost(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.contentType("application/json")
|
||||
.body(jsonObject.toJSONString(0)).execute().body();
|
||||
return JSONUtil.toBean(result, FaceResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金融级人脸验证加强版
|
||||
*
|
||||
* @param facePlusRequest
|
||||
* @return
|
||||
*/
|
||||
public FaceResult facePlus(FacePlusRequest facePlusRequest) {
|
||||
String httpsUrl = getFacePlusURL();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("faceUrl", facePlusRequest.getFaceUrl());
|
||||
jsonObject.put("idCardNo", facePlusRequest.getIdCardNo());
|
||||
jsonObject.put("name", facePlusRequest.getName());
|
||||
String result = HttpUtil.createPost(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.contentType("application/json")
|
||||
.body(jsonObject.toJSONString(0)).execute().body();
|
||||
return JSONUtil.toBean(result, FaceResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通人脸对比验证
|
||||
*
|
||||
* @param faceCompareRequest
|
||||
* @return
|
||||
*/
|
||||
public FaceResult faceCompare(FaceCompareRequest faceCompareRequest) {
|
||||
String httpsUrl = getFaceCompareURL();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("faceUrl", faceCompareRequest.getFaceUrl());
|
||||
jsonObject.put("faceUrl2", faceCompareRequest.getFaceUrlSecond());
|
||||
if (StrUtil.isNotBlank(faceCompareRequest.getName())) {
|
||||
jsonObject.put("name", faceCompareRequest.getName());
|
||||
}
|
||||
if (StrUtil.isNotBlank(faceCompareRequest.getIdCardNo())) {
|
||||
jsonObject.put("idCardNo", faceCompareRequest.getIdCardNo());
|
||||
}
|
||||
String result = HttpUtil.createPost(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.contentType("application/json")
|
||||
.body(jsonObject.toJSONString(0)).execute().body();
|
||||
return JSONUtil.toBean(result, FaceResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询金融人脸消耗记录
|
||||
*
|
||||
* @param pageQueryRequest
|
||||
* @return
|
||||
*/
|
||||
public UserPackageRecordResult facePlusRecord(PageQueryRequest pageQueryRequest) {
|
||||
String httpsUrl = getFacePlusRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc());
|
||||
String result = HttpUtil.createGet(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.execute()
|
||||
.charset("utf-8")
|
||||
.body();
|
||||
return JSONUtil.toBean(result, UserPackageRecordResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金融级人脸套餐数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public CommonInfoCountResult facePlusCount() {
|
||||
String httpsUrl = getFacePlusInfoCountURL();
|
||||
String result = HttpUtil.createGet(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.execute()
|
||||
.charset("utf-8")
|
||||
.body();
|
||||
return JSONUtil.toBean(result, CommonInfoCountResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实名认证
|
||||
*
|
||||
* @param verifyIdCardRequest
|
||||
* @return
|
||||
*/
|
||||
public IdCardResult verifyIdCard(VerifyIdCardRequest verifyIdCardRequest) {
|
||||
String httpsUrl = getIdVerifyIdCardURL();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("idCardNo", verifyIdCardRequest.getIdCardNo());
|
||||
jsonObject.put("name", verifyIdCardRequest.getName());
|
||||
log.info(jsonObject.toJSONString(0));
|
||||
String result = HttpUtil.createPost(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.contentType("application/json")
|
||||
.body(jsonObject.toJSONString(0)).execute().body();
|
||||
log.info(result);
|
||||
return JSONUtil.toBean(result, IdCardResult.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 实名消耗记录
|
||||
*
|
||||
* @param pageQueryRequest
|
||||
* @return
|
||||
*/
|
||||
public UserPackageRecordResult idCardRecord(PageQueryRequest pageQueryRequest) {
|
||||
String httpsUrl = getIdCardRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc());
|
||||
String result = HttpUtil.createGet(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.execute()
|
||||
.charset("utf-8")
|
||||
.body();
|
||||
return JSONUtil.toBean(result, UserPackageRecordResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实名套餐数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public CommonInfoCountResult idCardInfoCount() {
|
||||
String httpsUrl = getIdCardInfoCountURL();
|
||||
String result = HttpUtil.createGet(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.execute()
|
||||
.charset("utf-8")
|
||||
.body();
|
||||
return JSONUtil.toBean(result, CommonInfoCountResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 敏感词识别接口
|
||||
*
|
||||
* @param verifyWordsRequest
|
||||
* @return
|
||||
*/
|
||||
public VerifyWordsResult verifyWords(VerifyWordsRequest verifyWordsRequest) {
|
||||
String httpsUrl = getVerifyWordsURL();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("content", verifyWordsRequest.getContent());
|
||||
jsonObject.put("type", verifyWordsRequest.getType());
|
||||
String result = HttpUtil.createPost(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.contentType("application/json")
|
||||
.body(jsonObject.toJSONString(0)).execute().body();
|
||||
return JSONUtil.toBean(result, VerifyWordsResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 敏感词消耗记录
|
||||
*
|
||||
* @param pageQueryRequest
|
||||
* @return
|
||||
*/
|
||||
public UserPackageRecordResult wordsRecord(PageQueryRequest pageQueryRequest) {
|
||||
String httpsUrl = getWordsRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc());
|
||||
String result = HttpUtil.createGet(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.execute()
|
||||
.charset("utf-8")
|
||||
.body();
|
||||
return JSONUtil.toBean(result, UserPackageRecordResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 敏感词套餐数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public CommonInfoCountResult wordsInfoCount() {
|
||||
String httpsUrl = getWordsInfoCountURL();
|
||||
String result = HttpUtil.createGet(httpsUrl)
|
||||
.header("access_key", lxkOpenApiProperties.getLxkAccessKey())
|
||||
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
|
||||
.execute()
|
||||
.charset("utf-8")
|
||||
.body();
|
||||
return JSONUtil.toBean(result, CommonInfoCountResult.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前机器的公网IP
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public IpInfoResult getCurrentIp() {
|
||||
String httpsUrl = getApiIpUrl();
|
||||
String result = HttpUtil.createGet(httpsUrl)
|
||||
.execute()
|
||||
.charset("utf-8")
|
||||
.body();
|
||||
IpResult ipResult = JSONUtil.toBean(result, IpResult.class);
|
||||
return ipResult.getData();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user