animeic 1 жил өмнө
parent
commit
14e0163842

+ 0 - 81
baishuihu/api/printr.go

@@ -1,11 +1,6 @@
 package api
 
 import (
-	"baishuihu/db/model"
-	"baishuihu/db/repo"
-	"fmt"
-	"strings"
-
 	"github.com/gin-gonic/gin"
 )
 
@@ -15,79 +10,3 @@ func Printr(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	println(map1["a"])
 	return nil, nil
 }
-
-func SyncType(c *gin.Context, apictx *ApiSession) (interface{}, error) {
-
-	articles := []*model.Article{}
-	err := repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
-		CollectName: repo.CollectionArticle,
-		Project:     []string{"cid"},
-	}, &articles)
-	fmt.Println(len(articles))
-	for _, article := range articles {
-		cid := article.Cid
-		category := model.Category{}
-		found, err := repo.RepoSeachDoc(apictx.CreateRepoCtx(), &repo.DocSearchOptions{
-			CollectName: repo.CollectionCategory,
-			Query:       repo.Map{"_id": cid},
-			Project:     []string{"type"},
-		}, &category)
-		if err != nil {
-			continue
-		}
-		if found {
-			repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionArticle, article.Id.Hex(), &model.Article{Type: category.Type})
-		}
-
-	}
-
-	return articles, err
-
-}
-
-var originStatic string = "https://www.infish.cn/adhuaxi/v1/public"
-var targetStatic string = "https://3dqueen.cloud/baishuihu/v1/public"
-
-func SyncStaticAddr(c *gin.Context, apictx *ApiSession) (interface{}, error) {
-	articles := []*model.Article{}
-	repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
-		CollectName: repo.CollectionArticle,
-		Project:     []string{"cover", "content"},
-	}, &articles)
-	fmt.Println(len(articles))
-	for _, article := range articles {
-		cover := article.Cover
-		content := article.Content
-		coverNew := strings.Replace(cover, originStatic, targetStatic, -1)
-		contentNew := strings.Replace(content, originStatic, targetStatic, -1)
-		repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionArticle, article.Id.Hex(), &model.Article{Cover: coverNew, Content: contentNew})
-	}
-
-	banners := []*model.Banner{}
-	repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
-		CollectName: repo.CollectionBanner,
-		Project:     []string{"cover"},
-	}, &banners)
-	fmt.Println(len(banners))
-	for _, banner := range banners {
-		cover := banner.Cover
-		coverNew := strings.Replace(cover, originStatic, targetStatic, -1)
-		repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionBanner, banner.Id.Hex(), &model.Banner{Cover: coverNew})
-	}
-
-	categorys := []*model.Category{}
-	repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
-		CollectName: repo.CollectionCategory,
-		Project:     []string{"cover"},
-	}, &banners)
-	fmt.Println(len(categorys))
-	for _, category := range categorys {
-		cover := category.Cover
-		fmt.Println(cover)
-		coverNew := strings.Replace(cover, originStatic, targetStatic, -1)
-		repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionCategory, category.Id.Hex(), &model.Category{Cover: coverNew})
-	}
-
-	return articles, nil
-
-}

+ 0 - 3
baishuihu/go.mod

@@ -7,7 +7,6 @@ require (
 	github.com/alibabacloud-go/sts-20150401/v2 v2.0.1
 	github.com/alibabacloud-go/tea v1.1.19
 	github.com/alibabacloud-go/tea-utils/v2 v2.0.1
-	github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible
 	github.com/appleboy/gin-jwt/v2 v2.8.0
 	github.com/gin-contrib/cors v1.4.0
 	github.com/gin-contrib/sessions v0.0.5
@@ -33,7 +32,6 @@ require (
 	github.com/clbanning/mxj/v2 v2.5.5 // indirect
 	github.com/go-ole/go-ole v1.2.5 // indirect
 	github.com/tjfoc/gmsm v1.3.2 // indirect
-	golang.org/x/time v0.3.0 // indirect
 )
 
 require (
@@ -55,7 +53,6 @@ require (
 	github.com/hashicorp/errwrap v1.1.0 // indirect
 	github.com/hashicorp/go-multierror v1.1.1 // indirect
 	github.com/hashicorp/hcl v1.0.0 // indirect
-	github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible
 	github.com/jessevdk/go-flags v1.5.0 // indirect
 	github.com/json-iterator/go v1.1.12 // indirect
 	github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect

+ 0 - 5
baishuihu/go.sum

@@ -147,8 +147,6 @@ github.com/alibabacloud-go/tea-utils/v2 v2.0.1 h1:K6kwgo+UiYx+/kr6CO0PN5ACZDzE3n
 github.com/alibabacloud-go/tea-utils/v2 v2.0.1/go.mod h1:U5MTY10WwlquGPS34DOeomUGBB0gXbLueiq5Trwu0C4=
 github.com/alibabacloud-go/tea-xml v1.1.2 h1:oLxa7JUXm2EDFzMg+7oRsYc+kutgCVwm+bZlhhmvW5M=
 github.com/alibabacloud-go/tea-xml v1.1.2/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCEtyBy9+DPF6GgEu8=
-github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible h1:Sg/2xHwDrioHpxTN6WMiwbXTpUEinBpHsN7mG21Rc2k=
-github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
 github.com/aliyun/credentials-go v1.1.2 h1:qU1vwGIBb3UJ8BwunHDRFtAhS6jnQLnde/yk0+Ih2GY=
 github.com/aliyun/credentials-go v1.1.2/go.mod h1:ozcZaMR5kLM7pwtCMEpVmQ242suV6qTJya2bDq4X1Tw=
 github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
@@ -727,8 +725,6 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m
 github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
 github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
-github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible h1:XRAk4HBDLCYEdPLWtKf5iZhOi7lfx17aY0oSO9+mcg8=
-github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s=
 github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
@@ -1648,7 +1644,6 @@ golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxb
 golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
-golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=