parent
c0a9b1a1dd
commit
293e58809c
|
@ -24,48 +24,6 @@ public abstract class CacheAbsBasic<K,V> implements CacheBasic<K,V> {
|
||||||
redisService.setCacheObject(encode(key),value);
|
redisService.setCacheObject(encode(key),value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取缓存中车辆的数据
|
|
||||||
* @param key
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public V getManage(K key) {
|
|
||||||
return redisService.getCacheObject(encode(key));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将数据存入缓存
|
|
||||||
* @param key
|
|
||||||
* @param value
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void putManage(K key, V value) {
|
|
||||||
redisService.setCacheObject(encode(key),value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取缓存中故障的数据
|
|
||||||
* @param key
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public V getFault(K key) {
|
|
||||||
return redisService.getCacheObject(encode(key));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将数据存入故障缓存
|
|
||||||
* @param key
|
|
||||||
* @param value
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void putFault(K key, V value) {
|
|
||||||
redisService.setCacheObject(encode(key),value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public V get(K key) {
|
public V get(K key) {
|
||||||
return redisService.getCacheObject(encode(key));
|
return redisService.getCacheObject(encode(key));
|
||||||
|
|
|
@ -12,35 +12,6 @@ import java.awt.image.Kernel;
|
||||||
|
|
||||||
public interface CacheBasic<K,V> extends PrimaryKeyBasic<K>{
|
public interface CacheBasic<K,V> extends PrimaryKeyBasic<K>{
|
||||||
|
|
||||||
/**
|
|
||||||
* 将数据存入车辆缓存
|
|
||||||
* @param key
|
|
||||||
* @param value
|
|
||||||
*/
|
|
||||||
void putManage(K key,V value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取缓存中故障的数据
|
|
||||||
* @param key
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
V getFault(K key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将数据存入故障缓存
|
|
||||||
* @param key
|
|
||||||
* @param value
|
|
||||||
*/
|
|
||||||
void putFault(K key,V value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取缓存中车辆的数据
|
|
||||||
* @param key
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
V getManage(K key);
|
|
||||||
|
|
||||||
|
|
||||||
void put(K key,V value);
|
void put(K key,V value);
|
||||||
|
|
||||||
V get(K key);
|
V get(K key);
|
||||||
|
|
|
@ -88,10 +88,8 @@ public class CarManageController extends BaseController {
|
||||||
// 随机生成VIN码
|
// 随机生成VIN码
|
||||||
String key2 = RandomUtil.randomNumbers(17);
|
String key2 = RandomUtil.randomNumbers(17);
|
||||||
carVO.setCarVin(key2);
|
carVO.setCarVin(key2);
|
||||||
sysCarService.save(carVO);
|
sysCarService.insertCar(carVO);
|
||||||
// 存到缓存中去
|
return Result.success("添加成功");
|
||||||
carManageCacheService.putManage(carVO.getCarVin(),new CarManage());
|
|
||||||
return Result.success("车辆添加成功");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,10 @@ public interface CarManageService extends IService<CarManage> {
|
||||||
*/
|
*/
|
||||||
List<CarVO> CarListShow(CarDTO carDTO);
|
List<CarVO> CarListShow(CarDTO carDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆添加
|
||||||
|
* @param carVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void insertCar(CarManage carVO);
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,5 +103,12 @@ public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertCar(CarManage carVO) {
|
||||||
|
save(carVO);
|
||||||
|
// 存到缓存中去
|
||||||
|
carManageCacheService.put(carVO.getCarVin(),new CarManage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue