服务调用、依赖优化
This commit is contained in:
parent
d2fc6fb4ec
commit
55ccdb35d2
@ -65,6 +65,14 @@
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- PostGIS 支持 -->
|
||||
<dependency>
|
||||
<groupId>net.postgis</groupId>
|
||||
<artifactId>postgis-jdbc</artifactId>
|
||||
<version>2025.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -3,64 +3,28 @@ package com.ebike.feign.clients;
|
||||
import com.cdzy.common.model.response.JsonResult;
|
||||
import com.ebike.feign.component.FeignTokenInterceptor;
|
||||
import com.ebike.feign.config.ExampleFeignConfiguration;
|
||||
import com.ebike.feign.model.dto.FeignEbikeSiteQueryDto;
|
||||
import com.ebike.feign.model.dto.FeignLocationDto;
|
||||
import com.ebike.feign.model.vo.FeignEbikeBikeInfoVo;
|
||||
import com.ebike.feign.model.vo.FeignEbikeRegionVo;
|
||||
import com.ebike.feign.model.dto.FeignEbikeDto;
|
||||
import com.ebike.feign.model.vo.FeignEbikeBikeRadiusVo;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yanglei
|
||||
* @since 2025-10-21 11:44
|
||||
* @author attiya
|
||||
* @since 2025-11-7 17:18
|
||||
*/
|
||||
@FeignClient(name = "ebike-operations", configuration = {ExampleFeignConfiguration.class, FeignTokenInterceptor.class})
|
||||
public interface OperationsFeignClient {
|
||||
|
||||
|
||||
/**
|
||||
* 根据经纬度获取地址 (详细地址)
|
||||
* 用户半径范围内车辆
|
||||
*
|
||||
* @param location 经纬度(GCJ02坐标系)
|
||||
* @return 地址JSON对象
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("system/location2Address2")
|
||||
JsonResult<?> locationAddressDetails(@RequestBody FeignLocationDto location);
|
||||
@PostMapping("/api/userRadiusList")
|
||||
JsonResult<List<FeignEbikeDto>> userRadiusList(@Validated @RequestBody FeignEbikeBikeRadiusVo radiusVo);
|
||||
|
||||
|
||||
/**
|
||||
* 查询车辆所在站点。
|
||||
*
|
||||
* @param siteQuery 查询参数
|
||||
* @return 车辆所在站点
|
||||
*/
|
||||
@PostMapping("ebikeTracking/querySite")
|
||||
JsonResult<?> querySite(@RequestBody FeignEbikeSiteQueryDto siteQuery);
|
||||
|
||||
/**
|
||||
* 根据车辆编号获取车辆基本信息
|
||||
*
|
||||
* @param bikeCode 车辆编号
|
||||
* @return 车辆基本信息
|
||||
*/
|
||||
@GetMapping("ebikeBikeInfo/getBikeBaseInfoByCode/{bikeCode}")
|
||||
JsonResult<?> getBikeBaseInfoByCode(@PathVariable("bikeCode") String bikeCode);
|
||||
|
||||
/**
|
||||
* 获取运营区详情。
|
||||
*
|
||||
* @param regionId 运营区id
|
||||
* @return 结果数据 返回结果
|
||||
*/
|
||||
@GetMapping("ebikeRegion/getOperationById")
|
||||
JsonResult<FeignEbikeRegionVo> getOperationById(@RequestParam(name = "regionId") Long regionId);
|
||||
|
||||
/**
|
||||
* 根据车辆编号 获取整车信息详情
|
||||
*
|
||||
* @param bikeCode 车辆编号
|
||||
* @return 车辆信息
|
||||
*/
|
||||
@GetMapping("ebikeBikeInfo/getOperationById")
|
||||
JsonResult<FeignEbikeBikeInfoVo> getEbikeInfoByCode(String bikeCode);
|
||||
}
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
package com.ebike.feign.model.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.postgresql.geometric.PGpoint;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FeignEbikeDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 车辆编号(与车辆二维码编号相同
|
||||
*/
|
||||
private String bikeCode;
|
||||
|
||||
/**
|
||||
* 定位
|
||||
*/
|
||||
private PGpoint location;
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.ebike.feign.model.vo;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.postgresql.geometric.PGpoint;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 实体类。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-21
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FeignEbikeBikeRadiusVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户所在坐标
|
||||
*/
|
||||
@NotNull(message = "用户所在坐标不能为空")
|
||||
private PGpoint point;
|
||||
|
||||
/**
|
||||
* 用户所在坐标
|
||||
*/
|
||||
@NotNull(message = "半径不能为空")
|
||||
private Float radius;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -89,12 +89,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.fastjson2</groupId>
|
||||
<artifactId>fastjson2</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring Boot Redis Starter -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user