新增 高德查询充电站信息接口

This commit is contained in:
Lemon
2023-06-14 17:21:51 +08:00
parent a3513e3cc0
commit c2c238fb81
9 changed files with 241 additions and 4 deletions

View 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;
}

View 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);
}
}