mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-13 21:53:41 +08:00
用户名优化
This commit is contained in:
@@ -12,7 +12,7 @@ import lombok.Getter;
|
||||
@Getter
|
||||
public enum BusinessErrorEnum implements ErrorEnum {
|
||||
//==================================common==================================
|
||||
BUSINESS_ERROR(1001, "{}"),
|
||||
BUSINESS_ERROR(1001, "{0}"),
|
||||
//==================================user==================================
|
||||
//==================================chat==================================
|
||||
SYSTEM_ERROR(1001, "系统出小差了,请稍后再试哦~~"),
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.abin.mallchat.common.common.exception.ErrorEnum;
|
||||
import com.abin.mallchat.common.user.domain.entity.UserBackpack;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -71,7 +72,7 @@ public class AssertUtil {
|
||||
if (Objects.isNull(errorEnum)) {
|
||||
errorEnum = BusinessErrorEnum.BUSINESS_ERROR;
|
||||
}
|
||||
throw new BusinessException(errorEnum.getErrorCode(), String.format(errorEnum.getErrorMsg(), arg));
|
||||
throw new BusinessException(errorEnum.getErrorCode(), MessageFormat.format(errorEnum.getErrorMsg(), arg));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -40,9 +40,9 @@ public class UserBackpackDao extends ServiceImpl<UserBackpackMapper, UserBackpac
|
||||
return getOne(wrapper);
|
||||
}
|
||||
|
||||
public boolean invalidItem(Long itemId) {
|
||||
public boolean invalidItem(Long id) {
|
||||
UserBackpack update = new UserBackpack();
|
||||
update.setItemId(itemId);
|
||||
update.setId(id);
|
||||
update.setStatus(YesOrNoEnum.YES.getStatus());
|
||||
return updateById(update);
|
||||
}
|
||||
|
||||
@@ -37,4 +37,8 @@ public class UserDao extends ServiceImpl<UserMapper, User> {
|
||||
update.setItemId(badgeId);
|
||||
updateById(update);
|
||||
}
|
||||
|
||||
public User getByName(String name) {
|
||||
return lambdaQuery().eq(User::getName, name).one();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,11 @@ spring:
|
||||
username: ${mallchat.mysql.username}
|
||||
password: ${mallchat.mysql.password}
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
hikari:
|
||||
minimum-idle: 3
|
||||
maximum-pool-size: 10
|
||||
max-lifetime: 30000 #不能小于30秒,否则默认回到1800秒
|
||||
connection-test-query: SELECT 1
|
||||
mvc:
|
||||
pathmatch:
|
||||
matching-strategy: ANT_PATH_MATCHER
|
||||
|
||||
Reference in New Issue
Block a user