mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
refactor: remove router、ioc is adjusted to inject by type
This commit is contained in:
@@ -8,7 +8,15 @@ import (
|
||||
)
|
||||
|
||||
type Msg struct {
|
||||
MsgApp application.Msg `inject:""`
|
||||
msgApp application.Msg `inject:"T"`
|
||||
}
|
||||
|
||||
func (m *Msg) ReqConfs() *req.Confs {
|
||||
reqs := [...]*req.Conf{
|
||||
req.NewGet("/self", m.GetMsgs),
|
||||
}
|
||||
|
||||
return req.NewConfs("/msgs", reqs[:]...)
|
||||
}
|
||||
|
||||
// 获取账号接收的消息列表
|
||||
@@ -16,7 +24,7 @@ func (m *Msg) GetMsgs(rc *req.Ctx) {
|
||||
condition := &entity.Msg{
|
||||
RecipientId: int64(rc.GetLoginAccount().Id),
|
||||
}
|
||||
res, err := m.MsgApp.GetPageList(condition, rc.GetPageParam(), new([]entity.Msg))
|
||||
res, err := m.msgApp.GetPageList(condition, rc.GetPageParam(), new([]entity.Msg))
|
||||
biz.ErrIsNil(err)
|
||||
rc.ResData = res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user