2025-10-22 10:13:57 +08:00
|
|
|
package com.ebike.feign.clients;
|
|
|
|
|
|
2025-12-18 15:29:54 +08:00
|
|
|
import com.cdzy.common.model.dto.EbikeTracking;
|
2025-10-22 10:13:57 +08:00
|
|
|
import com.cdzy.common.model.response.JsonResult;
|
|
|
|
|
import com.ebike.feign.component.FeignTokenInterceptor;
|
|
|
|
|
import com.ebike.feign.config.ExampleFeignConfiguration;
|
2025-11-07 17:19:16 +08:00
|
|
|
import com.ebike.feign.model.dto.FeignEbikeDto;
|
2025-12-24 12:55:04 +08:00
|
|
|
import com.ebike.feign.model.dto.FeignEbikeReportRecordDto;
|
2025-11-11 09:58:43 +08:00
|
|
|
import com.ebike.feign.model.dto.FeignEbikeUserBikeInfo;
|
2025-11-11 16:23:50 +08:00
|
|
|
import com.ebike.feign.model.dto.FeignEbikeUserLockDto;
|
2025-12-25 17:16:59 +08:00
|
|
|
import com.ebike.feign.model.vo.*;
|
2025-10-22 10:13:57 +08:00
|
|
|
import org.springframework.cloud.openfeign.FeignClient;
|
2025-11-07 17:19:16 +08:00
|
|
|
import org.springframework.validation.annotation.Validated;
|
2025-11-11 10:08:40 +08:00
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
2025-11-07 17:19:16 +08:00
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
2025-11-10 16:26:11 +08:00
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
2025-11-07 17:19:16 +08:00
|
|
|
|
|
|
|
|
import java.util.List;
|
2025-10-22 10:13:57 +08:00
|
|
|
|
|
|
|
|
/**
|
2025-11-07 17:19:16 +08:00
|
|
|
* @author attiya
|
|
|
|
|
* @since 2025-11-7 17:18
|
2025-10-22 10:13:57 +08:00
|
|
|
*/
|
|
|
|
|
@FeignClient(name = "ebike-operations", configuration = {ExampleFeignConfiguration.class, FeignTokenInterceptor.class})
|
|
|
|
|
public interface OperationsFeignClient {
|
|
|
|
|
|
|
|
|
|
/**
|
2025-11-07 17:19:16 +08:00
|
|
|
* 用户半径范围内车辆
|
2025-10-22 10:13:57 +08:00
|
|
|
*
|
2025-11-07 17:19:16 +08:00
|
|
|
* @return 结果
|
2025-10-22 10:13:57 +08:00
|
|
|
*/
|
2025-11-07 17:27:05 +08:00
|
|
|
@PostMapping("/ebikeBikeInfo/api/userRadiusList")
|
2025-11-07 17:19:16 +08:00
|
|
|
JsonResult<List<FeignEbikeDto>> userRadiusList(@Validated @RequestBody FeignEbikeBikeRadiusVo radiusVo);
|
2025-10-22 10:13:57 +08:00
|
|
|
|
2025-11-10 16:26:11 +08:00
|
|
|
/**
|
2025-11-10 16:26:26 +08:00
|
|
|
* 用户开锁
|
2025-11-10 16:26:11 +08:00
|
|
|
*
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
2025-11-11 10:08:40 +08:00
|
|
|
@GetMapping("/ebikeBikeInfo/api/openLock")
|
2025-12-18 15:50:14 +08:00
|
|
|
JsonResult<?> openLock(@RequestParam("bikeCode") String bikeCode);
|
2025-11-10 16:26:11 +08:00
|
|
|
|
2025-11-11 15:30:58 +08:00
|
|
|
/**
|
2025-11-11 17:31:14 +08:00
|
|
|
* 用户关锁
|
2025-11-11 15:30:58 +08:00
|
|
|
*
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
2025-12-18 15:38:40 +08:00
|
|
|
@PostMapping("/ebikeBikeInfo/api/lock")
|
|
|
|
|
JsonResult<FeignEbikeUserLockDto> lock(@RequestBody EbikeLockVo lockVo);
|
2025-11-11 15:30:58 +08:00
|
|
|
|
2025-11-11 09:58:43 +08:00
|
|
|
/**
|
|
|
|
|
* 用户获取车辆详情及其计费规则
|
|
|
|
|
*
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
2025-11-11 10:19:30 +08:00
|
|
|
@GetMapping("/ebikeBikeInfo/api/bikeInfo")
|
2025-12-18 15:50:14 +08:00
|
|
|
JsonResult<FeignEbikeUserBikeInfo> bikeInfo(@RequestParam("bikeCode") String bikeCode);
|
2025-11-11 09:58:43 +08:00
|
|
|
|
2025-11-25 10:37:06 +08:00
|
|
|
/**
|
|
|
|
|
* 根据EcuSn生成换电工单
|
|
|
|
|
*
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/ebikeBikeOrder/batterySwapOrder")
|
2025-12-18 15:50:14 +08:00
|
|
|
JsonResult<FeignEbikeUserBikeInfo> batterySwapOrder(@RequestParam("ecuSn") String ecuSn);
|
2025-11-25 10:37:06 +08:00
|
|
|
|
2025-11-25 10:46:54 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据bikeCode生成巡检工单
|
|
|
|
|
*
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
2025-11-26 10:42:39 +08:00
|
|
|
@PostMapping("/ebikeBikeOrder/inspectionSwapOrder")
|
|
|
|
|
JsonResult<FeignEbikeUserBikeInfo> inspectionSwapOrder(@RequestBody FeignInspectionSwapOrderVo inspectionSwapOrderVo);
|
2025-11-25 10:46:54 +08:00
|
|
|
|
2025-12-18 15:29:54 +08:00
|
|
|
/**
|
|
|
|
|
* 保存车辆轨迹。
|
|
|
|
|
*
|
|
|
|
|
* @param ebikeTracking 车辆轨迹
|
|
|
|
|
* @return 结果数据 返回结果
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("ebikeTracking/save")
|
|
|
|
|
JsonResult<?> saveEbikeTracking(@RequestBody EbikeTracking ebikeTracking);
|
|
|
|
|
|
2025-12-18 15:50:14 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 保存车辆最新位置
|
2025-12-24 12:55:04 +08:00
|
|
|
*
|
|
|
|
|
* @param ecuSn 中控编号
|
2025-12-18 15:50:14 +08:00
|
|
|
* @param longitude 经度
|
2025-12-24 12:55:04 +08:00
|
|
|
* @param latitude 纬度
|
2025-12-18 15:50:14 +08:00
|
|
|
* @return 保存结果
|
|
|
|
|
*/
|
2025-12-24 12:55:04 +08:00
|
|
|
@GetMapping("/ebikeBikeInfo/changeLocation")
|
2025-12-18 15:50:14 +08:00
|
|
|
JsonResult<?> changeLocation(@RequestParam("ecuSn") String ecuSn, @RequestParam("longitude") Double longitude, @RequestParam("latitude") Double latitude);
|
|
|
|
|
|
2025-12-24 12:55:04 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 保存用户上报
|
|
|
|
|
*
|
|
|
|
|
* @param feignEbikeReportRecordDto 用户上报信息
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/ebikeReportRecord/saveReportRecord")
|
|
|
|
|
JsonResult<?> saveReportRecord(@RequestBody FeignEbikeReportRecordDto feignEbikeReportRecordDto);
|
|
|
|
|
|
2025-12-25 14:14:45 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取用户上报记录
|
|
|
|
|
*
|
|
|
|
|
* @param userId 用户id
|
|
|
|
|
* @return 用户上报记录
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/ebikeReportRecord/getReportRecord")
|
|
|
|
|
JsonResult<List<FeignEbikeReportRecordVo>> getReportRecord(@RequestParam("userId") Long userId);
|
2025-12-25 17:16:59 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取当前位置所属运营区
|
|
|
|
|
*
|
|
|
|
|
* @param lng 经度
|
|
|
|
|
* @param lat 维度
|
|
|
|
|
* @return 运营区信息
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/ebikeRegion/getRegionByLocation")
|
|
|
|
|
JsonResult<FeignEbikeRegionVo> getRegionByLocation(@RequestParam("lng") double lng,
|
|
|
|
|
@RequestParam("lat") double lat);
|
2025-10-22 10:13:57 +08:00
|
|
|
}
|