fix(): 修复业务模块无法启动问题

dev
面包骑士 2024-10-09 20:22:26 +08:00
parent 583779765d
commit 5361b43bd7
4 changed files with 40 additions and 32 deletions

View File

@ -21,6 +21,8 @@ public class ServiceNameConstants {
*/ */
public static final String FILE_SERVICE = "cloud-file"; public static final String FILE_SERVICE = "cloud-file";
public static final String CAR_SERVICE = "cloud-car";
/** /**
* *
*/ */

View File

@ -1,10 +1,11 @@
package com.muyu.openbusiness.remote; package com.muyu.openbusiness.remote;
import com.muyu.common.core.constant.ServiceNameConstants;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import com.muyu.openbusiness.domain.SysCar; import com.muyu.openbusiness.domain.SysCar;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
@FeignClient() @FeignClient(contextId = "sysCarRemoteService", value = ServiceNameConstants.CAR_SERVICE)
public interface SysCarRemoteService { public interface SysCarRemoteService {
public Result<SysCar> findByVin(String vin); public Result<SysCar> findByVin(String vin);

View File

@ -97,6 +97,11 @@
<artifactId>cloud-common-rabbit</artifactId> <artifactId>cloud-common-rabbit</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.muyu</groupId>
<artifactId>cloud-common-kafka</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.bouncycastle</groupId> <groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId> <artifactId>bcpkix-jdk15on</artifactId>

View File

@ -1,31 +1,31 @@
package com.muyu.openbusiness.cahce.apply; //package com.muyu.openbusiness.cahce.apply;
//
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; //import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.muyu.common.cache.BasicCacheData; //import com.muyu.common.cache.BasicCacheData;
import com.muyu.openbusiness.domain.SysCar; //import com.muyu.openbusiness.domain.SysCar;
import com.muyu.openbusiness.remote.SysCarRemoteService; //import com.muyu.openbusiness.remote.SysCarRemoteService;
import com.muyu.openbusiness.service.impl.SysCarServiceImpl; //import com.muyu.openbusiness.service.impl.SysCarServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary; //import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
//
/** ///**
* - // * 键和值转换 - 车辆数据
*/ // */
@Primary //@Primary
@Component //@Component
public class SysCarCacheRemoteData implements BasicCacheData<String, SysCar> { //public class SysCarCacheRemoteData implements BasicCacheData<String, SysCar> {
//
//
@Autowired // @Autowired
private SysCarServiceImpl sysCarService; // private SysCarServiceImpl sysCarService;
//
@Override // @Override
public SysCar apply(String key) { // public SysCar apply(String key) {
return sysCarService.getOne( // return sysCarService.getOne(
new LambdaQueryWrapper<>(){{ // new LambdaQueryWrapper<>(){{
eq(SysCar::getCarVin, key); // eq(SysCar::getCarVin, key);
}} // }}
); // );
} // }
} //}