fix(): 修复业务模块无法启动问题
parent
583779765d
commit
5361b43bd7
|
@ -21,6 +21,8 @@ public class ServiceNameConstants {
|
|||
*/
|
||||
public static final String FILE_SERVICE = "cloud-file";
|
||||
|
||||
public static final String CAR_SERVICE = "cloud-car";
|
||||
|
||||
/**
|
||||
* 智能车联服务
|
||||
*/
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package com.muyu.openbusiness.remote;
|
||||
|
||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.openbusiness.domain.SysCar;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
|
||||
@FeignClient()
|
||||
@FeignClient(contextId = "sysCarRemoteService", value = ServiceNameConstants.CAR_SERVICE)
|
||||
public interface SysCarRemoteService {
|
||||
|
||||
public Result<SysCar> findByVin(String vin);
|
||||
|
|
|
@ -97,6 +97,11 @@
|
|||
<artifactId>cloud-common-rabbit</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-kafka</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcpkix-jdk15on</artifactId>
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
package com.muyu.openbusiness.cahce.apply;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.muyu.common.cache.BasicCacheData;
|
||||
import com.muyu.openbusiness.domain.SysCar;
|
||||
import com.muyu.openbusiness.remote.SysCarRemoteService;
|
||||
import com.muyu.openbusiness.service.impl.SysCarServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 键和值转换 - 车辆数据
|
||||
*/
|
||||
@Primary
|
||||
@Component
|
||||
public class SysCarCacheRemoteData implements BasicCacheData<String, SysCar> {
|
||||
|
||||
|
||||
@Autowired
|
||||
private SysCarServiceImpl sysCarService;
|
||||
|
||||
@Override
|
||||
public SysCar apply(String key) {
|
||||
return sysCarService.getOne(
|
||||
new LambdaQueryWrapper<>(){{
|
||||
eq(SysCar::getCarVin, key);
|
||||
}}
|
||||
);
|
||||
}
|
||||
}
|
||||
//package com.muyu.openbusiness.cahce.apply;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
//import com.muyu.common.cache.BasicCacheData;
|
||||
//import com.muyu.openbusiness.domain.SysCar;
|
||||
//import com.muyu.openbusiness.remote.SysCarRemoteService;
|
||||
//import com.muyu.openbusiness.service.impl.SysCarServiceImpl;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.annotation.Primary;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
///**
|
||||
// * 键和值转换 - 车辆数据
|
||||
// */
|
||||
//@Primary
|
||||
//@Component
|
||||
//public class SysCarCacheRemoteData implements BasicCacheData<String, SysCar> {
|
||||
//
|
||||
//
|
||||
// @Autowired
|
||||
// private SysCarServiceImpl sysCarService;
|
||||
//
|
||||
// @Override
|
||||
// public SysCar apply(String key) {
|
||||
// return sysCarService.getOne(
|
||||
// new LambdaQueryWrapper<>(){{
|
||||
// eq(SysCar::getCarVin, key);
|
||||
// }}
|
||||
// );
|
||||
// }
|
||||
//}
|
||||
|
|
Loading…
Reference in New Issue