新增美甲师手机号改为选填并跳过空值哈希索引
自动发布开发环境 Nacos 配置 / publish (push) Successful in 25s

This commit is contained in:
2026-11-07 00:57:23 +08:00
parent 5fae5163ff
commit ae6317903a
4 changed files with 21 additions and 15 deletions
@@ -5,6 +5,7 @@ import com.xiaowang.jayucloud.salon.core.support.privacy.PhoneCrypto;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.time.LocalDateTime;
@@ -67,7 +68,8 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
return;
}
Object value = metaObject.getValue(source);
String hash = value == null ? null : PhoneCrypto.current().index(String.valueOf(value));
String text = value == null ? null : String.valueOf(value).trim();
String hash = !StringUtils.hasText(text) ? null : PhoneCrypto.current().index(text);
metaObject.setValue(target, hash);
}
}
@@ -384,7 +384,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements
if (userDTO == null || !Integer.valueOf(3).equals(userDTO.getType())) throw new IllegalArgumentException("仅支持新增美甲师");
if (shopId == null || shopId <= 0) throw new IllegalArgumentException("门店不能为空");
if (!StringUtils.hasText(userDTO.getNickname())) throw new IllegalArgumentException("美甲师姓名不能为空");
String phone = validateUserPhone(userDTO.getPhone(), null, true);
String phone = validateUserPhone(userDTO.getPhone(), null, false);
UserDO userDO = new UserDO();
userDO.setShopId(shopId);
userDO.setNickname(userDTO.getNickname().trim());