update 通知公告强化
This commit is contained in:
@@ -76,16 +76,17 @@ namespace Ewide.Core.Service.Notice
|
||||
if (input.Status != (int)NoticeStatus.DRAFT && input.Status != (int)NoticeStatus.PUBLIC)
|
||||
throw Oops.Oh(ErrorCode.D7000);
|
||||
|
||||
var notice = input.Adapt<SysNotice>();
|
||||
var config = new TypeAdapterConfig().ForType<AddNoticeInput, SysNotice>()
|
||||
.Map(target => target.Attachments, src => String.Join(",", src.Attachments))
|
||||
.Config;
|
||||
var notice = input.Adapt<SysNotice>(config);
|
||||
var id = System.Guid.NewGuid().ToString().ToLower();
|
||||
notice.Id = id;
|
||||
if (input.Attachments!=null)
|
||||
notice.Attachments = string.Join(",", input.Attachments);
|
||||
await UpdatePublicInfo(notice);
|
||||
// 如果是发布,则设置发布时间
|
||||
if (input.Status == (int)NoticeStatus.PUBLIC)
|
||||
notice.PublicTime = DateTime.Now;
|
||||
var newItem = await notice.InsertAsync();
|
||||
await notice.InsertAsync();
|
||||
|
||||
// 通知到的人
|
||||
var noticeUserIdList = input.NoticeUserIdList;
|
||||
|
||||
Reference in New Issue
Block a user