2024-01-23 19:30:28 +08:00
|
|
|
package api
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
tagapp "mayfly-go/internal/tag/application"
|
2024-11-23 17:23:18 +08:00
|
|
|
tagentity "mayfly-go/internal/tag/domain/entity"
|
2024-01-23 19:30:28 +08:00
|
|
|
"mayfly-go/pkg/req"
|
|
|
|
|
"mayfly-go/pkg/utils/collx"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type Dashbord struct {
|
|
|
|
|
TagTreeApp tagapp.TagTree `inject:""`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *Dashbord) Dashbord(rc *req.Ctx) {
|
|
|
|
|
accountId := rc.GetLoginAccount().Id
|
2024-11-23 17:23:18 +08:00
|
|
|
mongoNum := len(m.TagTreeApp.GetAccountTags(accountId, &tagentity.TagTreeQuery{Types: []tagentity.TagType{
|
|
|
|
|
tagentity.TagTypeMongo,
|
|
|
|
|
}}))
|
2024-01-23 19:30:28 +08:00
|
|
|
|
|
|
|
|
rc.ResData = collx.M{
|
|
|
|
|
"mongoNum": mongoNum,
|
|
|
|
|
}
|
|
|
|
|
}
|