Optimize: 代码格式优化.

pull/10/head
chen.ma 3 years ago
parent 39b7069736
commit 60cdfefbdd

@ -16,11 +16,10 @@ public class ConditionUtil {
}
}
public interface NoArgsConsumer {
/**
*
*
*/
void accept();

@ -8,6 +8,7 @@ import com.github.dynamic.threadpool.config.model.ConfigAllInfo;
import com.github.dynamic.threadpool.config.model.ConfigInfoBase;
import com.github.dynamic.threadpool.config.service.ConfigServletInner;
import com.github.dynamic.threadpool.config.toolkit.Md5ConfigUtil;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
@ -25,14 +26,13 @@ import java.util.Map;
* @date 2021/6/20 13:53
*/
@RestController
@AllArgsConstructor
@RequestMapping(Constants.CONFIG_CONTROLLER_PATH)
public class ConfigController {
@Autowired
private ConfigService configService;
private final ConfigService configService;
@Autowired
private ConfigServletInner configServletInner;
private final ConfigServletInner configServletInner;
@GetMapping
public Result<ConfigInfoBase> detailConfigInfo(

@ -131,4 +131,5 @@ public class DefaultPublisher extends Thread implements EventPublisher {
notifySubscriber(subscriber, event);
}
}
}

@ -70,6 +70,7 @@ public class ConfigServiceImpl implements ConfigService {
private Integer addConfigInfo(ConfigAllInfo config) {
config.setContent(ContentUtil.getPoolContent(config));
config.setMd5(Md5Util.getTpContentMd5(config));
try {
if (SqlHelper.retBool(configInfoMapper.insert(config))) {
return config.getId();

@ -44,8 +44,8 @@ public class ItemServiceImpl implements ItemService {
.eq(!StringUtils.isEmpty(reqDTO.getItemName()), ItemInfo::getItemName, reqDTO.getItemName())
.eq(!StringUtils.isEmpty(reqDTO.getTenantId()), ItemInfo::getTenantId, reqDTO.getTenantId())
.eq(!StringUtils.isEmpty(reqDTO.getOwner()), ItemInfo::getOwner, reqDTO.getOwner());
Page<ItemInfo> resultPage = itemInfoMapper.selectPage(reqDTO, wrapper);
Page<ItemInfo> resultPage = itemInfoMapper.selectPage(reqDTO, wrapper);
return resultPage.convert(each -> BeanUtil.convert(each, ItemRespDTO.class));
}
@ -55,8 +55,8 @@ public class ItemServiceImpl implements ItemService {
.lambdaQuery(ItemInfo.class)
.eq(ItemInfo::getTenantId, tenantId)
.eq(ItemInfo::getItemId, itemId);
ItemInfo itemInfo = itemInfoMapper.selectOne(queryWrapper);
ItemInfo itemInfo = itemInfoMapper.selectOne(queryWrapper);
ItemRespDTO result = BeanUtil.convert(itemInfo, ItemRespDTO.class);
return result;
}

@ -16,7 +16,7 @@ import org.springframework.stereotype.Service;
@AllArgsConstructor
public class LogRecordServiceImpl implements LogRecordService {
private LogRecordMapper logRecordMapper;
private final LogRecordMapper logRecordMapper;
@Override
public void record(LogRecordInfo logRecordInfo) {

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.github.dynamic.threadpool.common.toolkit.Assert;
import com.github.dynamic.threadpool.config.enums.DelEnum;
import com.github.dynamic.threadpool.config.mapper.TenantInfoMapper;
import com.github.dynamic.threadpool.config.model.TenantInfo;
@ -48,8 +49,8 @@ public class TenantServiceImpl implements TenantService {
public TenantRespDTO getTenantByTenantId(String tenantId) {
LambdaQueryWrapper<TenantInfo> queryWrapper = Wrappers
.lambdaQuery(TenantInfo.class).eq(TenantInfo::getTenantId, tenantId);
TenantInfo tenantInfo = tenantInfoMapper.selectOne(queryWrapper);
TenantInfo tenantInfo = tenantInfoMapper.selectOne(queryWrapper);
TenantRespDTO result = BeanUtil.convert(tenantInfo, TenantRespDTO.class);
return result;
}
@ -60,8 +61,8 @@ public class TenantServiceImpl implements TenantService {
.eq(!StringUtils.isEmpty(reqDTO.getTenantId()), TenantInfo::getTenantId, reqDTO.getTenantId())
.eq(!StringUtils.isEmpty(reqDTO.getTenantName()), TenantInfo::getTenantName, reqDTO.getTenantName())
.eq(!StringUtils.isEmpty(reqDTO.getOwner()), TenantInfo::getOwner, reqDTO.getOwner());
Page resultPage = tenantInfoMapper.selectPage(reqDTO, wrapper);
Page resultPage = tenantInfoMapper.selectPage(reqDTO, wrapper);
return resultPage.convert(each -> BeanUtil.convert(each, TenantRespDTO.class));
}

@ -1,6 +1,7 @@
package com.github.dynamic.threadpool.config.service.biz.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -39,6 +40,7 @@ public class ThreadPoolServiceImpl implements ThreadPoolService {
.eq(!StringUtils.isBlank(reqDTO.getItemId()), ConfigAllInfo::getItemId, reqDTO.getItemId())
.eq(!StringUtils.isBlank(reqDTO.getTpId()), ConfigAllInfo::getTpId, reqDTO.getTpId())
.eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL);
return configInfoMapper.selectPage(reqDTO, wrapper).convert(each -> BeanUtil.convert(each, ThreadPoolRespDTO.class));
}
@ -50,8 +52,10 @@ public class ThreadPoolServiceImpl implements ThreadPoolService {
@Override
public List<ThreadPoolRespDTO> getThreadPoolByItemId(String itemId) {
List<ConfigAllInfo> selectList = configInfoMapper
.selectList(Wrappers.lambdaUpdate(ConfigAllInfo.class).eq(ConfigAllInfo::getItemId, itemId));
LambdaQueryWrapper<ConfigAllInfo> queryWrapper = Wrappers.lambdaQuery(ConfigAllInfo.class)
.eq(ConfigAllInfo::getItemId, itemId);
List<ConfigAllInfo> selectList = configInfoMapper.selectList(queryWrapper);
return BeanUtil.convert(selectList, ThreadPoolRespDTO.class);
}

Loading…
Cancel
Save