Ver Código Fonte

合并海图参数

konghl 4 anos atrás
pai
commit
499e7a7d94

+ 1 - 15
ebc-sea-platform/src/main/java/com/ai/ipu/server/controller/GisParamController.java

@ -24,23 +24,9 @@ public class GisParamController {
24 24
    
25 25
    @Autowired
26 26
    GisTokenService gisTokenService;
27
28
    /**
29
     * 获取gis的token
30
     * @return
31
     * @throws Exception
32
     */
33
    @ResponseBody
34
    @RequestMapping("/gisToken")
35
    public JMap getGisToken() throws Exception {
36
        Map<String, Object> GisTokenMap = gisTokenService.getGisToken();
37
        JMap result = new JsonMap();
38
        result.put("result", GisTokenMap);
39
        return result;
40
    }
41 27
    
42 28
    /**
43
     * 获取海图相关的参数(中心坐标、比例尺)
29
     * 获取海图相关的参数(token、中心坐标、比例尺)
44 30
     * @return
45 31
     * @throws Exception
46 32
     */

+ 5 - 6
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/impl/GisTokenServiceImpl.java

@ -36,21 +36,20 @@ public class GisTokenServiceImpl implements GisTokenService {
36 36
	private String scale;
37 37
38 38
	@Override
39
	public Map<String, Object> getGisToken() {
39
	public Map<String, Object> getSeaMapParam() {
40 40
		Map<String, Object> mapParams = new HashMap<>();
41 41
		mapParams.put("userName", gisUserName);
42 42
		mapParams.put("passwd", gisPasswd);
43 43
44
		logger.debug("准备获取gisToken:userName=" + gisUserName + ",passwd=" + gisPasswd);
45
44 46
		Charset charset = Charset.forName("utf-8");
45 47
		String resultJson = HttpServiceUtil.sendPost(tokenUrl, mapParams, charset);
46 48
49
		logger.debug("已获取gisToken:" + resultJson);
50
47 51
		Map<String, Object> resultMap = JSON.parseObject(resultJson, Map.class);
48
		return resultMap;
49
	}
50 52
51
	@Override
52
	public Map<String, Object> getSeaMapParam() {
53
		Map<String, Object> resultMap = new HashMap<>();
54 53
		resultMap.put("longitude", longitude);
55 54
		resultMap.put("latitude", latitude);
56 55
		resultMap.put("scale", scale);

+ 0 - 2
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/interfaces/GisTokenService.java

@ -4,7 +4,5 @@ import java.util.Map;
4 4
5 5
public interface GisTokenService {
6 6
7
    Map<String, Object> getGisToken();
8
    
9 7
    Map<String, Object> getSeaMapParam();
10 8
}