|
|
@@ -621,10 +621,17 @@ private WechatService wechatService;
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ if (dto.getNickname() == null || dto.getNickname().trim().isEmpty()) {
|
|
|
+ throw new IllegalArgumentException("孩子昵称不能为空");
|
|
|
+ }
|
|
|
+ if (dto.getAge() == null || dto.getAge() < 1 || dto.getAge() > 18) {
|
|
|
+ throw new IllegalArgumentException("请输入有效的年龄(1-18岁)");
|
|
|
+ }
|
|
|
+
|
|
|
Child child = new Child();
|
|
|
child.setUserId(userId);
|
|
|
child.setFamilyId(user.getFamilyId());
|
|
|
- child.setNickname(dto.getNickname());
|
|
|
+ child.setNickname(dto.getNickname().trim());
|
|
|
child.setAge(dto.getAge());
|
|
|
child.setBirthday(dto.getBirthday());
|
|
|
child.setGender(dto.getGender());
|