|
@@ -6,68 +6,5 @@ import (
|
|
|
|
|
|
func Printr(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
return UtilMd5("697894"), nil
|
|
|
- // status := 0
|
|
|
- // h5s := make([]*model.H5, 0)
|
|
|
- // // id, _ := primitive.ObjectIDFromHex("6502cee3962a9f2698a981af")
|
|
|
- // err := repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
|
|
|
- // // Query: repo.Map{"_id": bson.M{"$ne": nil}},
|
|
|
- // CollectName: repo.CollectionH5,
|
|
|
- // Project: []string{"_id"},
|
|
|
- // }, &h5s)
|
|
|
- // fmt.Println(err)
|
|
|
- // for _, v := range h5s {
|
|
|
- // repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionH5, v.Id.Hex(), &model.H5{Public: &status})
|
|
|
- // }
|
|
|
- // return h5s, nil
|
|
|
- // return repo.RepoUpdateSetDocProps2(apictx.CreateRepoCtx(), repo.CollectionH5, bson.M{"_id": bson.M{"$ne": nil}}, bson.M{"$set": &model.H5{Public: &status}})
|
|
|
|
|
|
- // 迁移数据
|
|
|
- // _, lists := repo.RepoSeachDocsMap(apictx.CreateRepoCtx(), &repo.DocsSearchOptions{
|
|
|
- // CollectName: "platform_shoe_user",
|
|
|
- // // CollectName: "company_shoe_user",
|
|
|
- // })
|
|
|
- // count := 0
|
|
|
- // if len(lists) > 0 {
|
|
|
- // for _, list := range lists {
|
|
|
- // // id := list["_id"].(primitive.ObjectID).Hex()
|
|
|
- // // update := bson.M{"$set": bson.M{"categories": []string{"64e81811c234aba07787fd85"}}}
|
|
|
- // // _, err := repo.RepoUpdateSetDocProps(apictx.CreateRepoCtx(), "shoes", id, &update)
|
|
|
- // // if err != nil {
|
|
|
- // // fmt.Println(err)
|
|
|
- // // }
|
|
|
- // list["_id"] = primitive.NilObjectID
|
|
|
- // delete(list, "_id")
|
|
|
- // list["categories"] = []string{"64e81811c234aba07787fd85"}
|
|
|
- // list["cusCategories"] = []string{}
|
|
|
- // _, err := repo.RepoAddDoc(apictx.CreateRepoCtx(), "model", &list)
|
|
|
- // if err != nil {
|
|
|
- // fmt.Println(err)
|
|
|
- // }
|
|
|
- // count++
|
|
|
- // }
|
|
|
-
|
|
|
- // }
|
|
|
- // fmt.Println(count)
|
|
|
- return "success", nil
|
|
|
- // _, lists := repo.RepoSeachDocsMap(apictx.CreateRepoCtx(), &repo.DocsSearchOptions{
|
|
|
- // CollectName: "shoes",
|
|
|
- // })
|
|
|
- // if len(lists) > 0 {
|
|
|
- // for _, list := range lists {
|
|
|
- // id := list["_id"].(primitive.ObjectID).Hex()
|
|
|
- // update := bson.M{"$set": bson.M{"categories": []string{"64e81811c234aba07787fd85"}}}
|
|
|
- // _, err := repo.RepoUpdateSetDocProps(apictx.CreateRepoCtx(), "shoes", id, &update)
|
|
|
- // if err != nil {
|
|
|
- // fmt.Println(err)
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
- // t1 := time.Now().Add(100 * time.Second)
|
|
|
- // fmt.Println(time.Until(t1))
|
|
|
- // fmt.Println(UtilMd5("625117"))
|
|
|
- // 4368ca4d0d1d07869b4bae9fac908098
|
|
|
-
|
|
|
- return nil, nil
|
|
|
}
|