作者 tangxvhui

暂存

1 package notify 1 package notify
2 2
3 import ( 3 import (
  4 + "time"
  5 +
4 "github.com/linmadan/egglib-go/core/application" 6 "github.com/linmadan/egglib-go/core/application"
5 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory" 7 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
6 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/notify/command" 8 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/notify/command"
  9 + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
7 ) 10 )
8 11
9 // 个人信息提示 12 // 个人信息提示
@@ -28,8 +31,19 @@ func (srv *MessagePersonalService) TodayMessageSummaryEvaluationSelf(param *comm @@ -28,8 +31,19 @@ func (srv *MessagePersonalService) TodayMessageSummaryEvaluationSelf(param *comm
28 defer func() { 31 defer func() {
29 _ = transactionContext.RollbackTransaction() 32 _ = transactionContext.RollbackTransaction()
30 }() 33 }()
31 - // nowTime := time.Now()  
32 34
  35 + nowTime := time.Now()
  36 + evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{
  37 + "transactionContext": transactionContext,
  38 + })
  39 + _, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
  40 + "targetUserId": param.UserId,
  41 + "types": domain.EvaluationSelf,
  42 + "beginTime": nowTime,
  43 + "endTime": nowTime,
  44 + "limit": 20,
  45 + })
  46 + _ = evaluationList
33 if err := transactionContext.CommitTransaction(); err != nil { 47 if err := transactionContext.CommitTransaction(); err != nil {
34 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 48 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
35 } 49 }
@@ -4,15 +4,15 @@ import "time" @@ -4,15 +4,15 @@ import "time"
4 4
5 // MessagePersonal 个人的消息提示 5 // MessagePersonal 个人的消息提示
6 type MessagePersonal struct { 6 type MessagePersonal struct {
7 - Id int //  
8 - Types string //消息类型  
9 - TargetUserId int //消息指向的用户  
10 - ReadFlag MessageReadFlag //1:已读、2:未读  
11 - Title string //消息的标题  
12 - Content string //消息的内容  
13 - CreatedAt time.Time  
14 - UpdatedAt time.Time  
15 - Payload string //消息的额外承载的数据 7 + Id int `json:"id"` //
  8 + Types string `json:"types"` //消息类型
  9 + TargetUserId int `json:"targetUserId"` //消息指向的用户
  10 + ReadFlag MessageReadFlag `json:"readFlag"` //1:已读、2:未读
  11 + Title string `json:"title"` //消息的标题
  12 + Content string `json:"content"` //消息的内容
  13 + CreatedAt time.Time `json:"createdAt"`
  14 + UpdatedAt time.Time `json:"updatedAt"`
  15 + Payload string `json:"payload"` //消息的额外承载的数据
16 } 16 }
17 17
18 type MessageTypes string 18 type MessageTypes string
  1 +package models
  2 +
  3 +import "time"
  4 +
  5 +// MessagePersonal 记录个人的提示消息
  6 +type MessagePersonal struct {
  7 + tableName struct{} `comment:"记录个人的提示消息" pg:"message_personal"`
  8 + Id int `pg:"id,pk"` //
  9 + Types string `pg:"types"` //消息类型
  10 + TargetUserId int `pg:"target_user_id"` //消息指向的用户
  11 + ReadFlag string `pg:"read_flag"` //1:已读、2:未读
  12 + Title string `pg:"title"` //消息的标题
  13 + Content string `pg:"content"` //消息的内容
  14 + CreatedAt time.Time `pg:"created_at"`
  15 + UpdatedAt time.Time `pg:"updated_at"`
  16 + Payload string `pg:"payload"` //消息的额外承载的数据
  17 +}