Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
Expand All @@ -12,5 +13,7 @@
@Data
public class UpdateUserInfoDTO {

@NotEmpty(message = "{group.ids.not-empty}")
private List<@Min(1) Integer> groupIds;

}
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ public boolean deleteUser(Integer id) {
@Override
public boolean updateUserInfo(Integer id, UpdateUserInfoDTO validator) {
List<Integer> newGroupIds = validator.getGroupIds();
if (newGroupIds == null || newGroupIds.isEmpty()) {
return false;
}
Integer rootGroupId = groupService.getParticularGroupIdByLevel(GroupLevelEnum.ROOT);
boolean anyMatch = newGroupIds.stream().anyMatch(it -> it.equals(rootGroupId));
if (anyMatch) {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/ValidationMessages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ page.number.min=\u5206\u9875\u9875\u7801\u5FC5\u987B\u4E3A\u6B63\u6574\u6570
group.id.positive=\u5206\u7EC4id\u5FC5\u987B\u4E3A\u6B63\u6574\u6570
group.id.not-null=\u5206\u7EC4id\u4E0D\u53EF\u4E3A\u7A7A
group.ids.long-list=\u5206\u7EC4id\u6BCF\u4E00\u9879\u5FC5\u987B\u4E3A\u6B63\u6574\u6570
group.ids.not-empty=\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u5206\u7EC4
group.name.not-blank=\u8BF7\u8F93\u5165\u5206\u7EC4\u540D\u79F0
group.name.length=\u5206\u7EC4\u540D\u79F0\u4E0D\u53EF\u8D85\u8FC760\u5B57\u7B26
group.info.length=\u5206\u7EC4\u63CF\u8FF0\u4E0D\u53EF\u8D85\u8FC7255\u5B57\u7B26
Expand Down