animeic 2 rokov pred
rodič
commit
6e81b245cf

+ 2 - 2
oilseal-train/app.yaml

@@ -17,7 +17,7 @@ debug:
   UserRole: string
 
 nats:
-  url: nats://124.71.139.24:14302
-  # url: nats://127.0.0.1:14302
+  # url: nats://124.71.139.24:14302
+  url: nats://127.0.0.1:14302
   maxReconnect: 1000
   reconnDelaySecond: 5

+ 20 - 22
oilseal-train/go.mod

@@ -11,32 +11,33 @@ require (
 	github.com/natefinch/lumberjack v2.0.0+incompatible
 	github.com/spf13/viper v1.9.0
 	github.com/xuri/excelize/v2 v2.6.1
-	go.mongodb.org/mongo-driver v1.9.1
+	go.mongodb.org/mongo-driver v1.11.1
 	go.uber.org/dig v1.12.0
 	go.uber.org/zap v1.17.0
 	infish.cn/comm v0.0.0
 )
 
 require (
-	github.com/cespare/xxhash/v2 v2.1.2 // indirect
+	github.com/cenkalti/backoff/v4 v4.2.0 // indirect
+	github.com/cespare/xxhash/v2 v2.2.0 // indirect
 	github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
 	github.com/fsnotify/fsnotify v1.5.1 // indirect
 	github.com/gin-contrib/sse v0.1.0 // indirect
 	github.com/go-playground/locales v0.13.0 // indirect
 	github.com/go-playground/universal-translator v0.17.0 // indirect
 	github.com/go-playground/validator/v10 v10.4.1 // indirect
-	github.com/go-stack/stack v1.8.0 // indirect
 	github.com/golang-jwt/jwt/v4 v4.1.0 // indirect
+	github.com/golang-migrate/migrate/v4 v4.15.2 // indirect
 	github.com/golang/protobuf v1.5.2 // indirect
-	github.com/golang/snappy v0.0.3 // indirect
-	github.com/google/go-cmp v0.5.7 // indirect
+	github.com/golang/snappy v0.0.4 // indirect
 	github.com/gorilla/context v1.1.1 // indirect
 	github.com/gorilla/securecookie v1.1.1 // indirect
 	github.com/gorilla/sessions v1.1.3 // indirect
+	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/json-iterator/go v1.1.12 // indirect
-	github.com/klauspost/compress v1.14.4 // indirect
-	github.com/kr/text v0.2.0 // indirect
+	github.com/klauspost/compress v1.15.13 // indirect
 	github.com/leodido/go-urn v1.2.0 // indirect
 	github.com/magiconair/properties v1.8.5 // indirect
 	github.com/mattn/go-isatty v0.0.12 // indirect
@@ -45,11 +46,11 @@ require (
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/modern-go/reflect2 v1.0.2 // indirect
 	github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
+	github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
 	github.com/nats-io/jwt/v2 v2.3.0 // indirect
-	github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d // indirect
+	github.com/nats-io/nats.go v1.22.1 // indirect
 	github.com/nats-io/nkeys v0.3.0 // indirect
 	github.com/nats-io/nuid v1.0.1 // indirect
-	github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
 	github.com/pelletier/go-toml v1.9.4 // indirect
 	github.com/pkg/errors v0.9.1 // indirect
 	github.com/richardlehane/mscfb v1.0.4 // indirect
@@ -61,23 +62,20 @@ require (
 	github.com/subosito/gotenv v1.2.0 // indirect
 	github.com/ugorji/go/codec v1.1.7 // indirect
 	github.com/xdg-go/pbkdf2 v1.0.0 // indirect
-	github.com/xdg-go/scram v1.0.2 // indirect
-	github.com/xdg-go/stringprep v1.0.2 // indirect
+	github.com/xdg-go/scram v1.1.2 // indirect
+	github.com/xdg-go/stringprep v1.0.4 // indirect
 	github.com/xuri/efp v0.0.0-20220603152613-6918739fd470 // indirect
 	github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22 // indirect
-	github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
-	go.uber.org/atomic v1.7.0 // indirect
+	github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
+	go.uber.org/atomic v1.10.0 // indirect
 	go.uber.org/multierr v1.6.0 // indirect
-	golang.org/x/crypto v0.0.0-20220817201139-bc19a97f63c8 // indirect
-	golang.org/x/net v0.0.0-20220812174116-3211cb980234 // indirect
-	golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
-	golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
-	golang.org/x/text v0.3.7 // indirect
-	golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 // indirect
-	google.golang.org/protobuf v1.28.0 // indirect
-	gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
+	golang.org/x/crypto v0.4.0 // indirect
+	golang.org/x/net v0.4.0 // indirect
+	golang.org/x/sync v0.1.0 // indirect
+	golang.org/x/sys v0.3.0 // indirect
+	golang.org/x/text v0.5.0 // indirect
+	google.golang.org/protobuf v1.28.1 // indirect
 	gopkg.in/ini.v1 v1.66.6 // indirect
-	gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
 	gopkg.in/yaml.v2 v2.4.0 // indirect
 )
 

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 808 - 12
oilseal-train/go.sum


+ 2 - 0
oilseal-train/main.go

@@ -32,6 +32,8 @@ func BuildApp() *dig.Container {
 
 func main() {
 
+	comm.AppMongoMiration()
+
 	flag.Parse()
 	app := BuildApp()
 

+ 0 - 0
oilseal-train/migrations/banks.down.json


+ 152 - 0
oilseal-train/migrations/banks.up.json

@@ -0,0 +1,152 @@
+[
+    {
+        "insert": "banks",
+        "documents": [{
+            "_id": {
+                "$oid": "6397f71e94ab390229bb866e"
+            },
+            "name": "燃调工作原理",
+            "desc": "",
+            "state": 1,
+            "createTime": {
+                "$date": "2022-12-13T03:53:02.686Z"
+            },
+            "updateTime": {
+                "$date": "2022-12-13T03:53:02.686Z"
+            }
+        },
+        {
+            "_id": {
+                "$oid": "63a27c9843662056a4d76af8"
+            },
+            "name": "调节螺钉调整",
+            "state": 1,
+            "createTime": {
+                "$date": "2022-12-21T03:25:12.026Z"
+            },
+            "updateTime": {
+                "$date": "2022-12-21T03:25:12.026Z"
+            }
+        },
+        {
+            "_id": {
+                "$oid": "63a27cb843662056a4d76af9"
+            },
+            "name": "限流嘴放气嘴",
+            "state": 1,
+            "createTime": {
+                "$date": "2022-12-21T03:25:44.269Z"
+            },
+            "updateTime": {
+                "$date": "2022-12-21T03:25:44.269Z"
+            }
+        },
+        {
+            "_id": {
+                "$oid": "63a27cd343662056a4d76afa"
+            },
+            "name": "燃调拆装",
+            "state": 1,
+            "createTime": {
+                "$date": "2022-12-21T03:26:11.023Z"
+            },
+            "updateTime": {
+                "$date": "2022-12-21T03:26:11.023Z"
+            }
+        },
+        {
+            "_id": {
+                "$oid": "63a27ce743662056a4d76afb"
+            },
+            "name": "过滤嘴拆装清洗",
+            "state": 1,
+            "createTime": {
+                "$date": "2022-12-21T03:26:31.734Z"
+            },
+            "updateTime": {
+                "$date": "2022-12-21T03:26:31.734Z"
+            }
+        },
+        {
+            "_id": {
+                "$oid": "63a27cfe43662056a4d76afc"
+            },
+            "name": "感温矫正器",
+            "state": 1,
+            "createTime": {
+                "$date": "2022-12-21T03:26:54.577Z"
+            },
+            "updateTime": {
+                "$date": "2022-12-21T03:26:54.577Z"
+            }
+        },
+        {
+            "_id": {
+                "$oid": "63a27d0f43662056a4d76afd"
+            },
+            "name": "电子调节器",
+            "state": 1,
+            "createTime": {
+                "$date": "2022-12-21T03:27:11.298Z"
+            },
+            "updateTime": {
+                "$date": "2022-12-21T03:27:11.298Z"
+            }
+        },
+        {
+            "_id": {
+                "$oid": "63a27d2a43662056a4d76afe"
+            },
+            "name": "功率协调器",
+            "state": 1,
+            "createTime": {
+                "$date": "2022-12-21T03:27:38.361Z"
+            },
+            "updateTime": {
+                "$date": "2022-12-21T03:27:38.361Z"
+            },
+            "desc": ""
+        },
+        {
+            "_id": {
+                "$oid": "63b3cc5ae372618160090354"
+            },
+            "name": "中心细滤",
+            "state": 1,
+            "createTime": {
+                "$date": "2023-01-03T06:34:02.407Z"
+            },
+            "updateTime": {
+                "$date": "2023-01-03T06:34:02.407Z"
+            }
+        },
+        {
+            "_id": {
+                "$oid": "63b3cc68e372618160090355"
+            },
+            "name": "进口油滤",
+            "state": 1,
+            "createTime": {
+                "$date": "2023-01-03T06:34:16.57Z"
+            },
+            "updateTime": {
+                "$date": "2023-01-03T06:34:16.57Z"
+            }
+        },
+        {
+            "_id": {
+                "$oid": "63b3cc84e372618160090356"
+            },
+            "name": "空气滤",
+            "state": 1,
+            "createTime": {
+                "$date": "2023-01-03T06:34:44.007Z"
+            },
+            "updateTime": {
+                "$date": "2023-01-03T06:34:44.007Z"
+            }
+        }]        
+     }
+]
+
+

+ 0 - 0
oilseal-train/migrations/users.down.json


+ 21 - 0
oilseal-train/migrations/users.up.json

@@ -0,0 +1,21 @@
+[
+    {
+        "insert": "users",
+        "documents": [{
+            "_id": {
+                "$oid": "6396e4e5c86efab805c47c78"
+            },
+            "loginName": "admin",
+            "password": "e10adc3949ba59abbe56e057f20f883e",
+            "name": "admin",
+            "role": "admin",
+            "createTime": {
+                "$date": "2022-12-12T08:23:01.601Z"
+            },
+            "updateTime": {
+                "$date": "2022-12-12T08:23:01.601Z"
+            },
+            "state": 1
+        }]
+     }
+]

+ 44 - 7
oilseal-train/readme.md

@@ -1,9 +1,46 @@
-## windows 无网络部署
+# windows 无网络部署
+
+## 编译服务
+
+> 假设安装目录为D盘根路径,D:/pack-oilseal-train
 
 1. 拉取bus,替换bus-local-app.yaml中的内容到app.yaml
-2. windows下编译bus
-3. 设置环境变量`MONGO_MIGRATIONS: /data/migrations==mongodb://root:3dshow@3dshow-mongo-alpha:27017/supply-user?authSource=admin`
-4. 配置数据库迁移脚本到环境变量路径
-5. 编译当前项目
-6. 安装mongo
-7. 启动对应服务
+2. windows下编译bus,服务名为bus-service
+3. 配置数据库迁移脚本到环境变量路径
+4. 编译当前项目,服务名为train-service
+5. 安装mongo
+6. 启动对应服务
+
+## 安装mongodb
+
+> 查看端口被哪个进程占用 netstat -ano |findstr "端口号" 杀死进程 taskkill /f /t /im "进程id或者进程名称"
+
+1. pack-oliseal-train文件夹中安装,安装路径自定义为`D:/pack-oilseal-train/mongo`
+2. 将mongo mongosh bin目录配置环境变量 `D:\pack-oilseal-train\mongo\MongoDB\Server\6.0\bin`,`D:\pack-oilseal-train\mongo\mongosh-1.6.1-win32-x64\bin`
+3. 命令行执行mongod
+4. 启动服务 net start MongoDB
+5. 执行mongosh
+6. use admin
+7. db.createUser({user:"admin",pwd:"admin123",roles:[{"role":"userAdminAnyDatabase","db":"admin"}]})
+8. db.auth("admin","admin123")
+9. db.createUser({user:"root",pwd:"oilseal-train",roles:["dbOwner"]})
+10. 数据库迁移环境变量配置`MONGO_MIGRATION`:`D:/pack-oilseal-train/backend/migrations==mongodb://root:oilseal-train@127.0.0.1:27017/oilseal-train?authSource=admin`
+11. nginx配置
+
+    ```shell
+    server {
+        listen       8082;
+        server_name  127.0.0.1;
+
+        location / {
+            root  D:/pack-oilseal-train/frontend/dist;
+            index  index.html index.htm;
+        }
+        location ^~/oilseal-train/ {
+            proxy_pass http://127.0.0.1:7105/;
+        }
+    }
+    ```
+
+12. 启动服务,双击start.bat
+13. 后台管理系统访问,http://127.0.0.1:8082

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov