mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-26 22:15:06 +08:00
新增 高德查询充电站信息接口
This commit is contained in:
42
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/common/AMapCommonParams.java
vendored
Normal file
42
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/common/AMapCommonParams.java
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
package com.jsowell.thirdparty.amap.common;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
import lombok.Value;
|
||||
|
||||
/**
|
||||
* 高德地图通用入参
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/6/14 13:37
|
||||
*/
|
||||
@Data
|
||||
public class AMapCommonParams {
|
||||
// 时间戳(毫秒)
|
||||
@JSONField(name = "utc_timestamp")
|
||||
private String utcTimestamp;
|
||||
|
||||
// 版本号
|
||||
private String version;
|
||||
|
||||
// 字符串编码
|
||||
private String charset;
|
||||
|
||||
// 接口全限定名
|
||||
private String method;
|
||||
|
||||
// 签名
|
||||
private String sign;
|
||||
|
||||
// 签名类型
|
||||
@JSONField(name = "sign_type")
|
||||
private String signType;
|
||||
|
||||
// 应用id
|
||||
@JSONField(name = "app_id")
|
||||
private String appId;
|
||||
|
||||
// 请求业务体
|
||||
@JSONField(name = "biz_content")
|
||||
private String bizContent;
|
||||
}
|
||||
55
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/common/AMapCommonResult.java
vendored
Normal file
55
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/common/AMapCommonResult.java
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
package com.jsowell.thirdparty.amap.common;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 高德地图通用返回类
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/6/14 13:11
|
||||
*/
|
||||
@Data
|
||||
public class AMapCommonResult {
|
||||
|
||||
private Response response;
|
||||
|
||||
|
||||
@Data
|
||||
public static class Response{
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
private Object data;
|
||||
}
|
||||
|
||||
public AMapCommonResult(Response response) {
|
||||
this.response = response;
|
||||
}
|
||||
|
||||
public AMapCommonResult() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 成功响应
|
||||
* @param responseData
|
||||
* @return
|
||||
*/
|
||||
public AMapCommonResult successResponse(Object responseData) {
|
||||
AMapCommonResult result = new AMapCommonResult();
|
||||
result.response.setCode("1000");
|
||||
result.response.setMsg("请求成功");
|
||||
result.response.setData(responseData);
|
||||
return new AMapCommonResult(result.response);
|
||||
}
|
||||
|
||||
public AMapCommonResult failedResponse() {
|
||||
AMapCommonResult result = new AMapCommonResult();
|
||||
result.response.setCode("40004");
|
||||
result.response.setMsg("接口异常");
|
||||
return new AMapCommonResult(result.response);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user