mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-08 03:07:51 +00:00
feat(namespace): add batch member import DTOs
This commit is contained in:
parent
62028e9f55
commit
4f7cdc48cb
3 changed files with 36 additions and 0 deletions
|
|
@ -0,0 +1,10 @@
|
|||
package com.iflytek.skillhub.dto;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
public record BatchMemberRequest(
|
||||
@NotEmpty(message = "{validation.batch.members.notEmpty}")
|
||||
List<@Valid MemberRequest> members
|
||||
) {}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.iflytek.skillhub.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record BatchMemberResponse(
|
||||
int totalCount,
|
||||
int successCount,
|
||||
int failureCount,
|
||||
List<BatchMemberResult> results
|
||||
) {}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.iflytek.skillhub.dto;
|
||||
|
||||
public record BatchMemberResult(
|
||||
String userId,
|
||||
String role,
|
||||
boolean success,
|
||||
String error
|
||||
) {
|
||||
public static BatchMemberResult success(String userId, String role) {
|
||||
return new BatchMemberResult(userId, role, true, null);
|
||||
}
|
||||
|
||||
public static BatchMemberResult failure(String userId, String role, String error) {
|
||||
return new BatchMemberResult(userId, role, false, error);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue