mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-01-03 13:16:35 +08:00
fix: i18n & other optimizations
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"mayfly-go/internal/common/consts"
|
||||
tagapp "mayfly-go/internal/tag/application"
|
||||
tagentity "mayfly-go/internal/tag/domain/entity"
|
||||
"mayfly-go/pkg/req"
|
||||
"mayfly-go/pkg/utils/collx"
|
||||
)
|
||||
@@ -13,7 +13,9 @@ type Dashbord struct {
|
||||
|
||||
func (m *Dashbord) Dashbord(rc *req.Ctx) {
|
||||
accountId := rc.GetLoginAccount().Id
|
||||
mongoNum := len(m.TagTreeApp.GetAccountTagCodes(accountId, consts.ResourceTypeMongo, ""))
|
||||
mongoNum := len(m.TagTreeApp.GetAccountTags(accountId, &tagentity.TagTreeQuery{Types: []tagentity.TagType{
|
||||
tagentity.TagTypeMongo,
|
||||
}}))
|
||||
|
||||
rc.ResData = collx.M{
|
||||
"mongoNum": mongoNum,
|
||||
|
||||
@@ -33,12 +33,15 @@ func (m *Mongo) Mongos(rc *req.Ctx) {
|
||||
queryCond, page := req.BindQueryAndPage[*entity.MongoQuery](rc, new(entity.MongoQuery))
|
||||
|
||||
// 不存在可访问标签id,即没有可操作数据
|
||||
codes := m.TagApp.GetAccountTagCodes(rc.GetLoginAccount().Id, consts.ResourceTypeMongo, queryCond.TagPath)
|
||||
if len(codes) == 0 {
|
||||
tags := m.TagApp.GetAccountTags(rc.GetLoginAccount().Id, &tagentity.TagTreeQuery{
|
||||
Types: []tagentity.TagType{tagentity.TagTypeMongo},
|
||||
CodePathLikes: []string{queryCond.TagPath},
|
||||
})
|
||||
if len(tags) == 0 {
|
||||
rc.ResData = model.EmptyPageResult[any]()
|
||||
return
|
||||
}
|
||||
queryCond.Codes = codes
|
||||
queryCond.Codes = tags.GetCodes()
|
||||
|
||||
var mongovos []*vo.Mongo
|
||||
res, err := m.MongoApp.GetPageList(queryCond, page, &mongovos)
|
||||
|
||||
Reference in New Issue
Block a user