Refactor import paths to use internal/pkg/httpx/params
- Updated multiple repository and service files to replace imports from "github.com/mlogclub/simple/web/params" with "cs-agent/internal/pkg/httpx/params". - Adjusted context handling in auth_service and ws_service to use gin.Context instead of iris.Context. - Ensured consistent usage of HTTP status responses across websocket handlers.
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
if err := app.Listen(cfg.Server.Address()); err != nil {
|
||||
if err := app.Run(cfg.Server.Address()); err != nil {
|
||||
slog.Error("start server failed", "error", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -5,12 +5,16 @@ go 1.26.0
|
||||
require (
|
||||
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible
|
||||
github.com/cloudwego/eino v0.8.7
|
||||
github.com/cloudwego/eino-ext/components/model/openai v0.1.11
|
||||
github.com/eino-contrib/jsonschema v1.0.3
|
||||
github.com/gin-gonic/gin v1.12.0
|
||||
github.com/glebarez/sqlite v1.11.0
|
||||
github.com/go-playground/validator/v10 v10.30.1
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1
|
||||
github.com/gomarkdown/markdown v0.0.0-20240328165702-4d01890c35c0
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/gorilla/schema v1.4.1
|
||||
github.com/gorilla/websocket v1.5.1
|
||||
github.com/kataras/iris/v12 v12.2.11
|
||||
github.com/microcosm-cc/bluemonday v1.0.26
|
||||
github.com/mlogclub/codegen v1.0.3
|
||||
github.com/mlogclub/simple v1.2.40
|
||||
@@ -21,6 +25,7 @@ require (
|
||||
github.com/robfig/cron/v3 v3.0.1
|
||||
github.com/silenceper/wechat/v2 v2.1.12
|
||||
github.com/spf13/cast v1.6.0
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8
|
||||
github.com/yuin/goldmark v1.4.13
|
||||
golang.org/x/crypto v0.49.0
|
||||
golang.org/x/net v0.51.0
|
||||
@@ -31,15 +36,8 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v1.3.2 // indirect
|
||||
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 // indirect
|
||||
github.com/CloudyKit/jet/v6 v6.2.0 // indirect
|
||||
github.com/Joker/jade v1.1.3 // indirect
|
||||
github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 // indirect
|
||||
github.com/andybalholm/brotli v1.1.0 // indirect
|
||||
github.com/aymerick/douceur v0.2.0 // indirect
|
||||
github.com/bahlo/generic-list-go v0.2.0 // indirect
|
||||
github.com/blang/semver/v4 v4.0.0 // indirect
|
||||
github.com/bmatcuk/doublestar/v4 v4.10.0 // indirect
|
||||
github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d // indirect
|
||||
github.com/buger/jsonparser v1.1.1 // indirect
|
||||
@@ -48,79 +46,57 @@ require (
|
||||
github.com/bytedance/sonic/loader v0.5.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/cloudwego/base64x v0.1.6 // indirect
|
||||
github.com/cloudwego/eino-ext/components/model/openai v0.1.11 // indirect
|
||||
github.com/cloudwego/eino-ext/libs/acl/openai v0.1.15 // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/eino-contrib/jsonschema v1.0.3 // indirect
|
||||
github.com/evanphx/json-patch v0.5.2 // indirect
|
||||
github.com/fatih/structs v1.1.0 // indirect
|
||||
github.com/flosch/pongo2/v4 v4.0.2 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.6 // indirect
|
||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.12 // indirect
|
||||
github.com/gin-contrib/sse v1.1.0 // indirect
|
||||
github.com/glebarez/go-sqlite v1.21.2 // indirect
|
||||
github.com/go-playground/locales v0.14.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||
github.com/go-playground/validator/v10 v10.22.1 // indirect
|
||||
github.com/go-redis/redis/v8 v8.11.5 // indirect
|
||||
github.com/go-sql-driver/mysql v1.7.0 // indirect
|
||||
github.com/gobwas/httphead v0.1.0 // indirect
|
||||
github.com/gobwas/pool v0.2.1 // indirect
|
||||
github.com/gobwas/ws v1.3.2 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/goccy/go-json v0.10.5 // indirect
|
||||
github.com/goccy/go-yaml v1.19.2 // indirect
|
||||
github.com/google/jsonschema-go v0.4.2 // indirect
|
||||
github.com/goph/emperror v0.17.2 // indirect
|
||||
github.com/gorilla/css v1.0.0 // indirect
|
||||
github.com/iris-contrib/go.uuid v2.0.0+incompatible // indirect
|
||||
github.com/iris-contrib/schema v0.0.6 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/kataras/blocks v0.0.8 // indirect
|
||||
github.com/kataras/golog v0.1.11 // indirect
|
||||
github.com/kataras/neffos v0.0.24-0.20240408172741-99c879ba0ede // indirect
|
||||
github.com/kataras/pio v0.0.13 // indirect
|
||||
github.com/kataras/sitemap v0.0.6 // indirect
|
||||
github.com/kataras/tunnel v0.0.4 // indirect
|
||||
github.com/klauspost/compress v1.18.4 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
|
||||
github.com/leodido/go-urn v1.4.0 // indirect
|
||||
github.com/mailgun/raymond/v2 v2.0.48 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/mediocregopher/radix/v3 v3.8.1 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/meguminnnnnnnnn/go-openai v0.1.2 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/nats-io/nats.go v1.34.1 // indirect
|
||||
github.com/nats-io/nkeys v0.4.7 // indirect
|
||||
github.com/nats-io/nuid v1.0.1 // indirect
|
||||
github.com/nikolalohinski/gonja v1.5.3 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
|
||||
github.com/nxadm/tail v1.4.11 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/quic-go/qpack v0.6.0 // indirect
|
||||
github.com/quic-go/quic-go v0.59.0 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/schollz/closestmatch v2.1.0+incompatible // indirect
|
||||
github.com/segmentio/asm v1.2.1 // indirect
|
||||
github.com/segmentio/encoding v0.5.4 // indirect
|
||||
github.com/sirupsen/logrus v1.9.4 // indirect
|
||||
github.com/slongfield/pyfmt v0.0.0-20220222012616-ea85ff4c361f // indirect
|
||||
github.com/tdewolff/minify/v2 v2.20.19 // indirect
|
||||
github.com/tdewolff/parse/v2 v2.7.12 // indirect
|
||||
github.com/tidwall/gjson v1.18.0 // indirect
|
||||
github.com/tidwall/match v1.1.1 // indirect
|
||||
github.com/tidwall/pretty v1.2.1 // indirect
|
||||
github.com/tidwall/sjson v1.2.5 // indirect
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
|
||||
github.com/ugorji/go/codec v1.3.1 // indirect
|
||||
github.com/yargevad/filepathx v1.0.0 // indirect
|
||||
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
|
||||
github.com/yosssi/ace v0.0.5 // indirect
|
||||
go.mongodb.org/mongo-driver/v2 v2.5.0 // indirect
|
||||
go.opentelemetry.io/otel v1.42.0 // indirect
|
||||
golang.org/x/arch v0.11.0 // indirect
|
||||
golang.org/x/arch v0.22.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect
|
||||
golang.org/x/mod v0.33.0 // indirect
|
||||
golang.org/x/oauth2 v0.36.0 // indirect
|
||||
@@ -128,11 +104,9 @@ require (
|
||||
golang.org/x/sys v0.42.0 // indirect
|
||||
golang.org/x/text v0.35.0 // indirect
|
||||
golang.org/x/time v0.14.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 // indirect
|
||||
google.golang.org/grpc v1.78.0 // indirect
|
||||
google.golang.org/protobuf v1.36.11 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
modernc.org/libc v1.22.5 // indirect
|
||||
modernc.org/mathutil v1.5.0 // indirect
|
||||
modernc.org/memory v1.5.0 // indirect
|
||||
|
||||
@@ -1,33 +1,15 @@
|
||||
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
|
||||
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 h1:sR+/8Yb4slttB4vD+b9btVEnWgL3Q00OBTzVT8B9C0c=
|
||||
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno=
|
||||
github.com/CloudyKit/jet/v6 v6.2.0 h1:EpcZ6SR9n28BUGtNJSvlBqf90IpjeFr36Tizxhn/oME=
|
||||
github.com/CloudyKit/jet/v6 v6.2.0/go.mod h1:d3ypHeIRNo2+XyqnGA8s+aphtcVpjP5hPwP/Lzo7Ro4=
|
||||
github.com/Joker/hpp v1.0.0 h1:65+iuJYdRXv/XyN62C1uEmmOx3432rNG/rKlX6V7Kkc=
|
||||
github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY=
|
||||
github.com/Joker/jade v1.1.3 h1:Qbeh12Vq6BxURXT1qZBRHsDxeURB8ztcL6f3EXSGeHk=
|
||||
github.com/Joker/jade v1.1.3/go.mod h1:T+2WLyt7VH6Lp0TRxQrUYEs64nRc83wkMQrfeIQKduM=
|
||||
github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 h1:KkH3I3sJuOLP3TjA/dfr4NAY8bghDwnXiU7cTKxQqo0=
|
||||
github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06/go.mod h1:7erjKLwalezA0k99cWs5L11HWOAPNjdUZ6RxH1BXbbM=
|
||||
github.com/airbrake/gobrake v3.6.1+incompatible/go.mod h1:wM4gu3Cn0W0K7GUuVWnlXZU11AGBXMILnrdOU8Kn00o=
|
||||
github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
|
||||
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
|
||||
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk=
|
||||
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
|
||||
github.com/alicebob/miniredis/v2 v2.30.0 h1:uA3uhDbCxfO9+DI/DuGeAMr9qI+noVWwGPNTFuKID5M=
|
||||
github.com/alicebob/miniredis/v2 v2.30.0/go.mod h1:84TWKZlxYkfgMucPBf5SOQBYJceZeQRFIaQgNMiCX6Q=
|
||||
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible h1:8psS8a+wKfiLt1iVDX79F7Y6wUM49Lcha2FMXt4UM8g=
|
||||
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
|
||||
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
|
||||
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
|
||||
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
|
||||
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
|
||||
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
|
||||
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
|
||||
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
|
||||
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
|
||||
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
|
||||
github.com/bmatcuk/doublestar/v4 v4.10.0 h1:zU9WiOla1YA122oLM6i4EXvGW62DvKZVxIe6TYWexEs=
|
||||
github.com/bmatcuk/doublestar/v4 v4.10.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
|
||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
|
||||
@@ -39,6 +21,8 @@ github.com/bugsnag/bugsnag-go v1.4.0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqR
|
||||
github.com/bugsnag/panicwrap v1.2.0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
|
||||
github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M=
|
||||
github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM=
|
||||
github.com/bytedance/mockey v1.3.0 h1:ONLRdvhqmCfr9rTasUB8ZKCfvbdD2tohOg4u+4Q/ed0=
|
||||
github.com/bytedance/mockey v1.3.0/go.mod h1:1BPHF9sol5R1ud/+0VEHGQq/+i2lN+GTsr3O2Q9IENY=
|
||||
github.com/bytedance/sonic v1.15.0 h1:/PXeWFaR5ElNcVE84U0dOHjiMHQOwNIx3K4ymzh/uSE=
|
||||
github.com/bytedance/sonic v1.15.0/go.mod h1:tFkWrPz0/CUCLEF4ri4UkHekCIcdnkqXw9VduqpJh0k=
|
||||
github.com/bytedance/sonic/loader v0.5.0 h1:gXH3KVnatgY7loH5/TkeVyXPfESoqSBSBEiDd5VjlgE=
|
||||
@@ -69,21 +53,21 @@ github.com/eino-contrib/jsonschema v1.0.3 h1:2Kfsm1xlMV0ssY2nuxshS4AwbLFuqmPmzIj
|
||||
github.com/eino-contrib/jsonschema v1.0.3/go.mod h1:cpnX4SyKjWjGC7iN2EbhxaTdLqGjCi0e9DxpLYxddD4=
|
||||
github.com/evanphx/json-patch v0.5.2 h1:xVCHIVMUu1wtM/VkR9jVZ45N3FhZfYMMYGorLCR8P3k=
|
||||
github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ=
|
||||
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
|
||||
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
|
||||
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
|
||||
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
|
||||
github.com/flosch/pongo2/v4 v4.0.2 h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0Hw=
|
||||
github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8=
|
||||
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.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/gabriel-vasile/mimetype v1.4.6 h1:3+PzJTKLkvgjeTbts6msPJt4DixhT4YtFNf1gtGe3zc=
|
||||
github.com/gabriel-vasile/mimetype v1.4.6/go.mod h1:JX1qVKqZd40hUPpAfiNTe0Sne7hdfKSbOqqmkq8GCXc=
|
||||
github.com/gabriel-vasile/mimetype v1.4.12 h1:e9hWvmLYvtp846tLHam2o++qitpguFiYCKbn0w9jyqw=
|
||||
github.com/gabriel-vasile/mimetype v1.4.12/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
||||
github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ=
|
||||
github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w=
|
||||
github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM=
|
||||
github.com/gin-gonic/gin v1.12.0 h1:b3YAbrZtnf8N//yjKeU2+MQsh2mY5htkZidOM7O0wG8=
|
||||
github.com/gin-gonic/gin v1.12.0/go.mod h1:VxccKfsSllpKshkBWgVgRniFFAzFb9csfngsqANjnLc=
|
||||
github.com/glebarez/go-sqlite v1.21.2 h1:3a6LFC4sKahUunAmynQKLZceZCOzUthkRkEAl9gAXWo=
|
||||
github.com/glebarez/go-sqlite v1.21.2/go.mod h1:sfxdZyhQjTM2Wry3gVYWaW072Ri1WMdWJi0k6+3382k=
|
||||
github.com/glebarez/sqlite v1.11.0 h1:wSG0irqzP6VurnMEpFGer5Li19RpIRi2qvQz++w0GMw=
|
||||
@@ -100,21 +84,17 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
|
||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||
github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA=
|
||||
github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
|
||||
github.com/go-playground/validator/v10 v10.30.1 h1:f3zDSN/zOma+w6+1Wswgd9fLkdwy06ntQJp0BBvFG0w=
|
||||
github.com/go-playground/validator/v10 v10.30.1/go.mod h1:oSuBIQzuJxL//3MelwSLD5hc2Tu889bF0Idm9Dg26cM=
|
||||
github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
|
||||
github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
|
||||
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
|
||||
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
|
||||
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
|
||||
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
|
||||
github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=
|
||||
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
|
||||
github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=
|
||||
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
||||
github.com/gobwas/ws v1.3.2 h1:zlnbNHxumkRvfPWgfXu8RBwyNR1x8wh9cf5PTOCqs9Q=
|
||||
github.com/gobwas/ws v1.3.2/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY=
|
||||
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/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM=
|
||||
github.com/goccy/go-yaml v1.19.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
|
||||
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
|
||||
@@ -129,8 +109,6 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/gomarkdown/markdown v0.0.0-20240328165702-4d01890c35c0 h1:4gjrh/PN2MuWCCElk8/I4OCKRKWCCo2zEct3VKCbibU=
|
||||
github.com/gomarkdown/markdown v0.0.0-20240328165702-4d01890c35c0/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
@@ -139,8 +117,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
|
||||
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/jsonschema-go v0.4.2 h1:tmrUohrwoLZZS/P3x7ex0WAVknEkBZM46iALbcqoRA8=
|
||||
github.com/google/jsonschema-go v0.4.2/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
|
||||
@@ -155,50 +131,29 @@ github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25d
|
||||
github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k=
|
||||
github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=
|
||||
github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c=
|
||||
github.com/gorilla/schema v1.4.1 h1:jUg5hUjCSDZpNGLuXQOgIWGdlgrIdYvgQ0wZtdK1M3E=
|
||||
github.com/gorilla/schema v1.4.1/go.mod h1:Dg5SSm5PV60mhF2NFaTV1xuYYj8tV8NOPRo4FggUMnM=
|
||||
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
|
||||
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
|
||||
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=
|
||||
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/imkira/go-interpol v1.1.0 h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk=
|
||||
github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=
|
||||
github.com/iris-contrib/go.uuid v2.0.0+incompatible h1:XZubAYg61/JwnJNbZilGjf3b3pB80+OQg2qf6c8BfWE=
|
||||
github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0=
|
||||
github.com/iris-contrib/httpexpect/v2 v2.15.2 h1:T9THsdP1woyAqKHwjkEsbCnMefsAFvk8iJJKokcJ3Go=
|
||||
github.com/iris-contrib/httpexpect/v2 v2.15.2/go.mod h1:JLDgIqnFy5loDSUv1OA2j0mb6p/rDhiCqigP22Uq9xE=
|
||||
github.com/iris-contrib/schema v0.0.6 h1:CPSBLyx2e91H2yJzPuhGuifVRnZBBJ3pCOMbOvPZaTw=
|
||||
github.com/iris-contrib/schema v0.0.6/go.mod h1:iYszG0IOsuIsfzjymw1kMzTL8YQcCWlm65f3wX8J5iA=
|
||||
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
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/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||
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/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
|
||||
github.com/kataras/blocks v0.0.8 h1:MrpVhoFTCR2v1iOOfGng5VJSILKeZZI+7NGfxEh3SUM=
|
||||
github.com/kataras/blocks v0.0.8/go.mod h1:9Jm5zx6BB+06NwA+OhTbHW1xkMOYxahnqTN5DveZ2Yg=
|
||||
github.com/kataras/golog v0.1.11 h1:dGkcCVsIpqiAMWTlebn/ZULHxFvfG4K43LF1cNWSh20=
|
||||
github.com/kataras/golog v0.1.11/go.mod h1:mAkt1vbPowFUuUGvexyQ5NFW6djEgGyxQBIARJ0AH4A=
|
||||
github.com/kataras/iris/v12 v12.2.11 h1:sGgo43rMPfzDft8rjVhPs6L3qDJy3TbBrMD/zGL1pzk=
|
||||
github.com/kataras/iris/v12 v12.2.11/go.mod h1:uMAeX8OqG9vqdhyrIPv8Lajo/wXTtAF43wchP9WHt2w=
|
||||
github.com/kataras/neffos v0.0.24-0.20240408172741-99c879ba0ede h1:ZnSJQ+ri9x46Yz15wHqSb93Q03yY12XMVLUFDJJ0+/g=
|
||||
github.com/kataras/neffos v0.0.24-0.20240408172741-99c879ba0ede/go.mod h1:i0dtcTbpnw1lqIbojYtGtZlu6gDWPxJ4Xl2eJ6oQ1bE=
|
||||
github.com/kataras/pio v0.0.13 h1:x0rXVX0fviDTXOOLOmr4MUxOabu1InVSTu5itF8CXCM=
|
||||
github.com/kataras/pio v0.0.13/go.mod h1:k3HNuSw+eJ8Pm2lA4lRhg3DiCjVgHlP8hmXApSej3oM=
|
||||
github.com/kataras/sitemap v0.0.6 h1:w71CRMMKYMJh6LR2wTgnk5hSgjVNB9KL60n5e2KHvLY=
|
||||
github.com/kataras/sitemap v0.0.6/go.mod h1:dW4dOCNs896OR1HmG+dMLdT7JjDk7mYBzoIRwuj5jA4=
|
||||
github.com/kataras/tunnel v0.0.4 h1:sCAqWuJV7nPzGrlb0os3j49lk2JhILT0rID38NHNLpA=
|
||||
github.com/kataras/tunnel v0.0.4/go.mod h1:9FkU4LaeifdMWqZu7o20ojmW4B7hdhv2CMLwfnHGpYw=
|
||||
github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c=
|
||||
github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
|
||||
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/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
|
||||
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
@@ -209,26 +164,21 @@ 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/mailgun/raymond/v2 v2.0.48 h1:5dmlB680ZkFG2RN/0lvTAghrSxIESeu9/2aeDqACtjw=
|
||||
github.com/mailgun/raymond/v2 v2.0.48/go.mod h1:lsgvL50kgt1ylcFJYZiULi5fjPBkkhNfj4KA0W54Z18=
|
||||
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
|
||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
|
||||
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
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/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
|
||||
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/mediocregopher/radix/v3 v3.8.1 h1:rOkHflVuulFKlwsLY01/M2cM2tWCjDoETcMqKbAWu1M=
|
||||
github.com/mediocregopher/radix/v3 v3.8.1/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8=
|
||||
github.com/meguminnnnnnnnn/go-openai v0.1.2 h1:iXombGGjqjBrmE9WaSidUhhi3YQhf42QTHvHLMkgvCA=
|
||||
github.com/meguminnnnnnnnn/go-openai v0.1.2/go.mod h1:qs96ysDmxhE4BZoU45I43zcyfnaYxU3X+aRzLko/htY=
|
||||
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=
|
||||
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
|
||||
github.com/microcosm-cc/bluemonday v1.0.26 h1:xbqSvqzQMeEHCqMi64VAs4d8uy6Mequs3rQ0k/Khz58=
|
||||
github.com/microcosm-cc/bluemonday v1.0.26/go.mod h1:JyzOCs9gkyQyjs+6h10UEVSe02CGwkhd72Xdqh78TWs=
|
||||
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
|
||||
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
|
||||
github.com/mlogclub/codegen v1.0.3 h1:4hLfP076riUe+mHjZvlSpAeYpJ1/7Hhn0D/7XmNpY5I=
|
||||
github.com/mlogclub/codegen v1.0.3/go.mod h1:lVk93DtwpX8D/Dg0MMcbYnMRYT1kVPqt05n8lgfLjFI=
|
||||
github.com/mlogclub/simple v1.2.40 h1:2c35h8cl5aYciAPw5UdO+J+Nl/rBTHILeOVnMFedbUw=
|
||||
@@ -240,14 +190,7 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
|
||||
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/nats-io/nats.go v1.34.1 h1:syWey5xaNHZgicYBemv0nohUPPmaLteiBEUT6Q5+F/4=
|
||||
github.com/nats-io/nats.go v1.34.1/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8=
|
||||
github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI=
|
||||
github.com/nats-io/nkeys v0.4.7/go.mod h1:kqXRgRDPlGy7nGaEDMuYzmiJCIAAWDK0IMBtDmGD0nc=
|
||||
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
|
||||
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
|
||||
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/nikolalohinski/gonja v1.5.3 h1:GsA+EEaZDZPGJ8JtpeGN78jidhOlxeJROpqMT9fTj9c=
|
||||
github.com/nikolalohinski/gonja v1.5.3/go.mod h1:RmjwxNiXAEqcq1HeK5SSMmqFJvKOfTfXhkJv6YBtPa4=
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
@@ -272,8 +215,8 @@ github.com/openai/openai-go/v3 v3.28.0 h1:2+FfrCVMdGXSQrBv1tLWtokm+BU7+3hJ/8rAHP
|
||||
github.com/openai/openai-go/v3 v3.28.0/go.mod h1:cdufnVK14cWcT9qA1rRtrXx4FTRsgbDPW7Ia7SS5cZo=
|
||||
github.com/panjf2000/ants/v2 v2.12.0 h1:u9JhESo83i/GkZnhfTNuFMMWcNt7mnV1bGJ6FT4wXH8=
|
||||
github.com/panjf2000/ants/v2 v2.12.0/go.mod h1:tSQuaNQ6r6NRhPt+IZVUevvDyFMTs+eS4ztZc52uJTY=
|
||||
github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0=
|
||||
github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
||||
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/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=
|
||||
@@ -281,30 +224,25 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/qdrant/go-client v1.17.1 h1:7QmPwDddrHL3hC4NfycwtQlraVKRLcRi++BX6TTm+3g=
|
||||
github.com/qdrant/go-client v1.17.1/go.mod h1:n1h6GhkdAzcohoXt/5Z19I2yxbCkMA6Jejob3S6NZT8=
|
||||
github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8=
|
||||
github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII=
|
||||
github.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SAw=
|
||||
github.com/quic-go/quic-go v0.59.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
|
||||
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
|
||||
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/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
||||
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
|
||||
github.com/rollbar/rollbar-go v1.0.2/go.mod h1:AcFs5f0I+c71bpHlXNNDbOWJiKwjFDtISeXco0L5PKQ=
|
||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQo=
|
||||
github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U=
|
||||
github.com/schollz/closestmatch v2.1.0+incompatible h1:Uel2GXEpJqOWBrlyI+oY9LTiyyjYS17cCYRqP13/SHk=
|
||||
github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g=
|
||||
github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=
|
||||
github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
|
||||
github.com/segmentio/encoding v0.5.4 h1:OW1VRern8Nw6ITAtwSZ7Idrl3MXCFwXHPgqESYfvNt0=
|
||||
github.com/segmentio/encoding v0.5.4/go.mod h1:HS1ZKa3kSN32ZHVZ7ZLPLXWvOVIiZtyJnO1gPH1sKt0=
|
||||
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
|
||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||
github.com/silenceper/wechat/v2 v2.1.12 h1:hoBeuL7Mgafz/ox6rn6r02rffFxHZhu7E0SlDRa+m28=
|
||||
github.com/silenceper/wechat/v2 v2.1.12/go.mod h1:7Iu3EhQYVtDUJAj+ZVRy8yom75ga7aDWv8RurLkVm0s=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w=
|
||||
github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g=
|
||||
@@ -332,13 +270,6 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/tdewolff/minify/v2 v2.20.19 h1:tX0SR0LUrIqGoLjXnkIzRSIbKJ7PaNnSENLD4CyH6Xo=
|
||||
github.com/tdewolff/minify/v2 v2.20.19/go.mod h1:ulkFoeAVWMLEyjuDz1ZIWOA31g5aWOawCFRp9R/MudM=
|
||||
github.com/tdewolff/parse/v2 v2.7.12 h1:tgavkHc2ZDEQVKy1oWxwIyh5bP4F5fEh/JmBwPP/3LQ=
|
||||
github.com/tdewolff/parse/v2 v2.7.12/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA=
|
||||
github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE=
|
||||
github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739 h1:IkjBCtQOOjIn03u/dMQK9g+Iw9ewps4mCl1nB8Sscbo=
|
||||
github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8=
|
||||
github.com/tidwall/gjson v1.14.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
|
||||
@@ -352,40 +283,23 @@ github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
|
||||
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
|
||||
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/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8=
|
||||
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
|
||||
github.com/ugorji/go/codec v1.3.1 h1:waO7eEiFDwidsBN6agj1vJQ4AG7lh2yqXyOXqhgQuyY=
|
||||
github.com/ugorji/go/codec v1.3.1/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw=
|
||||
github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg=
|
||||
github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE=
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
|
||||
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
|
||||
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
||||
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY=
|
||||
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI=
|
||||
github.com/yargevad/filepathx v1.0.0 h1:SYcT+N3tYGi+NvazubCNlvgIPbzAk7i7y2dwg3I5FYc=
|
||||
github.com/yargevad/filepathx v1.0.0/go.mod h1:BprfX/gpYNJHJfc35GjRRpVcwWXS89gGulUIU5tK3tA=
|
||||
github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
|
||||
github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4=
|
||||
github.com/yosssi/ace v0.0.5 h1:tUkIP/BLdKqrlrPwcmH0shwEEhTRHoGnc1wFIWmaBUA=
|
||||
github.com/yosssi/ace v0.0.5/go.mod h1:ALfIzm2vT7t5ZE7uoIZqF3TQ7SAOyupFZnkrF5id+K0=
|
||||
github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA=
|
||||
github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg=
|
||||
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M=
|
||||
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ=
|
||||
github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
|
||||
go.mongodb.org/mongo-driver/v2 v2.5.0 h1:yXUhImUjjAInNcpTcAlPHiT7bIXhshCTL3jVBkF3xaE=
|
||||
go.mongodb.org/mongo-driver/v2 v2.5.0/go.mod h1:yOI9kBsufol30iFsl1slpdq1I0eHPzybRWdyYUs8K/0=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
||||
go.opentelemetry.io/otel v1.42.0 h1:lSQGzTgVR3+sgJDAU/7/ZMjN9Z+vUip7leaqBKy4sho=
|
||||
@@ -398,10 +312,10 @@ go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6
|
||||
go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=
|
||||
go.opentelemetry.io/otel/trace v1.42.0 h1:OUCgIPt+mzOnaUTpOQcBiM/PLQ/Op7oq6g4LenLmOYY=
|
||||
go.opentelemetry.io/otel/trace v1.42.0/go.mod h1:f3K9S+IFqnumBkKhRJMeaZeNk9epyhnCmQh/EysQCdc=
|
||||
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
|
||||
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
|
||||
golang.org/x/arch v0.11.0 h1:KXV8WWKCXm6tRpLirl2szsO5j/oOODwZf4hATmGVNs4=
|
||||
golang.org/x/arch v0.11.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
|
||||
go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
|
||||
go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
|
||||
golang.org/x/arch v0.22.0 h1:c/Zle32i5ttqRXjdLyyHZESLD/bB90DCU1g9l/0YBDI=
|
||||
golang.org/x/arch v0.22.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/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-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
@@ -412,17 +326,14 @@ golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtC
|
||||
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8=
|
||||
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
|
||||
golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8=
|
||||
golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
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-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
|
||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo=
|
||||
golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y=
|
||||
@@ -431,7 +342,6 @@ golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
|
||||
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -441,7 +351,6 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -450,9 +359,10 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
|
||||
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||
@@ -462,7 +372,6 @@ golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8=
|
||||
golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA=
|
||||
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
|
||||
@@ -470,13 +379,11 @@ golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
|
||||
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.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
|
||||
golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k=
|
||||
golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
|
||||
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
|
||||
@@ -495,21 +402,17 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
|
||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/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/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
|
||||
gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0=
|
||||
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
||||
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/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=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
@@ -529,5 +432,3 @@ modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds=
|
||||
modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
|
||||
modernc.org/sqlite v1.23.1 h1:nrSBg4aRQQwq59JpvGEQ15tNxoO5pX/kUjcRNwSAGQM=
|
||||
modernc.org/sqlite v1.23.1/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk=
|
||||
moul.io/http2curl/v2 v2.3.0 h1:9r3JfDzWPcbIklMOs2TnIFzDYvfAZvjeavG6EzP7jYs=
|
||||
moul.io/http2curl/v2 v2.3.0/go.mod h1:RW4hyBjTWSYDOxapodpNEtX0g5Eb16sxklBqmd2RHcE=
|
||||
|
||||
+114
-94
@@ -3,6 +3,8 @@ package bootstrap
|
||||
import (
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -13,131 +15,149 @@ import (
|
||||
"cs-agent/internal/controllers/third"
|
||||
"cs-agent/internal/middleware"
|
||||
"cs-agent/internal/pkg/config"
|
||||
"cs-agent/internal/pkg/ginx"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"github.com/kataras/iris/v12/middleware/cors"
|
||||
"github.com/kataras/iris/v12/middleware/recover"
|
||||
"github.com/kataras/iris/v12/mvc"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
_ "cs-agent/internal/services/wx_callback_handlers"
|
||||
)
|
||||
|
||||
func NewServer() (*iris.Application, error) {
|
||||
func NewServer() (*gin.Engine, error) {
|
||||
cfg := config.Current()
|
||||
app := iris.New()
|
||||
corsHandler := cors.New().
|
||||
AllowOrigin("*").
|
||||
AllowHeaders("Origin", "Content-Type", "Accept", "Authorization", "X-Requested-With", "X-Guest-Id", "X-Channel-Id", "X-External-Id", "X-External-Name", "X-Customer-Session-Token", "X-Customer-Session-Expires-At").
|
||||
MaxAge(600).
|
||||
ExposeHeaders("Content-Length", "Content-Type", "Authorization", "X-Guest-Id", "X-Channel-Id", "X-External-Id", "X-External-Name", "X-Customer-Session-Token", "X-Customer-Session-Expires-At").
|
||||
Handler()
|
||||
app.UseRouter(func(ctx iris.Context) {
|
||||
// WebSocket upgrade is validated by the upgrader's origin policy.
|
||||
app := gin.New()
|
||||
app.Use(corsMiddleware())
|
||||
app.Use(gin.Recovery())
|
||||
app.Use(requestLogMiddleware())
|
||||
app.Use(maxBodySizeMiddleware(cfg.Storage.MaxRequestBodySizeBytes()))
|
||||
|
||||
addRouter(app)
|
||||
|
||||
app.StaticFS(cfg.Storage.Local.BaseURL, http.Dir(cfg.Storage.Local.Root))
|
||||
registerDashboardStatic(app, "web/out")
|
||||
|
||||
return app, nil
|
||||
}
|
||||
|
||||
func corsMiddleware() gin.HandlerFunc {
|
||||
allowHeaders := "Origin, Content-Type, Accept, Authorization, X-Requested-With, X-Guest-Id, X-Channel-Id, X-External-Id, X-External-Name, X-Customer-Session-Token, X-Customer-Session-Expires-At"
|
||||
exposeHeaders := "Content-Length, Content-Type, Authorization, X-Guest-Id, X-Channel-Id, X-External-Id, X-External-Name, X-Customer-Session-Token, X-Customer-Session-Expires-At"
|
||||
return func(ctx *gin.Context) {
|
||||
if isWebsocketUpgrade(ctx) {
|
||||
ctx.Next()
|
||||
return
|
||||
}
|
||||
corsHandler(ctx)
|
||||
})
|
||||
app.UseRouter(recover.New())
|
||||
app.UseRouter(func(ctx iris.Context) {
|
||||
ctx.Header("Access-Control-Allow-Origin", "*")
|
||||
ctx.Header("Access-Control-Allow-Headers", allowHeaders)
|
||||
ctx.Header("Access-Control-Expose-Headers", exposeHeaders)
|
||||
ctx.Header("Access-Control-Max-Age", "600")
|
||||
if ctx.Request.Method == http.MethodOptions {
|
||||
ctx.AbortWithStatus(http.StatusNoContent)
|
||||
return
|
||||
}
|
||||
ctx.Next()
|
||||
}
|
||||
}
|
||||
|
||||
func requestLogMiddleware() gin.HandlerFunc {
|
||||
return func(ctx *gin.Context) {
|
||||
start := time.Now()
|
||||
path := ctx.Path()
|
||||
method := ctx.Method()
|
||||
path := ctx.Request.URL.Path
|
||||
method := ctx.Request.Method
|
||||
ctx.Next()
|
||||
|
||||
slog.Info("http request",
|
||||
"method", method,
|
||||
"path", path,
|
||||
"status", ctx.GetStatusCode(),
|
||||
"status", ctx.Writer.Status(),
|
||||
"elapsed", time.Since(start).Milliseconds(),
|
||||
"clientIp", ctx.RemoteAddr(),
|
||||
"clientIp", ctx.ClientIP(),
|
||||
)
|
||||
})
|
||||
app.UseRouter(func(ctx iris.Context) {
|
||||
ctx.SetMaxRequestBodySize(cfg.Storage.MaxRequestBodySizeBytes())
|
||||
ctx.Next()
|
||||
})
|
||||
|
||||
// 注册路由
|
||||
addRouter(app)
|
||||
|
||||
// 注册本地存储静态资源服务
|
||||
app.HandleDir(cfg.Storage.Local.BaseURL, iris.Dir(cfg.Storage.Local.Root), iris.DirOptions{
|
||||
ShowList: false,
|
||||
})
|
||||
|
||||
// 注册dashboard静态资源服务
|
||||
app.HandleDir("/", iris.Dir("web/out"), iris.DirOptions{
|
||||
IndexName: "index.html",
|
||||
Compress: true,
|
||||
ShowList: false,
|
||||
})
|
||||
|
||||
return app, nil
|
||||
}
|
||||
}
|
||||
|
||||
func isWebsocketUpgrade(ctx iris.Context) bool {
|
||||
func maxBodySizeMiddleware(limit int64) gin.HandlerFunc {
|
||||
return func(ctx *gin.Context) {
|
||||
ctx.Request.Body = http.MaxBytesReader(ctx.Writer, ctx.Request.Body, limit)
|
||||
ctx.Next()
|
||||
}
|
||||
}
|
||||
|
||||
func isWebsocketUpgrade(ctx *gin.Context) bool {
|
||||
if !strings.EqualFold(ctx.GetHeader("Upgrade"), "websocket") {
|
||||
return false
|
||||
}
|
||||
return strings.Contains(strings.ToLower(ctx.GetHeader("Connection")), "upgrade")
|
||||
}
|
||||
|
||||
func addRouter(app *iris.Application) {
|
||||
mcpHandler := mcps.NewHTTPHandler()
|
||||
func addRouter(app *gin.Engine) {
|
||||
app.Any("/api/mcp", gin.WrapH(mcps.NewHTTPHandler()))
|
||||
|
||||
app.Any("/api/mcp", iris.FromStd(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
mcpHandler.ServeHTTP(w, r)
|
||||
})))
|
||||
apiGroup := app.Group("/api")
|
||||
ginx.HandleController(apiGroup, "/auth", new(api.AuthController))
|
||||
ginx.HandleController(apiGroup, "/channel", new(api.ChannelController))
|
||||
ginx.HandleController(apiGroup, "/customer", new(api.CustomerController))
|
||||
ginx.HandleController(apiGroup, "/conversation", new(api.ConversationController), middleware.ExternalUserMiddleware)
|
||||
ginx.HandleController(apiGroup, "/message", new(api.MessageController), middleware.ExternalUserMiddleware)
|
||||
|
||||
mvc.Configure(app.Party("/api"), func(m *mvc.Application) {
|
||||
m.Party("/auth").Handle(new(api.AuthController))
|
||||
m.Party("/channel").Handle(new(api.ChannelController))
|
||||
m.Party("/customer").Handle(new(api.CustomerController))
|
||||
m.Party("/conversation", middleware.ExternalUserMiddleware).Handle(new(api.ConversationController))
|
||||
m.Party("/message", middleware.ExternalUserMiddleware).Handle(new(api.MessageController))
|
||||
})
|
||||
wsGroup := app.Group("/api/ws")
|
||||
wsGroup.GET("/dashboard", middleware.AuthMiddleware, services.WsService.HandleDashboardWS)
|
||||
wsGroup.GET("/dashboard/notification", middleware.AuthMiddleware, services.WsService.HandleDashboardNotificationWS)
|
||||
wsGroup.GET("/open", services.WsService.HandleOpenWS)
|
||||
|
||||
mvc.Configure(app.Party("/api/ws"), func(m *mvc.Application) {
|
||||
m.Router.Get("/dashboard", middleware.AuthMiddleware, services.WsService.HandleDashboardWS)
|
||||
m.Router.Get("/dashboard/notification", middleware.AuthMiddleware, services.WsService.HandleDashboardNotificationWS)
|
||||
m.Router.Get("/open", services.WsService.HandleOpenWS)
|
||||
})
|
||||
dashboardGroup := app.Group("/api/dashboard", middleware.AuthMiddleware)
|
||||
ginx.HandleController(dashboardGroup, "/dashboard", new(dashboard.DashboardController))
|
||||
ginx.HandleController(dashboardGroup, "/user", new(dashboard.UserController))
|
||||
ginx.HandleController(dashboardGroup, "/company", new(dashboard.CompanyController))
|
||||
ginx.HandleController(dashboardGroup, "/customer", new(dashboard.CustomerController))
|
||||
ginx.HandleController(dashboardGroup, "/customer-contact", new(dashboard.CustomerContactController))
|
||||
ginx.HandleController(dashboardGroup, "/role", new(dashboard.RoleController))
|
||||
ginx.HandleController(dashboardGroup, "/permission", new(dashboard.PermissionController))
|
||||
ginx.HandleController(dashboardGroup, "/session", new(dashboard.SessionController))
|
||||
ginx.HandleController(dashboardGroup, "/tag", new(dashboard.TagController))
|
||||
ginx.HandleController(dashboardGroup, "/conversation", new(dashboard.ConversationController))
|
||||
ginx.HandleController(dashboardGroup, "/ticket", new(dashboard.TicketController))
|
||||
ginx.HandleController(dashboardGroup, "/notification", new(dashboard.NotificationController))
|
||||
ginx.HandleController(dashboardGroup, "/quick-reply", new(dashboard.QuickReplyController))
|
||||
ginx.HandleController(dashboardGroup, "/channel", new(dashboard.ChannelController))
|
||||
ginx.HandleController(dashboardGroup, "/agent", new(dashboard.AgentController))
|
||||
ginx.HandleController(dashboardGroup, "/agent-team", new(dashboard.AgentTeamController))
|
||||
ginx.HandleController(dashboardGroup, "/agent-team-schedule", new(dashboard.AgentTeamScheduleController))
|
||||
ginx.HandleController(dashboardGroup, "/ai-agent", new(dashboard.AIAgentController))
|
||||
ginx.HandleController(dashboardGroup, "/ai-config", new(dashboard.AIConfigController))
|
||||
ginx.HandleController(dashboardGroup, "/asset", new(dashboard.AssetController))
|
||||
ginx.HandleController(dashboardGroup, "/knowledge-base", new(dashboard.KnowledgeBaseController))
|
||||
ginx.HandleController(dashboardGroup, "/knowledge-document", new(dashboard.KnowledgeDocumentController))
|
||||
ginx.HandleController(dashboardGroup, "/knowledge-faq", new(dashboard.KnowledgeFAQController))
|
||||
ginx.HandleController(dashboardGroup, "/knowledge-retrieve", new(dashboard.KnowledgeRetrieveController))
|
||||
ginx.HandleController(dashboardGroup, "/knowledge-retrieve-log", new(dashboard.KnowledgeRetrieveLogController))
|
||||
ginx.HandleController(dashboardGroup, "/agent-run-log", new(dashboard.AgentRunLogController))
|
||||
ginx.HandleController(dashboardGroup, "/skill-definition", new(dashboard.SkillDefinitionController))
|
||||
ginx.HandleController(dashboardGroup, "/mcp", new(dashboard.MCPController))
|
||||
|
||||
mvc.Configure(app.Party("/api/dashboard", middleware.AuthMiddleware), func(m *mvc.Application) {
|
||||
m.Party("/dashboard").Handle(new(dashboard.DashboardController))
|
||||
m.Party("/user").Handle(new(dashboard.UserController))
|
||||
m.Party("/company").Handle(new(dashboard.CompanyController))
|
||||
m.Party("/customer").Handle(new(dashboard.CustomerController))
|
||||
m.Party("/customer-contact").Handle(new(dashboard.CustomerContactController))
|
||||
m.Party("/role").Handle(new(dashboard.RoleController))
|
||||
m.Party("/permission").Handle(new(dashboard.PermissionController))
|
||||
m.Party("/session").Handle(new(dashboard.SessionController))
|
||||
m.Party("/tag").Handle(new(dashboard.TagController))
|
||||
m.Party("/conversation").Handle(new(dashboard.ConversationController))
|
||||
m.Party("/ticket").Handle(new(dashboard.TicketController))
|
||||
m.Party("/notification").Handle(new(dashboard.NotificationController))
|
||||
m.Party("/quick-reply").Handle(new(dashboard.QuickReplyController))
|
||||
m.Party("/channel").Handle(new(dashboard.ChannelController))
|
||||
m.Party("/agent").Handle(new(dashboard.AgentController))
|
||||
m.Party("/agent-team").Handle(new(dashboard.AgentTeamController))
|
||||
m.Party("/agent-team-schedule").Handle(new(dashboard.AgentTeamScheduleController))
|
||||
m.Party("/ai-agent").Handle(new(dashboard.AIAgentController))
|
||||
m.Party("/ai-config").Handle(new(dashboard.AIConfigController))
|
||||
m.Party("/asset").Handle(new(dashboard.AssetController))
|
||||
m.Party("/knowledge-base").Handle(new(dashboard.KnowledgeBaseController))
|
||||
m.Party("/knowledge-document").Handle(new(dashboard.KnowledgeDocumentController))
|
||||
m.Party("/knowledge-faq").Handle(new(dashboard.KnowledgeFAQController))
|
||||
m.Party("/knowledge-retrieve").Handle(new(dashboard.KnowledgeRetrieveController))
|
||||
m.Party("/knowledge-retrieve-log").Handle(new(dashboard.KnowledgeRetrieveLogController))
|
||||
m.Party("/agent-run-log").Handle(new(dashboard.AgentRunLogController))
|
||||
m.Party("/skill-definition").Handle(new(dashboard.SkillDefinitionController))
|
||||
m.Party("/mcp").Handle(new(dashboard.MCPController))
|
||||
})
|
||||
thirdGroup := app.Group("/api/third")
|
||||
ginx.HandleController(thirdGroup, "/wechat", new(third.WechatController))
|
||||
}
|
||||
|
||||
mvc.Configure(app.Party("/api/third"), func(m *mvc.Application) {
|
||||
m.Party("/wechat").Handle(new(third.WechatController))
|
||||
func registerDashboardStatic(app *gin.Engine, root string) {
|
||||
app.NoRoute(func(ctx *gin.Context) {
|
||||
if strings.HasPrefix(ctx.Request.URL.Path, "/api/") {
|
||||
ctx.JSON(http.StatusNotFound, gin.H{"success": false, "message": "not found"})
|
||||
return
|
||||
}
|
||||
requestPath := filepath.Clean(strings.TrimPrefix(ctx.Request.URL.Path, "/"))
|
||||
if strings.HasPrefix(requestPath, "..") {
|
||||
ctx.Status(http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if requestPath == "." {
|
||||
requestPath = "index.html"
|
||||
}
|
||||
fullPath := filepath.Join(root, requestPath)
|
||||
if stat, err := os.Stat(fullPath); err == nil && !stat.IsDir() {
|
||||
ctx.File(fullPath)
|
||||
return
|
||||
}
|
||||
ctx.File(filepath.Join(root, "index.html"))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package bootstrap
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"cs-agent/internal/pkg/config"
|
||||
)
|
||||
|
||||
func TestNewServerRegistersGinRoutes(t *testing.T) {
|
||||
config.SetCurrent(&config.Config{
|
||||
Storage: config.StorageConfig{
|
||||
Local: config.LocalStorageConfig{
|
||||
Root: "storage",
|
||||
BaseURL: "/storage",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
app, err := NewServer()
|
||||
if err != nil {
|
||||
t.Fatalf("NewServer() error = %v", err)
|
||||
}
|
||||
|
||||
routes := make(map[string]bool)
|
||||
for _, route := range app.Routes() {
|
||||
routes[route.Method+" "+route.Path] = true
|
||||
}
|
||||
|
||||
expected := []string{
|
||||
http.MethodPost + " /api/auth/login",
|
||||
http.MethodGet + " /api/auth/profile",
|
||||
http.MethodGet + " /api/dashboard/user/list",
|
||||
http.MethodGet + " /api/dashboard/user/:id",
|
||||
http.MethodPost + " /api/dashboard/user/create",
|
||||
http.MethodPost + " /api/dashboard/conversation/send_message",
|
||||
http.MethodGet + " /api/ws/dashboard",
|
||||
http.MethodGet + " /api/ws/open",
|
||||
}
|
||||
for _, route := range expected {
|
||||
if !routes[route] {
|
||||
t.Fatalf("expected route %s to be registered", route)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,17 +3,18 @@ package api
|
||||
import (
|
||||
"cs-agent/internal/pkg/config"
|
||||
"cs-agent/internal/pkg/dto/request"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"cs-agent/internal/services"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type AuthController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *AuthController) PostLogin() *web.JsonResult {
|
||||
@@ -23,7 +24,7 @@ func (c *AuthController) PostLogin() *web.JsonResult {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
|
||||
ret, err := services.AuthService.Login(req, cfg.Auth, c.Ctx.RemoteAddr(), c.Ctx.GetHeader("User-Agent"))
|
||||
ret, err := services.AuthService.Login(req, cfg.Auth, c.Ctx.ClientIP(), c.Ctx.GetHeader("User-Agent"))
|
||||
if err != nil {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
@@ -31,37 +32,37 @@ func (c *AuthController) PostLogin() *web.JsonResult {
|
||||
}
|
||||
|
||||
func (c *AuthController) GetWxwork_login() {
|
||||
loginURL, err := services.WxWorkLoginService.BuildWxWorkLoginURL(c.Ctx.URLParam("next"))
|
||||
loginURL, err := services.WxWorkLoginService.BuildWxWorkLoginURL(c.Ctx.Query("next"))
|
||||
if err != nil {
|
||||
c.redirectWxWorkError(err.Error())
|
||||
return
|
||||
}
|
||||
c.Ctx.Redirect(loginURL, iris.StatusFound)
|
||||
c.Ctx.Redirect(http.StatusFound, loginURL)
|
||||
}
|
||||
|
||||
func (c *AuthController) GetWxwork_qr_login() {
|
||||
loginURL, err := services.WxWorkLoginService.BuildWxWorkQRCodeLoginURL(c.Ctx.URLParam("next"))
|
||||
loginURL, err := services.WxWorkLoginService.BuildWxWorkQRCodeLoginURL(c.Ctx.Query("next"))
|
||||
if err != nil {
|
||||
c.redirectWxWorkError(err.Error())
|
||||
return
|
||||
}
|
||||
c.Ctx.Redirect(loginURL, iris.StatusFound)
|
||||
c.Ctx.Redirect(http.StatusFound, loginURL)
|
||||
}
|
||||
|
||||
func (c *AuthController) GetWxwork_callback() {
|
||||
cfg := config.Current()
|
||||
ticket, next, err := services.WxWorkLoginService.LoginByWxWork(
|
||||
c.Ctx.URLParam("code"),
|
||||
c.Ctx.URLParam("state"),
|
||||
c.Ctx.Query("code"),
|
||||
c.Ctx.Query("state"),
|
||||
cfg.Auth,
|
||||
c.Ctx.RemoteAddr(),
|
||||
c.Ctx.ClientIP(),
|
||||
c.Ctx.GetHeader("User-Agent"),
|
||||
)
|
||||
if err != nil {
|
||||
c.redirectWxWorkError(err.Error())
|
||||
return
|
||||
}
|
||||
c.Ctx.Redirect("/dashboard/login/wxwork/callback?ticket="+url.QueryEscape(ticket)+"&next="+url.QueryEscape(next), iris.StatusFound)
|
||||
c.Ctx.Redirect(http.StatusFound, "/dashboard/login/wxwork/callback?ticket="+url.QueryEscape(ticket)+"&next="+url.QueryEscape(next))
|
||||
}
|
||||
|
||||
func (c *AuthController) PostWxwork_exchange() *web.JsonResult {
|
||||
@@ -95,5 +96,5 @@ func (c *AuthController) redirectWxWorkError(message string) {
|
||||
if idx := strings.Index(message, ": "); idx >= 0 {
|
||||
message = message[idx+2:]
|
||||
}
|
||||
c.Ctx.Redirect("/login?wxworkError="+url.QueryEscape(message), iris.StatusFound)
|
||||
c.Ctx.Redirect(http.StatusFound, "/login?wxworkError="+url.QueryEscape(message))
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ import (
|
||||
"cs-agent/internal/pkg/errorsx"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
)
|
||||
|
||||
type ChannelController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *ChannelController) AnyConfig() *web.JsonResult {
|
||||
|
||||
@@ -4,23 +4,23 @@ import (
|
||||
"cs-agent/internal/builders"
|
||||
"cs-agent/internal/pkg/dto/request"
|
||||
"cs-agent/internal/pkg/dto/response"
|
||||
"cs-agent/internal/pkg/irisx"
|
||||
"cs-agent/internal/pkg/httpx"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type ConversationController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *ConversationController) GetBy(id int64) *web.JsonResult {
|
||||
if services.ChannelService.GetEnabledChannel(c.Ctx) == nil {
|
||||
return web.JsonErrorMsg("接入渠道未初始化")
|
||||
}
|
||||
external := irisx.GetExternalUser(c.Ctx)
|
||||
external := httpx.GetExternalUser(c.Ctx)
|
||||
if external == nil {
|
||||
return web.JsonErrorMsg("外部身份未初始化")
|
||||
}
|
||||
@@ -45,7 +45,7 @@ func (c *ConversationController) PostCreate_or_match() *web.JsonResult {
|
||||
if channel == nil {
|
||||
return web.JsonErrorMsg("接入渠道未初始化")
|
||||
}
|
||||
external := irisx.GetExternalUser(c.Ctx)
|
||||
external := httpx.GetExternalUser(c.Ctx)
|
||||
if external == nil {
|
||||
return web.JsonErrorMsg("外部身份未初始化")
|
||||
}
|
||||
@@ -61,7 +61,7 @@ func (c *ConversationController) PostClose() *web.JsonResult {
|
||||
if services.ChannelService.GetEnabledChannel(c.Ctx) == nil {
|
||||
return web.JsonErrorMsg("接入渠道未初始化")
|
||||
}
|
||||
external := irisx.GetExternalUser(c.Ctx)
|
||||
external := httpx.GetExternalUser(c.Ctx)
|
||||
if external == nil {
|
||||
return web.JsonErrorMsg("外部身份未初始化")
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@ import (
|
||||
"cs-agent/internal/pkg/openidentity"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
)
|
||||
|
||||
type CustomerController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *CustomerController) PostSession_exchange() *web.JsonResult {
|
||||
|
||||
@@ -4,26 +4,26 @@ import (
|
||||
"cs-agent/internal/builders"
|
||||
"cs-agent/internal/pkg/dto/request"
|
||||
"cs-agent/internal/pkg/enums"
|
||||
"cs-agent/internal/pkg/irisx"
|
||||
"cs-agent/internal/pkg/httpx"
|
||||
"cs-agent/internal/services"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"github.com/spf13/cast"
|
||||
)
|
||||
|
||||
type MessageController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *MessageController) AnyList() *web.JsonResult {
|
||||
if services.ChannelService.GetEnabledChannel(c.Ctx) == nil {
|
||||
return web.JsonErrorMsg("接入渠道未初始化")
|
||||
}
|
||||
external := irisx.GetExternalUser(c.Ctx)
|
||||
external := httpx.GetExternalUser(c.Ctx)
|
||||
if external == nil {
|
||||
return web.JsonErrorMsg("外部身份未初始化")
|
||||
}
|
||||
@@ -57,7 +57,7 @@ func (c *MessageController) PostSend() *web.JsonResult {
|
||||
if services.ChannelService.GetEnabledChannel(c.Ctx) == nil {
|
||||
return web.JsonErrorMsg("接入渠道未初始化")
|
||||
}
|
||||
external := irisx.GetExternalUser(c.Ctx)
|
||||
external := httpx.GetExternalUser(c.Ctx)
|
||||
if external == nil {
|
||||
return web.JsonErrorMsg("外部身份未初始化")
|
||||
}
|
||||
@@ -78,7 +78,7 @@ func (c *MessageController) PostRead() *web.JsonResult {
|
||||
if services.ChannelService.GetEnabledChannel(c.Ctx) == nil {
|
||||
return web.JsonErrorMsg("接入渠道未初始化")
|
||||
}
|
||||
external := irisx.GetExternalUser(c.Ctx)
|
||||
external := httpx.GetExternalUser(c.Ctx)
|
||||
if external == nil {
|
||||
return web.JsonErrorMsg("外部身份未初始化")
|
||||
}
|
||||
@@ -97,12 +97,12 @@ func (c *MessageController) PostUpload_image() *web.JsonResult {
|
||||
if services.ChannelService.GetEnabledChannel(c.Ctx) == nil {
|
||||
return web.JsonErrorMsg("接入渠道未初始化")
|
||||
}
|
||||
external := irisx.GetExternalUser(c.Ctx)
|
||||
external := httpx.GetExternalUser(c.Ctx)
|
||||
if external == nil {
|
||||
return web.JsonErrorMsg("外部身份未初始化")
|
||||
}
|
||||
|
||||
rawConv := strings.TrimSpace(c.Ctx.FormValue("conversationId"))
|
||||
rawConv := strings.TrimSpace(params.FormValue(c.Ctx, "conversationId"))
|
||||
if rawConv == "" {
|
||||
return web.JsonErrorMsg("conversationId不能为空")
|
||||
}
|
||||
@@ -121,12 +121,10 @@ func (c *MessageController) PostUpload_image() *web.JsonResult {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
|
||||
f, header, err := c.Ctx.FormFile("file")
|
||||
header, err := c.Ctx.FormFile("file")
|
||||
if err != nil {
|
||||
return web.JsonErrorMsg("请选择上传图片")
|
||||
}
|
||||
_ = f.Close()
|
||||
|
||||
if !strings.HasPrefix(strings.ToLower(header.Header.Get("Content-Type")), "image/") {
|
||||
return web.JsonErrorMsg("仅支持上传图片文件")
|
||||
}
|
||||
@@ -142,12 +140,12 @@ func (c *MessageController) PostUpload_attachment() *web.JsonResult {
|
||||
if services.ChannelService.GetEnabledChannel(c.Ctx) == nil {
|
||||
return web.JsonErrorMsg("接入渠道未初始化")
|
||||
}
|
||||
external := irisx.GetExternalUser(c.Ctx)
|
||||
external := httpx.GetExternalUser(c.Ctx)
|
||||
if external == nil {
|
||||
return web.JsonErrorMsg("外部身份未初始化")
|
||||
}
|
||||
|
||||
rawConv := strings.TrimSpace(c.Ctx.FormValue("conversationId"))
|
||||
rawConv := strings.TrimSpace(params.FormValue(c.Ctx, "conversationId"))
|
||||
if rawConv == "" {
|
||||
return web.JsonErrorMsg("conversationId不能为空")
|
||||
}
|
||||
@@ -159,12 +157,10 @@ func (c *MessageController) PostUpload_attachment() *web.JsonResult {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
|
||||
f, header, err := c.Ctx.FormFile("file")
|
||||
header, err := c.Ctx.FormFile("file")
|
||||
if err != nil {
|
||||
return web.JsonErrorMsg("请选择上传附件")
|
||||
}
|
||||
_ = f.Close()
|
||||
|
||||
item, err := services.AssetService.UploadFile(header, "attachments", nil)
|
||||
if err != nil {
|
||||
return web.JsonError(err)
|
||||
|
||||
@@ -6,13 +6,13 @@ import (
|
||||
"cs-agent/internal/pkg/dto/request"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type AgentController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *AgentController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -6,13 +6,13 @@ import (
|
||||
"cs-agent/internal/pkg/dto/response"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type AgentRunLogController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *AgentRunLogController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"cs-agent/internal/pkg/enums"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type AgentTeamController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *AgentTeamController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -8,13 +8,13 @@ import (
|
||||
"cs-agent/internal/pkg/dto/response"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type AgentTeamScheduleController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *AgentTeamScheduleController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -13,14 +13,14 @@ import (
|
||||
"cs-agent/internal/pkg/utils"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type AIAgentController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *AIAgentController) AnyList() *web.JsonResult {
|
||||
@@ -114,7 +114,7 @@ func (c *AIAgentController) PostUpdate_sort() *web.JsonResult {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
var ids []int64
|
||||
if err := c.Ctx.ReadJSON(&ids); err != nil {
|
||||
if err := params.ReadJSON(c.Ctx, &ids); err != nil {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
if err := services.AIAgentService.UpdateSort(ids); err != nil {
|
||||
|
||||
@@ -7,13 +7,13 @@ import (
|
||||
"cs-agent/internal/pkg/enums"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type AIConfigController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *AIConfigController) AnyList() *web.JsonResult {
|
||||
@@ -133,7 +133,7 @@ func (c *AIConfigController) PostUpdate_sort() *web.JsonResult {
|
||||
}
|
||||
|
||||
var ids []int64
|
||||
if err := c.Ctx.ReadJSON(&ids); err != nil {
|
||||
if err := params.ReadJSON(c.Ctx, &ids); err != nil {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
if err := services.AIConfigService.UpdateSort(ids); err != nil {
|
||||
|
||||
@@ -9,13 +9,13 @@ import (
|
||||
"cs-agent/internal/services"
|
||||
"strings"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type AssetController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *AssetController) AnyList() *web.JsonResult {
|
||||
@@ -29,7 +29,7 @@ func (c *AssetController) AnyList() *web.JsonResult {
|
||||
params.QueryFilter{ParamName: "createUserId"},
|
||||
params.QueryFilter{ParamName: "filename", Op: params.Like},
|
||||
).Desc("id")
|
||||
if strings.TrimSpace(c.Ctx.URLParam("status")) == "" {
|
||||
if strings.TrimSpace(c.Ctx.Query("status")) == "" {
|
||||
cnd = cnd.Eq("status", enums.AssetStatusSuccess)
|
||||
}
|
||||
|
||||
@@ -62,12 +62,10 @@ func (c *AssetController) PostCreate() *web.JsonResult {
|
||||
if err := params.ReadForm(c.Ctx, &req); err != nil {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
f, header, err := c.Ctx.FormFile("file")
|
||||
header, err := c.Ctx.FormFile("file")
|
||||
if err != nil {
|
||||
return web.JsonErrorMsg("请选择上传文件")
|
||||
}
|
||||
_ = f.Close()
|
||||
|
||||
item, err := services.AssetService.UploadFile(header, req.Prefix, operator)
|
||||
if err != nil {
|
||||
return web.JsonError(err)
|
||||
|
||||
@@ -8,13 +8,13 @@ import (
|
||||
"cs-agent/internal/pkg/enums"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type ChannelController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *ChannelController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -7,13 +7,13 @@ import (
|
||||
"cs-agent/internal/pkg/enums"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type CompanyController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *CompanyController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -10,15 +10,15 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/common/strs"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"github.com/spf13/cast"
|
||||
)
|
||||
|
||||
type ConversationController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *ConversationController) AnyList() *web.JsonResult {
|
||||
@@ -272,7 +272,7 @@ func (c *ConversationController) PostUpload_image() *web.JsonResult {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
|
||||
rawConv := strings.TrimSpace(c.Ctx.FormValue("conversationId"))
|
||||
rawConv := strings.TrimSpace(params.FormValue(c.Ctx, "conversationId"))
|
||||
if rawConv == "" {
|
||||
return web.JsonErrorMsg("conversationId不能为空")
|
||||
}
|
||||
@@ -284,12 +284,10 @@ func (c *ConversationController) PostUpload_image() *web.JsonResult {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
|
||||
f, header, err := c.Ctx.FormFile("file")
|
||||
header, err := c.Ctx.FormFile("file")
|
||||
if err != nil {
|
||||
return web.JsonErrorMsg("请选择上传图片")
|
||||
}
|
||||
_ = f.Close()
|
||||
|
||||
if !strings.HasPrefix(strings.ToLower(header.Header.Get("Content-Type")), "image/") {
|
||||
return web.JsonErrorMsg("仅支持上传图片文件")
|
||||
}
|
||||
@@ -307,7 +305,7 @@ func (c *ConversationController) PostUpload_attachment() *web.JsonResult {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
|
||||
rawConv := strings.TrimSpace(c.Ctx.FormValue("conversationId"))
|
||||
rawConv := strings.TrimSpace(params.FormValue(c.Ctx, "conversationId"))
|
||||
if rawConv == "" {
|
||||
return web.JsonErrorMsg("conversationId不能为空")
|
||||
}
|
||||
@@ -319,12 +317,10 @@ func (c *ConversationController) PostUpload_attachment() *web.JsonResult {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
|
||||
f, header, err := c.Ctx.FormFile("file")
|
||||
header, err := c.Ctx.FormFile("file")
|
||||
if err != nil {
|
||||
return web.JsonErrorMsg("请选择上传附件")
|
||||
}
|
||||
_ = f.Close()
|
||||
|
||||
item, err := services.AssetService.UploadFile(header, "attachments", operator)
|
||||
if err != nil {
|
||||
return web.JsonError(err)
|
||||
|
||||
@@ -6,13 +6,13 @@ import (
|
||||
"cs-agent/internal/pkg/dto/request"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type CustomerContactController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
// AnyList GET/POST /customer-contact/list?customerId=
|
||||
|
||||
@@ -8,13 +8,13 @@ import (
|
||||
"cs-agent/internal/pkg/enums"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type CustomerController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *CustomerController) PostList() *web.JsonResult {
|
||||
|
||||
@@ -3,13 +3,13 @@ package dashboard
|
||||
import (
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type DashboardController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *DashboardController) GetOverview() *web.JsonResult {
|
||||
|
||||
@@ -12,14 +12,14 @@ import (
|
||||
"cs-agent/internal/repositories"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type KnowledgeBaseController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *KnowledgeBaseController) AnyList() *web.JsonResult {
|
||||
@@ -127,7 +127,7 @@ func (c *KnowledgeBaseController) PostDelete() *web.JsonResult {
|
||||
|
||||
func (c *KnowledgeBaseController) PostUpdate_sort() *web.JsonResult {
|
||||
var ids []int64
|
||||
if err := c.Ctx.ReadJSON(&ids); err != nil {
|
||||
if err := params.ReadJSON(c.Ctx, &ids); err != nil {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
if err := services.KnowledgeBaseService.UpdateSort(ids); err != nil {
|
||||
|
||||
@@ -8,13 +8,13 @@ import (
|
||||
"cs-agent/internal/pkg/enums"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type KnowledgeDocumentController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *KnowledgeDocumentController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -7,13 +7,13 @@ import (
|
||||
"cs-agent/internal/pkg/dto/response"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type KnowledgeFAQController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *KnowledgeFAQController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -8,13 +8,13 @@ import (
|
||||
"cs-agent/internal/pkg/dto/request"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type KnowledgeRetrieveController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *KnowledgeRetrieveController) PostDebugSearch() *web.JsonResult {
|
||||
|
||||
@@ -6,13 +6,13 @@ import (
|
||||
"cs-agent/internal/pkg/dto/response"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type KnowledgeRetrieveLogController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *KnowledgeRetrieveLogController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -8,13 +8,13 @@ import (
|
||||
"cs-agent/internal/pkg/dto/response"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type MCPController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *MCPController) AnyList_servers() *web.JsonResult {
|
||||
|
||||
@@ -10,13 +10,13 @@ import (
|
||||
"cs-agent/internal/pkg/enums"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type NotificationController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *NotificationController) AnyList() *web.JsonResult {
|
||||
@@ -31,7 +31,7 @@ func (c *NotificationController) AnyList() *web.JsonResult {
|
||||
Eq("status", enums.StatusOk).
|
||||
Desc("id")
|
||||
|
||||
switch strings.TrimSpace(c.Ctx.URLParam("readStatus")) {
|
||||
switch strings.TrimSpace(c.Ctx.Query("readStatus")) {
|
||||
case "unread":
|
||||
cnd.Where("read_at IS NULL")
|
||||
case "read":
|
||||
|
||||
@@ -5,14 +5,14 @@ import (
|
||||
"cs-agent/internal/pkg/dto/response"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/common/strs"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type PermissionController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *PermissionController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -7,14 +7,14 @@ import (
|
||||
"cs-agent/internal/pkg/enums"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type QuickReplyController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *QuickReplyController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -6,14 +6,14 @@ import (
|
||||
"cs-agent/internal/pkg/dto/response"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type RoleController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *RoleController) AnyList() *web.JsonResult {
|
||||
@@ -177,7 +177,7 @@ func (c *RoleController) PostAssign_permission() *web.JsonResult {
|
||||
|
||||
func (c *RoleController) PostUpdate_sort() *web.JsonResult {
|
||||
var ids []int64
|
||||
if err := c.Ctx.ReadJSON(&ids); err != nil {
|
||||
if err := params.ReadJSON(c.Ctx, &ids); err != nil {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
if err := services.RoleService.UpdateSort(ids); err != nil {
|
||||
|
||||
@@ -8,13 +8,13 @@ import (
|
||||
"cs-agent/internal/services"
|
||||
"time"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type SessionController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *SessionController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -12,13 +12,13 @@ import (
|
||||
"cs-agent/internal/pkg/enums"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type SkillDefinitionController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *SkillDefinitionController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -6,13 +6,13 @@ import (
|
||||
"cs-agent/internal/pkg/dto/request"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type TagController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *TagController) AnyList() *web.JsonResult {
|
||||
@@ -101,7 +101,7 @@ func (c *TagController) PostDelete() *web.JsonResult {
|
||||
|
||||
func (c *TagController) PostUpdate_sort() *web.JsonResult {
|
||||
var ids []int64
|
||||
if err := c.Ctx.ReadJSON(&ids); err != nil {
|
||||
if err := params.ReadJSON(c.Ctx, &ids); err != nil {
|
||||
return web.JsonError(err)
|
||||
}
|
||||
if err := services.TagService.UpdateSort(ids); err != nil {
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"cs-agent/internal/pkg/dto/request"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type TicketController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *TicketController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -8,13 +8,13 @@ import (
|
||||
"cs-agent/internal/pkg/enums"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
type UserController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
func (c *UserController) AnyList() *web.JsonResult {
|
||||
|
||||
@@ -1,35 +1,37 @@
|
||||
package third
|
||||
|
||||
import (
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"cs-agent/internal/wxwork"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/silenceper/wechat/v2/work/kf"
|
||||
)
|
||||
|
||||
type WechatController struct {
|
||||
Ctx iris.Context
|
||||
Ctx *gin.Context
|
||||
}
|
||||
|
||||
// GetCallback GET请求用于校验回调是否配置正确
|
||||
func (c *WechatController) GetCallback() {
|
||||
cli, err := wxwork.GetWorkCli().GetKF()
|
||||
if err != nil {
|
||||
c.Ctx.StopWithError(http.StatusInternalServerError, err)
|
||||
c.Ctx.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
options := kf.SignatureOptions{}
|
||||
if err := c.Ctx.ReadForm(&options); err != nil {
|
||||
c.Ctx.StopWithError(http.StatusUnauthorized, err)
|
||||
if err := params.ReadForm(c.Ctx, &options); err != nil {
|
||||
c.Ctx.AbortWithError(http.StatusUnauthorized, err)
|
||||
return
|
||||
}
|
||||
// 调用VerifyURL方法校验当前请求,如果合法则把解密后的内容作为响应返回给微信服务器
|
||||
echo, err := cli.VerifyURL(options)
|
||||
if err == nil {
|
||||
c.Ctx.WriteString(echo)
|
||||
c.Ctx.String(http.StatusOK, echo)
|
||||
} else {
|
||||
c.Ctx.StopWithError(http.StatusUnauthorized, err)
|
||||
c.Ctx.AbortWithError(http.StatusUnauthorized, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +39,7 @@ func (c *WechatController) GetCallback() {
|
||||
func (c *WechatController) PostCallback() {
|
||||
cli, err := wxwork.GetWorkCli().GetKF()
|
||||
if err != nil {
|
||||
c.Ctx.StopWithError(http.StatusInternalServerError, err)
|
||||
c.Ctx.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
var (
|
||||
@@ -45,22 +47,22 @@ func (c *WechatController) PostCallback() {
|
||||
body []byte
|
||||
)
|
||||
// 读取原始消息内容
|
||||
body, err = c.Ctx.GetBody()
|
||||
body, err = io.ReadAll(c.Ctx.Request.Body)
|
||||
if err != nil {
|
||||
c.Ctx.StopWithError(http.StatusInternalServerError, err)
|
||||
c.Ctx.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
// 解析原始数据
|
||||
message, err = cli.GetCallbackMessage(body)
|
||||
if err != nil {
|
||||
c.Ctx.StopWithError(http.StatusInternalServerError, err)
|
||||
c.Ctx.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
if err := wxwork.ConsumeCallback(message); err != nil {
|
||||
c.Ctx.StopWithError(http.StatusInternalServerError, err)
|
||||
c.Ctx.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
c.Ctx.WriteString("ok")
|
||||
c.Ctx.String(http.StatusOK, "ok")
|
||||
}
|
||||
|
||||
@@ -3,21 +3,21 @@ package middleware
|
||||
import (
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
)
|
||||
|
||||
func AuthMiddleware(ctx iris.Context) {
|
||||
func AuthMiddleware(ctx *gin.Context) {
|
||||
if !authenticateRequest(ctx) {
|
||||
return
|
||||
}
|
||||
ctx.Next()
|
||||
}
|
||||
|
||||
func authenticateRequest(ctx iris.Context) bool {
|
||||
func authenticateRequest(ctx *gin.Context) bool {
|
||||
if _, err := services.AuthService.Authenticate(ctx); err != nil {
|
||||
_ = ctx.JSON(web.JsonError(err))
|
||||
ctx.StopExecution()
|
||||
ctx.JSON(200, web.JsonError(err))
|
||||
ctx.Abort()
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"cs-agent/internal/pkg/irisx"
|
||||
"cs-agent/internal/pkg/httpx"
|
||||
"cs-agent/internal/services"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
)
|
||||
|
||||
func ExternalUserMiddleware(ctx iris.Context) {
|
||||
func ExternalUserMiddleware(ctx *gin.Context) {
|
||||
channel := services.ChannelService.GetEnabledChannel(ctx)
|
||||
if channel == nil {
|
||||
ctx.StopExecution()
|
||||
_ = ctx.JSON(web.JsonErrorMsg("接入渠道异常"))
|
||||
ctx.JSON(200, web.JsonErrorMsg("接入渠道异常"))
|
||||
ctx.Abort()
|
||||
return
|
||||
}
|
||||
result, err := services.CustomerSessionService.VerifyRequest(ctx, channel)
|
||||
if err != nil {
|
||||
ctx.StopExecution()
|
||||
_ = ctx.JSON(web.JsonError(err))
|
||||
ctx.JSON(200, web.JsonError(err))
|
||||
ctx.Abort()
|
||||
return
|
||||
}
|
||||
services.CustomerSessionService.SetRefreshHeaders(ctx, result)
|
||||
irisx.SetExternalUser(ctx, result.ExternalUser)
|
||||
httpx.SetExternalUser(ctx, result.ExternalUser)
|
||||
ctx.Next()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
package ginx
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
)
|
||||
|
||||
var jsonResultType = reflect.TypeOf((*web.JsonResult)(nil))
|
||||
|
||||
func HandleController(group *gin.RouterGroup, relativePath string, prototype any, handlers ...gin.HandlerFunc) {
|
||||
router := group.Group(relativePath, handlers...)
|
||||
t := reflect.TypeOf(prototype)
|
||||
if t.Kind() != reflect.Ptr || t.Elem().Kind() != reflect.Struct {
|
||||
panic("ginx.HandleController requires a pointer to a controller struct")
|
||||
}
|
||||
for i := 0; i < t.NumMethod(); i++ {
|
||||
method := t.Method(i)
|
||||
httpMethods, path, ok := parseAction(method)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
handler := buildHandler(t, method)
|
||||
for _, httpMethod := range httpMethods {
|
||||
router.Handle(httpMethod, path, handler)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func parseAction(method reflect.Method) ([]string, string, bool) {
|
||||
prefixes := []struct {
|
||||
name string
|
||||
methods []string
|
||||
}{
|
||||
{"Any", []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete, http.MethodPatch, http.MethodOptions}},
|
||||
{"Get", []string{http.MethodGet}},
|
||||
{"Post", []string{http.MethodPost}},
|
||||
{"Put", []string{http.MethodPut}},
|
||||
{"Delete", []string{http.MethodDelete}},
|
||||
}
|
||||
for _, prefix := range prefixes {
|
||||
if !strings.HasPrefix(method.Name, prefix.name) {
|
||||
continue
|
||||
}
|
||||
suffix := strings.TrimPrefix(method.Name, prefix.name)
|
||||
return prefix.methods, actionPath(suffix, method.Type.NumIn()-1), true
|
||||
}
|
||||
return nil, "", false
|
||||
}
|
||||
|
||||
func actionPath(suffix string, argCount int) string {
|
||||
if suffix == "" {
|
||||
return "/"
|
||||
}
|
||||
if suffix == "By" && argCount == 1 {
|
||||
return "/:id"
|
||||
}
|
||||
if strings.HasSuffix(suffix, "By") && argCount == 1 {
|
||||
base := strings.TrimSuffix(suffix, "By")
|
||||
return "/" + actionSegmentPath(base) + "/:id"
|
||||
}
|
||||
return "/" + actionSegmentPath(suffix)
|
||||
}
|
||||
|
||||
func actionSegmentPath(s string) string {
|
||||
if s == "" {
|
||||
return ""
|
||||
}
|
||||
parts := strings.Split(s, "_")
|
||||
for i, part := range parts {
|
||||
parts[i] = camelToPath(part)
|
||||
}
|
||||
return strings.Join(parts, "_")
|
||||
}
|
||||
|
||||
func camelToPath(s string) string {
|
||||
var b strings.Builder
|
||||
for i, r := range s {
|
||||
if unicode.IsUpper(r) {
|
||||
if i > 0 {
|
||||
b.WriteByte('/')
|
||||
}
|
||||
r = unicode.ToLower(r)
|
||||
}
|
||||
b.WriteRune(r)
|
||||
}
|
||||
return b.String()
|
||||
}
|
||||
|
||||
func buildHandler(controllerType reflect.Type, method reflect.Method) gin.HandlerFunc {
|
||||
return func(ctx *gin.Context) {
|
||||
controller := reflect.New(controllerType.Elem())
|
||||
if field := controller.Elem().FieldByName("Ctx"); field.IsValid() && field.CanSet() {
|
||||
field.Set(reflect.ValueOf(ctx))
|
||||
}
|
||||
|
||||
args := []reflect.Value{controller}
|
||||
for i := 1; i < method.Type.NumIn(); i++ {
|
||||
argType := method.Type.In(i)
|
||||
raw := ctx.Param("id")
|
||||
value, ok := convertPathArg(raw, argType)
|
||||
if !ok {
|
||||
ctx.JSON(http.StatusBadRequest, web.JsonErrorMsg("路径参数错误"))
|
||||
return
|
||||
}
|
||||
args = append(args, value)
|
||||
}
|
||||
|
||||
results := method.Func.Call(args)
|
||||
if len(results) == 0 || results[0].IsNil() {
|
||||
return
|
||||
}
|
||||
if result, ok := results[0].Interface().(*web.JsonResult); ok {
|
||||
ctx.JSON(http.StatusOK, result)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func convertPathArg(raw string, t reflect.Type) (reflect.Value, bool) {
|
||||
switch t.Kind() {
|
||||
case reflect.Int64:
|
||||
v, err := strconv.ParseInt(raw, 10, 64)
|
||||
if err != nil {
|
||||
return reflect.Value{}, false
|
||||
}
|
||||
return reflect.ValueOf(v), true
|
||||
case reflect.String:
|
||||
return reflect.ValueOf(raw), true
|
||||
default:
|
||||
return reflect.Zero(t), false
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,28 @@
|
||||
package irisx
|
||||
package httpx
|
||||
|
||||
import (
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"cs-agent/internal/pkg/openidentity"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/common/strs"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
const (
|
||||
ctxKeyExternalUser = "externalUser"
|
||||
)
|
||||
|
||||
func SetExternalUser(ctx iris.Context, ext *openidentity.ExternalUser) {
|
||||
ctx.Values().Set(ctxKeyExternalUser, ext)
|
||||
func SetExternalUser(ctx *gin.Context, ext *openidentity.ExternalUser) {
|
||||
ctx.Set(ctxKeyExternalUser, ext)
|
||||
}
|
||||
|
||||
func GetExternalUser(ctx iris.Context) *openidentity.ExternalUser {
|
||||
v := ctx.Values().Get(ctxKeyExternalUser)
|
||||
func GetExternalUser(ctx *gin.Context) *openidentity.ExternalUser {
|
||||
v, _ := ctx.Get(ctxKeyExternalUser)
|
||||
ext, _ := v.(*openidentity.ExternalUser)
|
||||
return ext
|
||||
}
|
||||
|
||||
func GetChannelID(ctx iris.Context) string {
|
||||
func GetChannelID(ctx *gin.Context) string {
|
||||
if channelID := ctx.GetHeader("X-Channel-ID"); strs.IsNotBlank(channelID) {
|
||||
return channelID
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
package params
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-playground/validator/v10"
|
||||
"github.com/gorilla/schema"
|
||||
"github.com/mlogclub/simple/common/dates"
|
||||
"github.com/mlogclub/simple/common/jsons"
|
||||
"github.com/mlogclub/simple/common/strs"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/spf13/cast"
|
||||
)
|
||||
|
||||
var (
|
||||
decoder = schema.NewDecoder()
|
||||
validate = validator.New()
|
||||
)
|
||||
|
||||
func init() {
|
||||
decoder.SetAliasTag("form")
|
||||
decoder.ZeroEmpty(true)
|
||||
decoder.IgnoreUnknownKeys(true)
|
||||
}
|
||||
|
||||
func paramError(name string) error {
|
||||
return fmt.Errorf("unable to find param value '%s'", name)
|
||||
}
|
||||
|
||||
func ReadForm(ctx *gin.Context, obj any) error {
|
||||
if ctx == nil {
|
||||
return errors.New("request context is nil")
|
||||
}
|
||||
if err := ctx.Request.ParseForm(); err != nil {
|
||||
return err
|
||||
}
|
||||
values := ctx.Request.Form
|
||||
if len(values) == 0 {
|
||||
if err := ctx.Request.ParseMultipartForm(32 << 20); err != nil && !errors.Is(err, http.ErrNotMultipart) {
|
||||
return err
|
||||
}
|
||||
values = ctx.Request.Form
|
||||
}
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
if err := decoder.Decode(obj, values); err != nil {
|
||||
return err
|
||||
}
|
||||
return validate.Struct(obj)
|
||||
}
|
||||
|
||||
func ReadJSON(ctx *gin.Context, obj any) error {
|
||||
if ctx == nil {
|
||||
return errors.New("request context is nil")
|
||||
}
|
||||
if err := ctx.ShouldBindJSON(obj); err != nil {
|
||||
return err
|
||||
}
|
||||
return validate.Struct(obj)
|
||||
}
|
||||
|
||||
func Get(ctx *gin.Context, name string) (string, bool) {
|
||||
str := FormValue(ctx, name)
|
||||
return str, str != ""
|
||||
}
|
||||
|
||||
func GetInt64(ctx *gin.Context, name string) (int64, bool) {
|
||||
str, ok := Get(ctx, name)
|
||||
if !ok {
|
||||
return 0, false
|
||||
}
|
||||
value, err := cast.ToInt64E(str)
|
||||
if err != nil {
|
||||
return 0, false
|
||||
}
|
||||
return value, true
|
||||
}
|
||||
|
||||
func GetInt(ctx *gin.Context, name string) (int, bool) {
|
||||
str, ok := Get(ctx, name)
|
||||
if !ok {
|
||||
return 0, false
|
||||
}
|
||||
value, err := cast.ToIntE(str)
|
||||
if err != nil {
|
||||
return 0, false
|
||||
}
|
||||
return value, true
|
||||
}
|
||||
|
||||
func GetBool(ctx *gin.Context, name string) (bool, bool) {
|
||||
str, ok := Get(ctx, name)
|
||||
if !ok {
|
||||
return false, false
|
||||
}
|
||||
value, err := cast.ToBoolE(str)
|
||||
if err != nil {
|
||||
return false, false
|
||||
}
|
||||
return value, true
|
||||
}
|
||||
|
||||
func GetTime(ctx *gin.Context, name string) *time.Time {
|
||||
value, _ := Get(ctx, name)
|
||||
if strs.IsBlank(value) {
|
||||
return nil
|
||||
}
|
||||
layouts := []string{dates.FmtDateTime, dates.FmtDate, dates.FmtDateTimeNoSeconds}
|
||||
for _, layout := range layouts {
|
||||
if ret, err := dates.Parse(value, layout); err == nil {
|
||||
return &ret
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetInt64Arr(ctx *gin.Context, name string) []int64 {
|
||||
str, ok := Get(ctx, name)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
str = strings.TrimSpace(str)
|
||||
if strings.HasPrefix(str, "[") && strings.HasSuffix(str, "]") {
|
||||
var ret []int64
|
||||
if err := jsons.Parse(str, &ret); err != nil {
|
||||
slog.Error(err.Error())
|
||||
}
|
||||
return ret
|
||||
}
|
||||
return StrSplitToInt64Arr(str)
|
||||
}
|
||||
|
||||
func StrSplitToInt64Arr(str string) (ret []int64) {
|
||||
if strs.IsBlank(str) {
|
||||
return ret
|
||||
}
|
||||
for _, s := range strings.Split(str, ",") {
|
||||
i, err := cast.ToInt64E(strings.TrimSpace(s))
|
||||
if err == nil {
|
||||
ret = append(ret, i)
|
||||
}
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func FormValue(ctx *gin.Context, name string) string {
|
||||
if ctx == nil {
|
||||
return ""
|
||||
}
|
||||
if value := ctx.PostForm(name); value != "" {
|
||||
return value
|
||||
}
|
||||
return ctx.Query(name)
|
||||
}
|
||||
|
||||
func FormValueRequired(ctx *gin.Context, name string) (string, error) {
|
||||
str := FormValue(ctx, name)
|
||||
if len(str) == 0 {
|
||||
return "", errors.New("参数:" + name + "不能为空")
|
||||
}
|
||||
return str, nil
|
||||
}
|
||||
|
||||
func FormValueDefault(ctx *gin.Context, name, def string) string {
|
||||
if value := FormValue(ctx, name); value != "" {
|
||||
return value
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
||||
func FormValueInt(ctx *gin.Context, name string) (int, error) {
|
||||
str := FormValue(ctx, name)
|
||||
if str == "" {
|
||||
return 0, paramError(name)
|
||||
}
|
||||
return strconv.Atoi(str)
|
||||
}
|
||||
|
||||
func FormValueIntDefault(ctx *gin.Context, name string, def int) int {
|
||||
if v, err := FormValueInt(ctx, name); err == nil {
|
||||
return v
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
||||
func FormValueInt64(ctx *gin.Context, name string) (int64, error) {
|
||||
str := FormValue(ctx, name)
|
||||
if str == "" {
|
||||
return 0, paramError(name)
|
||||
}
|
||||
return strconv.ParseInt(str, 10, 64)
|
||||
}
|
||||
|
||||
func FormValueInt64Default(ctx *gin.Context, name string, def int64) int64 {
|
||||
if v, err := FormValueInt64(ctx, name); err == nil {
|
||||
return v
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
||||
func FormValueInt64Array(ctx *gin.Context, name string) []int64 {
|
||||
str := strings.TrimSpace(FormValue(ctx, name))
|
||||
if strings.HasPrefix(str, "[") && strings.HasSuffix(str, "]") {
|
||||
var ret []int64
|
||||
if err := jsons.Parse(str, &ret); err != nil {
|
||||
slog.Error(err.Error())
|
||||
}
|
||||
return ret
|
||||
}
|
||||
return StrSplitToInt64Arr(str)
|
||||
}
|
||||
|
||||
func FormValueStringArray(ctx *gin.Context, name string) []string {
|
||||
str := FormValue(ctx, name)
|
||||
if len(str) == 0 {
|
||||
return nil
|
||||
}
|
||||
var ret []string
|
||||
for _, s := range strings.Split(str, ",") {
|
||||
s = strings.TrimSpace(s)
|
||||
if len(s) > 0 {
|
||||
ret = append(ret, s)
|
||||
}
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func FormValueBool(ctx *gin.Context, name string) (bool, error) {
|
||||
str := FormValue(ctx, name)
|
||||
if str == "" {
|
||||
return false, paramError(name)
|
||||
}
|
||||
return strconv.ParseBool(str)
|
||||
}
|
||||
|
||||
func FormValueBoolDefault(ctx *gin.Context, name string, def bool) bool {
|
||||
str := FormValue(ctx, name)
|
||||
if str == "" {
|
||||
return def
|
||||
}
|
||||
value, err := strconv.ParseBool(str)
|
||||
if err != nil {
|
||||
return def
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
func FormDate(ctx *gin.Context, name string) *time.Time {
|
||||
return GetTime(ctx, name)
|
||||
}
|
||||
|
||||
func GetPaging(ctx *gin.Context) *sqls.Paging {
|
||||
page := FormValueIntDefault(ctx, "page", 1)
|
||||
limit := FormValueIntDefault(ctx, "limit", 20)
|
||||
if page <= 0 {
|
||||
page = 1
|
||||
}
|
||||
if limit <= 0 {
|
||||
limit = 20
|
||||
}
|
||||
return &sqls.Paging{Page: page, Limit: limit}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package params
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/common/strs"
|
||||
"github.com/mlogclub/simple/common/strs/strcase"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
)
|
||||
|
||||
type QueryOp string
|
||||
|
||||
const (
|
||||
Eq QueryOp = "eq"
|
||||
Gt QueryOp = "gt"
|
||||
Lt QueryOp = "lt"
|
||||
Gte QueryOp = "gte"
|
||||
Lte QueryOp = "lte"
|
||||
Like QueryOp = "like"
|
||||
In QueryOp = "in"
|
||||
Starting QueryOp = "starting"
|
||||
Ending QueryOp = "ending"
|
||||
)
|
||||
|
||||
type QueryFilter struct {
|
||||
ParamName string
|
||||
Op QueryOp
|
||||
ColumnName string
|
||||
ValueWrapper func(origin string) string
|
||||
}
|
||||
|
||||
func NewPagedSqlCnd(ctx *gin.Context, filters ...QueryFilter) *sqls.Cnd {
|
||||
cnd := NewSqlCnd(ctx, filters...)
|
||||
p := GetPaging(ctx)
|
||||
cnd.Page(p.Page, p.Limit)
|
||||
return cnd
|
||||
}
|
||||
|
||||
func NewSqlCnd(ctx *gin.Context, filters ...QueryFilter) *sqls.Cnd {
|
||||
cnd := sqls.NewCnd()
|
||||
for _, filter := range filters {
|
||||
columnName := filter.ColumnName
|
||||
paramValue := FormValue(ctx, filter.ParamName)
|
||||
if strs.IsBlank(string(filter.Op)) {
|
||||
filter.Op = Eq
|
||||
}
|
||||
if filter.ValueWrapper != nil {
|
||||
paramValue = filter.ValueWrapper(paramValue)
|
||||
}
|
||||
if strs.IsBlank(paramValue) {
|
||||
continue
|
||||
}
|
||||
if strs.IsBlank(columnName) {
|
||||
columnName = strcase.ToSnake(filter.ParamName)
|
||||
}
|
||||
switch filter.Op {
|
||||
case Eq:
|
||||
cnd.Eq(columnName, paramValue)
|
||||
case Gt:
|
||||
cnd.Gt(columnName, paramValue)
|
||||
case Lt:
|
||||
cnd.Lt(columnName, paramValue)
|
||||
case Gte:
|
||||
cnd.Gte(columnName, paramValue)
|
||||
case Lte:
|
||||
cnd.Lte(columnName, paramValue)
|
||||
case Like:
|
||||
cnd.Like(columnName, paramValue)
|
||||
case Starting:
|
||||
cnd.Starting(columnName, paramValue)
|
||||
case Ending:
|
||||
cnd.Ending(columnName, paramValue)
|
||||
case In:
|
||||
cnd.In(columnName, strings.Split(paramValue, ","))
|
||||
}
|
||||
}
|
||||
return cnd
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package params
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/common/strs/strcase"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
)
|
||||
|
||||
type QueryParams struct {
|
||||
Ctx *gin.Context
|
||||
sqls.Cnd
|
||||
}
|
||||
|
||||
func NewQueryParams(ctx *gin.Context) *QueryParams {
|
||||
return &QueryParams{Ctx: ctx}
|
||||
}
|
||||
|
||||
func (q *QueryParams) getValueByColumn(column string) string {
|
||||
if q.Ctx == nil {
|
||||
return ""
|
||||
}
|
||||
return FormValue(q.Ctx, strcase.ToLowerCamel(column))
|
||||
}
|
||||
|
||||
func (q *QueryParams) EqByReq(column string) *QueryParams {
|
||||
if value := q.getValueByColumn(column); len(value) > 0 {
|
||||
q.Eq(column, value)
|
||||
}
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *QueryParams) NotEqByReq(column string) *QueryParams {
|
||||
if value := q.getValueByColumn(column); len(value) > 0 {
|
||||
q.NotEq(column, value)
|
||||
}
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *QueryParams) GtByReq(column string) *QueryParams {
|
||||
if value := q.getValueByColumn(column); len(value) > 0 {
|
||||
q.Gt(column, value)
|
||||
}
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *QueryParams) GteByReq(column string) *QueryParams {
|
||||
if value := q.getValueByColumn(column); len(value) > 0 {
|
||||
q.Gte(column, value)
|
||||
}
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *QueryParams) LtByReq(column string) *QueryParams {
|
||||
if value := q.getValueByColumn(column); len(value) > 0 {
|
||||
q.Lt(column, value)
|
||||
}
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *QueryParams) LteByReq(column string) *QueryParams {
|
||||
if value := q.getValueByColumn(column); len(value) > 0 {
|
||||
q.Lte(column, value)
|
||||
}
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *QueryParams) LikeByReq(column string) *QueryParams {
|
||||
if value := q.getValueByColumn(column); len(value) > 0 {
|
||||
q.Like(column, value)
|
||||
}
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *QueryParams) PageByReq() *QueryParams {
|
||||
if q.Ctx == nil {
|
||||
return q
|
||||
}
|
||||
paging := GetPaging(q.Ctx)
|
||||
q.Page(paging.Page, paging.Limit)
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *QueryParams) Asc(column string) *QueryParams {
|
||||
q.Orders = append(q.Orders, sqls.OrderByCol{Column: column, Asc: true})
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *QueryParams) Desc(column string) *QueryParams {
|
||||
q.Orders = append(q.Orders, sqls.OrderByCol{Column: column, Asc: false})
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *QueryParams) Limit(limit int) *QueryParams {
|
||||
q.Page(1, limit)
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *QueryParams) Page(page, limit int) *QueryParams {
|
||||
if q.Paging == nil {
|
||||
q.Paging = &sqls.Paging{Page: page, Limit: limit}
|
||||
} else {
|
||||
q.Paging.Page = page
|
||||
q.Paging.Limit = limit
|
||||
}
|
||||
return q
|
||||
}
|
||||
@@ -7,10 +7,10 @@ import (
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/kataras/iris/v12"
|
||||
"github.com/mlogclub/simple/common/strs"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
// ExternalUser 外部访客身份(IM 客户),与站内 AuthPrincipal 区分。
|
||||
@@ -26,7 +26,7 @@ type UserTokenClaims struct {
|
||||
jwt.RegisteredClaims
|
||||
}
|
||||
|
||||
func GetExternalUser(ctx iris.Context, secret string) (*ExternalUser, error) {
|
||||
func GetExternalUser(ctx *gin.Context, secret string) (*ExternalUser, error) {
|
||||
if userToken := getUserToken(ctx); strs.IsNotBlank(userToken) {
|
||||
claims, err := verifyUserToken(userToken, secret)
|
||||
if err != nil {
|
||||
@@ -83,7 +83,7 @@ func verifyUserToken(userToken, secret string) (*UserTokenClaims, error) {
|
||||
return claims, nil
|
||||
}
|
||||
|
||||
func getUserToken(ctx iris.Context) string {
|
||||
func getUserToken(ctx *gin.Context) string {
|
||||
auth := strings.TrimSpace(ctx.GetHeader("Authorization"))
|
||||
if len(auth) > 7 && strings.EqualFold(auth[:7], "Bearer ") {
|
||||
if token := strings.TrimSpace(auth[7:]); token != "" {
|
||||
@@ -94,7 +94,7 @@ func getUserToken(ctx iris.Context) string {
|
||||
return strings.TrimSpace(userToken)
|
||||
}
|
||||
|
||||
func getGuestUser(ctx iris.Context) (*ExternalUser, error) {
|
||||
func getGuestUser(ctx *gin.Context) (*ExternalUser, error) {
|
||||
externalID := getExternalID(ctx)
|
||||
if strs.IsBlank(externalID) {
|
||||
return nil, errorsx.Unauthorized("用户标识不能为空")
|
||||
@@ -106,7 +106,7 @@ func getGuestUser(ctx iris.Context) (*ExternalUser, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func getExternalID(ctx iris.Context) string {
|
||||
func getExternalID(ctx *gin.Context) string {
|
||||
externalID := ctx.GetHeader("X-External-Id")
|
||||
if strs.IsBlank(externalID) {
|
||||
externalID, _ = params.Get(ctx, "externalId")
|
||||
@@ -114,7 +114,7 @@ func getExternalID(ctx iris.Context) string {
|
||||
return externalID
|
||||
}
|
||||
|
||||
func getExternalName(ctx iris.Context) string {
|
||||
func getExternalName(ctx *gin.Context) string {
|
||||
externalName := ctx.GetHeader("X-External-Name")
|
||||
if strs.IsBlank(externalName) {
|
||||
externalName, _ = params.Get(ctx, "externalName")
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"cs-agent/internal/pkg/enums"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/mlogclub/simple/common/strs"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/mlogclub/simple/common/strs"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"cs-agent/internal/models"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
var AgentProfileService = newAgentProfileService()
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"cs-agent/internal/repositories"
|
||||
"strings"
|
||||
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
var AgentRunLogService = newAgentRunLogService()
|
||||
|
||||
@@ -14,8 +14,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
var AgentTeamService = newAgentTeamService()
|
||||
|
||||
@@ -15,8 +15,8 @@ import (
|
||||
"cs-agent/internal/pkg/utils"
|
||||
"cs-agent/internal/repositories"
|
||||
|
||||
"cs-agent/internal/pkg/httpx/params"
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
"github.com/mlogclub/simple/web/params"
|
||||
)
|
||||
|
||||
var AIAgentService = newAIAgentService()
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user