add remote firmInfo

master
冯凯 2023-11-22 08:36:08 +08:00
parent 6917a6c44b
commit d7690e0c9c
1 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import com.dragon.common.core.domain.Result;
import com.dragon.common.security.utils.SecurityUtils; import com.dragon.common.security.utils.SecurityUtils;
import com.dragon.vehicle.firm.domain.cache.FirmInfoCache; import com.dragon.vehicle.firm.domain.cache.FirmInfoCache;
import com.dragon.vehicle.firm.server.service.FirmInfoService; import com.dragon.vehicle.firm.server.service.FirmInfoService;
import lombok.extern.log4j.Log4j2;
import org.apache.catalina.security.SecurityUtil; import org.apache.catalina.security.SecurityUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2023/11/21 13:52 * @date 2023/11/21 13:52
*/ */
@RestController @RestController
@Log4j2
@RequestMapping("/firm") @RequestMapping("/firm")
public class FirmInfoController { public class FirmInfoController {
@ -37,6 +39,7 @@ public class FirmInfoController {
public Result<FirmInfoCache> getFirmInfoByUserId(){ public Result<FirmInfoCache> getFirmInfoByUserId(){
Long userId = SecurityUtils.getUserId();//获取当前登录人的userId Long userId = SecurityUtils.getUserId();//获取当前登录人的userId
log.info("当前登录人是:"+userId);
FirmInfoCache firmInfoCache=firmService.getFirmInfoByUserId(userId); FirmInfoCache firmInfoCache=firmService.getFirmInfoByUserId(userId);
return Result.success(firmInfoCache); return Result.success(firmInfoCache);
} }