perf: 补充启动日志

This commit is contained in:
xiaozzzi 2024-01-06 20:48:33 +08:00
parent 1e96c112ba
commit 74d604b75a
2 changed files with 4 additions and 1 deletions

View File

@ -41,7 +41,7 @@ public class ParamService extends ServiceImpl<ParamMapper, ParamEntity> {
*/
@EventListener(ApplicationStartedEvent.class)
public void refresh() {
log.info("[ BASE] 初始化系统参数缓存");
log.info("[ PARAM] 初始化系统参数缓存");
CACHE.clear();
List<ParamEntity> params = baseMapper.selectList(new QueryWrapper<>());
if (CollUtil.isEmpty(params)) {

View File

@ -15,6 +15,7 @@ import com.blossom.backend.base.user.pojo.UserEntity;
import com.blossom.common.base.exception.XzException500;
import com.blossom.common.base.util.BeanUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;
@ -28,6 +29,7 @@ import java.util.stream.Collectors;
/**
* 用户参数
*/
@Slf4j
@Service
@AllArgsConstructor
public class UserParamService extends ServiceImpl<UserParamMapper, UserParamEntity> {
@ -42,6 +44,7 @@ public class UserParamService extends ServiceImpl<UserParamMapper, UserParamEnti
*/
@EventListener(ApplicationStartedEvent.class)
public void refresh() {
log.info("[ U_PARAM] 初始化用户参数缓存");
CACHE.clear();
List<UserEntity> users = userMapper.selectList(new QueryWrapper<>());
// 初始化所有用户的配置参数