|
@@ -40,11 +40,11 @@ func GetAssetCount(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
return nil, errors.New("dbId不能为空")
|
|
|
}
|
|
|
query := make(map[string]interface{})
|
|
|
- query["_id"] = dbId
|
|
|
+ query["_id"], _ = primitive.ObjectIDFromHex(dbId)
|
|
|
option := &repo.DocSearchOptions{
|
|
|
CollectName: repo.CollectionDatabase,
|
|
|
Query: query,
|
|
|
- Project: []string{"_id", "assets"},
|
|
|
+ Project: []string{"_id", "assets", "name"},
|
|
|
}
|
|
|
var datbaseDoc model.Database
|
|
|
found, err := repo.RepoSeachDoc(apictx.CreateRepoCtx(), option, &datbaseDoc)
|
|
@@ -122,29 +122,6 @@ func GetAssetCount(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
return assetDefCountInfo, nil
|
|
|
}
|
|
|
|
|
|
-type CountInfo struct {
|
|
|
- Mesh []DefItem `json:"mesh"`
|
|
|
- Image []DefItem `json:"image"`
|
|
|
- Material []DefItem `json:"material"`
|
|
|
- Env3d []DefItem `json:"env3d"`
|
|
|
-}
|
|
|
-
|
|
|
-type DefItem struct {
|
|
|
- DefName string `json:"defName"`
|
|
|
- DefKey string `json:"defKey"`
|
|
|
- Time []CountTime `json:"time"`
|
|
|
-}
|
|
|
-type CountTime struct {
|
|
|
- TimePoint time.Time `json:"timePoint"`
|
|
|
- Count int `json:"count"`
|
|
|
-}
|
|
|
-
|
|
|
-type DefInfo struct {
|
|
|
- DefId string
|
|
|
- DefName string
|
|
|
- DefKey string
|
|
|
-}
|
|
|
-
|
|
|
type ReqAssetCount struct {
|
|
|
DbId string `json:"dbId"`
|
|
|
Step int `json:"step"`
|