sunsheng 9 місяців тому
батько
коміт
2404c4bfb3
5 змінених файлів з 15 додано та 61 видалено
  1. 0 61
      db/db.go
  2. 15 0
      package/app.yaml
  3. BIN
      package/tmplate/tmplate-原始.xlsx
  4. BIN
      package/tmplate/tmplate.xlsx
  5. BIN
      package/update.exe

+ 0 - 61
db/db.go

@@ -1,61 +0,0 @@
-package db
-
-import (
-	"context"
-	"log"
-	"time"
-
-	"go.mongodb.org/mongo-driver/mongo"
-	"go.mongodb.org/mongo-driver/mongo/options"
-)
-
-const (
-	MONGODB_URI = "mongodb://root:boxcost@124.71.139.24:37030/box-cost?authSource=admin"
-	DB_NAME     = "box-cost"
-	COLL_NAME   = "product-plan"
-)
-
-var (
-	client     *mongo.Client
-	collection *mongo.Collection
-)
-
-// 初始化MongoDB连接
-func InitMongoConn() {
-	// 创建一个新的上下文
-	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
-	defer cancel()
-
-	// 连接到MongoDB
-	var err error
-	client, err = mongo.Connect(ctx, options.Client().ApplyURI(MONGODB_URI))
-	if err != nil {
-		log.Fatal(err)
-	}
-
-	// 选择数据库和集合
-	collection = client.Database(DB_NAME).Collection(COLL_NAME)
-}
-
-// 获取已初始化的集合
-func GetCollection() *mongo.Collection {
-	if collection == nil {
-		log.Fatal("MongoDB connection not initialized")
-	}
-	return collection
-}
-
-// 关闭MongoDB连接
-func CloseMongoConn() {
-	if client != nil {
-		// 创建一个新的上下文
-		ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
-		defer cancel()
-
-		// 关闭连接
-		err := client.Disconnect(ctx)
-		if err != nil {
-			log.Fatal(err)
-		}
-	}
-}

+ 15 - 0
package/app.yaml

@@ -0,0 +1,15 @@
+plans:
+  - "6648181a23830800fd7751fd"
+  - "664968ac23830800fd775203"
+  - "66498b5423830800fd775205"
+  - "6649535e23830800fd7751ff"
+  - "664989d823830800fd775204"
+  - "6649a02b23830800fd775216"
+  - "6649980723830800fd77520f"
+  - "66499a3423830800fd775211"
+  - "66499e2b23830800fd775215"
+  - "665dbdd623830800fd775416"
+  - "66499ae023830800fd775212"
+  - "6649990123830800fd775210"
+  - "66499c1d23830800fd775213"
+  - "66499cfd23830800fd775214"

BIN
package/tmplate/tmplate-原始.xlsx


BIN
package/tmplate/tmplate.xlsx


BIN
package/update.exe