feat: 添加通知微服务,支持站内通知已读状态
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"juwan-backend/app/notification/rpc/internal/models"
|
||||
"juwan-backend/app/notification/rpc/pb"
|
||||
)
|
||||
|
||||
func entNotificationToPb(n *models.Notifications) *pb.Notifications {
|
||||
out := &pb.Notifications{
|
||||
Id: n.ID,
|
||||
UserId: n.UserID,
|
||||
Type: n.Type,
|
||||
Title: n.Title,
|
||||
Content: n.Content,
|
||||
Read: n.Read,
|
||||
CreatedAt: n.CreatedAt.Unix(),
|
||||
UpdatedAt: n.UpdatedAt.Unix(),
|
||||
}
|
||||
if n.Link != nil {
|
||||
out.Link = *n.Link
|
||||
}
|
||||
return out
|
||||
}
|
||||
Reference in New Issue
Block a user