add remote firmInfo
parent
26c4d85191
commit
386d481cb1
|
@ -1,6 +1,7 @@
|
|||
package com.dragon.vehicle.firm.server.controller;
|
||||
|
||||
import com.dragon.common.core.domain.Result;
|
||||
import com.dragon.common.redis.service.RedisService;
|
||||
import com.dragon.common.security.utils.SecurityUtils;
|
||||
import com.dragon.vehicle.firm.domain.cache.FirmInfoCache;
|
||||
import com.dragon.vehicle.firm.server.service.FirmInfoService;
|
||||
|
@ -22,6 +23,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@RequestMapping("/firm")
|
||||
public class FirmInfoController {
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
/**
|
||||
*注入公司service
|
||||
*/
|
||||
|
|
|
@ -47,6 +47,7 @@ public class FirmInfoServiceImpl extends ServiceImpl<FirmInfoMapper,FirmInfo> i
|
|||
Assert.notNull(userId,"用户不能为空");
|
||||
queryWrapper.eq(FirmInfo::getCreateBy,userId);
|
||||
firmInfoCache= FirmInfoCache.getCache(firmInfoMapper.selectOne(queryWrapper));
|
||||
redisService.setCacheObject("company:"+userId,firmInfoCache);
|
||||
log.info(firmInfoCache);
|
||||
return firmInfoCache;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue