作者 tangxvhui

暂存

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