diff --git a/Makefile b/Makefile index d1a861b..32788a4 100644 --- a/Makefile +++ b/Makefile @@ -1,51 +1,61 @@ DB_URL=postgresql://root:secret@localhost:5432/management?sslmode=disable +.PHONY: network network: docker network create management +.PHONY: redis redis: docker run --network management --name rd -d -p 6379:6379 redis:7.2.4 --requirepass "secret" +.PHONY: postgres postgres: docker run --name postgres --network management -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres:16-alpine -createdb: +.PHONY: create_db +create_db: docker exec -it postgres createdb --username=root --owner=root management -dropdb: +.PHONY: drop_db +drop_db: docker exec -it postgres dropdb management +.PHONY: psql psql: docker exec -it postgres psql -U root -d management -migrateinit: +.PHONY: migrate_init +migrate_init: migrate create -ext sql -dir internal/db/migration -seq init_schema -migrateup: +.PHONY: migrate_up +migrate_up: migrate -path internal/db/migration -database "$(DB_URL)" -verbose up -migratedown: +.PHONY: migrate_down +migrate_down: migrate -path internal/db/migration -database "$(DB_URL)" -verbose down +.PHONY: db db: sql2dbml --postgres doc/ss.sql -o doc/db.dbm +.PHONY: db_docs db_docs: dbdocs build doc/db.dbml +.PHONY: db_schema db_schema: dbml2sql --postgres -o internal/db/migration/000001_init_schema.up.sql doc/db.dbml +.PHONY: sqlc sqlc: sqlc generate +.PHONY: wire wire: wire ./... +.PHONY: test test: go test -v -cover ./... - -server: - modd - -.PHONY: network redis postgres createdb dropdb psql migrateinit migrateup migratedown db_docs db_schema wire test server \ No newline at end of file diff --git a/go.mod b/go.mod index 6d3a13f..70cc86d 100644 --- a/go.mod +++ b/go.mod @@ -3,95 +3,60 @@ module management go 1.24.2 require ( - github.com/aead/chacha20poly1305 v0.0.0-20201124145622-1a5aba2a8b29 - github.com/alexedwards/scs/pgxstore v0.0.0-20250212122300-421ef1d8611c + github.com/alexedwards/scs/postgresstore v0.0.0-20250417082927-ab20b3feb5e9 github.com/alexedwards/scs/v2 v2.8.0 - github.com/bwmarrin/snowflake v0.3.0 github.com/drhin/logger v0.0.0-20250417021954-aa33afe047bc - github.com/fsnotify/fsnotify v1.8.0 + github.com/fsnotify/fsnotify v1.9.0 github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6 - github.com/gin-gonic/gin v1.10.0 github.com/go-chi/chi/v5 v5.2.1 github.com/go-playground/locales v0.14.1 github.com/go-playground/universal-translator v0.18.1 github.com/go-playground/validator/v10 v10.26.0 - github.com/golang-jwt/jwt/v5 v5.2.1 github.com/google/uuid v1.6.0 - github.com/gorilla/schema v1.4.1 + github.com/google/wire v0.6.0 github.com/h2non/filetype v1.1.3 - github.com/hirochachacha/go-smb2 v1.1.0 - github.com/jackc/pgconn v1.14.3 github.com/jackc/pgx/v5 v5.7.4 github.com/justinas/nosurf v1.1.1 github.com/matoous/go-nanoid/v2 v2.1.0 github.com/mojocn/base64Captcha v1.3.8 - github.com/natefinch/lumberjack v2.0.0+incompatible - github.com/o1egl/paseto v1.0.0 - github.com/redis/go-redis/v9 v9.7.3 - github.com/rs/zerolog v1.34.0 + github.com/redis/go-redis/v9 v9.8.0 github.com/spf13/cobra v1.9.1 github.com/spf13/viper v1.20.1 - github.com/sqids/sqids-go v0.4.1 github.com/zhang2092/browser v0.0.2 go.uber.org/zap v1.27.0 - golang.org/x/crypto v0.36.0 + golang.org/x/crypto v0.38.0 gorm.io/driver/postgres v1.5.11 - gorm.io/gorm v1.25.12 + gorm.io/gorm v1.26.1 ) require ( - github.com/BurntSushi/toml v1.5.0 // indirect - github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect - github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 // indirect - github.com/alexedwards/scs/postgresstore v0.0.0-20250212122300-421ef1d8611c // indirect github.com/blang/semver/v4 v4.0.0 // indirect - github.com/bytedance/sonic v1.12.9 // indirect - github.com/bytedance/sonic/loader v0.2.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/cloudwego/base64x v0.1.5 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/gabriel-vasile/mimetype v1.4.8 // indirect - github.com/geoffgarside/ber v1.1.0 // indirect - github.com/gin-contrib/sse v1.0.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.9 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect - github.com/goccy/go-json v0.10.5 // indirect github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect - github.com/google/wire v0.6.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jackc/chunkreader/v2 v2.0.1 // indirect - github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgproto3/v2 v2.3.3 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect github.com/jackc/puddle/v2 v2.2.2 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/cpuid/v2 v2.2.9 // indirect github.com/leodido/go-urn v1.4.0 // indirect - github.com/mattn/go-colorable v0.1.14 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.2.3 // indirect - github.com/pkg/errors v0.9.1 // indirect + github.com/natefinch/lumberjack v2.0.0+incompatible // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/sagikazarmark/locafero v0.9.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.14.0 // indirect - github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/cast v1.8.0 // indirect github.com/spf13/pflag v1.0.6 // indirect github.com/subosito/gotenv v1.6.0 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.12 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/arch v0.14.0 // indirect - golang.org/x/image v0.25.0 // indirect - golang.org/x/net v0.38.0 // indirect - golang.org/x/sync v0.12.0 // indirect - golang.org/x/sys v0.31.0 // indirect - golang.org/x/text v0.23.0 // indirect - google.golang.org/protobuf v1.36.5 // indirect - gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect + golang.org/x/image v0.27.0 // indirect + golang.org/x/net v0.40.0 // indirect + golang.org/x/sync v0.14.0 // indirect + golang.org/x/sys v0.33.0 // indirect + golang.org/x/text v0.25.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 758dcbc..91b6776 100644 --- a/go.sum +++ b/go.sum @@ -1,17 +1,7 @@ -github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= -github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= -github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY= -github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA= -github.com/aead/chacha20poly1305 v0.0.0-20170617001512-233f39982aeb/go.mod h1:UzH9IX1MMqOcwhoNOIjmTQeAxrFgzs50j4golQtXXxU= -github.com/aead/chacha20poly1305 v0.0.0-20201124145622-1a5aba2a8b29 h1:1DcvRPZOdbQRg5nAHt2jrc5QbV0AGuhDdfQI6gXjiFE= -github.com/aead/chacha20poly1305 v0.0.0-20201124145622-1a5aba2a8b29/go.mod h1:UzH9IX1MMqOcwhoNOIjmTQeAxrFgzs50j4golQtXXxU= -github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 h1:52m0LGchQBBVqJRyYYufQuIbVqRawmubW3OFGqK1ekw= -github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635/go.mod h1:lmLxL+FV291OopO93Bwf9fQLQeLyt33VJRUg5VJ30us= -github.com/alexedwards/scs/pgxstore v0.0.0-20250212122300-421ef1d8611c h1:Y33ELOUUjGGV7p99OU8MXrmSKhOayEPtQ26qDr0LcRg= -github.com/alexedwards/scs/pgxstore v0.0.0-20250212122300-421ef1d8611c/go.mod h1:hwveArYcjyOK66EViVgVU5Iqj7zyEsWjKXMQhDJrTLI= -github.com/alexedwards/scs/postgresstore v0.0.0-20250212122300-421ef1d8611c h1:VNg1Uj7ICuqGP7AH6lQwLfzpLRe0VAesYOhwBt7D8uQ= -github.com/alexedwards/scs/postgresstore v0.0.0-20250212122300-421ef1d8611c/go.mod h1:TDDdV/xnjj+/4zBQ9a2k+i2AbuAdY7SQjPUh5zoTZ3M= +github.com/alexedwards/scs/postgresstore v0.0.0-20250417082927-ab20b3feb5e9 h1:FGBhs+LG4w1y511QLcuLr1xfhI7Fbyq6Da1TCf6EQq4= +github.com/alexedwards/scs/postgresstore v0.0.0-20250417082927-ab20b3feb5e9/go.mod h1:TDDdV/xnjj+/4zBQ9a2k+i2AbuAdY7SQjPUh5zoTZ3M= github.com/alexedwards/scs/v2 v2.8.0 h1:h31yUYoycPuL0zt14c0gd+oqxfRwIj6SOjHdKRZxhEw= github.com/alexedwards/scs/v2 v2.8.0/go.mod h1:ToaROZxyKukJKT/xLcVQAChi5k6+Pn1Gvmdl7h3RRj8= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= @@ -20,46 +10,24 @@ github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= -github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= -github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= -github.com/bytedance/sonic v1.12.9 h1:Od1BvK55NnewtGaJsTDeAOSnLVO2BTSLOe0+ooKokmQ= -github.com/bytedance/sonic v1.12.9/go.mod h1:uVvFidNmlt9+wa31S1urfwwthTWteBgG0hWuoKAXTx8= -github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= -github.com/bytedance/sonic/loader v0.2.3 h1:yctD0Q3v2NOGfSWPLPvG2ggA2kV6TS6s4wioyEqssH0= -github.com/bytedance/sonic/loader v0.2.3/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= -github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= -github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/drhin/logger v0.0.0-20250407005450-5bbde7825366 h1:HcCQ0kAGAiprUVYDw54vMcC9n9TSX3co0ro+l44TcrE= -github.com/drhin/logger v0.0.0-20250407005450-5bbde7825366/go.mod h1:XfunbMqKGMTCr3jsu5Vwe7kVUAINPOi/4z+e8qvVJDE= -github.com/drhin/logger v0.0.0-20250407025020-f3e0beed768b h1:VkXK9/bFutQXrFYcHcbxzkvMHAP9dybMJRMLEMPtKro= -github.com/drhin/logger v0.0.0-20250407025020-f3e0beed768b/go.mod h1:QUg+qnn7zvYONlsRRGWVKI4zArm4vZN2e5JFTydJICM= github.com/drhin/logger v0.0.0-20250417021954-aa33afe047bc h1:/vyhHw4e3eNwpEEJ80m889cVcLV7g+AiTVKzRgCl6As= github.com/drhin/logger v0.0.0-20250417021954-aa33afe047bc/go.mod h1:QUg+qnn7zvYONlsRRGWVKI4zArm4vZN2e5JFTydJICM= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= -github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= +github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6 h1:6VSn3hB5U5GeA6kQw4TwWIWbOhtvR2hmbBJnTOtqTWc= github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6/go.mod h1:YxOVT5+yHzKvwhsiSIWmbAYM3Dr9AEEbER2dVayfBkg= -github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM= -github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8= -github.com/geoffgarside/ber v1.1.0 h1:qTmFG4jJbwiSzSXoNJeHcOprVzZ8Ulde2Rrrifu5U9w= -github.com/geoffgarside/ber v1.1.0/go.mod h1:jVPKeCbj6MvQZhwLYsGwaGI52oUorHoHKNecGT85ZCc= -github.com/gin-contrib/sse v1.0.0 h1:y3bT1mUWUxDpW4JLQg/HnTqV4rozuW4tC9eFKTxYI9E= -github.com/gin-contrib/sse v1.0.0/go.mod h1:zNuFdwarAygJBht0NTKiSi3jRf6RbqeILZ9Sp6Slhe0= -github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= -github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= +github.com/gabriel-vasile/mimetype v1.4.9 h1:5k+WDwEsD9eTLL8Tz3L0VnmVh9QxGjRmjBvAG7U/oYY= +github.com/gabriel-vasile/mimetype v1.4.9/go.mod h1:WnSQhFKJuBlRyLiKohA/2DtIlPFAbguNaG7QCHcyGok= github.com/go-chi/chi/v5 v5.2.1 h1:KOIHODQj58PmL80G2Eak4WdvUzjSJSm0vG72crDCqb8= github.com/go-chi/chi/v5 v5.2.1/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= @@ -72,17 +40,11 @@ github.com/go-playground/validator/v10 v10.26.0 h1:SP05Nqhjcvz81uJaRfEV0YBSSSGMc github.com/go-playground/validator/v10 v10.26.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo= github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= -github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= -github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -90,97 +52,48 @@ github.com/google/wire v0.6.0 h1:HBkoIh4BdSxoyo9PveV8giw7ZsaBOvzWKfcg/6MrVwI= github.com/google/wire v0.6.0/go.mod h1:F4QhpQ9EDIdJ1Mbop/NZBRB+5yrR6qg3BnctaoUk6NA= github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= -github.com/gorilla/schema v1.4.1 h1:jUg5hUjCSDZpNGLuXQOgIWGdlgrIdYvgQ0wZtdK1M3E= -github.com/gorilla/schema v1.4.1/go.mod h1:Dg5SSm5PV60mhF2NFaTV1xuYYj8tV8NOPRo4FggUMnM= github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg= github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY= -github.com/hirochachacha/go-smb2 v1.1.0 h1:b6hs9qKIql9eVXAiN0M2wSFY5xnhbHAQoCwRKbaRTZI= -github.com/hirochachacha/go-smb2 v1.1.0/go.mod h1:8F1A4d5EZzrGu5R7PU163UcMRDJQl4FtcxjBfsY8TZE= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= -github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/pgconn v1.14.3 h1:bVoTr12EGANZz66nZPkMInAV/KHD2TxH9npjXXgiB3w= -github.com/jackc/pgconn v1.14.3/go.mod h1:RZbme4uasqzybK2RK5c65VsHxoyaml09lx3tXOcO/VM= -github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= -github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= -github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= -github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3/v2 v2.3.3 h1:1HLSx5H+tXR9pW3in3zaztoEwQYRC9SQaYUHjTSUOag= -github.com/jackc/pgproto3/v2 v2.3.3/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.5.4/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= github.com/jackc/pgx/v5 v5.7.4 h1:9wKznZrhWa2QiHL+NjTSPP6yjl3451BX3imWDnokYlg= github.com/jackc/pgx/v5 v5.7.4/go.mod h1:ncY89UGWxg82EykZUwSpUKEfccBGGYq1xjrOpsbsfGQ= -github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= 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/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/justinas/nosurf v1.1.1 h1:92Aw44hjSK4MxJeMSyDa7jwuI9GR2J/JCQiaKvXXSlk= github.com/justinas/nosurf v1.1.1/go.mod h1:ALpWdSbuNGy2lZWtyXdjkYv4edL23oSEgfBT1gPJ5BQ= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= -github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= -github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/lib/pq v1.4.0 h1:TmtCFbH+Aw0AixwyttznSMQDgbR5Yed/Gg6S8Funrhc= github.com/lib/pq v1.4.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/matoous/go-nanoid/v2 v2.1.0 h1:P64+dmq21hhWdtvZfEAofnvJULaRR1Yib0+PnU669bE= github.com/matoous/go-nanoid/v2 v2.1.0/go.mod h1:KlbGNQ+FhrUNIHUxZdL63t7tl4LaPkZNpUULS8H4uVM= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= -github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mojocn/base64Captcha v1.3.8 h1:rrN9BhCwXKS8ht1e21kvR3iTaMgf4qPC9sRoV52bqEg= github.com/mojocn/base64Captcha v1.3.8/go.mod h1:QFZy927L8HVP3+VV5z2b1EAEiv1KxVJKZbAucVgLUy4= github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM= github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk= -github.com/o1egl/paseto v1.0.0 h1:bwpvPu2au176w4IBlhbyUv/S5VPptERIA99Oap5qUd0= -github.com/o1egl/paseto v1.0.0/go.mod h1:5HxsZPmw/3RI2pAwGo1HhOOwSdvBpcuVzO7uDkm+CLU= -github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= -github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/redis/go-redis/v9 v9.7.3 h1:YpPyAayJV+XErNsatSElgRZZVCwXX9QzkKYNvO7x0wM= -github.com/redis/go-redis/v9 v9.7.3/go.mod h1:bGUrSggJ9X9GUmZpZNEOQKaANxSGgOEBRltRTZHSvrA= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/redis/go-redis/v9 v9.8.0 h1:q3nRvjrlge/6UD7eTu/DSg2uYiU2mCL0G/uzBWqhicI= +github.com/redis/go-redis/v9 v9.8.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= -github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY= -github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.9.0 h1:GbgQGNtTrEmddYDSAH9QLRyfAHY12md+8YFTqyMTC9k= github.com/sagikazarmark/locafero v0.9.0/go.mod h1:UBUyz37V+EdMS3hDF3QWIiVr/2dPrx49OMO0Bn0hJqk= @@ -192,36 +105,21 @@ github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9yS github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA= github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo= -github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= -github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.8.0 h1:gEN9K4b8Xws4EX0+a0reLmhq8moKn7ntRlQYgjPeCDk= +github.com/spf13/cast v1.8.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= -github.com/sqids/sqids-go v0.4.1 h1:eQKYzmAZbLlRwHeHYPF35QhgxwZHLnlmVj9AkIj/rrw= -github.com/sqids/sqids-go v0.4.1/go.mod h1:EMwHuPQgSNFS0A49jESTfIQS+066XQTVhukrzEPScl8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= -github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zhang2092/browser v0.0.2 h1:4jyWWkSCabGxqn74lCDvNnA4o9TlmsUXuwQHPZFsflQ= github.com/zhang2092/browser v0.0.2/go.mod h1:k/HIdVgWmpi9WvGuIU8pu8aK4rMCI4vr0ICCsk5H8T8= @@ -231,29 +129,23 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/arch v0.14.0 h1:z9JUEZWr8x4rR0OU6c4/4t6E6jOZ8/QBS2bBYBm4tx4= -golang.org/x/arch v0.14.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= -golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= +golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= +golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY= -golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ= -golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs= +golang.org/x/image v0.27.0 h1:C8gA4oWU/tKkdCfYT6T2u4faJu3MeNS5O8UPWlPF61w= +golang.org/x/image v0.27.0/go.mod h1:xbdrClrAUway1MUTEZDq9mz/UpRwYAkFFNUslZtcB+g= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -263,8 +155,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= -golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= +golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -272,33 +164,27 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= -golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= +golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= @@ -311,8 +197,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= +golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -321,16 +207,11 @@ golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58 golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= -google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -338,6 +219,5 @@ 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/driver/postgres v1.5.11 h1:ubBVAfbKEUld/twyKZ0IYn9rSQh448EdelLYk9Mv314= gorm.io/driver/postgres v1.5.11/go.mod h1:DX3GReXH+3FPWGrrgffdvCk3DQ1dwDPdmbenSkweRGI= -gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8= -gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ= -nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +gorm.io/gorm v1.26.1 h1:ghB2gUI9FkS46luZtn6DLZ0f6ooBJ5IbVej2ENFDjRw= +gorm.io/gorm v1.26.1/go.mod h1:8Z33v652h4//uMA76KjeDH8mJXPm1QNCYrMeatR0DOE= diff --git a/internal/erpserver/handler/handler.go b/internal/erpserver/handler/handler.go index db09993..4522b40 100644 --- a/internal/erpserver/handler/handler.go +++ b/internal/erpserver/handler/handler.go @@ -13,6 +13,10 @@ import ( "github.com/drhin/logger" ) +//type RouterGroup interface { +// Register(router chi.Router) +//} + type Handler struct { Config *config.Config Log *logger.Logger diff --git a/internal/erpserver/handler/system/role.go b/internal/erpserver/handler/system/role.go index 8a43020..d9cc6fa 100644 --- a/internal/erpserver/handler/system/role.go +++ b/internal/erpserver/handler/system/role.go @@ -107,7 +107,6 @@ func (h *RoleHandler) Save(w http.ResponseWriter, r *http.Request) { h.JSONErr(w, err.Error()) return } - h.JSONOk(w, "更新成功") } } @@ -122,18 +121,14 @@ func (h *RoleHandler) Data(w http.ResponseWriter, r *http.Request) { h.JSONErr(w, err.Error()) return } - h.JSON(w, res) - return } else if t == "xm_select_tree" { res, err := h.roleService.XmSelectTree(ctx, 0) if err != nil { h.JSONErr(w, err.Error()) return } - h.JSON(w, res) - return } } diff --git a/internal/erpserver/handler/system/router.go b/internal/erpserver/handler/system/router.go new file mode 100644 index 0000000..140f553 --- /dev/null +++ b/internal/erpserver/handler/system/router.go @@ -0,0 +1,145 @@ +package system + +// +//import ( +// v1 "management/internal/erpserver/service/v1" +// mi "management/internal/pkg/middleware" +// "management/internal/pkg/session" +// +// "github.com/go-chi/chi/v5" +//) +// +//type HandlerGroup struct { +// sm session.Manager +// menuService v1.MenuService +// HomeHandler *HomeHandler +// ConfigHandler *ConfigHandler +// UserHandler *UserHandler +// LoginLogHandler *LoginLogHandler +// AuditHandler *AuditHandler +// MenuHandler *MenuHandler +// RoleHandler *RoleHandler +// DepartmentHandler *DepartmentHandler +//} +// +//func NewHandlerGroup( +// sm session.Manager, +// menuService v1.MenuService, +// homeHandler *HomeHandler, +// configHandler *ConfigHandler, +// userHandler *UserHandler, +// loginLogHandler *LoginLogHandler, +// auditHandler *AuditHandler, +// menuHandler *MenuHandler, +// roleHandler *RoleHandler, +// departmentHandler *DepartmentHandler, +//) *HandlerGroup { +// return &HandlerGroup{ +// sm: sm, +// HomeHandler: homeHandler, +// ConfigHandler: configHandler, +// UserHandler: userHandler, +// LoginLogHandler: loginLogHandler, +// AuditHandler: auditHandler, +// MenuHandler: menuHandler, +// RoleHandler: roleHandler, +// DepartmentHandler: departmentHandler, +// } +//} +// +//func (g *HandlerGroup) Register(r chi.Router) { +// //r.Get("/captcha", g.CaptchaHandler.Captcha) +// //r.Post("/login", userHandler.Login) +// +// r.Get("/", g.UserHandler.Login) +// r.Group(func(r chi.Router) { +// r.Use(mi.Authorize(g.sm, menuService)) +// +// r.Get("/logout", userHandler.Logout) +// +// r.Get("/home.html", homeHandler.Home) +// r.Get("/dashboard", homeHandler.Dashboard) +// r.Get("/pear.json", configHandler.Pear) +// +// r.Route("/upload", func(r chi.Router) { +// r.Use(mi.Audit(sm, auditLogService, log)) +// r.Get("/img", uploadHandler.Img) +// r.Get("/file", uploadHandler.File) +// r.Get("/multi_files", uploadHandler.MultiFiles) +// }) +// +// r.Route("/system", func(r chi.Router) { +// r.Use(mi.Audit(sm, auditLogService, log)) +// +// r.Get("/menus", menuHandler.Menus) +// +// r.Route("/config", func(r chi.Router) { +// r.Get("/list", configHandler.List) +// r.Post("/list", configHandler.List) +// r.Get("/add", configHandler.Add) +// r.Get("/edit", configHandler.Edit) +// r.Post("/save", configHandler.Save) +// r.Post("/refresh_cache", configHandler.RefreshCache) +// r.Post("/reset_pear", configHandler.ResetPear) +// }) +// +// r.Route("/menu", func(r chi.Router) { +// r.Get("/list", menuHandler.List) +// r.Post("/list", menuHandler.List) +// r.Get("/add", menuHandler.Add) +// r.Get("/add_children", menuHandler.AddChildren) +// r.Get("/edit", menuHandler.Edit) +// r.Post("/save", menuHandler.Save) +// r.Post("/data", menuHandler.Data) +// r.Post("/refresh_cache", menuHandler.RefreshCache) +// }) +// +// r.Route("/department", func(r chi.Router) { +// r.Get("/list", departmentHandler.List) +// r.Post("/list", departmentHandler.List) +// r.Get("/add", departmentHandler.Add) +// r.Get("/add_children", departmentHandler.AddChildren) +// r.Get("/edit", departmentHandler.Edit) +// r.Post("/save", departmentHandler.Save) +// r.Post("/data", departmentHandler.Data) +// r.Post("/refresh_cache", departmentHandler.RefreshCache) +// r.Post("/rebuild_parent_path", departmentHandler.RebuildParentPath) +// }) +// +// r.Route("/role", func(r chi.Router) { +// r.Get("/list", roleHandler.List) +// r.Post("/list", roleHandler.List) +// r.Get("/add", roleHandler.Add) +// r.Get("/add_children", roleHandler.AddChildren) +// r.Get("/edit", roleHandler.Edit) +// r.Post("/save", roleHandler.Save) +// r.Post("/data", roleHandler.Data) +// r.Post("/refresh_cache", roleHandler.RefreshCache) +// r.Post("/rebuild_parent_path", roleHandler.RebuildParentPath) +// r.Post("/refresh_role_menus", roleHandler.RefreshRoleMenus) +// r.Get("/set_menu", roleHandler.SetMenu) +// r.Post("/set_menu", roleHandler.SetMenu) +// }) +// +// r.Route("/user", func(r chi.Router) { +// r.Get("/list", userHandler.List) +// r.Post("/list", userHandler.List) +// r.Get("/add", userHandler.Add) +// r.Get("/edit", userHandler.Edit) +// r.Post("/save", userHandler.Save) +// r.Get("/profile", userHandler.Profile) +// r.Post("/data", userHandler.Data) +// }) +// +// r.Route("/login_log", func(r chi.Router) { +// r.Get("/list", loginLogHandler.List) +// r.Post("/list", loginLogHandler.List) +// }) +// +// r.Route("/audit_log", func(r chi.Router) { +// r.Get("/list", auditHandler.List) +// r.Post("/list", auditHandler.List) +// }) +// }) +// }) +//} diff --git a/internal/erpserver/service/service.go b/internal/erpserver/service/service.go deleted file mode 100644 index 5a812fb..0000000 --- a/internal/erpserver/service/service.go +++ /dev/null @@ -1,30 +0,0 @@ -package service - -import ( - "management/internal/erpserver/repository" - "management/internal/pkg/redis" - "management/internal/pkg/session" - - "github.com/drhin/logger" -) - -type Service struct { - Log *logger.Logger - Tx repository.Transaction - Session session.Manager - Redis redis.Cache -} - -func NewService( - log *logger.Logger, - tx repository.Transaction, - session session.Manager, - redis redis.Cache, -) *Service { - return &Service{ - Log: log, - Tx: tx, - Session: session, - Redis: redis, - } -} diff --git a/internal/erpserver/service/util/util.go b/internal/erpserver/service/util/util.go new file mode 100644 index 0000000..43c8631 --- /dev/null +++ b/internal/erpserver/service/util/util.go @@ -0,0 +1,54 @@ +package util + +import ( + "context" + "encoding/json" + "log" + "math/rand" + "time" + + "management/internal/erpserver/model/view" + "management/internal/pkg/redis" +) + +func GetCacheExpire() time.Duration { + return time.Hour*6 + time.Duration(rand.Intn(600))*time.Second // 6小时±10分钟 +} + +func GetOrSetCache(ctx context.Context, redis redis.Cache, key string, expire time.Duration, getData func() (any, error), result any) error { + if data, err := redis.GetBytes(ctx, key); err == nil { + return json.Unmarshal(data, result) + } + + data, err := getData() + if err != nil { + return err + } + + bytes, err := json.Marshal(data) + if err != nil { + return err + } + + if err := redis.Set(ctx, key, bytes, expire); err != nil { + log.Printf("Failed to set cache: %v", err) + } + + return json.Unmarshal(bytes, result) +} + +func BuildTree[T any]( + parentID int32, + data []*T, + idFunc func(*T) int32, + childrenFunc func(*T, []*view.LayuiTree) *view.LayuiTree, +) []*view.LayuiTree { + var res []*view.LayuiTree + for _, item := range data { + if idFunc(item) == parentID { + childNodes := BuildTree[T](idFunc(item), data, idFunc, childrenFunc) + res = append(res, childrenFunc(item, childNodes)) + } + } + return res +} diff --git a/internal/erpserver/service/v1/common/captcha.go b/internal/erpserver/service/v1/common/captcha.go index 302b955..9307dc6 100644 --- a/internal/erpserver/service/v1/common/captcha.go +++ b/internal/erpserver/service/v1/common/captcha.go @@ -6,23 +6,25 @@ import ( "github.com/mojocn/base64Captcha" ) -type captchaService struct{} - -func NewCaptchaService() v1.CaptchaService { - return &captchaService{} +type captchaService struct { + store base64Captcha.Store } -var captchaStore = base64Captcha.DefaultMemStore +func NewCaptchaService() v1.CaptchaService { + return &captchaService{ + store: base64Captcha.DefaultMemStore, + } +} func (b *captchaService) Generate(height int, width int, length int, maxSkew float64, dotCount int) (id, b64s, answer string, err error) { driver := base64Captcha.NewDriverDigit(height, width, length, maxSkew, dotCount) // driver := base64Captcha.NewDriverString(config.File.Captcha.ImgHeight, // config.File.Captcha.ImgWidth, // 6, 1, keyLong, source, nil, nil, nil) - cp := base64Captcha.NewCaptcha(driver, captchaStore) + cp := base64Captcha.NewCaptcha(driver, b.store) return cp.Generate() } func (b *captchaService) Verify(id, answer string, clear bool) bool { - return captchaStore.Verify(id, answer, clear) + return b.store.Verify(id, answer, clear) } diff --git a/internal/erpserver/service/v1/service.go b/internal/erpserver/service/v1/service.go index 26db284..12fe2a4 100644 --- a/internal/erpserver/service/v1/service.go +++ b/internal/erpserver/service/v1/service.go @@ -8,8 +8,34 @@ import ( "management/internal/erpserver/model/form" "management/internal/erpserver/model/system" "management/internal/erpserver/model/view" + "management/internal/erpserver/repository" + "management/internal/pkg/redis" + "management/internal/pkg/session" + + "github.com/drhin/logger" ) +type Service struct { + Log *logger.Logger + Tx repository.Transaction + Session session.Manager + Redis redis.Cache +} + +func NewService( + log *logger.Logger, + tx repository.Transaction, + session session.Manager, + redis redis.Cache, +) *Service { + return &Service{ + Log: log, + Tx: tx, + Session: session, + Redis: redis, + } +} + type CaptchaService interface { Generate(height int, width int, length int, maxSkew float64, dotCount int) (id, b64s, answer string, err error) Verify(id, answer string, clear bool) bool diff --git a/internal/erpserver/service/v1/system/audit_log.go b/internal/erpserver/service/v1/system/audit_log.go index b79c7a4..3cd9b6f 100644 --- a/internal/erpserver/service/v1/system/audit_log.go +++ b/internal/erpserver/service/v1/system/audit_log.go @@ -5,16 +5,15 @@ import ( "management/internal/erpserver/model/dto" "management/internal/erpserver/model/system" - "management/internal/erpserver/service" - v1 "management/internal/erpserver/service/v1" + "management/internal/erpserver/service/v1" ) type auditLogService struct { - *service.Service + *v1.Service repo system.AuditLogRepository } -func NewAuditLogService(service *service.Service, repo system.AuditLogRepository) v1.AuditLogService { +func NewAuditLogService(service *v1.Service, repo system.AuditLogRepository) v1.AuditLogService { return &auditLogService{ Service: service, repo: repo, diff --git a/internal/erpserver/service/v1/system/config.go b/internal/erpserver/service/v1/system/config.go index 0fa6875..39c2dfc 100644 --- a/internal/erpserver/service/v1/system/config.go +++ b/internal/erpserver/service/v1/system/config.go @@ -8,8 +8,8 @@ import ( "management/internal/erpserver/model/dto" "management/internal/erpserver/model/system" - "management/internal/erpserver/service" - v1 "management/internal/erpserver/service/v1" + "management/internal/erpserver/service/util" + "management/internal/erpserver/service/v1" "management/internal/pkg/know" "management/internal/pkg/know/pearadmin" @@ -17,11 +17,11 @@ import ( ) type configService struct { - *service.Service + *v1.Service repo system.ConfigRepository } -func NewConfigService(service *service.Service, repo system.ConfigRepository) v1.ConfigService { +func NewConfigService(service *v1.Service, repo system.ConfigRepository) v1.ConfigService { return &configService{ Service: service, repo: repo, @@ -45,28 +45,12 @@ func (s *configService) List(ctx context.Context, q dto.SearchDto) ([]*system.Co } func (s *configService) Pear(ctx context.Context) (*dto.PearConfig, error) { - // 判断redis是否存储 + var res *dto.PearConfig key := know.GetManageKey(ctx, know.PearAdmin) - bs, err := s.Redis.GetBytes(ctx, key) - if err == nil { - var res *dto.PearConfig - if err := json.Unmarshal(bs, &res); err == nil { - return res, nil - } - } - - conf, err := s.repo.GetByKey(ctx, pearadmin.PearKey) - if err != nil { - return nil, err - } - - var pear dto.PearConfig - if err := json.Unmarshal([]byte(conf.Value), &pear); err != nil { - return nil, err - } - - _ = s.Redis.Set(ctx, key, conf.Value, time.Hour*6) - return &pear, nil + err := util.GetOrSetCache(ctx, s.Redis, key, util.GetCacheExpire(), func() (any, error) { + return s.repo.GetByKey(ctx, pearadmin.PearKey) + }, &res) + return res, err } func (s *configService) RefreshCache(ctx context.Context, key string) error { diff --git a/internal/erpserver/service/v1/system/department.go b/internal/erpserver/service/v1/system/department.go index 4b40020..a0ceae7 100644 --- a/internal/erpserver/service/v1/system/department.go +++ b/internal/erpserver/service/v1/system/department.go @@ -2,7 +2,6 @@ package system import ( "context" - "encoding/json" "errors" "fmt" "strconv" @@ -12,19 +11,19 @@ import ( "management/internal/erpserver/model/form" "management/internal/erpserver/model/system" "management/internal/erpserver/model/view" - "management/internal/erpserver/service" - v1 "management/internal/erpserver/service/v1" + "management/internal/erpserver/service/util" + "management/internal/erpserver/service/v1" "management/internal/pkg/convertor" "management/internal/pkg/database" "management/internal/pkg/know" ) type departmentService struct { - *service.Service + *v1.Service repo system.DepartmentRepository } -func NewDepartmentService(service *service.Service, repo system.DepartmentRepository) v1.DepartmentService { +func NewDepartmentService(service *v1.Service, repo system.DepartmentRepository) v1.DepartmentService { return &departmentService{ Service: service, repo: repo, @@ -107,27 +106,12 @@ func (s *departmentService) Get(ctx context.Context, id int32) (*system.Departme } func (s *departmentService) All(ctx context.Context) ([]*system.Department, error) { + var res []*system.Department key := know.GetManageKey(ctx, know.AllDepartments) - bs, err := s.Redis.GetBytes(ctx, key) - if err == nil { - var res []*system.Department - if err := json.Unmarshal(bs, &res); err == nil { - return res, nil - } - } - - res, err := s.repo.All(ctx) - if err != nil { - return nil, err - } - - bs, err = json.Marshal(res) - if err != nil { - return nil, err - } - - _ = s.Redis.Set(ctx, key, bs, time.Hour*6) - return res, nil + err := util.GetOrSetCache(ctx, s.Redis, key, util.GetCacheExpire(), func() (any, error) { + return s.repo.All(ctx) + }, &res) + return res, err } func (s *departmentService) List(ctx context.Context, q dto.SearchDto) ([]*system.Department, int64, error) { @@ -135,19 +119,12 @@ func (s *departmentService) List(ctx context.Context, q dto.SearchDto) ([]*syste } func (s *departmentService) RefreshCache(ctx context.Context) error { + var res []*system.Department key := know.GetManageKey(ctx, know.AllDepartments) - res, err := s.All(ctx) - if err != nil { - return err - } - - b, err := json.Marshal(res) - if err != nil { - return err - } - - _ = s.Redis.Set(ctx, key, b, time.Hour*6) - return nil + err := util.GetOrSetCache(ctx, s.Redis, key, util.GetCacheExpire(), func() (any, error) { + return s.All(ctx) + }, &res) + return err } func (s *departmentService) RebuildParentPath(ctx context.Context) error { diff --git a/internal/erpserver/service/v1/system/login_log.go b/internal/erpserver/service/v1/system/login_log.go index a9e3c99..a9dfe83 100644 --- a/internal/erpserver/service/v1/system/login_log.go +++ b/internal/erpserver/service/v1/system/login_log.go @@ -6,16 +6,15 @@ import ( "management/internal/erpserver/model/dto" "management/internal/erpserver/model/system" - "management/internal/erpserver/service" - v1 "management/internal/erpserver/service/v1" + "management/internal/erpserver/service/v1" ) type loginLogService struct { - *service.Service + *v1.Service repo system.LoginLogRepository } -func NewLoginLogService(service *service.Service, repo system.LoginLogRepository) v1.LoginLogService { +func NewLoginLogService(service *v1.Service, repo system.LoginLogRepository) v1.LoginLogService { return &loginLogService{ Service: service, repo: repo, diff --git a/internal/erpserver/service/v1/system/menu.go b/internal/erpserver/service/v1/system/menu.go index f146f1c..33f15a3 100644 --- a/internal/erpserver/service/v1/system/menu.go +++ b/internal/erpserver/service/v1/system/menu.go @@ -5,25 +5,24 @@ import ( "encoding/json" "strconv" "strings" - "time" "management/internal/erpserver/model/dto" "management/internal/erpserver/model/system" "management/internal/erpserver/model/view" - "management/internal/erpserver/service" - v1 "management/internal/erpserver/service/v1" + "management/internal/erpserver/service/util" + "management/internal/erpserver/service/v1" "management/internal/pkg/know" ) type menuService struct { - *service.Service + *v1.Service repo system.MenuRepository roleService v1.RoleService roleMenuService v1.RoleMenuService } func NewMenuService( - service *service.Service, + service *v1.Service, repo system.MenuRepository, roleService v1.RoleService, roleMenuService v1.RoleMenuService, @@ -53,27 +52,12 @@ func (s *menuService) GetByUrl(ctx context.Context, url string) (*system.Menu, e } func (s *menuService) All(ctx context.Context) ([]*system.Menu, error) { + var res []*system.Menu key := know.GetManageKey(ctx, know.AllMenus) - b, err := s.Redis.GetBytes(ctx, key) - if err == nil { - var res []*system.Menu - if err := json.Unmarshal(b, &res); err == nil { - return res, nil - } - } - - res, err := s.repo.All(ctx) - if err != nil { - return nil, err - } - - b, err = json.Marshal(res) - if err != nil { - return nil, err - } - - _ = s.Redis.Set(ctx, key, b, time.Hour*6) - return res, nil + err := util.GetOrSetCache(ctx, s.Redis, key, util.GetCacheExpire(), func() (any, error) { + return s.repo.All(ctx) + }, &res) + return res, err } func (s *menuService) ListMenuTree(ctx context.Context) ([]*view.MenuTree, error) { @@ -111,7 +95,7 @@ func (s *menuService) SetListByRoleID(ctx context.Context, roleID int32) ([]*dto return nil, err } - _ = s.Redis.Set(ctx, key, b, time.Hour*6) + _ = s.Redis.Set(ctx, key, b, util.GetCacheExpire()) return res, nil } @@ -141,7 +125,7 @@ func (s *menuService) SetListByRoleIDToMap(ctx context.Context, roleID int32) (m return nil, err } - _ = s.Redis.Set(ctx, key, b, time.Hour*6) + _ = s.Redis.Set(ctx, key, b, util.GetCacheExpire()) return res, nil } @@ -172,7 +156,7 @@ func (s *menuService) SetOwerMenus(ctx context.Context, roleID int32) ([]*dto.Me return nil, err } - _ = s.Redis.Set(ctx, key, b, time.Hour*6) + _ = s.Redis.Set(ctx, key, b, util.GetCacheExpire()) return res, nil } @@ -206,19 +190,12 @@ func (s *menuService) SetRoleMenu(ctx context.Context, roleID int32, rms []*syst } func (s *menuService) RefreshCache(ctx context.Context) error { + var res []*system.Menu key := know.GetManageKey(ctx, know.AllMenus) - res, err := s.All(ctx) - if err != nil { - return err + getData := func() (any, error) { + return s.repo.All(ctx) } - - b, err := json.Marshal(res) - if err != nil { - return err - } - - _ = s.Redis.Set(ctx, key, b, time.Hour*6) - return nil + return util.GetOrSetCache(ctx, s.Redis, key, util.GetCacheExpire(), getData, &res) } func (s *menuService) RebuildParentPath(ctx context.Context) error { @@ -303,15 +280,28 @@ func (s *menuService) toXmSelectTree(parentId int32, data []*system.Menu) []*vie } func findMenu(rms []*system.RoleMenu, ms []*system.Menu) []*system.Menu { + menuMap := make(map[int32]*system.Menu) + for _, m := range ms { + menuMap[m.ID] = m + } + var res []*system.Menu for _, rm := range rms { - for _, m := range ms { - if rm.MenuID == m.ID { - res = append(res, m) - } + if m, ok := menuMap[rm.MenuID]; ok { + res = append(res, m) } } return res + + //var res []*system.Menu + //for _, rm := range rms { + // for _, m := range ms { + // if rm.MenuID == m.ID { + // res = append(res, m) + // } + // } + //} + //return res } func toOwnerMenuDto(ms []*system.Menu) []*dto.OwnerMenuDto { diff --git a/internal/erpserver/service/v1/system/role.go b/internal/erpserver/service/v1/system/role.go index 9ad87f8..3ed7f48 100644 --- a/internal/erpserver/service/v1/system/role.go +++ b/internal/erpserver/service/v1/system/role.go @@ -2,7 +2,6 @@ package system import ( "context" - "encoding/json" "errors" "fmt" "strconv" @@ -12,19 +11,19 @@ import ( "management/internal/erpserver/model/form" "management/internal/erpserver/model/system" "management/internal/erpserver/model/view" - "management/internal/erpserver/service" - v1 "management/internal/erpserver/service/v1" + "management/internal/erpserver/service/util" + "management/internal/erpserver/service/v1" "management/internal/pkg/convertor" "management/internal/pkg/database" "management/internal/pkg/know" ) type roleService struct { - *service.Service + *v1.Service repo system.RoleRepository } -func NewRoleService(service *service.Service, repo system.RoleRepository) v1.RoleService { +func NewRoleService(service *v1.Service, repo system.RoleRepository) v1.RoleService { return &roleService{ Service: service, repo: repo, @@ -110,27 +109,12 @@ func (s *roleService) Get(ctx context.Context, id int32) (*system.Role, error) { } func (s *roleService) All(ctx context.Context) ([]*system.Role, error) { + var res []*system.Role key := know.GetManageKey(ctx, know.AllRoles) - bs, err := s.Redis.GetBytes(ctx, key) - if err == nil { - var res []*system.Role - if err := json.Unmarshal(bs, &res); err == nil { - return res, nil - } - } - - res, err := s.repo.All(ctx) - if err != nil { - return nil, err - } - - bs, err = json.Marshal(res) - if err != nil { - return nil, err - } - - _ = s.Redis.Set(ctx, key, bs, time.Hour*6) - return res, nil + err := util.GetOrSetCache(ctx, s.Redis, key, util.GetCacheExpire(), func() (any, error) { + return s.repo.All(ctx) + }, &res) + return res, err } func (s *roleService) List(ctx context.Context, q dto.SearchDto) ([]*system.Role, int64, error) { @@ -138,19 +122,11 @@ func (s *roleService) List(ctx context.Context, q dto.SearchDto) ([]*system.Role } func (s *roleService) RefreshCache(ctx context.Context) error { + var res []*system.Role key := know.GetManageKey(ctx, know.AllRoles) - res, err := s.All(ctx) - if err != nil { - return err - } - - b, err := json.Marshal(res) - if err != nil { - return err - } - - _ = s.Redis.Set(ctx, key, b, time.Hour*6) - return nil + return util.GetOrSetCache(ctx, s.Redis, key, util.GetCacheExpire(), func() (any, error) { + return s.repo.All(ctx) + }, &res) } func (s *roleService) RebuildParentPath(ctx context.Context) error { @@ -176,6 +152,23 @@ func (s *roleService) XmSelectTree(ctx context.Context, id int32) ([]*view.XmSel } func (s *roleService) toTree(parentId int32, data []*system.Role) []*view.LayuiTree { + //idFunc := func(s *system.Role) int32 { + // return s.ParentID + //} + //childrenFunc := func(s *system.Role, childNodes []*view.LayuiTree) *view.LayuiTree { + // spread := false + // if s.ParentID == 0 { + // spread = true + // } + // return &view.LayuiTree{ + // Title: s.Name, + // ID: strconv.FormatInt(int64(s.ID), 10), + // Children: childNodes, + // Spread: spread, + // } + //} + //return util.BuildTree(parentId, data, idFunc, childrenFunc) + var res []*view.LayuiTree for _, v := range data { if v.ParentID == parentId { diff --git a/internal/erpserver/service/v1/system/role_menu.go b/internal/erpserver/service/v1/system/role_menu.go index ac48a2e..4a0dbc6 100644 --- a/internal/erpserver/service/v1/system/role_menu.go +++ b/internal/erpserver/service/v1/system/role_menu.go @@ -4,16 +4,15 @@ import ( "context" "management/internal/erpserver/model/system" - "management/internal/erpserver/service" - v1 "management/internal/erpserver/service/v1" + "management/internal/erpserver/service/v1" ) type roleMenuService struct { - *service.Service + *v1.Service repo system.RoleMenuRepository } -func NewRoleMenuService(service *service.Service, repo system.RoleMenuRepository) v1.RoleMenuService { +func NewRoleMenuService(service *v1.Service, repo system.RoleMenuRepository) v1.RoleMenuService { return &roleMenuService{ Service: service, repo: repo, diff --git a/internal/erpserver/service/v1/system/user.go b/internal/erpserver/service/v1/system/user.go index 8251e59..41359a8 100644 --- a/internal/erpserver/service/v1/system/user.go +++ b/internal/erpserver/service/v1/system/user.go @@ -10,8 +10,7 @@ import ( "management/internal/erpserver/model/form" "management/internal/erpserver/model/system" "management/internal/erpserver/model/view" - "management/internal/erpserver/service" - v1 "management/internal/erpserver/service/v1" + "management/internal/erpserver/service/v1" "management/internal/pkg/crypto" "management/internal/pkg/database" "management/internal/pkg/know" @@ -22,14 +21,14 @@ import ( ) type userService struct { - *service.Service + *v1.Service repo system.UserRepository roleService v1.RoleService loginLogService v1.LoginLogService } func NewUserService( - service *service.Service, + service *v1.Service, repo system.UserRepository, roleService v1.RoleService, loginLogService v1.LoginLogService, diff --git a/internal/erpserver/wire.go b/internal/erpserver/wire.go index 940e939..d4f023b 100644 --- a/internal/erpserver/wire.go +++ b/internal/erpserver/wire.go @@ -9,7 +9,7 @@ import ( systemHandler "management/internal/erpserver/handler/system" "management/internal/erpserver/repository" systemRepo "management/internal/erpserver/repository/system" - "management/internal/erpserver/service" + "management/internal/erpserver/service/v1" commonService "management/internal/erpserver/service/v1/common" systemService "management/internal/erpserver/service/v1/system" "management/internal/pkg/config" @@ -37,7 +37,7 @@ var repositorySet = wire.NewSet( ) var serviceSet = wire.NewSet( - service.NewService, + v1.NewService, commonService.NewCaptchaService, systemService.NewUserService, systemService.NewLoginLogService, diff --git a/internal/erpserver/wire_gen.go b/internal/erpserver/wire_gen.go index 796623e..abf969f 100644 --- a/internal/erpserver/wire_gen.go +++ b/internal/erpserver/wire_gen.go @@ -15,7 +15,7 @@ import ( system3 "management/internal/erpserver/handler/system" "management/internal/erpserver/repository" "management/internal/erpserver/repository/system" - "management/internal/erpserver/service" + "management/internal/erpserver/service/v1" "management/internal/erpserver/service/v1/common" system2 "management/internal/erpserver/service/v1/system" "management/internal/pkg/config" @@ -43,15 +43,15 @@ func NewWire(configConfig *config.Config, loggerLogger *logger.Logger) (*chi.Mux cleanup() return nil, nil, err } - serviceService := service.NewService(loggerLogger, transaction, manager, cache) + service := v1.NewService(loggerLogger, transaction, manager, cache) menuRepository := system.NewMenuRepository(repositoryRepository) roleRepository := system.NewRoleRepository(repositoryRepository) - roleService := system2.NewRoleService(serviceService, roleRepository) + roleService := system2.NewRoleService(service, roleRepository) roleMenuRepository := system.NewRoleMenuRepository(repositoryRepository) - roleMenuService := system2.NewRoleMenuService(serviceService, roleMenuRepository) - menuService := system2.NewMenuService(serviceService, menuRepository, roleService, roleMenuService) + roleMenuService := system2.NewRoleMenuService(service, roleMenuRepository) + menuService := system2.NewMenuService(service, menuRepository, roleService, roleMenuService) auditLogRepository := system.NewAuditLogRepository(repositoryRepository) - auditLogService := system2.NewAuditLogService(serviceService, auditLogRepository) + auditLogService := system2.NewAuditLogService(service, auditLogRepository) renderRender, err := render.New(manager, menuService) if err != nil { cleanup2() @@ -63,15 +63,15 @@ func NewWire(configConfig *config.Config, loggerLogger *logger.Logger) (*chi.Mux captchaHandler := common2.NewCaptchaHandler(handlerHandler, captchaService) uploadHandler := common2.NewUploadHandler(handlerHandler) configRepository := system.NewConfigRepository(repositoryRepository) - configService := system2.NewConfigService(serviceService, configRepository) + configService := system2.NewConfigService(service, configRepository) configHandler := system3.NewConfigHandler(handlerHandler, configService) userRepository := system.NewUserRepository(repositoryRepository) loginLogRepository := system.NewLoginLogRepository(repositoryRepository) - loginLogService := system2.NewLoginLogService(serviceService, loginLogRepository) - userService := system2.NewUserService(serviceService, userRepository, roleService, loginLogService) + loginLogService := system2.NewLoginLogService(service, loginLogRepository) + userService := system2.NewUserService(service, userRepository, roleService, loginLogService) homeHandler := system3.NewHomeHandler(handlerHandler, userService, loginLogService) departmentRepository := system.NewDepartmentRepository(repositoryRepository) - departmentService := system2.NewDepartmentService(serviceService, departmentRepository) + departmentService := system2.NewDepartmentService(service, departmentRepository) userHandler := system3.NewUserHandler(handlerHandler, captchaService, userService, roleService, departmentService) loginLogHandler := system3.NewLoginLogHandler(handlerHandler, loginLogService) auditHandler := system3.NewAuditHandler(handlerHandler, auditLogService) @@ -89,7 +89,7 @@ func NewWire(configConfig *config.Config, loggerLogger *logger.Logger) (*chi.Mux var repositorySet = wire.NewSet(repository.NewDB, repository.NewRepository, repository.NewTransaction, system.NewUserRepository, system.NewLoginLogRepository, system.NewAuditLogRepository, system.NewRoleRepository, system.NewMenuRepository, system.NewRoleMenuRepository, system.NewDepartmentRepository, system.NewConfigRepository) -var serviceSet = wire.NewSet(service.NewService, common.NewCaptchaService, system2.NewUserService, system2.NewLoginLogService, system2.NewAuditLogService, system2.NewRoleService, system2.NewMenuService, system2.NewRoleMenuService, system2.NewDepartmentService, system2.NewConfigService) +var serviceSet = wire.NewSet(v1.NewService, common.NewCaptchaService, system2.NewUserService, system2.NewLoginLogService, system2.NewAuditLogService, system2.NewRoleService, system2.NewMenuService, system2.NewRoleMenuService, system2.NewDepartmentService, system2.NewConfigService) var handlerSet = wire.NewSet(handler.NewHandler, common2.NewCaptchaHandler, common2.NewUploadHandler, system3.NewHomeHandler, system3.NewUserHandler, system3.NewLoginLogHandler, system3.NewAuditHandler, system3.NewRoleHandler, system3.NewMenuHandler, system3.NewDepartmentHandler, system3.NewConfigHandler)