2023-07-03 21:42:04 +08:00
|
|
|
package api
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"mayfly-go/internal/msg/application"
|
|
|
|
|
"mayfly-go/internal/msg/domain/entity"
|
2023-10-26 17:15:49 +08:00
|
|
|
"mayfly-go/pkg/biz"
|
2023-07-03 21:42:04 +08:00
|
|
|
"mayfly-go/pkg/req"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type Msg struct {
|
2024-01-21 22:52:20 +08:00
|
|
|
MsgApp application.Msg `inject:""`
|
2023-07-03 21:42:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取账号接收的消息列表
|
|
|
|
|
func (m *Msg) GetMsgs(rc *req.Ctx) {
|
|
|
|
|
condition := &entity.Msg{
|
2023-11-07 21:05:21 +08:00
|
|
|
RecipientId: int64(rc.GetLoginAccount().Id),
|
2023-07-03 21:42:04 +08:00
|
|
|
}
|
2024-02-25 12:46:18 +08:00
|
|
|
res, err := m.MsgApp.GetPageList(condition, rc.GetPageParam(), new([]entity.Msg))
|
2023-10-26 17:15:49 +08:00
|
|
|
biz.ErrIsNil(err)
|
|
|
|
|
rc.ResData = res
|
2023-07-03 21:42:04 +08:00
|
|
|
}
|