| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.dromara.common.core.constant.CacheNames; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | |
| | | import org.dromara.system.domain.vo.SysClientVo; |
| | | import org.dromara.system.mapper.SysClientMapper; |
| | | import org.dromara.system.service.ISysClientService; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collection; |
| | |
| | | /** |
| | | * 查询客户端管理 |
| | | */ |
| | | @Cacheable(cacheNames = CacheNames.SYS_CLIENT, key = "#clientId") |
| | | @Override |
| | | public SysClient queryByClientId(String clientId) { |
| | | return baseMapper.selectOne(new LambdaQueryWrapper<SysClient>().eq(SysClient::getClientId, clientId)); |
| | | public SysClientVo queryByClientId(String clientId) { |
| | | return baseMapper.selectVoOne(new LambdaQueryWrapper<SysClient>().eq(SysClient::getClientId, clientId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 修改客户端管理 |
| | | */ |
| | | @CacheEvict(cacheNames = CacheNames.SYS_CLIENT, key = "#bo.clientId") |
| | | @Override |
| | | public Boolean updateByBo(SysClientBo bo) { |
| | | SysClient update = MapstructUtils.convert(bo, SysClient.class); |
| | |
| | | /** |
| | | * 修改状态 |
| | | */ |
| | | @CacheEvict(cacheNames = CacheNames.SYS_CLIENT, key = "#clientId") |
| | | @Override |
| | | public int updateUserStatus(Long id, String status) { |
| | | public int updateClientStatus(String clientId, String status) { |
| | | return baseMapper.update(null, |
| | | new LambdaUpdateWrapper<SysClient>() |
| | | .set(SysClient::getStatus, status) |
| | | .eq(SysClient::getId, id)); |
| | | .eq(SysClient::getClientId, clientId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 批量删除客户端管理 |
| | | */ |
| | | @CacheEvict(cacheNames = CacheNames.SYS_CLIENT, allEntries = true) |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if (isValid) { |
| | | //TODO 做一些业务上的校验,判断是否需要校验 |
| | | } |
| | | return baseMapper.deleteBatchIds(ids) > 0; |
| | | return baseMapper.deleteByIds(ids) > 0; |
| | | } |
| | | } |