mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-10-31 10:57:13 +08:00 
			
		
		
		
	refactor: 使用 CollUtils 替代部分 Stream 操作,提高代码的可读性,减少代码行数(缺点:方法写起来不如流式代码舒爽)
This commit is contained in:
		| @@ -33,6 +33,7 @@ import top.continew.admin.system.mapper.NoticeMapper; | ||||
| import top.continew.admin.system.model.entity.NoticeDO; | ||||
| import top.continew.admin.system.service.NoticeService; | ||||
| import top.continew.starter.core.constant.PropertiesConstants; | ||||
| import top.continew.starter.core.util.CollUtils; | ||||
| import top.continew.starter.extension.tenant.annotation.TenantIgnore; | ||||
|  | ||||
| import java.time.LocalDateTime; | ||||
| @@ -109,7 +110,7 @@ public class NoticePublishJob { | ||||
|         // 更新状态 | ||||
|         noticeMapper.lambdaUpdate() | ||||
|             .set(NoticeDO::getStatus, NoticeStatusEnum.PUBLISHED) | ||||
|             .in(NoticeDO::getId, list.stream().map(NoticeDO::getId).toList()) | ||||
|             .in(NoticeDO::getId, CollUtils.mapToList(list, NoticeDO::getId)) | ||||
|             .update(); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user