Skip to content

Commit 6c28d99

Browse files
authored
Merge pull request #586 from actiontech/company-notice-ce
Company notice ce
2 parents 8e23cd2 + 7f0dbbc commit 6c28d99

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

internal/dms/service/company_notice.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ func (d *DMSService) GetCompanyNotice(ctx context.Context, currentUserUid string
1616
}
1717
if companyNotice != nil {
1818
data.NoticeStr = companyNotice.NoticeStr
19+
if companyNotice.CreateUserUID != "" {
20+
users := d.UserUsecase.GetBizUserWithNameByUids(ctx, []string{companyNotice.CreateUserUID})
21+
if len(users) > 0 {
22+
data.CreateUserName = users[0].Name
23+
}
24+
}
1925
data.StartTime = companyNotice.StartTime
2026
data.ExpireTime = companyNotice.EndTime
2127
}

internal/dms/storage/convert.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,17 +988,23 @@ func convertBizCompanyNotice(b *biz.CompanyNotice) (*model.CompanyNotice, error)
988988
Model: model.Model{
989989
UID: b.UID,
990990
},
991+
CreateUserUID: b.CreateUserUID,
991992
NoticeStr: b.NoticeStr,
992993
ReadUserIds: b.ReadUserIds,
994+
StartTime: b.StartTime,
995+
EndTime: b.EndTime,
993996
}, nil
994997
}
995998

996999
func convertModelCompanyNotice(m *model.CompanyNotice) (*biz.CompanyNotice, error) {
9971000
p := &biz.CompanyNotice{
9981001
Base: convertBase(m.Model),
9991002
UID: m.UID,
1003+
CreateUserUID: m.CreateUserUID,
10001004
NoticeStr: m.NoticeStr,
10011005
ReadUserIds: m.ReadUserIds,
1006+
StartTime: m.StartTime,
1007+
EndTime: m.EndTime,
10021008
}
10031009

10041010
return p, nil

internal/dms/storage/model/model.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,11 @@ type BasicConfig struct {
438438

439439
type CompanyNotice struct {
440440
Model
441+
CreateUserUID string `json:"create_user_uid" gorm:"column:create_user_uid;size:32;comment:'创建人uid'"`
441442
NoticeStr string `gorm:"type:mediumtext;comment:'企业公告'" json:"notice_str"`
442443
ReadUserIds ReadUsers `gorm:"type:longtext" json:"read_user_ids"`
444+
StartTime *time.Time `json:"start_time" gorm:"column:start_time;comment:'公告开始时间'"`
445+
EndTime *time.Time `json:"end_time" gorm:"column:end_time;comment:'公告结束时间'"`
443446
}
444447

445448
type ReadUsers []string

0 commit comments

Comments
 (0)