소스 검색

添加获取两个经纬度的距离接口

qrs 2 주 전
부모
커밋
058a167d01
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      alien-store/src/main/java/shop/alien/store/controller/GaoDeController.java

+ 12 - 0
alien-store/src/main/java/shop/alien/store/controller/GaoDeController.java

@@ -118,4 +118,16 @@ public class GaoDeController {
 
     }
 
+    @ApiOperation("获取两个经纬度的距离")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "longitudeOne", value = "经度1", dataType = "String", paramType = "query", required = true),
+            @ApiImplicitParam(name = "latitudeOne", value = "纬度1", dataType = "String", paramType = "query", required = true),
+            @ApiImplicitParam(name = "longitudeTwo", value = "纬度2", dataType = "String", paramType = "query", required = true),
+            @ApiImplicitParam(name = "latitudeTwo", value = "纬度2", dataType = "String", paramType = "query", required = true)
+    })
+    @GetMapping("/getDistance")
+    public R<Double> getDistance(String longitudeOne, String latitudeOne, String longitudeTwo, String latitudeTwo) {
+        return R.data(gaodeMapUtil.getDistance(longitudeOne, latitudeOne, longitudeTwo, latitudeTwo));
+    }
+
 }