Commit 7cae28525ff97506f5e099dc3373e7ed03ee3de9
1 parent
90d358a9
fix(oa): 解除计划单附件数量限制
Showing
2 changed files
with
5 additions
and
2 deletions
yudao-module-oa/src/main/java/cn/iocoder/yudao/module/oa/controller/admin/plan/vo/OaPlanSaveReqVO.java
| @@ -57,7 +57,6 @@ public class OaPlanSaveReqVO { | @@ -57,7 +57,6 @@ public class OaPlanSaveReqVO { | ||
| 57 | private LocalDateTime endTime; | 57 | private LocalDateTime endTime; |
| 58 | 58 | ||
| 59 | @Schema(description = "附件地址列表", example = "[\"https://example.com/file.pdf\"]") | 59 | @Schema(description = "附件地址列表", example = "[\"https://example.com/file.pdf\"]") |
| 60 | - @Size(max = 1, message = "附件最多上传 1 个") | ||
| 61 | private List<@NotBlank(message = "附件地址不能为空") @Size(max = 512, message = "附件地址长度不能超过 512 个字符") String> fileUrls; | 60 | private List<@NotBlank(message = "附件地址不能为空") @Size(max = 512, message = "附件地址长度不能超过 512 个字符") String> fileUrls; |
| 62 | 61 | ||
| 63 | @JsonIgnore | 62 | @JsonIgnore |
yudao-module-oa/src/test/java/cn/iocoder/yudao/module/oa/service/plan/OaPlanServiceImplTest.java
| @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.oa.service.plan; | @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.oa.service.plan; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.util.StrUtil; | 3 | import cn.hutool.core.util.StrUtil; |
| 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | +import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; | ||
| 5 | import cn.iocoder.yudao.framework.security.core.LoginUser; | 6 | import cn.iocoder.yudao.framework.security.core.LoginUser; |
| 6 | import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; | 7 | import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; |
| 7 | import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | 8 | import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; |
| @@ -62,7 +63,9 @@ public class OaPlanServiceImplTest extends BaseDbUnitTest { | @@ -62,7 +63,9 @@ public class OaPlanServiceImplTest extends BaseDbUnitTest { | ||
| 62 | public void testCreatePlan_success() { | 63 | public void testCreatePlan_success() { |
| 63 | // 准备参数 | 64 | // 准备参数 |
| 64 | Long userId = randomLongId(); | 65 | Long userId = randomLongId(); |
| 65 | - OaPlanSaveReqVO reqVO = buildPlanSaveReqVO(); | 66 | + OaPlanSaveReqVO reqVO = buildPlanSaveReqVO() |
| 67 | + .setFileUrls(Arrays.asList("https://example.com/a.txt", "https://example.com/b.txt")); | ||
| 68 | + ValidationUtils.validate(reqVO); | ||
| 66 | 69 | ||
| 67 | // 调用 | 70 | // 调用 |
| 68 | SecurityFrameworkUtils.setLoginUser(new LoginUser().setId(userId), new MockHttpServletRequest()); | 71 | SecurityFrameworkUtils.setLoginUser(new LoginUser().setId(userId), new MockHttpServletRequest()); |
| @@ -72,6 +75,7 @@ public class OaPlanServiceImplTest extends BaseDbUnitTest { | @@ -72,6 +75,7 @@ public class OaPlanServiceImplTest extends BaseDbUnitTest { | ||
| 72 | OaPlanDO plan = planMapper.selectById(planId); | 75 | OaPlanDO plan = planMapper.selectById(planId); |
| 73 | assertEquals(userId.toString(), plan.getCreator()); | 76 | assertEquals(userId.toString(), plan.getCreator()); |
| 74 | assertEquals(reqVO.getTitle(), plan.getTitle()); | 77 | assertEquals(reqVO.getTitle(), plan.getTitle()); |
| 78 | + assertEquals(reqVO.getFileUrls(), plan.getFileUrls()); | ||
| 75 | } | 79 | } |
| 76 | 80 | ||
| 77 | @Test | 81 | @Test |