Browse Source

update:修改内部库为线上引用

zoie 4 tuần trước cách đây
mục cha
commit
014bf9c416

+ 2 - 2
Nats/Nats.go

@@ -5,10 +5,10 @@ import (
 	"ERP_user/models/Account"
 	"ERP_user/models/System"
 	"fmt"
-	powerlibs "git.baozhida.cn/ERP_libs/Power"
-	userlibs "git.baozhida.cn/ERP_libs/User"
 	"github.com/nats-io/nats.go"
 	"github.com/vmihailenco/msgpack/v5"
+	powerlibs "gogs.baozhida.cn/zoie/ERP_libs/Power"
+	userlibs "gogs.baozhida.cn/zoie/ERP_libs/User"
 )
 
 var Nats *nats.Conn

+ 3 - 3
Nats/NatsServer/NatsERP.go

@@ -7,10 +7,10 @@ import (
 	"ERP_user/models/Account"
 	"errors"
 	"fmt"
-	menulibs "git.baozhida.cn/ERP_libs/Menu"
-	powerlibs "git.baozhida.cn/ERP_libs/Power"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/vmihailenco/msgpack/v5"
+	menulibs "gogs.baozhida.cn/zoie/ERP_libs/Menu"
+	powerlibs "gogs.baozhida.cn/zoie/ERP_libs/Power"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"time"
 )
 

+ 1 - 1
Nats/NatsServer/NatsWx.go

@@ -4,7 +4,7 @@ import (
 	"ERP_user/Nats"
 	"ERP_user/logs"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"time"
 )
 

+ 2 - 2
README.md

@@ -2,11 +2,11 @@
 
 ### 导入线上库
 
-git config --global url."git@git.baozhida.cn/ERP_libs".insteadOf "http://120.55.48.97:3000/bzd_zeng/ERP_libs"
+git config --global url."git@gogs.baozhida.cn/zoie/ERP_libs".insteadOf "http://120.55.48.97:3000/bzd_zeng/ERP_libs"
 
 ### 导入本地库
 
-go mod edit -replace git.baozhida.cn/ERP_libs=/Users/zoie/work/bzd_project/ERP/ERP_libs
+go mod edit -replace gogs.baozhida.cn/zoie/ERP_libs=/Users/zoie/work/bzd_project/ERP/ERP_libs
 
 ### 添加新系统
 

+ 36 - 0
conf/app_prod.conf

@@ -0,0 +1,36 @@
+appname = ERP_user
+HTTPPort = 6700
+runmode = dev
+Graceful = true
+EnableDocs = true
+copyrequestbody = true
+
+NatsServer_Url = "127.0.0.1:4223"
+NatsSubj_Prefix = ""
+# Mysql 线上
+MysqlServer_UrlPort = "127.0.0.1:3316"
+MysqlServer_Database = "erp_user"
+MysqlServer_Username = "erp_user"
+MysqlServer_Password = "C8iaSLwhRpCermaR"
+MysqlServer_MaxIdleConnections = 100
+MysqlServer_MaxOpenConnections = 200
+
+# Redis
+Redis_address = "127.0.0.1:6378"
+Redis_password = ""
+Redis_dbNum = "2"
+
+# 静态资源
+Qiniu_AccessKey = "-8ezB_d-8-eUFTMvhOGbGzgeQRPeKQnaQ3DBcUxo"
+Qiniu_SecretKey = "KFhkYxTAJ2ZPN3ZS3euTsfWk8-C92rKgkhAMkDRN"
+Qiniu_BUCKET = "baozhida-erp"
+Qiniu_Url = "https://erposs.baozhida.cn/"
+
+FilterExcludeURL = /Login_verification
+FilterOnlyLoginCheckURL = /Menu/List,/User/Info,/User/Post,/Menu/User_List,/User/List,/User/Get,/UpFileToken,/Dept/List,/Post/List,/News/List,/News/See
+
+#Sys = ERP_ACCOUNT|账号管理,ERP_AMS|考勤管理,ERP_SALARY|薪资管理,ERP_STORAGE|仓库管理,ERP_PROJECT|项目管理
+Sys = ERP_ACCOUNT|账号管理,ERP_AMS|考勤管理,ERP_SALARY|薪资管理,ERP_STORAGE|仓库管理
+# Sys = ERP_ACCOUNT|账号管理,ERP_STORAGE|仓库管理
+
+

+ 1 - 1
controllers/Dept.go

