upd
parent
68a64a9382
commit
1e8f75ede5
|
@ -1,5 +1,8 @@
|
|||
package com.dragon.vehicle.firm.domain.common;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dragon.common.core.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
@ -16,10 +19,12 @@ import lombok.NoArgsConstructor;
|
|||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("firm_info")
|
||||
public class FirmInfo {
|
||||
/**
|
||||
*编号
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@Excel(name = "编号")
|
||||
private String firmId;
|
||||
/**
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package dragon.vehicle.firm.server.controller;
|
||||
|
||||
import com.dragon.common.core.domain.Result;
|
||||
import com.dragon.common.security.utils.SecurityUtils;
|
||||
import com.dragon.vehicle.firm.domain.cache.FirmInfoCache;
|
||||
import dragon.vehicle.firm.server.service.FirmService;
|
||||
import dragon.vehicle.firm.server.service.FirmInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -17,13 +16,13 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/firm")
|
||||
public class FirmController {
|
||||
public class FirmInfoController {
|
||||
|
||||
/**
|
||||
*注入公司service
|
||||
*/
|
||||
@Autowired
|
||||
private FirmService firmService;
|
||||
private FirmInfoService firmService;
|
||||
|
||||
/***
|
||||
* @description: 通过userId获取用户的公司
|
|
@ -11,5 +11,5 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
* @date 2023/11/21 13:57
|
||||
*/
|
||||
@Mapper
|
||||
public interface FirmMapper extends BaseMapper<FirmInfo> {
|
||||
public interface FirmInfoMapper extends BaseMapper<FirmInfo> {
|
||||
}
|
|
@ -10,7 +10,7 @@ import com.dragon.vehicle.firm.domain.common.FirmInfo;
|
|||
* @description:
|
||||
* @date 2023/11/21 13:57
|
||||
*/
|
||||
public interface FirmService extends IService<FirmInfo> {
|
||||
public interface FirmInfoService extends IService<FirmInfo> {
|
||||
|
||||
|
||||
/***
|
|
@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.dragon.common.redis.service.RedisService;
|
||||
import com.dragon.vehicle.firm.domain.cache.FirmInfoCache;
|
||||
import com.dragon.vehicle.firm.domain.common.FirmInfo;
|
||||
import dragon.vehicle.firm.server.mapper.FirmMapper;
|
||||
import dragon.vehicle.firm.server.service.FirmService;
|
||||
import dragon.vehicle.firm.server.mapper.FirmInfoMapper;
|
||||
import dragon.vehicle.firm.server.service.FirmInfoService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -20,10 +20,10 @@ import org.springframework.util.Assert;
|
|||
*/
|
||||
@Service
|
||||
@Log4j2
|
||||
public class FirmServiceImpl extends ServiceImpl<FirmMapper, FirmInfo> implements FirmService {
|
||||
public class FirmInfoServiceImpl extends ServiceImpl<FirmInfoMapper,FirmInfo> implements FirmInfoService {
|
||||
|
||||
@Autowired
|
||||
private FirmMapper firmMapper;
|
||||
private FirmInfoMapper firmInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
@ -45,7 +45,7 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, FirmInfo> implement
|
|||
LambdaQueryWrapper<FirmInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Assert.notNull(userId,"用户不能为空");
|
||||
queryWrapper.eq(FirmInfo::getCreateBy,userId);
|
||||
firmInfoCache= FirmInfoCache.getCache(firmMapper.selectOne(queryWrapper));
|
||||
firmInfoCache= FirmInfoCache.getCache(firmInfoMapper.selectOne(queryWrapper));
|
||||
log.info(firmInfoCache);
|
||||
return firmInfoCache;
|
||||
}
|
Loading…
Reference in New Issue