fix(系统设置): 修复项目添加成员报错的缺陷
This commit is contained in:
parent
123fd03839
commit
cf40902d99
|
@ -128,7 +128,7 @@ public class OrganizationProjectController {
|
||||||
@PostMapping("/add-members")
|
@PostMapping("/add-members")
|
||||||
@RequiresPermissions(PermissionConstants.ORGANIZATION_PROJECT_MEMBER_ADD)
|
@RequiresPermissions(PermissionConstants.ORGANIZATION_PROJECT_MEMBER_ADD)
|
||||||
@Operation(summary = "系统设置-组织-项目-添加成员")
|
@Operation(summary = "系统设置-组织-项目-添加成员")
|
||||||
@CheckOwner(resourceId = "#request.id", resourceType = "project")
|
@CheckOwner(resourceId = "#request.projectId", resourceType = "project")
|
||||||
public void addProjectMember(@Validated @RequestBody ProjectAddMemberRequest request) {
|
public void addProjectMember(@Validated @RequestBody ProjectAddMemberRequest request) {
|
||||||
ProjectAddMemberBatchRequest batchRequest = new ProjectAddMemberBatchRequest();
|
ProjectAddMemberBatchRequest batchRequest = new ProjectAddMemberBatchRequest();
|
||||||
batchRequest.setProjectIds(List.of(request.getProjectId()));
|
batchRequest.setProjectIds(List.of(request.getProjectId()));
|
||||||
|
|
|
@ -3,16 +3,14 @@ package io.metersphere.system.dto.request;
|
||||||
import io.metersphere.validation.groups.Created;
|
import io.metersphere.validation.groups.Created;
|
||||||
import io.metersphere.validation.groups.Updated;
|
import io.metersphere.validation.groups.Updated;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class ProjectAddMemberBatchRequest extends ProjectAddMemberRequest{
|
public class ProjectAddMemberBatchRequest extends ProjectAddMemberRequest {
|
||||||
@Schema(description = "项目ID集合", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "项目ID集合", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@Valid
|
|
||||||
private List<
|
private List<
|
||||||
@NotBlank(message = "{project.id.not_blank}", groups = {Created.class, Updated.class})
|
@NotBlank(message = "{project.id.not_blank}", groups = {Created.class, Updated.class})
|
||||||
String> projectIds;
|
String> projectIds;
|
||||||
|
|
|
@ -3,7 +3,6 @@ package io.metersphere.system.dto.request;
|
||||||
import io.metersphere.validation.groups.Created;
|
import io.metersphere.validation.groups.Created;
|
||||||
import io.metersphere.validation.groups.Updated;
|
import io.metersphere.validation.groups.Updated;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -12,13 +11,12 @@ import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class ProjectAddMemberRequest {
|
public class ProjectAddMemberRequest {
|
||||||
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotBlank(message = "{project.id.not_blank}")
|
@NotBlank(message = "{project.id.not_blank}")
|
||||||
private String projectId;
|
private String projectId;
|
||||||
|
|
||||||
@Schema(description = "用户ID集合", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "用户ID集合", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotEmpty(message = "{user.ids.not_blank}")
|
@NotEmpty(message = "{user.ids.not_blank}")
|
||||||
@Valid
|
|
||||||
private List<
|
private List<
|
||||||
@NotBlank(message = "{user_role_relation.user_id.not_blank}", groups = {Created.class, Updated.class})
|
@NotBlank(message = "{user_role_relation.user_id.not_blank}", groups = {Created.class, Updated.class})
|
||||||
String> userIds;
|
String> userIds;
|
||||||
|
|
Loading…
Reference in New Issue