@@ -2,8 +2,8 @@ package controllers
 
 import (
 	"ERP_user/models/Account"
-	"git.baozhida.cn/ERP_libs/lib"
 	beego "github.com/beego/beego/v2/server/web"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 )
 
 type DeptController struct {

+ 2 - 2
controllers/Menu.go

@@ -6,9 +6,9 @@ import (
 	"ERP_user/logs"
 	"ERP_user/models/Account"
 	"fmt"
-	menulibs "git.baozhida.cn/ERP_libs/Menu"
-	"git.baozhida.cn/ERP_libs/lib"
 	beego "github.com/beego/beego/v2/server/web"
+	menulibs "gogs.baozhida.cn/zoie/ERP_libs/Menu"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 )
 
 type MenuController struct {

+ 1 - 1
controllers/News.go

@@ -4,8 +4,8 @@ import (
 	"ERP_user/conf"
 	"ERP_user/models/Account"
 	"ERP_user/models/System"
-	"git.baozhida.cn/ERP_libs/lib"
 	beego "github.com/beego/beego/v2/server/web"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"math"
 )
 

+ 3 - 3
controllers/Power.go

@@ -6,12 +6,12 @@ import (
 	"ERP_user/models/Account"
 	"ERP_user/models/System"
 	"fmt"
-	menulibs "git.baozhida.cn/ERP_libs/Menu"
-	powerlibs "git.baozhida.cn/ERP_libs/Power"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/astaxie/beego/logs"
 	"github.com/beego/beego/v2/adapter/orm"
 	beego "github.com/beego/beego/v2/server/web"
+	menulibs "gogs.baozhida.cn/zoie/ERP_libs/Menu"
+	powerlibs "gogs.baozhida.cn/zoie/ERP_libs/Power"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"math"
 	"strings"
 )

+ 1 - 1
controllers/SysLogs.go

@@ -4,8 +4,8 @@ import (
 	"ERP_user/conf"
 	"ERP_user/models/Account"
 	"ERP_user/models/System"
-	"git.baozhida.cn/ERP_libs/lib"
 	beego "github.com/beego/beego/v2/server/web"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"math"
 )
 

+ 1 - 1
controllers/UpFile.go

@@ -2,11 +2,11 @@ package controllers
 
 import (
 	"ERP_user/conf"
-	"git.baozhida.cn/ERP_libs/lib"
 	beego "github.com/beego/beego/v2/server/web"
 	"github.com/qiniu/go-sdk/v7/auth/qbox"
 	"github.com/qiniu/go-sdk/v7/storage"
 	uuid "github.com/satori/go.uuid"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"strconv"
 	"time"
 )

+ 1 - 1
controllers/User.go

@@ -4,8 +4,8 @@ import (
 	"ERP_user/conf"
 	"ERP_user/models/Account"
 	"ERP_user/models/System"
-	"git.baozhida.cn/ERP_libs/lib"
 	beego "github.com/beego/beego/v2/server/web"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"math"
 	"time"
 )

+ 1 - 1
controllers/UserLogs.go

@@ -4,8 +4,8 @@ import (
 	"ERP_user/conf"
 	"ERP_user/models/Account"
 	"ERP_user/models/System"
-	"git.baozhida.cn/ERP_libs/lib"
 	beego "github.com/beego/beego/v2/server/web"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"math"
 )
 

+ 2 - 8
go.mod

@@ -3,16 +3,14 @@ module ERP_user
 go 1.19
 
 require (
-	git.baozhida.cn/ERP_libs v0.0.0-00010101000000-000000000000
 	github.com/astaxie/beego v1.12.3
 	github.com/beego/beego/v2 v2.0.7
 	github.com/go-sql-driver/mysql v1.7.0
 	github.com/nats-io/nats.go v1.23.0
 	github.com/qiniu/go-sdk/v7 v7.14.0
 	github.com/satori/go.uuid v1.2.0
-	github.com/spf13/cobra v1.6.1
 	github.com/vmihailenco/msgpack/v5 v5.3.5
-	gorm.io/gorm v1.24.6
+	gogs.baozhida.cn/zoie/ERP_libs v0.0.0-00010101000000-000000000000
 )
 
 require (
@@ -21,9 +19,6 @@ require (
 	github.com/golang/protobuf v1.5.2 // indirect
 	github.com/gomodule/redigo v2.0.0+incompatible // indirect
 	github.com/hashicorp/golang-lru v0.5.4 // indirect
-	github.com/inconshreveable/mousetrap v1.0.1 // indirect
-	github.com/jinzhu/inflection v1.0.0 // indirect
-	github.com/jinzhu/now v1.1.5 // indirect
 	github.com/klauspost/compress v1.15.15 // indirect
 	github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
 	github.com/minio/highwayhash v1.0.2 // indirect
@@ -41,7 +36,6 @@ require (
 	github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 // indirect
 	github.com/shopspring/decimal v1.3.1 // indirect
 	github.com/signintech/gopdf v0.16.1 // indirect
-	github.com/spf13/pflag v1.0.5 // indirect
 	github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
 	golang.org/x/crypto v0.5.0 // indirect
 	golang.org/x/net v0.5.0 // indirect
@@ -54,4 +48,4 @@ require (
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 )
 
-replace git.baozhida.cn/ERP_libs => /Users/zoie/work/bzd_project/ERP/ERP_libs
+replace gogs.baozhida.cn/zoie/ERP_libs => /Users/zoie/work/bzd_project/ERP/ERP_libs

+ 0 - 14
go.sum

@@ -66,7 +66,6 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX
 github.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U=
 github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c=
 github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs=
-github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
 github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
 github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -168,12 +167,6 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l
 github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
-github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
-github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
-github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
-github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
-github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
-github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
 github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
 github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
 github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
@@ -278,7 +271,6 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
 github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
 github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
 github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
-github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
 github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
 github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
@@ -294,10 +286,6 @@ github.com/signintech/gopdf v0.16.1/go.mod h1:wrLtZoWaRNrS4hphED0oflFoa6IWkOu6M3
 github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
 github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
-github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
-github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
-github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
-github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
 github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -622,8 +610,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
 gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gorm.io/gorm v1.24.6 h1:wy98aq9oFEetsc4CAbKD2SoBCdMzsbSIvSUUFJuHi5s=
-gorm.io/gorm v1.24.6/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

+ 1 - 1
main.go

@@ -8,13 +8,13 @@ import (
 	_ "ERP_user/models/Account"
 	_ "ERP_user/routers"
 	"fmt"
-	powerlibs "git.baozhida.cn/ERP_libs/Power"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	beego "github.com/beego/beego/v2/server/web"
 	"github.com/beego/beego/v2/server/web/context"
 	"github.com/beego/beego/v2/server/web/filter/cors"
 	_ "github.com/go-sql-driver/mysql"
+	powerlibs "gogs.baozhida.cn/zoie/ERP_libs/Power"
 	"runtime"
 	"strconv"
 )

+ 1 - 1
models/Account/Dept.go

@@ -2,8 +2,8 @@ package Account
 
 import (
 	"ERP_user/logs"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/beego/beego/v2/adapter/orm"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"sync"
 	"time"
 )

+ 2 - 2
models/Account/Menu.go

@@ -4,12 +4,12 @@ import (
 	"ERP_user/conf"
 	"encoding/json"
 	"fmt"
-	menulibs "git.baozhida.cn/ERP_libs/Menu"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/astaxie/beego/cache"
 	_ "github.com/astaxie/beego/cache/redis"
 	"github.com/astaxie/beego/logs"
 	"github.com/beego/beego/v2/adapter/orm"
+	menulibs "gogs.baozhida.cn/zoie/ERP_libs/Menu"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"time"
 )
 

+ 3 - 3
models/Account/Power.go

@@ -2,10 +2,10 @@ package Account
 
 import (
 	"ERP_user/logs"
-	menulibs "git.baozhida.cn/ERP_libs/Menu"
-	powerlibs "git.baozhida.cn/ERP_libs/Power"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/beego/beego/v2/adapter/orm"
+	menulibs "gogs.baozhida.cn/zoie/ERP_libs/Menu"
+	powerlibs "gogs.baozhida.cn/zoie/ERP_libs/Power"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 )
 
 func init() {

+ 1 - 1
models/Account/Tokey.go

@@ -4,10 +4,10 @@ import (
 	"ERP_user/conf"
 	"ERP_user/logs"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/astaxie/beego/cache"
 	_ "github.com/astaxie/beego/cache/redis"
 	uuid "github.com/satori/go.uuid"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"log"
 	"time"
 )

+ 2 - 2
models/Account/User.go

@@ -3,11 +3,11 @@ package Account
 import (
 	"errors"
 	"fmt"
-	userlibs "git.baozhida.cn/ERP_libs/User"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/astaxie/beego/logs"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"
+	userlibs "gogs.baozhida.cn/zoie/ERP_libs/User"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"time"
 )
 

+ 1 - 1
models/System/SysLogs.go

@@ -4,9 +4,9 @@ import (
 	"ERP_user/logs"
 	"encoding/json"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"time"
 )
 

+ 1 - 1
models/System/UserLogs.go

@@ -4,9 +4,9 @@ import (
 	"ERP_user/logs"
 	"encoding/json"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"time"
 )
 

+ 1 - 1
routers/filter.go

@@ -4,8 +4,8 @@ import (
 	"ERP_user/conf"
 	"ERP_user/logs"
 	"ERP_user/models/Account"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/beego/beego/v2/server/web/context"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"strings"
 )
 

+ 1 - 1
routers/router.go

@@ -2,8 +2,8 @@ package routers
 
 import (
 	"ERP_user/controllers"
-	errorlibs "git.baozhida.cn/ERP_libs/Error"
 	beego "github.com/beego/beego/v2/server/web"
+	errorlibs "gogs.baozhida.cn/zoie/ERP_libs/Error"
 )
 
 func init() {