mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
refactor: tooltip延迟显示等
This commit is contained in:
@@ -49,7 +49,7 @@ func (d *Db) Dbs(rc *req.Ctx) {
|
||||
}
|
||||
|
||||
queryCond.TagIds = tagIds
|
||||
res, err := d.DbApp.GetPageList(queryCond, page, new([]vo.SelectDataDbVO))
|
||||
res, err := d.DbApp.GetPageList(queryCond, page, new([]vo.DbListVO))
|
||||
biz.ErrIsNil(err)
|
||||
rc.ResData = res
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ type Instance struct {
|
||||
// @router /api/instances [get]
|
||||
func (d *Instance) Instances(rc *req.Ctx) {
|
||||
queryCond, page := ginx.BindQueryAndPage[*entity.InstanceQuery](rc.GinCtx, new(entity.InstanceQuery))
|
||||
res, err := d.InstanceApp.GetPageList(queryCond, page, new([]vo.SelectDataInstanceVO))
|
||||
res, err := d.InstanceApp.GetPageList(queryCond, page, new([]vo.InstanceListVO))
|
||||
biz.ErrIsNil(err)
|
||||
rc.ResData = res
|
||||
}
|
||||
|
||||
@@ -2,8 +2,7 @@ package vo
|
||||
|
||||
import "time"
|
||||
|
||||
type SelectDataDbVO struct {
|
||||
//models.BaseModel
|
||||
type DbListVO struct {
|
||||
Id *int64 `json:"id"`
|
||||
Name *string `json:"name"`
|
||||
Database *string `json:"database"`
|
||||
@@ -14,6 +13,9 @@ type SelectDataDbVO struct {
|
||||
InstanceId *int64 `json:"instanceId"`
|
||||
InstanceName *string `json:"instanceName"`
|
||||
InstanceType *string `json:"type"`
|
||||
Host string `json:"host"`
|
||||
Port int `json:"port"`
|
||||
Username string `json:"username"`
|
||||
|
||||
CreateTime *time.Time `json:"createTime"`
|
||||
Creator *string `json:"creator"`
|
||||
|
||||
@@ -2,8 +2,7 @@ package vo
|
||||
|
||||
import "time"
|
||||
|
||||
type SelectDataInstanceVO struct {
|
||||
//models.BaseModel
|
||||
type InstanceListVO struct {
|
||||
Id *int64 `json:"id"`
|
||||
Name *string `json:"name"`
|
||||
Host *string `json:"host"`
|
||||
|
||||
@@ -19,7 +19,7 @@ func newDbRepo() repository.Db {
|
||||
// 分页获取数据库信息列表
|
||||
func (d *dbRepoImpl) GetDbList(condition *entity.DbQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
|
||||
qd := gormx.NewQueryWithTableName("t_db db").
|
||||
Select("db.*, inst.name instance_name, inst.type instance_type").
|
||||
Select("db.*, inst.name instance_name, inst.type instance_type, inst.host, inst.port, inst.username ").
|
||||
Joins("JOIN t_db_instance inst ON db.instance_id = inst.id").
|
||||
Eq("db.instance_id", condition.InstanceId).
|
||||
Like("db.database", condition.Database).
|
||||
|
||||
Reference in New Issue
Block a user