From 58d9ab55185c96ef75fd379e752fa36810dc6892 Mon Sep 17 00:00:00 2001 From: msb_89821 Date: Sat, 22 Oct 2022 18:23:23 +0800 Subject: [PATCH] =?UTF-8?q?add:=E5=AE=9E=E7=8E=B0service-map=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v1/onelinetextplublic/service-map/pom.xml | 45 ++++++++++++++++++ .../service/map/ServiceMapApplication.java | 24 ++++++++++ .../map/controller/DistanceController.java | 40 ++++++++++++++++ .../service/map/service/DistanceService.java | 35 ++++++++++++++ .../src/main/resources/application.yml | 16 +++++++ .../service/map/ServiceMapApplication.class | Bin 0 -> 739 bytes .../com/mashibing/dto/DistanceResult.java | 28 +++++++++++ 7 files changed, 188 insertions(+) create mode 100644 oneLineTxt/v1/onelinetextplublic/service-map/pom.xml create mode 100644 oneLineTxt/v1/onelinetextplublic/service-map/src/main/java/com/mashibing/service/map/ServiceMapApplication.java create mode 100644 oneLineTxt/v1/onelinetextplublic/service-map/src/main/java/com/mashibing/service/map/controller/DistanceController.java create mode 100644 oneLineTxt/v1/onelinetextplublic/service-map/src/main/java/com/mashibing/service/map/service/DistanceService.java create mode 100644 oneLineTxt/v1/onelinetextplublic/service-map/src/main/resources/application.yml create mode 100644 oneLineTxt/v1/onelinetextplublic/target/classes/com/mashibing/service/map/ServiceMapApplication.class create mode 100644 oneLineTxt/v1/onelinetextplublic/untitled4/src/main/java/com/mashibing/dto/DistanceResult.java diff --git a/oneLineTxt/v1/onelinetextplublic/service-map/pom.xml b/oneLineTxt/v1/onelinetextplublic/service-map/pom.xml new file mode 100644 index 0000000..74d58a7 --- /dev/null +++ b/oneLineTxt/v1/onelinetextplublic/service-map/pom.xml @@ -0,0 +1,45 @@ + + + + + oneline-text-plublic + com.mashibing + 1.0-SNAPSHOT + + + 4.0.0 + + service-map + + + + org.springframework.boot + spring-boot-starter-web + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + com.mashibing + untitled4 + 1.0-SNAPSHOT + compile + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + \ No newline at end of file diff --git a/oneLineTxt/v1/onelinetextplublic/service-map/src/main/java/com/mashibing/service/map/ServiceMapApplication.java b/oneLineTxt/v1/onelinetextplublic/service-map/src/main/java/com/mashibing/service/map/ServiceMapApplication.java new file mode 100644 index 0000000..99448a4 --- /dev/null +++ b/oneLineTxt/v1/onelinetextplublic/service-map/src/main/java/com/mashibing/service/map/ServiceMapApplication.java @@ -0,0 +1,24 @@ +package com.mashibing.service.map; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Copyright© 2020.10.20 by 博纳德集团有限公司.All rights reserved. + * 1.版权归博纳德集团公司所有; + * 2.未经原作者允许不得转载本代码内容,否则将视为侵权; + * 3.对于不遵守此声明或者其他违法使用本代码内容者,本公司依法保留追究权。. + * Description:
+ * + * @author nod + * ProjectName: onelinetextplublic + *
PackageName: com.mashibing.service.map + *
ClassName: + *
Date: 2022/10/22 16:32 + */ +@SpringBootApplication +public class ServiceMapApplication { + public static void main(String[] args) { + SpringApplication.run(ServiceMapApplication.class,args); + } +} diff --git a/oneLineTxt/v1/onelinetextplublic/service-map/src/main/java/com/mashibing/service/map/controller/DistanceController.java b/oneLineTxt/v1/onelinetextplublic/service-map/src/main/java/com/mashibing/service/map/controller/DistanceController.java new file mode 100644 index 0000000..f499631 --- /dev/null +++ b/oneLineTxt/v1/onelinetextplublic/service-map/src/main/java/com/mashibing/service/map/controller/DistanceController.java @@ -0,0 +1,40 @@ +package com.mashibing.service.map.controller; + +import com.alibaba.fastjson.JSON; +import com.mashibing.dto.AddressLatiLong; +import com.mashibing.dto.DistanceResult; +import com.mashibing.dto.ResponseResult; +import com.mashibing.service.map.service.DistanceService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * Copyright© 2020.10.20 by 博纳德集团有限公司.All rights reserved. + * 1.版权归博纳德集团公司所有; + * 2.未经原作者允许不得转载本代码内容,否则将视为侵权; + * 3.对于不遵守此声明或者其他违法使用本代码内容者,本公司依法保留追究权。. + * Description:
+ * + * @author nod + * ProjectName: onelinetextplublic + *
PackageName: com.mashibing.service.map.controller + *
ClassName: + *
Date: 2022/10/22 17:07 + */ +@Slf4j +@RestController +public class DistanceController { + + @Resource + private DistanceService distanceService; + + @PostMapping("/queryDistanceResult") + public ResponseResult queryDistanceResult(@RequestBody AddressLatiLong addressLatiLong){ + log.info("service-map 获取请求参数={}", JSON.toJSONString(addressLatiLong)); + return ResponseResult.success(distanceService.queryDistanceResult(addressLatiLong)); + } +} diff --git a/oneLineTxt/v1/onelinetextplublic/service-map/src/main/java/com/mashibing/service/map/service/DistanceService.java b/oneLineTxt/v1/onelinetextplublic/service-map/src/main/java/com/mashibing/service/map/service/DistanceService.java new file mode 100644 index 0000000..5492cde --- /dev/null +++ b/oneLineTxt/v1/onelinetextplublic/service-map/src/main/java/com/mashibing/service/map/service/DistanceService.java @@ -0,0 +1,35 @@ +package com.mashibing.service.map.service; + +import com.alibaba.fastjson.JSON; +import com.mashibing.dto.AddressLatiLong; +import com.mashibing.dto.DistanceResult; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * Copyright© 2020.10.20 by 博纳德集团有限公司.All rights reserved. + * 1.版权归博纳德集团公司所有; + * 2.未经原作者允许不得转载本代码内容,否则将视为侵权; + * 3.对于不遵守此声明或者其他违法使用本代码内容者,本公司依法保留追究权。. + * Description:
+ * + * @author nod + * ProjectName: onelinetextplublic + *
PackageName: com.mashibing.service.map.service + *
ClassName: + *
Date: 2022/10/22 17:30 + */ +@Slf4j +@Service +public class DistanceService { + + private static final String reqPath = "/v3/direction/driving"; + + public DistanceResult queryDistanceResult(AddressLatiLong addressLatiLong){ + log.info("调高德服务商获取距离 参数={}", JSON.toJSONString(addressLatiLong)); + + DistanceResult distanceResult =new DistanceResult(); + + return distanceResult; + } +} diff --git a/oneLineTxt/v1/onelinetextplublic/service-map/src/main/resources/application.yml b/oneLineTxt/v1/onelinetextplublic/service-map/src/main/resources/application.yml new file mode 100644 index 0000000..11c5ecf --- /dev/null +++ b/oneLineTxt/v1/onelinetextplublic/service-map/src/main/resources/application.yml @@ -0,0 +1,16 @@ +server: + port: 8087 + + +spring: + cloud: + nacos: + discovery: + server-addr: 127.0.0.1:8848 + application: + name: service-map + +gaodeMap: + key: 595148d3d09d60942adaaacf7dfb95aa + url: https://restapi.amap.com + diff --git a/oneLineTxt/v1/onelinetextplublic/target/classes/com/mashibing/service/map/ServiceMapApplication.class b/oneLineTxt/v1/onelinetextplublic/target/classes/com/mashibing/service/map/ServiceMapApplication.class new file mode 100644 index 0000000000000000000000000000000000000000..465c87b84629200acdfd2444d9b006754ad0f9b1 GIT binary patch literal 739 zcmb7CO;6iE5Pcg04kqOz;k#UV3pubtLR?Zsf=Ha)R%%c<^t3ihSg?1k^&0xOdTP}} ze?Wf}V%9;zhj74$8PB|(nfGS*|I^=p08VfaqKVA_TOqcw6JVEN>9f+x4H*`ChZBb8 z$XrW?wMc3Cwaj8^FGZYErW2V&q!VG4k6)5acdH79<0vs1&qQ&nVx_0NkoG|(k}^3T z&;GxN{4CE?l?bPd9?+mnD9y0l`w`uV2fC_L>^+Z-aa@$nBu3w;X=x=N zS4YkXsB36r5lamGo!SHJwXu(n4C}ALzr}YlaSZ)88O=D<=F^SYk~SFkY6~2tq9_J) zc6K;dD@k zo*h7l6^fQA{y-UDd|EXFTAfD!4;HRo>qA07FEqeTtw#&1SfhLc>y_O=hrFNF1)c$e CX~by& literal 0 HcmV?d00001 diff --git a/oneLineTxt/v1/onelinetextplublic/untitled4/src/main/java/com/mashibing/dto/DistanceResult.java b/oneLineTxt/v1/onelinetextplublic/untitled4/src/main/java/com/mashibing/dto/DistanceResult.java new file mode 100644 index 0000000..d2f3d3a --- /dev/null +++ b/oneLineTxt/v1/onelinetextplublic/untitled4/src/main/java/com/mashibing/dto/DistanceResult.java @@ -0,0 +1,28 @@ +package com.mashibing.dto; + +import lombok.Data; + +/** + * Copyright© 2020.10.20 by 博纳德集团有限公司.All rights reserved. + * 1.版权归博纳德集团公司所有; + * 2.未经原作者允许不得转载本代码内容,否则将视为侵权; + * 3.对于不遵守此声明或者其他违法使用本代码内容者,本公司依法保留追究权。. + * Description:
+ * + * @author nod + * ProjectName: onelinetextplublic + *
PackageName: com.mashibing.dto + *
ClassName: + *
Date: 2022/10/22 11:16 + */ +@Data +public class DistanceResult { + + private Integer distance; + private Integer duration; + + public DistanceResult(Integer distance, Integer duration) { + this.distance = distance; + this.duration = duration; + } +}