|
@@ -14,9 +14,9 @@ import (
|
|
|
|
|
|
func AssetCount(router *GinRouter) {
|
|
|
|
|
|
- router.GET("/count/info/types/:dbId", GetAssetCount)
|
|
|
+ router.GET("/asset/info/types/:dbId", GetAssetCount)
|
|
|
|
|
|
- router.GET("/count/info", GetInfo)
|
|
|
+ router.GET("/asset/info", GetInfo)
|
|
|
}
|
|
|
|
|
|
type AssetDefCountInfo struct {
|
|
@@ -258,7 +258,6 @@ func GetInfo(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
|
|
|
dbId, _ := primitive.ObjectIDFromHex(form.DbId)
|
|
|
|
|
|
-
|
|
|
|
|
|
var databaseDoc model.Database
|
|
|
dbParam := &repo.DocSearchOptions{
|
|
@@ -273,15 +272,15 @@ func GetInfo(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
|
|
|
|
|
|
parm := &repo.DocSearchOptions{
|
|
|
- Db: databaseDoc.Name,
|
|
|
- CollectName: repo.CollectionAssetCount,
|
|
|
+ Db: databaseDoc.Name,
|
|
|
+ CollectName: repo.CollectionAssetCount,
|
|
|
Project: []string{"_id", "defId", "createTime"},
|
|
|
Sort: bson.M{"createTime": -1},
|
|
|
}
|
|
|
|
|
|
var assetCount model.AssetCount
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
if databaseDoc.Assets == nil {
|
|
|
return nil, errors.New("资产不存在")
|
|
@@ -308,7 +307,7 @@ func GetInfo(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
meshDefItem.DefName = asset.Label
|
|
|
|
|
|
for _, timePoint := range timeSet {
|
|
|
-
|
|
|
+
|
|
|
query["defId"] = asset.Id
|
|
|
parm.Query = query
|
|
|
bl, err := repo.RepoSeachDoc(ctx, parm, &assetCount)
|