From 9953aab7bd33a72220b62dae2576cdf228d058e6 Mon Sep 17 00:00:00 2001 From: ZhiShuo_Lou <13209945+zhishuo-lou@user.noreply.gitee.com> Date: Mon, 27 Nov 2023 20:48:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9remote=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/god/base/remote/RemoteCarService.java | 10 ++++++---- .../base/remote/factory/RemoteCarFallbackFactory.java | 8 +++++++- ...mework.boot.autoconfigure.AutoConfiguration.imports | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 car-base-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/car-base-remote/src/main/java/com/god/base/remote/RemoteCarService.java b/car-base-remote/src/main/java/com/god/base/remote/RemoteCarService.java index 9cd58b7..3fcd086 100644 --- a/car-base-remote/src/main/java/com/god/base/remote/RemoteCarService.java +++ b/car-base-remote/src/main/java/com/god/base/remote/RemoteCarService.java @@ -1,5 +1,6 @@ package com.god.base.remote; +import com.god.base.common.domain.Fence; import com.god.base.remote.factory.RemoteCarFallbackFactory; import com.god.base.server.common.domain.Car; import com.god.common.core.constant.SecurityConstants; @@ -8,9 +9,7 @@ import com.god.common.core.domain.Result; import com.god.common.security.annotation.RequiresPermissions; import com.god.common.system.remote.factory.RemoteLogFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.*; /** * 车辆服务 @@ -23,5 +22,8 @@ public interface RemoteCarService { @GetMapping("/car/list/{vinId}") - public Result list(@PathVariable String vinId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + public Result list(@PathVariable String vinId); + + @PostMapping("/baseFence/fenceById") + public Result fenceById(@RequestParam("fenceId") Integer fenceId); } diff --git a/car-base-remote/src/main/java/com/god/base/remote/factory/RemoteCarFallbackFactory.java b/car-base-remote/src/main/java/com/god/base/remote/factory/RemoteCarFallbackFactory.java index 7e840fc..a5a1b14 100644 --- a/car-base-remote/src/main/java/com/god/base/remote/factory/RemoteCarFallbackFactory.java +++ b/car-base-remote/src/main/java/com/god/base/remote/factory/RemoteCarFallbackFactory.java @@ -1,5 +1,6 @@ package com.god.base.remote.factory; +import com.god.base.common.domain.Fence; import com.god.base.remote.RemoteCarService; import com.god.base.server.common.domain.Car; import com.god.common.core.domain.Result; @@ -25,7 +26,12 @@ public class RemoteCarFallbackFactory implements FallbackFactory list(String vinId, String source) { + public Result list(String vinId) { + return Result.error("保存操作日志失败:" + cause.getMessage()); + } + + @Override + public Result fenceById(Integer fenceId) { return Result.error("保存操作日志失败:" + cause.getMessage()); } }; diff --git a/car-base-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/car-base-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..6d2b4cc --- /dev/null +++ b/car-base-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.god.base.remote.factory.RemoteCarFallbackFactory