Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rbmonster committed Jun 15, 2020
0 parents commit f3c0034
Show file tree
Hide file tree
Showing 68 changed files with 2,203 additions and 0 deletions.
69 changes: 69 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.example</groupId>
<artifactId>learningNote</artifactId>
<version>1.0-SNAPSHOT</version>


<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId> <!-- Use 'netty-all' for 4.0 or above -->
<version>4.1.10.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.23.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>2.2.3.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
</dependency>

</dependencies>
</project>
24 changes: 24 additions & 0 deletions src/main/java/com/learning/LearnApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.learning;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;

/**
* <pre>
* @Description: TODO(一句话描述该类的功能)
* </pre>
*
* @version v1.0
* @ClassName: LearnApplication
* @Author: 86159
* @Date: 2020/4/19 22:17
*/
@SpringBootApplication
@EnableFeignClients
public class LearnApplication {

public static void main(String[] args) {
SpringApplication.run(LearnApplication.class, args);
}
}
32 changes: 32 additions & 0 deletions src/main/java/com/learning/client/AddressComponent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.learning.client;

import lombok.Getter;
import lombok.Setter;

/**
* <pre>
* 描述:TODO
* </pre>
*
* @类名:com.xy.tms.baiDuPosition.entity.AddressComponent
* @作者: ht_hbs
* @创建日期: 2019/9/2 19:07
*/
@Getter
@Setter
public class AddressComponent {
private String country;
private String country_code;
private String country_code_iso;
private String country_code_iso2;
private String province;
private String city;
private String city_level;
private String district;
private String town;
private String adcode;
private String street;
private String street_number;
private String direction;
private String distance;
}
47 changes: 47 additions & 0 deletions src/main/java/com/learning/client/BaiduMapClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.learning.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
* <pre>
* 描述:百度定位地址解析获取
* http://api.map.baidu.com/geocoding/v3/?address=%E4%B8%8A%E6%B5%B7%E5%B8%82&output=json&ak=tvjX68wYlVlHM0acgnPxhuqnyj3mBpBx&callback=sh
* </pre>
*
* @类名:com.xy.tms.api.baiduMap.BaiduMapClient
* @作者: 洪杉铷
* @创建日期: 2019/9/23 14:56
*/
@FeignClient(name = "baidu-map-service", url = "http://api.map.baidu.com")
public interface BaiduMapClient {

/**
* 根据地址获取经纬度
* @param address
* @param output
* @param ak
* @return
*/
@GetMapping(path = "/geocoding/v3/")
String getLatitudeAndLongitude(@RequestParam("address") String address, @RequestParam("output") String output, @RequestParam("ak") String ak);

/**
* 根据经纬度获取地址
* @param ak
* @param output
* @param coordtype
* @param location
* @return
*/
@GetMapping(path = "/reverse_geocoding/v3/")
String getAddressByLatAndLtude(@RequestParam("ak") String ak, @RequestParam("output") String output, @RequestParam("coordtype") String coordtype, @RequestParam("location") String location);

@GetMapping(path = "/directionlite/v1/driving")
String getRoad(@RequestParam("origin")String origin,@RequestParam("destination")String destination,@RequestParam("ak")String ak);
}



21 changes: 21 additions & 0 deletions src/main/java/com/learning/client/Destination.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.learning.client;

import lombok.Data;

/**
* <pre>
* @Description:
* TODO
* </pre>
*
* @version v1.0
* @ClassName: destination
* @Author: sanwu
* @Date: 2020/6/10 22:41
*/
@Data
public class Destination {

private double lng;
private double lat;
}
20 changes: 20 additions & 0 deletions src/main/java/com/learning/client/Location.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.learning.client;

import lombok.Getter;
import lombok.Setter;

/**
* <pre>
* 描述:TODO
* </pre>
*
* @类名:com.xy.tms.baiDuPosition.entity.Location
* @作者: ht_hbs
* @创建日期: 2019/9/2 19:05
*/
@Getter
@Setter
public class Location {
private Double lng;
private Double lat;
}
22 changes: 22 additions & 0 deletions src/main/java/com/learning/client/Origin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.learning.client;

import lombok.Getter;
import lombok.Setter;

/**
* <pre>
* @Description:
* TODO
* </pre>
*
* @version v1.0
* @ClassName: Origin
* @Author: sanwu
* @Date: 2020/6/10 22:40
*/
@Getter
@Setter
public class Origin {
private double lng;
private double lat;
}
19 changes: 19 additions & 0 deletions src/main/java/com/learning/client/PoiRegions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.learning.client;

import lombok.Getter;
import lombok.Setter;

/**
* <pre>
* 描述:TODO
* </pre>
*
* @类名:com.xy.tms.baiDuPosition.entity.PoiRegions
* @作者: ht_hbs
* @创建日期: 2019/9/2 19:09
*/
@Getter
@Setter
public class PoiRegions {
private String one;
}
19 changes: 19 additions & 0 deletions src/main/java/com/learning/client/Pois.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.learning.client;

import lombok.Getter;
import lombok.Setter;

/**
* <pre>
* 描述:TODO
* </pre>
*
* @类名:com.xy.tms.baiDuPosition.entity.Pois
* @作者: ht_hbs
* @创建日期: 2019/9/2 19:11
*/
@Getter
@Setter
public class Pois {
private String one;
}
24 changes: 24 additions & 0 deletions src/main/java/com/learning/client/ReceData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.learning.client;

import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
* <pre>
* 描述:TODO
* </pre>
*
* @类名:com.xy.tms.baiDuPosition.entity.latitudeLongitude.receData
* @作者: ht_hbs
* @创建日期: 2019/9/2 19:17
*/
@Getter
@Setter
public class ReceData {
private int status;
private String message;
private Result result;

}
35 changes: 35 additions & 0 deletions src/main/java/com/learning/client/Result.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.learning.client;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
* <pre>
* 描述:TODO
* </pre>
*
* @类名:com.xy.tms.baiDuPosition.entity.Result
* @作者: ht_hbs
* @创建日期: 2019/9/2 19:04
*/
@Getter
@Setter
public class Result {
private Location location;
private int precise;
private int confidence;
private int comprehension;
private String level;
private String formatted_address;
private String business;
private AddressComponent addressComponent;
private List<PoiRegions> poiRegions;
private List<Roads> roads;
private List<Pois> pois;
private String sematic_description;
private int cityCode;

}
23 changes: 23 additions & 0 deletions src/main/java/com/learning/client/RoadData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.learning.client;

import lombok.Getter;
import lombok.Setter;

/**
* <pre>
* @Description:
* TODO
* </pre>
*
* @version v1.0
* @ClassName: RoadData
* @Author: sanwu
* @Date: 2020/6/10 22:52
*/
@Getter
@Setter
public class RoadData {
private int status;
private String message;
private RoadResult result;
}
25 changes: 25 additions & 0 deletions src/main/java/com/learning/client/RoadResult.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.learning.client;

import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
* <pre>
* @Description:
* TODO
* </pre>
*
* @version v1.0
* @ClassName: RoadResult
* @Author: sanwu
* @Date: 2020/6/10 22:52
*/
@Getter
@Setter
public class RoadResult {
private Origin origin;
private Destination destination;
private List<Routes> routes;
}
Loading

0 comments on commit f3c0034

Please sign in to comment.