mirror of https://gitee.com/answerdev/answer.git
update Notification
This commit is contained in:
parent
0a4f75323c
commit
bd079a0040
|
@ -96,10 +96,14 @@ func (nr *notificationRepo) GetNotificationPage(ctx context.Context, searchCond
|
|||
|
||||
session := nr.data.DB.NewSession()
|
||||
session = session.Desc("updated_at")
|
||||
|
||||
cond := &entity.Notification{
|
||||
UserID: searchCond.UserID,
|
||||
Type: searchCond.Type,
|
||||
}
|
||||
if searchCond.InboxType > 0 {
|
||||
cond.MsgType = searchCond.InboxType
|
||||
}
|
||||
total, err = pager.Help(searchCond.Page, searchCond.PageSize, ¬ificationList, cond, session)
|
||||
if err != nil {
|
||||
err = errors.InternalServer(reason.DatabaseError).WithError(err).WithStack()
|
||||
|
|
|
@ -7,10 +7,10 @@ const (
|
|||
NotificationRead = 2
|
||||
NotificationStatusNormal = 1
|
||||
NotificationStatusDelete = 10
|
||||
NotificationInboxTypeAll = 1
|
||||
NotificationInboxTypePosts = 2
|
||||
NotificationInboxTypeAll = 0
|
||||
NotificationInboxTypePosts = 1
|
||||
NotificationInboxTypeVotes = 2
|
||||
NotificationInboxTypeInvites = 3
|
||||
NotificationInboxTypeVotes = 4
|
||||
)
|
||||
|
||||
var NotificationType = map[string]int{
|
||||
|
|
|
@ -125,9 +125,9 @@ func (ns *NotificationService) GetNotificationPage(ctx context.Context, searchCo
|
|||
}
|
||||
searchInboxType := schema.NotificationInboxTypeAll
|
||||
if searchType == schema.NotificationTypeInbox {
|
||||
searchInboxType, ok = schema.NotificationInboxType[searchCond.InboxTypeStr]
|
||||
if !ok {
|
||||
return pager.NewPageModel(0, resp), nil
|
||||
_, ok = schema.NotificationInboxType[searchCond.InboxTypeStr]
|
||||
if ok {
|
||||
searchInboxType = schema.NotificationInboxType[searchCond.InboxTypeStr]
|
||||
}
|
||||
}
|
||||
searchCond.Type = searchType
|
||||
|
|
Loading…
Reference in New Issue