fix: core模块完成用户/用户角色/角色 相关编码

main
NoahLan 1 year ago
parent b1ab275c72
commit 4e070c8156

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,172 @@
[
{
"code": "110000",
"name": "北京市",
"province": "11"
},
{
"code": "120000",
"name": "天津市",
"province": "12"
},
{
"code": "130000",
"name": "河北省",
"province": "13"
},
{
"code": "140000",
"name": "山西省",
"province": "14"
},
{
"code": "150000",
"name": "内蒙古自治区",
"province": "15"
},
{
"code": "210000",
"name": "辽宁省",
"province": "21"
},
{
"code": "220000",
"name": "吉林省",
"province": "22"
},
{
"code": "230000",
"name": "黑龙江省",
"province": "23"
},
{
"code": "310000",
"name": "上海市",
"province": "31"
},
{
"code": "320000",
"name": "江苏省",
"province": "32"
},
{
"code": "330000",
"name": "浙江省",
"province": "33"
},
{
"code": "340000",
"name": "安徽省",
"province": "34"
},
{
"code": "350000",
"name": "福建省",
"province": "35"
},
{
"code": "360000",
"name": "江西省",
"province": "36"
},
{
"code": "370000",
"name": "山东省",
"province": "37"
},
{
"code": "410000",
"name": "河南省",
"province": "41"
},
{
"code": "420000",
"name": "湖北省",
"province": "42"
},
{
"code": "430000",
"name": "湖南省",
"province": "43"
},
{
"code": "440000",
"name": "广东省",
"province": "44"
},
{
"code": "450000",
"name": "广西壮族自治区",
"province": "45"
},
{
"code": "460000",
"name": "海南省",
"province": "46"
},
{
"code": "500000",
"name": "重庆市",
"province": "50"
},
{
"code": "510000",
"name": "四川省",
"province": "51"
},
{
"code": "520000",
"name": "贵州省",
"province": "52"
},
{
"code": "530000",
"name": "云南省",
"province": "53"
},
{
"code": "540000",
"name": "西藏自治区",
"province": "54"
},
{
"code": "610000",
"name": "陕西省",
"province": "61"
},
{
"code": "620000",
"name": "甘肃省",
"province": "62"
},
{
"code": "630000",
"name": "青海省",
"province": "63"
},
{
"code": "640000",
"name": "宁夏回族自治区",
"province": "64"
},
{
"code": "650000",
"name": "新疆维吾尔自治区",
"province": "65"
},
{
"code": "710000",
"name": "台湾省",
"province": "71"
},
{
"code": "810000",
"name": "香港特别行政区",
"province": "81"
},
{
"code": "820000",
"name": "澳门特别行政区",
"province": "82"
}
]

File diff suppressed because it is too large Load Diff

@ -0,0 +1,42 @@
package errx
import (
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
)
// Common
const (
WrongCode code.Code = iota + 1000 // 验证码错误
WrongCaptcha // 验证码错误
WrongPassword // 密码错误
UserNotFound // 用户不存在
NeedPhoneOrEmail // 请输入正确的手机号或邮箱
UnsupportedLoginType // 暂未支持此类型登录方式
)
// User register
const (
UsernameAlreadyExists code.Code = iota + 1100 // 用户名已注册
PasswordInvalidArgument // 密码格式错误
UserPhoneNumberAlreadyExists // 手机号码已被绑定
UserExists // 用户已存在
UserNicknameAlreadyExists // 用户昵称已存在
UserEmailAlreadyExists // 此邮箱已被注册
)
func init() {
msg.Add(WrongCode, "auth.wrongCode")
msg.Add(WrongCaptcha, "auth.wrongCaptcha")
msg.Add(WrongPassword, "auth.wrongPassword")
msg.Add(UserNotFound, "auth.userNotFound")
msg.Add(NeedPhoneOrEmail, "auth.needPhoneOrEmail")
msg.Add(UnsupportedLoginType, "auth.unsupportedLoginType")
msg.Add(UsernameAlreadyExists, "register.user.usernameExists")
msg.Add(PasswordInvalidArgument, "register.user.passwordInvalid")
msg.Add(UserPhoneNumberAlreadyExists, "register.user.phoneNumberExists")
msg.Add(UserExists, "register.user.exists")
msg.Add(UserNicknameAlreadyExists, "register.user.nicknameExists")
msg.Add(UserEmailAlreadyExists, "register.user.emailExists")
}

@ -0,0 +1,16 @@
package errx
import (
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
)
const (
RoleCodeNotEmpty code.Code = iota + 3000
RoleCodeInUsed
)
func init() {
msg.Add(RoleCodeNotEmpty, "role.codeNotEmpty")
msg.Add(RoleCodeInUsed, "role.codeInUsed")
}

@ -0,0 +1,14 @@
package errx
import (
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
)
const (
UpdateUserMetaErr code.Code = iota + 2000
)
func init() {
msg.Add(UpdateUserMetaErr, "user.updateMetaErr")
}

@ -19,5 +19,29 @@
"init": {
"alreadyInit": "已初始化,请勿重复进行此操作",
"initializeIsRunning": "正在初始化,请稍等"
},
"auth": {
"wrongCode": "验证码错误",
"wrongCaptcha": "验证码错误",
"wrongPassword": "密码错误",
"userNotFound": "用户不存在",
"needPhoneOrEmail": "请输入正确的手机号码或邮箱"
},
"register": {
"user": {
"usernameExists": "用户名已被注册",
"passwordInvalid": "密码格式错误",
"phoneNumberExists": "手机号码已被绑定",
"exists": "用户已存在",
"nicknameExists": "昵称已被使用",
"emailExists": "该邮箱已被使用"
}
},
"user": {
"updateMetaErr": "更新Metadata错误"
},
"role": {
"codeNotEmpty": "角色代码不能为空",
"codeInUsed": "角色代码已被使用"
}
}

@ -4,22 +4,111 @@ go 1.20
require (
entgo.io/ent v0.12.3
git.noahlan.cn/noahlan/ntool v1.1.7
git.noahlan.cn/noahlan/ntool-biz v1.2.2
git.noahlan.cn/noahlan/ntool v1.1.10
git.noahlan.cn/noahlan/ntool-biz v1.2.4
github.com/jinzhu/copier v0.4.0
github.com/zeromicro/go-zero v1.5.4
google.golang.org/grpc v1.56.2
google.golang.org/protobuf v1.31.0
)
require (
ariga.io/atlas v0.12.0 // indirect
ariga.io/entcache v0.1.0 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-redis/redis/v8 v8.11.5 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/gofrs/uuid/v5 v5.0.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gookit/color v1.5.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect
github.com/hashicorp/hcl/v2 v2.17.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/hashstructure v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nicksnyder/go-i18n/v2 v2.2.1 // indirect
github.com/openzipkin/zipkin-go v0.4.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/radovskyb/watcher v1.0.7 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/zclconf/go-cty v1.13.2 // indirect
go.etcd.io/etcd/api/v3 v3.5.9 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect
go.etcd.io/etcd/client/v3 v3.5.9 // indirect
go.opentelemetry.io/otel v1.14.0 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.14.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 // indirect
go.opentelemetry.io/otel/exporters/zipkin v1.14.0 // indirect
go.opentelemetry.io/otel/sdk v1.14.0 // indirect
go.opentelemetry.io/otel/trace v1.14.0 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/automaxprocs v1.5.2 // indirect
go.uber.org/multierr v1.9.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.26.3 // indirect
k8s.io/apimachinery v0.27.0-alpha.3 // indirect
k8s.io/client-go v0.26.3 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230307230338-69ee2d25a840 // indirect
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

644
go.sum

@ -1,73 +1,705 @@
ariga.io/atlas v0.12.0 h1:jDfjxT3ppKhzqLS26lZv9ni7p9TVNrhy7SQquaF7bPs=
ariga.io/atlas v0.12.0/go.mod h1:+TR129FJZ5Lvzms6dvCeGWh1yR6hMvmXBhug4hrNIGk=
ariga.io/entcache v0.1.0 h1:nfJXzjB5CEvAK6SmjupHREMJrKLakeqU5tG3s4TO6JA=
ariga.io/entcache v0.1.0/go.mod h1:3Z1Sql5bcqPA1YV/jvMlZyh9T+ntSFOclaASAm1TiKQ=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
entgo.io/ent v0.12.3 h1:N5lO2EOrHpCH5HYfiMOCHYbo+oh5M8GjT0/cx5x6xkk=
entgo.io/ent v0.12.3/go.mod h1:AigGGx+tbrBBYHAzGOg8ND661E5cxx1Uiu5o/otJ6Yg=
git.noahlan.cn/noahlan/ntool v1.1.7 h1:UwR4zb0lgWqMdOQ4xsbhXAIaq2JjUmXV/uNHVhv9FiI=
git.noahlan.cn/noahlan/ntool v1.1.7/go.mod h1:pzoXErnQDLaHhvEHOGDoINf5VP1MDiU8NAcnaMEhxa4=
git.noahlan.cn/noahlan/ntool-biz v1.2.2 h1:salfS1/mFOi9tmNkCKrhjFYzXpok1ld+edQzs5ITDGo=
git.noahlan.cn/noahlan/ntool-biz v1.2.2/go.mod h1:aND1S4nxgIkqCKvkEDlZ91Eb38t+5jsIfEhXZTNlIL0=
git.noahlan.cn/noahlan/ntool v1.1.10 h1:78ntTd71v+25ejEAxHHb0NrZCIwLISo9aLoZIbB3Cj8=
git.noahlan.cn/noahlan/ntool v1.1.10/go.mod h1:pzoXErnQDLaHhvEHOGDoINf5VP1MDiU8NAcnaMEhxa4=
git.noahlan.cn/noahlan/ntool-biz v1.2.4 h1:rYIg1sgKO/3gDMqqZN+IS1x1OPEoxvV0P/QfaH8OPKs=
git.noahlan.cn/noahlan/ntool-biz v1.2.4/go.mod h1:aND1S4nxgIkqCKvkEDlZ91Eb38t+5jsIfEhXZTNlIL0=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo=
github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk=
github.com/alicebob/miniredis/v2 v2.30.4 h1:8S4/o1/KoUArAGbGwPxcwf0krlzceva2XVOSchFS7Eo=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4=
github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE=
github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8=
github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
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-redis/redismock/v8 v8.0.6 h1:rtuijPgGynsRB2Y7KDACm09WvjHWS4RaG44Nm7rcj4Y=
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M=
github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54=
github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/gookit/color v1.5.3 h1:twfIhZs4QLCtimkP7MOxlF3A0U/5cDPseRT9M/+2SCE=
github.com/gookit/color v1.5.3/go.mod h1:NUzwzeehUfl7GIb36pqId+UGmRfQcU/WiiyTTeNjHtE=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0=
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hcl/v2 v2.17.0 h1:z1XvSUyXd1HP10U4lrLg5e0JMVz6CPaJvAgxM0KNZVY=
github.com/hashicorp/hcl/v2 v2.17.0/go.mod h1:gJyW2PTShkJqQBKpAmPO3yxMxIuoXkOF2TpqXzrQyx4=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=
github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
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/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
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.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
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-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
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/mitchellh/hashstructure v1.1.0 h1:P6P1hdjqAAknpY/M1CGipelZgp+4y9ja9kmUZPXP+H0=
github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/6d8ulp4AwfLKrmA=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/nicksnyder/go-i18n/v2 v2.2.1 h1:aOzRCdwsJuoExfZhoiXHy4bjruwCMdt5otbYojM/PaA=
github.com/nicksnyder/go-i18n/v2 v2.2.1/go.mod h1:fF2++lPHlo+/kPaj3nB0uxtPwzlPm+BlgwGX7MkeGj0=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo/v2 v2.7.0 h1:/XxtEV3I3Eif/HobnVx9YmJgk8ENdRsuUmM+fLCFNow=
github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q=
github.com/openzipkin/zipkin-go v0.4.1 h1:kNd/ST2yLLWhaWrkgchya40TJabe8Hioj9udfPcEO5A=
github.com/openzipkin/zipkin-go v0.4.1/go.mod h1:qY0VqDSN1pOBN94dBc6w2GJlWLiovAyg7Qt6/I9HecM=
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/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM=
github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
github.com/radovskyb/watcher v1.0.7 h1:AYePLih6dpmS32vlHfhCeli8127LzkIgwJGcwwe8tUE=
github.com/radovskyb/watcher v1.0.7/go.mod h1:78okwvY5wPdzcb1UYnip1pvrZNIVEIh/Cm+ZuvsUYIg=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE=
github.com/zclconf/go-cty v1.13.2 h1:4GvrUxe/QUDYuJKAav4EYqdM47/kZa672LwmXFmEKT0=
github.com/zclconf/go-cty v1.13.2/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0=
github.com/zeromicro/go-zero v1.5.4 h1:kRvcYuxcHOkUZvg7887KQl77Qv4klGL7MqGkTBgkpS8=
github.com/zeromicro/go-zero v1.5.4/go.mod h1:x/aUyLmSwRECvOyjOf+lhwThBOilJIY+s3slmPAeboA=
go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs=
go.etcd.io/etcd/api/v3 v3.5.9/go.mod h1:uyAal843mC8uUVSLWz6eHa/d971iDGnCRpmKd2Z+X8k=
go.etcd.io/etcd/client/pkg/v3 v3.5.9 h1:oidDC4+YEuSIQbsR94rY9gur91UPL6DnxDCIYd2IGsE=
go.etcd.io/etcd/client/pkg/v3 v3.5.9/go.mod h1:y+CzeSmkMpWN2Jyu1npecjB9BBnABxGM4pN8cGuJeL4=
go.etcd.io/etcd/client/v3 v3.5.9 h1:r5xghnU7CwbUxD/fbUtRyJGaYNfDun8sp/gTr1hew6E=
go.etcd.io/etcd/client/v3 v3.5.9/go.mod h1:i/Eo5LrZ5IKqpbtpPDuaUnDOUv471oDg8cjQaUr2MbA=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
go.opentelemetry.io/otel/exporters/jaeger v1.14.0 h1:CjbUNd4iN2hHmWekmOqZ+zSCU+dzZppG8XsV+A3oc8Q=
go.opentelemetry.io/otel/exporters/jaeger v1.14.0/go.mod h1:4Ay9kk5vELRrbg5z4cpP9EtmQRFap2Wb0woPG4lujZA=
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 h1:/fXHZHGvro6MVqV34fJzDhi7sHGpX3Ej/Qjmfn003ho=
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0/go.mod h1:UFG7EBMRdXyFstOwH028U0sVf+AvukSGhF0g8+dmNG8=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 h1:TKf2uAs2ueguzLaxOCBXNpHxfO/aC7PAdDsSH0IbeRQ=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0/go.mod h1:HrbCVv40OOLTABmOn1ZWty6CHXkU8DK/Urc43tHug70=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 h1:ap+y8RXX3Mu9apKVtOkM6WSFESLM8K3wNQyOU8sWHcc=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0/go.mod h1:5w41DY6S9gZrbjuq6Y+753e96WfPha5IcsOSZTtullM=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0 h1:3jAYbRHQAqzLjd9I4tzxwJ8Pk/N6AqBcF6m1ZHrxG94=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0/go.mod h1:+N7zNjIJv4K+DeX67XXET0P+eIciESgaFDBqh+ZJFS4=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 h1:sEL90JjOO/4yhquXl5zTAkLLsZ5+MycAgX99SDsxGc8=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0/go.mod h1:oCslUcizYdpKYyS9e8srZEqM6BB8fq41VJBjLAE6z1w=
go.opentelemetry.io/otel/exporters/zipkin v1.14.0 h1:reEVE1upBF9tcujgvSqLJS0SrI7JQPaTKP4s4rymnSs=
go.opentelemetry.io/otel/exporters/zipkin v1.14.0/go.mod h1:RcjvOAcvhzcufQP8aHmzRw1gE9g/VEZufDdo2w+s4sk=
go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw=
go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME=
go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561 h1:MDc5xs78ZrZr3HMQugiXOAkSZtfTpbJLDr/lwfgO53E=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU=
golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g=
golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c=
golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg=
golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM=
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/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI=
google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/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.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU=
k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE=
k8s.io/apimachinery v0.27.0-alpha.3 h1:uujqsdFrbqF+cEbqFHrkLKp+s3XxRgphTpc6Yg84qLo=
k8s.io/apimachinery v0.27.0-alpha.3/go.mod h1:TO4higCGNMwebVSdb1XPJdXMU4kk+nmMY/cTMVCGa6M=
k8s.io/client-go v0.26.3 h1:k1UY+KXfkxV2ScEL3gilKcF7761xkYsSD6BC9szIu8s=
k8s.io/client-go v0.26.3/go.mod h1:ZPNu9lm8/dbRIPAgteN30RSXea6vrCpFvq+MateTUuQ=
k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw=
k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/kube-openapi v0.0.0-20230307230338-69ee2d25a840 h1:1Q4XWtrQQh04ZweCpL7aMNYafFMoPEiST4dl5b4PmYw=
k8s.io/kube-openapi v0.0.0-20230307230338-69ee2d25a840/go.mod h1:y5VtZWM9sHHc2ZodIH/6SHzXj+TPU5USoA8lcIeKEKY=
k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY=
k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=

@ -3,6 +3,8 @@ package main
import (
"flag"
"fmt"
"git.noahlan.cn/noahlan/ntool-biz/core/i18n"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/config"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/server"
@ -16,7 +18,7 @@ import (
"google.golang.org/grpc/reflection"
)
var configFile = flag.String("f", "etc/core.yaml", "the config file")
var configFile = flag.String("f", "rpc/core/etc/core.yaml", "the config file")
func main() {
flag.Parse()
@ -32,6 +34,14 @@ func main() {
reflection.Register(grpcServer)
}
})
// 添加服务端拦截器包括nstatus与i18n处理功能
s.AddUnaryInterceptors(nstatus.UnaryServerInterceptor(), i18n.UnaryServerInterceptor())
// 设置grpc 消息容量 50mb
s.AddOptions(
grpc.MaxRecvMsgSize(1024*1024*50),
grpc.MaxSendMsgSize(1024*1024*50),
)
defer s.Stop()
fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)

@ -27,49 +27,77 @@ enum DistrictQueryType {
Parents = 3;
}
message GetDistrictNameResp {
string code = 1;
message DepartmentReq {
int64 ID = 1;
string name = 2;
repeated string name_list = 3;
int64 leader_id = 3;
int64 parent_id = 4;
bool with_leader = 5;
bool with_user = 6;
bool with_children = 7;
optional Pagination page = 10;
}
message LoginRecordInfo {
message DepartmentListResp {
optional Pagination page = 1;
repeated DepartmentInfo data = 2;
}
message DictionaryReq {
int64 ID = 1;
string created_at = 3;
string updated_at = 4;
int64 user_id = 5;
string last_login_at = 6;
string last_login_ipv4 = 7;
string last_login_device = 8;
string last_login_ua = 9;
uint64 login_count = 10;
string name = 2;
string title = 3;
bool with_details = 4;
optional Pagination page = 10;
}
message TokenListResp {
message DictionaryDetailReq {
optional Pagination page = 1;
repeated TokenInfo data = 2;
int64 ID = 2;
int64 dict_id = 3;
string title = 4;
string key = 5;
string value = 6;
bool with_dictionary = 7;
}
message UserSocialInfo {
message TokenInfo {
int64 ID = 1;
string created_at = 2;
string updated_at = 3;
int64 user_id = 4;
string provider = 5;
string status = 2;
string created_at = 3;
string updated_at = 4;
int64 user_id = 5;
string access_token = 6;
string refresh_token = 7;
string uid = 8;
string open_id = 9;
string union_id = 10;
string key = 11;
uint64 expires_in = 12;
string user_profile = 13;
UserInfo user = 14;
string source = 8;
int64 expired_at = 9;
UserInfo user = 10;
}
message DepartmentListResp {
message OauthProviderInfo {
int64 ID = 1;
string created_at = 2;
string updated_at = 3;
string name = 4;
string client_id = 5;
string client_secret = 6;
string redirect_url = 7;
string scopes = 8;
string auth_url = 9;
string token_url = 10;
string info_url = 11;
string description = 12;
bool system = 13;
bool init = 14;
}
message RoleListResp {
optional Pagination page = 1;
repeated DepartmentInfo data = 2;
repeated RoleInfo data = 2;
}
message IDReq {
int64 ID = 1;
}
// DistrictInfo
@ -90,37 +118,43 @@ message DistrictInfo {
repeated DistrictInfo children = 20;
}
message DistrictListResp {
optional Pagination page = 1;
repeated DistrictInfo data = 2;
message DistrictTree {
repeated DistrictInfo tree = 1;
}
message TokenInfo {
message DistrictCodeReq {
string code = 1;
}
message GetDistrictNameReq {
string code = 1;
string separator = 2;
}
message LoginRecordInfo {
int64 ID = 1;
string status = 2;
string created_at = 3;
string updated_at = 4;
int64 user_id = 5;
string access_token = 6;
string refresh_token = 7;
string source = 8;
int64 expired_at = 9;
UserInfo user = 10;
string last_login_at = 6;
string last_login_ipv4 = 7;
string last_login_device = 8;
string last_login_ua = 9;
uint64 login_count = 10;
}
message DepartmentInfo {
int64 ID = 1;
string status = 2;
string created_at = 3;
string updated_at = 4;
string name = 5;
string leader_id = 6;
string remark = 7;
int64 parent_id = 8;
DepartmentInfo parent = 10;
repeated DepartmentInfo children = 11;
repeated UserInfo users = 12;
UserInfo leader = 13;
message UserRoleReq {
int64 user_id = 1;
repeated int64 role_ids = 2;
repeated string role_codes = 3;
}
// Base message
message Empty {}
message DictionaryDetailListResp {
optional Pagination page = 1;
repeated DictionaryDetailInfo data = 2;
}
message DistrictReq {
@ -136,48 +170,52 @@ message DistrictReq {
DistrictQueryType query_type = 11;
}
message OauthProviderListResp {
message OauthLoginReq {
string state = 1;
string provider = 2;
}
message GetUserRolesReq {
optional Pagination page = 1;
repeated OauthProviderInfo data = 2;
int64 user_id = 2;
}
message UserInfo {
//
message Pagination {
uint64 size = 1;
uint64 total = 2;
uint64 current = 3;
}
message DictionaryInfo {
int64 ID = 1;
string status = 2;
string created_at = 3;
string updated_at = 4;
string username = 5;
optional string phone_number = 6;
optional string email = 7;
string password = 8;
optional string nickname = 9;
map<string,string> metas = 10;
repeated RoleInfo roles = 20;
repeated UserSocialInfo socials = 21;
repeated DepartmentInfo departments = 22;
repeated TokenInfo tokens = 23;
LoginRecordInfo login_record = 24;
string title = 5;
string name = 6;
string description = 7;
repeated DictionaryDetailInfo details = 10;
}
message UserReq {
int64 ID = 1;
string username = 2;
string phone_number = 3;
string email = 4;
string nickname = 5;
bool with_role = 6;
bool with_social = 7;
bool with_department = 8;
bool with_token = 9;
bool with_login_record = 10;
optional Pagination page = 20;
message OauthProviderListResp {
optional Pagination page = 1;
repeated OauthProviderInfo data = 2;
}
// Base message
message Empty {}
message TokenUserReq {
int64 user_id = 1;
}
message OauthRedirectResp {
string url = 1;
message UserSocialListResp {
optional Pagination page = 1;
repeated UserSocialInfo data = 2;
}
message GetDistrictNameResp {
string code = 1;
string name = 2;
repeated string name_list = 3;
}
message TokenReq {
@ -190,102 +228,83 @@ message TokenReq {
optional Pagination page = 10;
}
message DictionaryListResp {
optional Pagination page = 1;
repeated DictionaryInfo data = 2;
message UserReq {
int64 ID = 1;
string username = 2;
string phone_number = 3;
string email = 4;
string nickname = 5;
bool with_role = 6;
bool with_social = 7;
bool with_department = 8;
bool with_token = 9;
bool with_login_record = 10;
optional Pagination page = 20;
}
message OauthProviderInfo {
message UserSocialInfo {
int64 ID = 1;
string created_at = 2;
string updated_at = 3;
string name = 4;
string client_id = 5;
string client_secret = 6;
string redirect_url = 7;
string scopes = 8;
string auth_url = 9;
string token_url = 10;
string info_url = 11;
string description = 12;
bool system = 13;
bool init = 14;
int64 user_id = 4;
string provider = 5;
string access_token = 6;
string refresh_token = 7;
string uid = 8;
string open_id = 9;
string union_id = 10;
string key = 11;
uint64 expires_in = 12;
string user_profile = 13;
UserInfo user = 14;
}
message RoleInfo {
int64 ID = 1;
string status = 2;
string created_at = 3;
string updated_at = 4;
string code = 5;
string name = 6;
string description = 7;
repeated UserInfo users = 10;
message TokenListResp {
optional Pagination page = 1;
repeated TokenInfo data = 2;
}
message RoleReq {
int64 ID = 1;
string name = 2;
string code = 3;
optional Pagination page = 10;
message UserListResp {
optional Pagination page = 1;
repeated UserInfo data = 2;
}
//
message BaseResp {
uint32 code = 1;
int32 code = 1;
string msg = 2;
}
message DepartmentReq {
int64 ID = 1;
string name = 2;
int64 leader_id = 3;
int64 parent_id = 4;
bool with_leader = 5;
bool with_user = 6;
bool with_children = 7;
optional Pagination page = 10;
}
message DictionaryReq {
int64 ID = 1;
string name = 2;
string title = 3;
bool with_details = 4;
optional Pagination page = 10;
}
message DictionaryDetailListResp {
optional Pagination page = 1;
repeated DictionaryDetailInfo data = 2;
}
message DeleteDictionaryDetailReq {
repeated int64 ids = 1;
int64 dict_id = 2;
}
message OauthLoginReq {
string state = 1;
string provider = 2;
}
message RoleListResp {
optional Pagination page = 1;
repeated RoleInfo data = 2;
message RecordReq {
int64 user_id = 1;
}
message UserListResp {
optional Pagination page = 1;
repeated UserInfo data = 2;
message OauthRedirectResp {
string url = 1;
}
message IDReq {
uint64 id = 1;
message RoleInfo {
int64 ID = 1;
string status = 2;
string created_at = 3;
string updated_at = 4;
string code = 5;
string name = 6;
string description = 7;
repeated UserInfo users = 10;
}
message IDsReq {
repeated uint64 ids = 1;
message RoleReq {
int64 ID = 1;
string name = 2;
string code = 3;
bool with_user = 4;
optional Pagination page = 10;
}
message DictionaryDetailInfo {
@ -301,37 +320,9 @@ message DictionaryDetailInfo {
DictionaryInfo dictionary = 10;
}
message UserSocialListResp {
optional Pagination page = 1;
repeated UserSocialInfo data = 2;
}
message CallbackReq {
string state = 1;
string code = 2;
}
message DictionaryDetailReq {
message DistrictListResp {
optional Pagination page = 1;
int64 ID = 2;
int64 dict_id = 3;
string title = 4;
string key = 5;
string value = 6;
bool with_dictionary = 7;
}
message DistrictTree {
repeated DistrictInfo tree = 1;
}
message RecordReq {
int64 user_id = 1;
}
message GetDistrictNameReq {
string code = 1;
string separator = 2;
repeated DistrictInfo data = 2;
}
message OauthProviderReq {
@ -343,8 +334,22 @@ message OauthProviderReq {
optional Pagination page = 10;
}
message TokenUserReq {
int64 user_id = 1;
message UserInfo {
int64 ID = 1;
string status = 2;
string created_at = 3;
string updated_at = 4;
string username = 5;
optional string phone_number = 6;
optional string email = 7;
string password = 8;
optional string nickname = 9;
map<string,string> metas = 10;
repeated RoleInfo roles = 20;
repeated UserSocialInfo socials = 21;
repeated DepartmentInfo departments = 22;
repeated TokenInfo tokens = 23;
LoginRecordInfo login_record = 24;
}
message UserSocialReq {
@ -359,33 +364,40 @@ message UserSocialReq {
optional Pagination page = 10;
}
message IDsReq {
repeated int64 ids = 1;
}
// ID
message BaseIDResp {
uint64 id = 1;
uint32 code = 2;
int64 ID = 1;
int32 code = 2;
string msg = 3;
}
//
message Pagination {
uint64 size = 1;
uint64 total = 2;
uint64 current = 3;
}
message DictionaryInfo {
message DepartmentInfo {
int64 ID = 1;
string status = 2;
string created_at = 3;
string updated_at = 4;
string title = 5;
string name = 6;
string description = 7;
repeated DictionaryDetailInfo details = 10;
string name = 5;
int64 leader_id = 6;
string remark = 7;
int64 parent_id = 8;
DepartmentInfo parent = 10;
repeated DepartmentInfo children = 11;
repeated UserInfo users = 12;
UserInfo leader = 13;
}
message DistrictCodeReq {
string code = 1;
message DictionaryListResp {
optional Pagination page = 1;
repeated DictionaryInfo data = 2;
}
message CallbackReq {
string state = 1;
string code = 2;
}
service Core {
@ -488,6 +500,19 @@ service Core {
rpc getUser(UserReq) returns (UserInfo);
// group: user
rpc deleteUser(IDsReq) returns (BaseResp);
// User-Role Relationship Management
// UserBindRole
// group: user_role
rpc UserBindRole(UserRoleReq) returns (BaseResp);
// UserUnbindRole
// group: user_role
rpc UserUnbindRole(UserRoleReq) returns (BaseResp);
// UserClearRole
// group: user_role
rpc UserClearRole(IDReq) returns (BaseResp);
// GetUserRoles
// group: user_role
rpc GetUserRoles(GetUserRolesReq) returns (RoleListResp);
// User Management
// group: user_social
rpc createUserSocial(UserSocialInfo) returns (BaseIDResp);

@ -34,6 +34,7 @@ type (
Empty = core.Empty
GetDistrictNameReq = core.GetDistrictNameReq
GetDistrictNameResp = core.GetDistrictNameResp
GetUserRolesReq = core.GetUserRolesReq
IDReq = core.IDReq
IDsReq = core.IDsReq
LoginRecordInfo = core.LoginRecordInfo
@ -54,6 +55,7 @@ type (
UserInfo = core.UserInfo
UserListResp = core.UserListResp
UserReq = core.UserReq
UserRoleReq = core.UserRoleReq
UserSocialInfo = core.UserSocialInfo
UserSocialListResp = core.UserSocialListResp
UserSocialReq = core.UserSocialReq
@ -113,6 +115,14 @@ type (
GetUserList(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserListResp, error)
GetUser(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserInfo, error)
DeleteUser(ctx context.Context, in *IDsReq, opts ...grpc.CallOption) (*BaseResp, error)
// User-Role Relationship Management
UserBindRole(ctx context.Context, in *UserRoleReq, opts ...grpc.CallOption) (*BaseResp, error)
// UserUnbindRole 用户解绑角色
UserUnbindRole(ctx context.Context, in *UserRoleReq, opts ...grpc.CallOption) (*BaseResp, error)
// UserClearRole 用户清理角色
UserClearRole(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error)
// GetUserRoles 获取用户绑定的角色列表
GetUserRoles(ctx context.Context, in *GetUserRolesReq, opts ...grpc.CallOption) (*RoleListResp, error)
// User Management
CreateUserSocial(ctx context.Context, in *UserSocialInfo, opts ...grpc.CallOption) (*BaseIDResp, error)
UpdateUserSocial(ctx context.Context, in *UserSocialInfo, opts ...grpc.CallOption) (*BaseResp, error)
@ -366,6 +376,30 @@ func (m *defaultCore) DeleteUser(ctx context.Context, in *IDsReq, opts ...grpc.C
return client.DeleteUser(ctx, in, opts...)
}
// User-Role Relationship Management
func (m *defaultCore) UserBindRole(ctx context.Context, in *UserRoleReq, opts ...grpc.CallOption) (*BaseResp, error) {
client := core.NewCoreClient(m.cli.Conn())
return client.UserBindRole(ctx, in, opts...)
}
// UserUnbindRole 用户解绑角色
func (m *defaultCore) UserUnbindRole(ctx context.Context, in *UserRoleReq, opts ...grpc.CallOption) (*BaseResp, error) {
client := core.NewCoreClient(m.cli.Conn())
return client.UserUnbindRole(ctx, in, opts...)
}
// UserClearRole 用户清理角色
func (m *defaultCore) UserClearRole(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error) {
client := core.NewCoreClient(m.cli.Conn())
return client.UserClearRole(ctx, in, opts...)
}
// GetUserRoles 获取用户绑定的角色列表
func (m *defaultCore) GetUserRoles(ctx context.Context, in *GetUserRolesReq, opts ...grpc.CallOption) (*RoleListResp, error) {
client := core.NewCoreClient(m.cli.Conn())
return client.GetUserRoles(ctx, in, opts...)
}
// User Management
func (m *defaultCore) CreateUserSocial(ctx context.Context, in *UserSocialInfo, opts ...grpc.CallOption) (*BaseIDResp, error) {
client := core.NewCoreClient(m.cli.Conn())

@ -8,23 +8,23 @@ option go_package = "./core";
message Empty {}
message IDReq {
uint64 id = 1;
int64 ID = 1;
}
message IDsReq {
repeated uint64 ids = 1;
repeated int64 ids = 1;
}
//
message BaseResp {
uint32 code = 1;
int32 code = 1;
string msg = 2;
}
// ID
message BaseIDResp {
uint64 id = 1;
uint32 code = 2;
int64 ID = 1;
int32 code = 2;
string msg = 3;
}

@ -6,7 +6,7 @@ message DepartmentInfo {
string created_at = 3;
string updated_at = 4;
string name = 5;
string leader_id = 6;
int64 leader_id = 6;
string remark = 7;
int64 parent_id = 8;

@ -17,6 +17,8 @@ message RoleReq {
string name = 2;
string code = 3;
bool with_user = 4;
optional Pagination page = 10;
}

@ -0,0 +1,28 @@
syntax = "proto3";
message UserRoleReq {
int64 user_id = 1;
repeated int64 role_ids = 2;
repeated string role_codes = 3;
}
message GetUserRolesReq {
optional Pagination page = 1;
int64 user_id = 2;
}
service Core {
// User-Role Relationship Management
// UserBindRole
// group: user_role
rpc UserBindRole (UserRoleReq) returns (BaseResp);
// UserUnbindRole
// group: user_role
rpc UserUnbindRole (UserRoleReq) returns (BaseResp);
// UserClearRole
// group: user_role
rpc UserClearRole (IDReq) returns (BaseResp);
// GetUserRoles
// group: user_role
rpc GetUserRoles (GetUserRolesReq) returns (RoleListResp);
}

@ -405,15 +405,15 @@ func (c *DepartmentClient) QueryChildren(d *Department) *DepartmentQuery {
return query
}
// QueryUser queries the user edge of a Department.
func (c *DepartmentClient) QueryUser(d *Department) *UserQuery {
// QueryUsers queries the users edge of a Department.
func (c *DepartmentClient) QueryUsers(d *Department) *UserQuery {
query := (&UserClient{config: c.config}).Query()
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
id := d.ID
step := sqlgraph.NewStep(
sqlgraph.From(department.Table, department.FieldID, id),
sqlgraph.To(user.Table, user.FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, department.UserTable, department.UserColumn),
sqlgraph.Edge(sqlgraph.M2M, true, department.UsersTable, department.UsersPrimaryKey...),
)
fromV = sqlgraph.Neighbors(d.driver.Dialect(), step)
return fromV, nil
@ -1523,7 +1523,7 @@ func (c *UserClient) QueryDepartments(u *User) *DepartmentQuery {
step := sqlgraph.NewStep(
sqlgraph.From(user.Table, user.FieldID, id),
sqlgraph.To(department.Table, department.FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, user.DepartmentsTable, user.DepartmentsColumn),
sqlgraph.Edge(sqlgraph.M2M, false, user.DepartmentsTable, user.DepartmentsPrimaryKey...),
)
fromV = sqlgraph.Neighbors(u.driver.Dialect(), step)
return fromV, nil

@ -20,9 +20,9 @@ type Department struct {
// ID of the ent.
// Primary Key | 主键
ID int64 `json:"id,omitempty"`
// 创建时间
// Create Time | 创建时间
CreatedAt time.Time `json:"created_at,omitempty"`
// 更新时间
// Update Time | 更新时间
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Status | 状态
Status types.Status `json:"status,omitempty"`
@ -38,9 +38,8 @@ type Department struct {
ParentID int64 `json:"parent_id,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the DepartmentQuery when eager-loading is set.
Edges DepartmentEdges `json:"edges"`
user_departments *int64
selectValues sql.SelectValues
Edges DepartmentEdges `json:"edges"`
selectValues sql.SelectValues
}
// DepartmentEdges holds the relations/edges for other nodes in the graph.
@ -49,8 +48,8 @@ type DepartmentEdges struct {
Parent *Department `json:"parent,omitempty"`
// Children holds the value of the children edge.
Children []*Department `json:"children,omitempty"`
// User holds the value of the user edge.
User *User `json:"user,omitempty"`
// Users holds the value of the users edge.
Users []*User `json:"users,omitempty"`
// Leader holds the value of the leader edge.
Leader *User `json:"leader,omitempty"`
// loadedTypes holds the information for reporting if a
@ -80,17 +79,13 @@ func (e DepartmentEdges) ChildrenOrErr() ([]*Department, error) {
return nil, &NotLoadedError{edge: "children"}
}
// UserOrErr returns the User value or an error if the edge
// was not loaded in eager-loading, or loaded but was not found.
func (e DepartmentEdges) UserOrErr() (*User, error) {
// UsersOrErr returns the Users value or an error if the edge
// was not loaded in eager-loading.
func (e DepartmentEdges) UsersOrErr() ([]*User, error) {
if e.loadedTypes[2] {
if e.User == nil {
// Edge was loaded but was not found.
return nil, &NotFoundError{label: user.Label}
}
return e.User, nil
return e.Users, nil
}
return nil, &NotLoadedError{edge: "user"}
return nil, &NotLoadedError{edge: "users"}
}
// LeaderOrErr returns the Leader value or an error if the edge
@ -117,8 +112,6 @@ func (*Department) scanValues(columns []string) ([]any, error) {
values[i] = new(sql.NullString)
case department.FieldCreatedAt, department.FieldUpdatedAt:
values[i] = new(sql.NullTime)
case department.ForeignKeys[0]: // user_departments
values[i] = new(sql.NullInt64)
default:
values[i] = new(sql.UnknownType)
}
@ -188,13 +181,6 @@ func (d *Department) assignValues(columns []string, values []any) error {
} else if value.Valid {
d.ParentID = value.Int64
}
case department.ForeignKeys[0]:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for edge-field user_departments", value)
} else if value.Valid {
d.user_departments = new(int64)
*d.user_departments = int64(value.Int64)
}
default:
d.selectValues.Set(columns[i], values[i])
}
@ -218,9 +204,9 @@ func (d *Department) QueryChildren() *DepartmentQuery {
return NewDepartmentClient(d.config).QueryChildren(d)
}
// QueryUser queries the "user" edge of the Department entity.
func (d *Department) QueryUser() *UserQuery {
return NewDepartmentClient(d.config).QueryUser(d)
// QueryUsers queries the "users" edge of the Department entity.
func (d *Department) QueryUsers() *UserQuery {
return NewDepartmentClient(d.config).QueryUsers(d)
}
// QueryLeader queries the "leader" edge of the Department entity.

@ -37,8 +37,8 @@ const (
EdgeParent = "parent"
// EdgeChildren holds the string denoting the children edge name in mutations.
EdgeChildren = "children"
// EdgeUser holds the string denoting the user edge name in mutations.
EdgeUser = "user"
// EdgeUsers holds the string denoting the users edge name in mutations.
EdgeUsers = "users"
// EdgeLeader holds the string denoting the leader edge name in mutations.
EdgeLeader = "leader"
// Table holds the table name of the department in the database.
@ -51,13 +51,11 @@ const (
ChildrenTable = "sys_department"
// ChildrenColumn is the table column denoting the children relation/edge.
ChildrenColumn = "parent_id"
// UserTable is the table that holds the user relation/edge.
UserTable = "sys_department"
// UserInverseTable is the table name for the User entity.
// UsersTable is the table that holds the users relation/edge. The primary key declared below.
UsersTable = "user_departments"
// UsersInverseTable is the table name for the User entity.
// It exists in this package in order to avoid circular dependency with the "user" package.
UserInverseTable = "sys_user"
// UserColumn is the table column denoting the user relation/edge.
UserColumn = "user_departments"
UsersInverseTable = "sys_user"
// LeaderTable is the table that holds the leader relation/edge.
LeaderTable = "sys_department"
// LeaderInverseTable is the table name for the User entity.
@ -80,11 +78,11 @@ var Columns = []string{
FieldParentID,
}
// ForeignKeys holds the SQL foreign-keys that are owned by the "sys_department"
// table and are not defined as standalone fields in the schema.
var ForeignKeys = []string{
"user_departments",
}
var (
// UsersPrimaryKey and UsersColumn2 are the table columns denoting the
// primary key for the users relation (M2M).
UsersPrimaryKey = []string{"user_id", "department_id"}
)
// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
@ -93,11 +91,6 @@ func ValidColumn(column string) bool {
return true
}
}
for i := range ForeignKeys {
if column == ForeignKeys[i] {
return true
}
}
return false
}
@ -201,10 +194,17 @@ func ByChildren(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
}
}
// ByUserField orders the results by user field.
func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption {
// ByUsersCount orders the results by users count.
func ByUsersCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newUsersStep(), opts...)
}
}
// ByUsers orders the results by users terms.
func ByUsers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newUserStep(), sql.OrderByField(field, opts...))
sqlgraph.OrderByNeighborTerms(s, newUsersStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
@ -228,11 +228,11 @@ func newChildrenStep() *sqlgraph.Step {
sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn),
)
}
func newUserStep() *sqlgraph.Step {
func newUsersStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(UserInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
sqlgraph.To(UsersInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2M, true, UsersTable, UsersPrimaryKey...),
)
}
func newLeaderStep() *sqlgraph.Step {

@ -487,21 +487,21 @@ func HasChildrenWith(preds ...predicate.Department) predicate.Department {
})
}
// HasUser applies the HasEdge predicate on the "user" edge.
func HasUser() predicate.Department {
// HasUsers applies the HasEdge predicate on the "users" edge.
func HasUsers() predicate.Department {
return predicate.Department(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
sqlgraph.Edge(sqlgraph.M2M, true, UsersTable, UsersPrimaryKey...),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates).
func HasUserWith(preds ...predicate.User) predicate.Department {
// HasUsersWith applies the HasEdge predicate on the "users" edge with a given conditions (other predicates).
func HasUsersWith(preds ...predicate.User) predicate.Department {
return predicate.Department(func(s *sql.Selector) {
step := newUserStep()
step := newUsersStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)

@ -162,23 +162,19 @@ func (dc *DepartmentCreate) AddChildren(d ...*Department) *DepartmentCreate {
return dc.AddChildIDs(ids...)
}
// SetUserID sets the "user" edge to the User entity by ID.
func (dc *DepartmentCreate) SetUserID(id int64) *DepartmentCreate {
dc.mutation.SetUserID(id)
// AddUserIDs adds the "users" edge to the User entity by IDs.
func (dc *DepartmentCreate) AddUserIDs(ids ...int64) *DepartmentCreate {
dc.mutation.AddUserIDs(ids...)
return dc
}
// SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (dc *DepartmentCreate) SetNillableUserID(id *int64) *DepartmentCreate {
if id != nil {
dc = dc.SetUserID(*id)
// AddUsers adds the "users" edges to the User entity.
func (dc *DepartmentCreate) AddUsers(u ...*User) *DepartmentCreate {
ids := make([]int64, len(u))
for i := range u {
ids[i] = u[i].ID
}
return dc
}
// SetUser sets the "user" edge to the User entity.
func (dc *DepartmentCreate) SetUser(u *User) *DepartmentCreate {
return dc.SetUserID(u.ID)
return dc.AddUserIDs(ids...)
}
// SetLeader sets the "leader" edge to the User entity.
@ -367,12 +363,12 @@ func (dc *DepartmentCreate) createSpec() (*Department, *sqlgraph.CreateSpec) {
}
_spec.Edges = append(_spec.Edges, edge)
}
if nodes := dc.mutation.UserIDs(); len(nodes) > 0 {
if nodes := dc.mutation.UsersIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.M2O,
Rel: sqlgraph.M2M,
Inverse: true,
Table: department.UserTable,
Columns: []string{department.UserColumn},
Table: department.UsersTable,
Columns: department.UsersPrimaryKey,
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt64),
@ -381,7 +377,6 @@ func (dc *DepartmentCreate) createSpec() (*Department, *sqlgraph.CreateSpec) {
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_node.user_departments = &nodes[0]
_spec.Edges = append(_spec.Edges, edge)
}
if nodes := dc.mutation.LeaderIDs(); len(nodes) > 0 {

@ -25,9 +25,8 @@ type DepartmentQuery struct {
predicates []predicate.Department
withParent *DepartmentQuery
withChildren *DepartmentQuery
withUser *UserQuery
withUsers *UserQuery
withLeader *UserQuery
withFKs bool
modifiers []func(*sql.Selector)
// intermediate query (i.e. traversal path).
sql *sql.Selector
@ -109,8 +108,8 @@ func (dq *DepartmentQuery) QueryChildren() *DepartmentQuery {
return query
}
// QueryUser chains the current query on the "user" edge.
func (dq *DepartmentQuery) QueryUser() *UserQuery {
// QueryUsers chains the current query on the "users" edge.
func (dq *DepartmentQuery) QueryUsers() *UserQuery {
query := (&UserClient{config: dq.config}).Query()
query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
if err := dq.prepareQuery(ctx); err != nil {
@ -123,7 +122,7 @@ func (dq *DepartmentQuery) QueryUser() *UserQuery {
step := sqlgraph.NewStep(
sqlgraph.From(department.Table, department.FieldID, selector),
sqlgraph.To(user.Table, user.FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, department.UserTable, department.UserColumn),
sqlgraph.Edge(sqlgraph.M2M, true, department.UsersTable, department.UsersPrimaryKey...),
)
fromU = sqlgraph.SetNeighbors(dq.driver.Dialect(), step)
return fromU, nil
@ -347,7 +346,7 @@ func (dq *DepartmentQuery) Clone() *DepartmentQuery {
predicates: append([]predicate.Department{}, dq.predicates...),
withParent: dq.withParent.Clone(),
withChildren: dq.withChildren.Clone(),
withUser: dq.withUser.Clone(),
withUsers: dq.withUsers.Clone(),
withLeader: dq.withLeader.Clone(),
// clone intermediate query.
sql: dq.sql.Clone(),
@ -377,14 +376,14 @@ func (dq *DepartmentQuery) WithChildren(opts ...func(*DepartmentQuery)) *Departm
return dq
}
// WithUser tells the query-builder to eager-load the nodes that are connected to
// the "user" edge. The optional arguments are used to configure the query builder of the edge.
func (dq *DepartmentQuery) WithUser(opts ...func(*UserQuery)) *DepartmentQuery {
// WithUsers tells the query-builder to eager-load the nodes that are connected to
// the "users" edge. The optional arguments are used to configure the query builder of the edge.
func (dq *DepartmentQuery) WithUsers(opts ...func(*UserQuery)) *DepartmentQuery {
query := (&UserClient{config: dq.config}).Query()
for _, opt := range opts {
opt(query)
}
dq.withUser = query
dq.withUsers = query
return dq
}
@ -476,21 +475,14 @@ func (dq *DepartmentQuery) prepareQuery(ctx context.Context) error {
func (dq *DepartmentQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Department, error) {
var (
nodes = []*Department{}
withFKs = dq.withFKs
_spec = dq.querySpec()
loadedTypes = [4]bool{
dq.withParent != nil,
dq.withChildren != nil,
dq.withUser != nil,
dq.withUsers != nil,
dq.withLeader != nil,
}
)
if dq.withUser != nil {
withFKs = true
}
if withFKs {
_spec.Node.Columns = append(_spec.Node.Columns, department.ForeignKeys...)
}
_spec.ScanValues = func(columns []string) ([]any, error) {
return (*Department).scanValues(nil, columns)
}
@ -525,9 +517,10 @@ func (dq *DepartmentQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*D
return nil, err
}
}
if query := dq.withUser; query != nil {
if err := dq.loadUser(ctx, query, nodes, nil,
func(n *Department, e *User) { n.Edges.User = e }); err != nil {
if query := dq.withUsers; query != nil {
if err := dq.loadUsers(ctx, query, nodes,
func(n *Department) { n.Edges.Users = []*User{} },
func(n *Department, e *User) { n.Edges.Users = append(n.Edges.Users, e) }); err != nil {
return nil, err
}
}
@ -579,7 +572,6 @@ func (dq *DepartmentQuery) loadChildren(ctx context.Context, query *DepartmentQu
init(nodes[i])
}
}
query.withFKs = true
if len(query.ctx.Fields) > 0 {
query.ctx.AppendFieldOnce(department.FieldParentID)
}
@ -600,34 +592,63 @@ func (dq *DepartmentQuery) loadChildren(ctx context.Context, query *DepartmentQu
}
return nil
}
func (dq *DepartmentQuery) loadUser(ctx context.Context, query *UserQuery, nodes []*Department, init func(*Department), assign func(*Department, *User)) error {
ids := make([]int64, 0, len(nodes))
nodeids := make(map[int64][]*Department)
for i := range nodes {
if nodes[i].user_departments == nil {
continue
}
fk := *nodes[i].user_departments
if _, ok := nodeids[fk]; !ok {
ids = append(ids, fk)
}
nodeids[fk] = append(nodeids[fk], nodes[i])
}
if len(ids) == 0 {
return nil
func (dq *DepartmentQuery) loadUsers(ctx context.Context, query *UserQuery, nodes []*Department, init func(*Department), assign func(*Department, *User)) error {
edgeIDs := make([]driver.Value, len(nodes))
byID := make(map[int64]*Department)
nids := make(map[int64]map[*Department]struct{})
for i, node := range nodes {
edgeIDs[i] = node.ID
byID[node.ID] = node
if init != nil {
init(node)
}
}
query.Where(func(s *sql.Selector) {
joinT := sql.Table(department.UsersTable)
s.Join(joinT).On(s.C(user.FieldID), joinT.C(department.UsersPrimaryKey[0]))
s.Where(sql.InValues(joinT.C(department.UsersPrimaryKey[1]), edgeIDs...))
columns := s.SelectedColumns()
s.Select(joinT.C(department.UsersPrimaryKey[1]))
s.AppendSelect(columns...)
s.SetDistinct(false)
})
if err := query.prepareQuery(ctx); err != nil {
return err
}
query.Where(user.IDIn(ids...))
neighbors, err := query.All(ctx)
qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) {
return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) {
assign := spec.Assign
values := spec.ScanValues
spec.ScanValues = func(columns []string) ([]any, error) {
values, err := values(columns[1:])
if err != nil {
return nil, err
}
return append([]any{new(sql.NullInt64)}, values...), nil
}
spec.Assign = func(columns []string, values []any) error {
outValue := values[0].(*sql.NullInt64).Int64
inValue := values[1].(*sql.NullInt64).Int64
if nids[inValue] == nil {
nids[inValue] = map[*Department]struct{}{byID[outValue]: {}}
return assign(columns[1:], values[1:])
}
nids[inValue][byID[outValue]] = struct{}{}
return nil
}
})
})
neighbors, err := withInterceptors[[]*User](ctx, query, qr, query.inters)
if err != nil {
return err
}
for _, n := range neighbors {
nodes, ok := nodeids[n.ID]
nodes, ok := nids[n.ID]
if !ok {
return fmt.Errorf(`unexpected foreign-key "user_departments" returned %v`, n.ID)
return fmt.Errorf(`unexpected "users" node returned %v`, n.ID)
}
for i := range nodes {
assign(nodes[i], n)
for kn := range nodes {
assign(kn, n)
}
}
return nil

@ -158,23 +158,19 @@ func (du *DepartmentUpdate) AddChildren(d ...*Department) *DepartmentUpdate {
return du.AddChildIDs(ids...)
}
// SetUserID sets the "user" edge to the User entity by ID.
func (du *DepartmentUpdate) SetUserID(id int64) *DepartmentUpdate {
du.mutation.SetUserID(id)
// AddUserIDs adds the "users" edge to the User entity by IDs.
func (du *DepartmentUpdate) AddUserIDs(ids ...int64) *DepartmentUpdate {
du.mutation.AddUserIDs(ids...)
return du
}
// SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (du *DepartmentUpdate) SetNillableUserID(id *int64) *DepartmentUpdate {
if id != nil {
du = du.SetUserID(*id)
// AddUsers adds the "users" edges to the User entity.
func (du *DepartmentUpdate) AddUsers(u ...*User) *DepartmentUpdate {
ids := make([]int64, len(u))
for i := range u {
ids[i] = u[i].ID
}
return du
}
// SetUser sets the "user" edge to the User entity.
func (du *DepartmentUpdate) SetUser(u *User) *DepartmentUpdate {
return du.SetUserID(u.ID)
return du.AddUserIDs(ids...)
}
// SetLeader sets the "leader" edge to the User entity.
@ -214,12 +210,27 @@ func (du *DepartmentUpdate) RemoveChildren(d ...*Department) *DepartmentUpdate {
return du.RemoveChildIDs(ids...)
}
// ClearUser clears the "user" edge to the User entity.
func (du *DepartmentUpdate) ClearUser() *DepartmentUpdate {
du.mutation.ClearUser()
// ClearUsers clears all "users" edges to the User entity.
func (du *DepartmentUpdate) ClearUsers() *DepartmentUpdate {
du.mutation.ClearUsers()
return du
}
// RemoveUserIDs removes the "users" edge to User entities by IDs.
func (du *DepartmentUpdate) RemoveUserIDs(ids ...int64) *DepartmentUpdate {
du.mutation.RemoveUserIDs(ids...)
return du
}
// RemoveUsers removes "users" edges to User entities.
func (du *DepartmentUpdate) RemoveUsers(u ...*User) *DepartmentUpdate {
ids := make([]int64, len(u))
for i := range u {
ids[i] = u[i].ID
}
return du.RemoveUserIDs(ids...)
}
// ClearLeader clears the "leader" edge to the User entity.
func (du *DepartmentUpdate) ClearLeader() *DepartmentUpdate {
du.mutation.ClearLeader()
@ -391,12 +402,12 @@ func (du *DepartmentUpdate) sqlSave(ctx context.Context) (n int, err error) {
}
_spec.Edges.Add = append(_spec.Edges.Add, edge)
}
if du.mutation.UserCleared() {
if du.mutation.UsersCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.M2O,
Rel: sqlgraph.M2M,
Inverse: true,
Table: department.UserTable,
Columns: []string{department.UserColumn},
Table: department.UsersTable,
Columns: department.UsersPrimaryKey,
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt64),
@ -404,12 +415,28 @@ func (du *DepartmentUpdate) sqlSave(ctx context.Context) (n int, err error) {
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := du.mutation.UserIDs(); len(nodes) > 0 {
if nodes := du.mutation.RemovedUsersIDs(); len(nodes) > 0 && !du.mutation.UsersCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.M2O,
Rel: sqlgraph.M2M,
Inverse: true,
Table: department.UsersTable,
Columns: department.UsersPrimaryKey,
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt64),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := du.mutation.UsersIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.M2M,
Inverse: true,
Table: department.UserTable,
Columns: []string{department.UserColumn},
Table: department.UsersTable,
Columns: department.UsersPrimaryKey,
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt64),
@ -598,23 +625,19 @@ func (duo *DepartmentUpdateOne) AddChildren(d ...*Department) *DepartmentUpdateO
return duo.AddChildIDs(ids...)
}
// SetUserID sets the "user" edge to the User entity by ID.
func (duo *DepartmentUpdateOne) SetUserID(id int64) *DepartmentUpdateOne {
duo.mutation.SetUserID(id)
// AddUserIDs adds the "users" edge to the User entity by IDs.
func (duo *DepartmentUpdateOne) AddUserIDs(ids ...int64) *DepartmentUpdateOne {
duo.mutation.AddUserIDs(ids...)
return duo
}
// SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (duo *DepartmentUpdateOne) SetNillableUserID(id *int64) *DepartmentUpdateOne {
if id != nil {
duo = duo.SetUserID(*id)
// AddUsers adds the "users" edges to the User entity.
func (duo *DepartmentUpdateOne) AddUsers(u ...*User) *DepartmentUpdateOne {
ids := make([]int64, len(u))
for i := range u {
ids[i] = u[i].ID
}
return duo
}
// SetUser sets the "user" edge to the User entity.
func (duo *DepartmentUpdateOne) SetUser(u *User) *DepartmentUpdateOne {
return duo.SetUserID(u.ID)
return duo.AddUserIDs(ids...)
}
// SetLeader sets the "leader" edge to the User entity.
@ -654,12 +677,27 @@ func (duo *DepartmentUpdateOne) RemoveChildren(d ...*Department) *DepartmentUpda
return duo.RemoveChildIDs(ids...)
}
// ClearUser clears the "user" edge to the User entity.
func (duo *DepartmentUpdateOne) ClearUser() *DepartmentUpdateOne {
duo.mutation.ClearUser()
// ClearUsers clears all "users" edges to the User entity.
func (duo *DepartmentUpdateOne) ClearUsers() *DepartmentUpdateOne {
duo.mutation.ClearUsers()
return duo
}
// RemoveUserIDs removes the "users" edge to User entities by IDs.
func (duo *DepartmentUpdateOne) RemoveUserIDs(ids ...int64) *DepartmentUpdateOne {
duo.mutation.RemoveUserIDs(ids...)
return duo
}
// RemoveUsers removes "users" edges to User entities.
func (duo *DepartmentUpdateOne) RemoveUsers(u ...*User) *DepartmentUpdateOne {
ids := make([]int64, len(u))
for i := range u {
ids[i] = u[i].ID
}
return duo.RemoveUserIDs(ids...)
}
// ClearLeader clears the "leader" edge to the User entity.
func (duo *DepartmentUpdateOne) ClearLeader() *DepartmentUpdateOne {
duo.mutation.ClearLeader()
@ -861,12 +899,12 @@ func (duo *DepartmentUpdateOne) sqlSave(ctx context.Context) (_node *Department,
}
_spec.Edges.Add = append(_spec.Edges.Add, edge)
}
if duo.mutation.UserCleared() {
if duo.mutation.UsersCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.M2O,
Rel: sqlgraph.M2M,
Inverse: true,
Table: department.UserTable,
Columns: []string{department.UserColumn},
Table: department.UsersTable,
Columns: department.UsersPrimaryKey,
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt64),
@ -874,12 +912,28 @@ func (duo *DepartmentUpdateOne) sqlSave(ctx context.Context) (_node *Department,
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := duo.mutation.UserIDs(); len(nodes) > 0 {
if nodes := duo.mutation.RemovedUsersIDs(); len(nodes) > 0 && !duo.mutation.UsersCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.M2O,
Rel: sqlgraph.M2M,
Inverse: true,
Table: department.UsersTable,
Columns: department.UsersPrimaryKey,
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt64),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := duo.mutation.UsersIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.M2M,
Inverse: true,
Table: department.UserTable,
Columns: []string{department.UserColumn},
Table: department.UsersTable,
Columns: department.UsersPrimaryKey,
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt64),

@ -19,9 +19,9 @@ type Dictionary struct {
// ID of the ent.
// Primary Key | 主键
ID int64 `json:"id,omitempty"`
// 创建时间
// Create Time | 创建时间
CreatedAt time.Time `json:"created_at,omitempty"`
// 更新时间
// Update Time | 更新时间
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Status | 状态
Status types.Status `json:"status,omitempty"`

@ -18,9 +18,9 @@ type District struct {
// ID of the ent.
// ID | 主键
ID int64 `json:"id,omitempty"`
// 创建时间
// Create Time | 创建时间
CreatedAt time.Time `json:"created_at,omitempty"`
// 更新时间
// Update Time | 更新时间
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Region Name | 地区名称
Name string `json:"name,omitempty"`

@ -19,9 +19,9 @@ type LoginRecord struct {
// ID of the ent.
// Primary Key | 主键
ID int64 `json:"id,omitempty"`
// 创建时间
// Create Time | 创建时间
CreatedAt time.Time `json:"created_at,omitempty"`
// 更新时间
// Update Time | 更新时间
UpdatedAt time.Time `json:"updated_at,omitempty"`
// optimistic lock | 乐观锁
Version int64 `json:"version,omitempty"`

@ -12,15 +12,14 @@ var (
// SysDepartmentColumns holds the columns for the "sys_department" table.
SysDepartmentColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt64, Comment: "Primary Key | 主键"},
{Name: "created_at", Type: field.TypeTime, Comment: "创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "status", Type: field.TypeEnum, Comment: "Status | 状态", Enums: []string{"Normal", "Pending", "Disabled", "Locked"}, Default: "Normal", SchemaType: map[string]string{"mysql": "varchar(32)"}},
{Name: "version", Type: field.TypeInt64, Comment: "optimistic lock | 乐观锁", Default: 1},
{Name: "name", Type: field.TypeString, Comment: "Department name | 部门名称"},
{Name: "remark", Type: field.TypeString, Nullable: true, Comment: "Remark | 备注"},
{Name: "parent_id", Type: field.TypeInt64, Nullable: true, Comment: "Parent ID | 直接父级ID"},
{Name: "leader_id", Type: field.TypeInt64, Nullable: true, Comment: "Department leader | 部门负责人"},
{Name: "user_departments", Type: field.TypeInt64, Nullable: true},
}
// SysDepartmentTable holds the schema information for the "sys_department" table.
SysDepartmentTable = &schema.Table{
@ -41,19 +40,13 @@ var (
RefColumns: []*schema.Column{SysUserColumns[0]},
OnDelete: schema.SetNull,
},
{
Symbol: "sys_department_sys_user_departments",
Columns: []*schema.Column{SysDepartmentColumns[9]},
RefColumns: []*schema.Column{SysUserColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// SysDictionariesColumns holds the columns for the "sys_dictionaries" table.
SysDictionariesColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt64, Comment: "Primary Key | 主键"},
{Name: "created_at", Type: field.TypeTime, Comment: "创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "status", Type: field.TypeEnum, Comment: "Status | 状态", Enums: []string{"Normal", "Pending", "Disabled", "Locked"}, Default: "Normal", SchemaType: map[string]string{"mysql": "varchar(32)"}},
{Name: "version", Type: field.TypeInt64, Comment: "optimistic lock | 乐观锁", Default: 1},
{Name: "title", Type: field.TypeString, Comment: "The title shown in the ui | 展示名称 建议配合i18n"},
@ -96,8 +89,8 @@ var (
// SysDistrictColumns holds the columns for the "sys_district" table.
SysDistrictColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt64, Comment: "ID | 主键"},
{Name: "created_at", Type: field.TypeTime, Comment: "创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "name", Type: field.TypeString, Comment: "Region Name | 地区名称"},
{Name: "short_name", Type: field.TypeString, Nullable: true, Comment: "Region ShortName | 地区缩写,省级"},
{Name: "code", Type: field.TypeString, Unique: true, Comment: "Region Code | 地区行政编号"},
@ -119,8 +112,8 @@ var (
// SysLoginRecordColumns holds the columns for the "sys_login_record" table.
SysLoginRecordColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt64, Comment: "Primary Key | 主键"},
{Name: "created_at", Type: field.TypeTime, Comment: "创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "version", Type: field.TypeInt64, Comment: "optimistic lock | 乐观锁", Default: 1},
{Name: "last_login_at", Type: field.TypeTime, Nullable: true, Comment: "LastLogin Time | 最近一次登录时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "last_login_ipv4", Type: field.TypeString, Nullable: true, Comment: "LastLogin IPv4 | 最近一次登录IPv4"},
@ -147,8 +140,8 @@ var (
// SysOauthProviderColumns holds the columns for the "sys_oauth_provider" table.
SysOauthProviderColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt64, Comment: "Primary Key | 主键"},
{Name: "created_at", Type: field.TypeTime, Comment: "创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Soft delete | 软删除(逻辑删除)", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "name", Type: field.TypeString, Unique: true, Comment: "The provider's name | 提供商名称"},
{Name: "client_id", Type: field.TypeString, Comment: "The client id | 客户端 id"},
@ -172,8 +165,8 @@ var (
// SysRoleColumns holds the columns for the "sys_role" table.
SysRoleColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt64, Comment: "Primary Key | 主键"},
{Name: "created_at", Type: field.TypeTime, Comment: "创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "version", Type: field.TypeInt64, Comment: "optimistic lock | 乐观锁", Default: 1},
{Name: "status", Type: field.TypeEnum, Comment: "Status | 状态", Enums: []string{"Normal", "Pending", "Disabled", "Locked"}, Default: "Normal", SchemaType: map[string]string{"mysql": "varchar(32)"}},
{Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Soft delete | 软删除(逻辑删除)", SchemaType: map[string]string{"mysql": "datetime"}},
@ -191,8 +184,8 @@ var (
// SysTokenColumns holds the columns for the "sys_token" table.
SysTokenColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt64, Comment: "Primary Key | 主键"},
{Name: "created_at", Type: field.TypeTime, Comment: "创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "status", Type: field.TypeEnum, Comment: "Status | 状态", Enums: []string{"Normal", "Pending", "Disabled", "Locked"}, Default: "Normal", SchemaType: map[string]string{"mysql": "varchar(32)"}},
{Name: "version", Type: field.TypeInt64, Comment: "optimistic lock | 乐观锁", Default: 1},
{Name: "token_type", Type: field.TypeString, Comment: "Token type | 凭证类型 [Bearer]"},
@ -221,8 +214,8 @@ var (
SysUserColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt64, Comment: "Primary Key | 主键"},
{Name: "status", Type: field.TypeEnum, Comment: "Status | 状态", Enums: []string{"Normal", "Pending", "Disabled", "Locked"}, Default: "Normal", SchemaType: map[string]string{"mysql": "varchar(32)"}},
{Name: "created_at", Type: field.TypeTime, Comment: "创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "version", Type: field.TypeInt64, Comment: "optimistic lock | 乐观锁", Default: 1},
{Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Soft delete | 软删除(逻辑删除)", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "username", Type: field.TypeString, Unique: true, Comment: "User's login name | 登录名"},
@ -241,8 +234,8 @@ var (
// SysUsermetaColumns holds the columns for the "sys_usermeta" table.
SysUsermetaColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt64, Comment: "Primary Key | 主键"},
{Name: "created_at", Type: field.TypeTime, Comment: "创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "version", Type: field.TypeInt64, Comment: "optimistic lock | 乐观锁", Default: 1},
{Name: "key", Type: field.TypeString, Nullable: true, Comment: "Key | 键", SchemaType: map[string]string{"mysql": "varchar(255)"}},
{Name: "value", Type: field.TypeString, Nullable: true, Size: 2147483647, Comment: "Key | 值"},
@ -283,8 +276,8 @@ var (
// SysUserSocialColumns holds the columns for the "sys_user_social" table.
SysUserSocialColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt64, Comment: "Primary Key | 主键"},
{Name: "created_at", Type: field.TypeTime, Comment: "创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
{Name: "provider", Type: field.TypeString, Comment: "OAuth Provider | 服务提供商"},
{Name: "access_token", Type: field.TypeString, Comment: "Access Token | 用户在提供商最近一次登录的访问凭证"},
{Name: "refresh_token", Type: field.TypeString, Comment: "Refresh Token | 用户在提供商最近一次登录的刷新凭证"},
@ -336,6 +329,31 @@ var (
},
},
}
// UserDepartmentsColumns holds the columns for the "user_departments" table.
UserDepartmentsColumns = []*schema.Column{
{Name: "user_id", Type: field.TypeInt64},
{Name: "department_id", Type: field.TypeInt64},
}
// UserDepartmentsTable holds the schema information for the "user_departments" table.
UserDepartmentsTable = &schema.Table{
Name: "user_departments",
Columns: UserDepartmentsColumns,
PrimaryKey: []*schema.Column{UserDepartmentsColumns[0], UserDepartmentsColumns[1]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "user_departments_user_id",
Columns: []*schema.Column{UserDepartmentsColumns[0]},
RefColumns: []*schema.Column{SysUserColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "user_departments_department_id",
Columns: []*schema.Column{UserDepartmentsColumns[1]},
RefColumns: []*schema.Column{SysDepartmentColumns[0]},
OnDelete: schema.Cascade,
},
},
}
// Tables holds all the tables in the schema.
Tables = []*schema.Table{
SysDepartmentTable,
@ -350,13 +368,13 @@ var (
SysUsermetaTable,
SysUserSocialTable,
UserRolesTable,
UserDepartmentsTable,
}
)
func init() {
SysDepartmentTable.ForeignKeys[0].RefTable = SysDepartmentTable
SysDepartmentTable.ForeignKeys[1].RefTable = SysUserTable
SysDepartmentTable.ForeignKeys[2].RefTable = SysUserTable
SysDepartmentTable.Annotation = &entsql.Annotation{
Table: "sys_department",
}
@ -397,4 +415,6 @@ func init() {
}
UserRolesTable.ForeignKeys[0].RefTable = SysUserTable
UserRolesTable.ForeignKeys[1].RefTable = SysRoleTable
UserDepartmentsTable.ForeignKeys[0].RefTable = SysUserTable
UserDepartmentsTable.ForeignKeys[1].RefTable = SysDepartmentTable
}

@ -67,8 +67,9 @@ type DepartmentMutation struct {
children map[int64]struct{}
removedchildren map[int64]struct{}
clearedchildren bool
user *int64
cleareduser bool
users map[int64]struct{}
removedusers map[int64]struct{}
clearedusers bool
leader *int64
clearedleader bool
done bool
@ -607,43 +608,58 @@ func (m *DepartmentMutation) ResetChildren() {
m.removedchildren = nil
}
// SetUserID sets the "user" edge to the User entity by id.
func (m *DepartmentMutation) SetUserID(id int64) {
m.user = &id
// AddUserIDs adds the "users" edge to the User entity by ids.
func (m *DepartmentMutation) AddUserIDs(ids ...int64) {
if m.users == nil {
m.users = make(map[int64]struct{})
}
for i := range ids {
m.users[ids[i]] = struct{}{}
}
}
// ClearUser clears the "user" edge to the User entity.
func (m *DepartmentMutation) ClearUser() {
m.cleareduser = true
// ClearUsers clears the "users" edge to the User entity.
func (m *DepartmentMutation) ClearUsers() {
m.clearedusers = true
}
// UserCleared reports if the "user" edge to the User entity was cleared.
func (m *DepartmentMutation) UserCleared() bool {
return m.cleareduser
// UsersCleared reports if the "users" edge to the User entity was cleared.
func (m *DepartmentMutation) UsersCleared() bool {
return m.clearedusers
}
// UserID returns the "user" edge ID in the mutation.
func (m *DepartmentMutation) UserID() (id int64, exists bool) {
if m.user != nil {
return *m.user, true
// RemoveUserIDs removes the "users" edge to the User entity by IDs.
func (m *DepartmentMutation) RemoveUserIDs(ids ...int64) {
if m.removedusers == nil {
m.removedusers = make(map[int64]struct{})
}
for i := range ids {
delete(m.users, ids[i])
m.removedusers[ids[i]] = struct{}{}
}
}
// RemovedUsers returns the removed IDs of the "users" edge to the User entity.
func (m *DepartmentMutation) RemovedUsersIDs() (ids []int64) {
for id := range m.removedusers {
ids = append(ids, id)
}
return
}
// UserIDs returns the "user" edge IDs in the mutation.
// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use
// UserID instead. It exists only for internal usage by the builders.
func (m *DepartmentMutation) UserIDs() (ids []int64) {
if id := m.user; id != nil {
ids = append(ids, *id)
// UsersIDs returns the "users" edge IDs in the mutation.
func (m *DepartmentMutation) UsersIDs() (ids []int64) {
for id := range m.users {
ids = append(ids, id)
}
return
}
// ResetUser resets all changes to the "user" edge.
func (m *DepartmentMutation) ResetUser() {
m.user = nil
m.cleareduser = false
// ResetUsers resets all changes to the "users" edge.
func (m *DepartmentMutation) ResetUsers() {
m.users = nil
m.clearedusers = false
m.removedusers = nil
}
// ClearLeader clears the "leader" edge to the User entity.
@ -967,8 +983,8 @@ func (m *DepartmentMutation) AddedEdges() []string {
if m.children != nil {
edges = append(edges, department.EdgeChildren)
}
if m.user != nil {
edges = append(edges, department.EdgeUser)
if m.users != nil {
edges = append(edges, department.EdgeUsers)
}
if m.leader != nil {
edges = append(edges, department.EdgeLeader)
@ -990,10 +1006,12 @@ func (m *DepartmentMutation) AddedIDs(name string) []ent.Value {
ids = append(ids, id)
}
return ids
case department.EdgeUser:
if id := m.user; id != nil {
return []ent.Value{*id}
case department.EdgeUsers:
ids := make([]ent.Value, 0, len(m.users))
for id := range m.users {
ids = append(ids, id)
}
return ids
case department.EdgeLeader:
if id := m.leader; id != nil {
return []ent.Value{*id}
@ -1008,6 +1026,9 @@ func (m *DepartmentMutation) RemovedEdges() []string {
if m.removedchildren != nil {
edges = append(edges, department.EdgeChildren)
}
if m.removedusers != nil {
edges = append(edges, department.EdgeUsers)
}
return edges
}
@ -1021,6 +1042,12 @@ func (m *DepartmentMutation) RemovedIDs(name string) []ent.Value {
ids = append(ids, id)
}
return ids
case department.EdgeUsers:
ids := make([]ent.Value, 0, len(m.removedusers))
for id := range m.removedusers {
ids = append(ids, id)
}
return ids
}
return nil
}
@ -1034,8 +1061,8 @@ func (m *DepartmentMutation) ClearedEdges() []string {
if m.clearedchildren {
edges = append(edges, department.EdgeChildren)
}
if m.cleareduser {
edges = append(edges, department.EdgeUser)
if m.clearedusers {
edges = append(edges, department.EdgeUsers)
}
if m.clearedleader {
edges = append(edges, department.EdgeLeader)
@ -1051,8 +1078,8 @@ func (m *DepartmentMutation) EdgeCleared(name string) bool {
return m.clearedparent
case department.EdgeChildren:
return m.clearedchildren
case department.EdgeUser:
return m.cleareduser
case department.EdgeUsers:
return m.clearedusers
case department.EdgeLeader:
return m.clearedleader
}
@ -1066,9 +1093,6 @@ func (m *DepartmentMutation) ClearEdge(name string) error {
case department.EdgeParent:
m.ClearParent()
return nil
case department.EdgeUser:
m.ClearUser()
return nil
case department.EdgeLeader:
m.ClearLeader()
return nil
@ -1086,8 +1110,8 @@ func (m *DepartmentMutation) ResetEdge(name string) error {
case department.EdgeChildren:
m.ResetChildren()
return nil
case department.EdgeUser:
m.ResetUser()
case department.EdgeUsers:
m.ResetUsers()
return nil
case department.EdgeLeader:
m.ResetLeader()

@ -18,9 +18,9 @@ type OauthProvider struct {
// ID of the ent.
// Primary Key | 主键
ID int64 `json:"id,omitempty"`
// 创建时间
// Create Time | 创建时间
CreatedAt time.Time `json:"created_at,omitempty"`
// 更新时间
// Update Time | 更新时间
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Soft delete | 软删除(逻辑删除)
DeletedAt time.Time `json:"deleted_at,omitempty"`

@ -19,9 +19,9 @@ type Role struct {
// ID of the ent.
// Primary Key | 主键
ID int64 `json:"id,omitempty"`
// 创建时间
// Create Time | 创建时间
CreatedAt time.Time `json:"created_at,omitempty"`
// 更新时间
// Update Time | 更新时间
UpdatedAt time.Time `json:"updated_at,omitempty"`
// optimistic lock | 乐观锁
Version int64 `json:"version,omitempty"`

@ -40,9 +40,8 @@ func (Department) Edges() []ent.Edge {
Field("parent_id").
Unique(),
// 用户从属关系
edge.From("user", User.Type).
Ref("departments").
Unique(), // to one
edge.From("users", User.Type).
Ref("departments"), // to many
// 负责人关系
edge.To("leader", User.Type).
Field("leader_id").

@ -20,9 +20,9 @@ type Token struct {
// ID of the ent.
// Primary Key | 主键
ID int64 `json:"id,omitempty"`
// 创建时间
// Create Time | 创建时间
CreatedAt time.Time `json:"created_at,omitempty"`
// 更新时间
// Update Time | 更新时间
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Status | 状态
Status types.Status `json:"status,omitempty"`

@ -22,9 +22,9 @@ type User struct {
ID int64 `json:"id,omitempty"`
// Status | 状态
Status types.Status `json:"status,omitempty"`
// 创建时间
// Create Time | 创建时间
CreatedAt time.Time `json:"created_at,omitempty"`
// 更新时间
// Update Time | 更新时间
UpdatedAt time.Time `json:"updated_at,omitempty"`
// optimistic lock | 乐观锁
Version int64 `json:"version,omitempty"`

@ -70,13 +70,11 @@ const (
SocialsInverseTable = "sys_user_social"
// SocialsColumn is the table column denoting the socials relation/edge.
SocialsColumn = "user_id"
// DepartmentsTable is the table that holds the departments relation/edge.
DepartmentsTable = "sys_department"
// DepartmentsTable is the table that holds the departments relation/edge. The primary key declared below.
DepartmentsTable = "user_departments"
// DepartmentsInverseTable is the table name for the Department entity.
// It exists in this package in order to avoid circular dependency with the "department" package.
DepartmentsInverseTable = "sys_department"
// DepartmentsColumn is the table column denoting the departments relation/edge.
DepartmentsColumn = "user_departments"
// TokenTable is the table that holds the token relation/edge.
TokenTable = "sys_token"
// TokenInverseTable is the table name for the Token entity.
@ -112,6 +110,9 @@ var (
// RolesPrimaryKey and RolesColumn2 are the table columns denoting the
// primary key for the roles relation (M2M).
RolesPrimaryKey = []string{"user_id", "role_id"}
// DepartmentsPrimaryKey and DepartmentsColumn2 are the table columns denoting the
// primary key for the departments relation (M2M).
DepartmentsPrimaryKey = []string{"user_id", "department_id"}
)
// ValidColumn reports if the column name is valid (part of the table columns).
@ -314,7 +315,7 @@ func newDepartmentsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(DepartmentsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, DepartmentsTable, DepartmentsColumn),
sqlgraph.Edge(sqlgraph.M2M, false, DepartmentsTable, DepartmentsPrimaryKey...),
)
}
func newTokenStep() *sqlgraph.Step {

@ -730,7 +730,7 @@ func HasDepartments() predicate.User {
return predicate.User(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, DepartmentsTable, DepartmentsColumn),
sqlgraph.Edge(sqlgraph.M2M, false, DepartmentsTable, DepartmentsPrimaryKey...),
)
sqlgraph.HasNeighbors(s, step)
})

@ -478,10 +478,10 @@ func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) {
}
if nodes := uc.mutation.DepartmentsIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Rel: sqlgraph.M2M,
Inverse: false,
Table: user.DepartmentsTable,
Columns: []string{user.DepartmentsColumn},
Columns: user.DepartmentsPrimaryKey,
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(department.FieldID, field.TypeInt64),

@ -151,7 +151,7 @@ func (uq *UserQuery) QueryDepartments() *DepartmentQuery {
step := sqlgraph.NewStep(
sqlgraph.From(user.Table, user.FieldID, selector),
sqlgraph.To(department.Table, department.FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, user.DepartmentsTable, user.DepartmentsColumn),
sqlgraph.Edge(sqlgraph.M2M, false, user.DepartmentsTable, user.DepartmentsPrimaryKey...),
)
fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step)
return fromU, nil
@ -747,33 +747,63 @@ func (uq *UserQuery) loadSocials(ctx context.Context, query *UserSocialQuery, no
return nil
}
func (uq *UserQuery) loadDepartments(ctx context.Context, query *DepartmentQuery, nodes []*User, init func(*User), assign func(*User, *Department)) error {
fks := make([]driver.Value, 0, len(nodes))
nodeids := make(map[int64]*User)
for i := range nodes {
fks = append(fks, nodes[i].ID)
nodeids[nodes[i].ID] = nodes[i]
edgeIDs := make([]driver.Value, len(nodes))
byID := make(map[int64]*User)
nids := make(map[int64]map[*User]struct{})
for i, node := range nodes {
edgeIDs[i] = node.ID
byID[node.ID] = node
if init != nil {
init(nodes[i])
init(node)
}
}
query.withFKs = true
query.Where(predicate.Department(func(s *sql.Selector) {
s.Where(sql.InValues(s.C(user.DepartmentsColumn), fks...))
}))
neighbors, err := query.All(ctx)
query.Where(func(s *sql.Selector) {
joinT := sql.Table(user.DepartmentsTable)
s.Join(joinT).On(s.C(department.FieldID), joinT.C(user.DepartmentsPrimaryKey[1]))
s.Where(sql.InValues(joinT.C(user.DepartmentsPrimaryKey[0]), edgeIDs...))
columns := s.SelectedColumns()
s.Select(joinT.C(user.DepartmentsPrimaryKey[0]))
s.AppendSelect(columns...)
s.SetDistinct(false)
})
if err := query.prepareQuery(ctx); err != nil {
return err
}
qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) {
return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) {
assign := spec.Assign
values := spec.ScanValues
spec.ScanValues = func(columns []string) ([]any, error) {
values, err := values(columns[1:])
if err != nil {
return nil, err
}
return append([]any{new(sql.NullInt64)}, values...), nil
}
spec.Assign = func(columns []string, values []any) error {
outValue := values[0].(*sql.NullInt64).Int64
inValue := values[1].(*sql.NullInt64).Int64
if nids[inValue] == nil {
nids[inValue] = map[*User]struct{}{byID[outValue]: {}}
return assign(columns[1:], values[1:])
}
nids[inValue][byID[outValue]] = struct{}{}
return nil
}
})
})
neighbors, err := withInterceptors[[]*Department](ctx, query, qr, query.inters)
if err != nil {
return err
}
for _, n := range neighbors {
fk := n.user_departments
if fk == nil {
return fmt.Errorf(`foreign-key "user_departments" is nil for node %v`, n.ID)
}
node, ok := nodeids[*fk]
nodes, ok := nids[n.ID]
if !ok {
return fmt.Errorf(`unexpected referenced foreign-key "user_departments" returned %v for node %v`, *fk, n.ID)
return fmt.Errorf(`unexpected "departments" node returned %v`, n.ID)
}
for kn := range nodes {
assign(kn, n)
}
assign(node, n)
}
return nil
}

@ -628,10 +628,10 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
}
if uu.mutation.DepartmentsCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Rel: sqlgraph.M2M,
Inverse: false,
Table: user.DepartmentsTable,
Columns: []string{user.DepartmentsColumn},
Columns: user.DepartmentsPrimaryKey,
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(department.FieldID, field.TypeInt64),
@ -641,10 +641,10 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
}
if nodes := uu.mutation.RemovedDepartmentsIDs(); len(nodes) > 0 && !uu.mutation.DepartmentsCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Rel: sqlgraph.M2M,
Inverse: false,
Table: user.DepartmentsTable,
Columns: []string{user.DepartmentsColumn},
Columns: user.DepartmentsPrimaryKey,
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(department.FieldID, field.TypeInt64),
@ -657,10 +657,10 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
}
if nodes := uu.mutation.DepartmentsIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Rel: sqlgraph.M2M,
Inverse: false,
Table: user.DepartmentsTable,
Columns: []string{user.DepartmentsColumn},
Columns: user.DepartmentsPrimaryKey,
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(department.FieldID, field.TypeInt64),
@ -1389,10 +1389,10 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error)
}
if uuo.mutation.DepartmentsCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Rel: sqlgraph.M2M,
Inverse: false,
Table: user.DepartmentsTable,
Columns: []string{user.DepartmentsColumn},
Columns: user.DepartmentsPrimaryKey,
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(department.FieldID, field.TypeInt64),
@ -1402,10 +1402,10 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error)
}
if nodes := uuo.mutation.RemovedDepartmentsIDs(); len(nodes) > 0 && !uuo.mutation.DepartmentsCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Rel: sqlgraph.M2M,
Inverse: false,
Table: user.DepartmentsTable,
Columns: []string{user.DepartmentsColumn},
Columns: user.DepartmentsPrimaryKey,
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(department.FieldID, field.TypeInt64),
@ -1418,10 +1418,10 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error)
}
if nodes := uuo.mutation.DepartmentsIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Rel: sqlgraph.M2M,
Inverse: false,
Table: user.DepartmentsTable,
Columns: []string{user.DepartmentsColumn},
Columns: user.DepartmentsPrimaryKey,
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(department.FieldID, field.TypeInt64),

@ -19,9 +19,9 @@ type UserMeta struct {
// ID of the ent.
// Primary Key | 主键
ID int64 `json:"id,omitempty"`
// 创建时间
// Create Time | 创建时间
CreatedAt time.Time `json:"created_at,omitempty"`
// 更新时间
// Update Time | 更新时间
UpdatedAt time.Time `json:"updated_at,omitempty"`
// optimistic lock | 乐观锁
Version int64 `json:"version,omitempty"`

@ -19,9 +19,9 @@ type UserSocial struct {
// ID of the ent.
// Primary Key | 主键
ID int64 `json:"id,omitempty"`
// 创建时间
// Create Time | 创建时间
CreatedAt time.Time `json:"created_at,omitempty"`
// 更新时间
// Update Time | 更新时间
UpdatedAt time.Time `json:"updated_at,omitempty"`
// 系统用户ID
UserID int64 `json:"user_id,omitempty"`

@ -1,10 +1,8 @@
Name: core.rpc
ListenOn: 0.0.0.0:0
ListenOn: 0.0.0.0:18888
Timeout: 0
Mode: dev
Log:
ServiceName: coreRpcLogger
Mode: console
@ -20,3 +18,27 @@ Prometheus:
Host: 0.0.0.0
Port: 4001
Path: /metrics
# 数据库配置
DatabaseConf:
Type: mysql
Host: 192.168.1.155
Port: 3306
DBName: n-admin
Username: root
Password: root
MaxOpenConn: 1000
SSLMode: disable # disable or require
CacheTime: 5
# Redis缓存配置
RedisConf:
Addr: 192.168.1.155:6379
Type: node
# 多语言配置
I18nConf:
Default: zh
RootPath: dal/i18n/locale
SortedParameterPrefix: p

@ -1,9 +1,16 @@
package config
import (
config2 "git.noahlan.cn/noahlan/ntool-biz/core/config"
"git.noahlan.cn/noahlan/ntool-biz/core/i18n"
"git.noahlan.cn/noahlan/ntool-biz/core/orm/nent/config"
"github.com/zeromicro/go-zero/zrpc"
)
type Config struct {
zrpc.RpcServerConf
DatabaseConf config.Database
RedisConf config2.RedisConf
I18nConf i18n.Config
}

@ -2,6 +2,15 @@ package role
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/dal/errx"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/role"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/entx"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/hander"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
"git.noahlan.cn/noahlan/ntool-biz/core/orm/nent/types"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
@ -21,7 +30,46 @@ func NewCreateRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create
// Role management
func (l *CreateRoleLogic) CreateRole(in *core.RoleInfo) (*core.BaseIDResp, error) {
// todo: add your logic here and delete this line
var id int64
if err := entx.WithTx(l.ctx, l.svcCtx.DB, func(tx *ent.Tx) error {
if err := l.preCheck(tx, in); err != nil {
return err
}
return &core.BaseIDResp{}, nil
dbData, err := tx.Role.Create().
SetStatus(types.ParseStatus(in.Status)).
SetName(in.Name).
SetCode(in.Code).
SetDescription(in.Description).
Save(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
id = dbData.ID
return nil
}); err != nil {
return nil, err
}
return &core.BaseIDResp{
ID: id,
Code: code.StatusOK,
Msg: msg.CreateSuccess,
}, nil
}
func (l *CreateRoleLogic) preCheck(tx *ent.Tx, in *core.RoleInfo) error {
if in.Code == "" {
return nstatus.NewBizErrWithCode(errx.RoleCodeNotEmpty)
}
// check exists
exist, err := tx.Role.Query().Where(role.CodeEQ(in.Code)).Exist(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
if exist {
return nstatus.NewBizErrWithCode(errx.RoleCodeInUsed)
}
return nil
}

@ -2,6 +2,10 @@ package role
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/role"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/hander"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
@ -20,7 +24,12 @@ func NewDeleteRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delete
}
func (l *DeleteRoleLogic) DeleteRole(in *core.IDsReq) (*core.BaseResp, error) {
// todo: add your logic here and delete this line
return &core.BaseResp{}, nil
_, err := l.svcCtx.DB.Role.Delete().Where(role.IDIn(in.Ids...)).Exec(l.ctx)
if err != nil {
return nil, hander.HandleEntErr(err, in)
}
return &core.BaseResp{
Code: code.StatusOK,
Msg: msg.DeleteSuccess,
}, nil
}

@ -2,6 +2,11 @@ package role
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/predicate"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/role"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/hander"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
@ -20,7 +25,50 @@ func NewGetRoleListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetRo
}
func (l *GetRoleListLogic) GetRoleList(in *core.RoleReq) (*core.RoleListResp, error) {
// todo: add your logic here and delete this line
var predicates []predicate.Role
if in.ID != 0 {
predicates = append(predicates, role.IDEQ(in.ID))
goto Query
}
if in.Name != "" {
predicates = append(predicates, role.NameContains(in.Name))
}
if in.Code != "" {
predicates = append(predicates, role.CodeEQ(in.Code))
}
Query:
query := l.svcCtx.DB.Role.Query().
Where(predicates...)
if in.WithUser {
query.WithUsers()
}
return &core.RoleListResp{}, nil
var (
pagination *core.Pagination
list []*ent.Role
err error
)
if in.Page != nil {
result, pageErr := query.Page(l.ctx, in.Page.Current, in.Page.Size)
if pageErr == nil {
pagination = utils.ConvertPaginationDb(result.PageDetails)
list = result.List
} else {
err = pageErr
}
} else {
list, err = query.All(l.ctx)
}
if err != nil {
return nil, hander.HandleEntErr(err, in)
}
resp := &core.RoleListResp{
Page: pagination,
Data: make([]*core.RoleInfo, len(list)),
}
for i, v := range list {
resp.Data[i] = l.svcCtx.Convert.ConvertRoleRpc(l.ctx, v)
}
return resp, nil
}

@ -2,6 +2,9 @@ package role
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/predicate"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/role"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/hander"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
@ -20,7 +23,25 @@ func NewGetRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetRoleLo
}
func (l *GetRoleLogic) GetRole(in *core.RoleReq) (*core.RoleInfo, error) {
// todo: add your logic here and delete this line
return &core.RoleInfo{}, nil
var predicates []predicate.Role
if in.ID != 0 {
predicates = append(predicates, role.IDEQ(in.ID))
goto Query
}
if in.Name != "" {
predicates = append(predicates, role.NameContains(in.Name))
}
if in.Code != "" {
predicates = append(predicates, role.CodeEQ(in.Code))
}
Query:
query := l.svcCtx.DB.Role.Query().Where(predicates...)
if in.WithUser {
query.WithUsers()
}
dbData, err := query.First(l.ctx)
if err != nil {
return nil, hander.HandleEntErr(err, in)
}
return l.svcCtx.Convert.ConvertRoleRpc(l.ctx, dbData), nil
}

@ -2,6 +2,12 @@ package role
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/entx"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/hander"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
"git.noahlan.cn/noahlan/ntool-biz/core/orm/nent/types"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
@ -20,7 +26,25 @@ func NewUpdateRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Update
}
func (l *UpdateRoleLogic) UpdateRole(in *core.RoleInfo) (*core.BaseResp, error) {
// todo: add your logic here and delete this line
if err := entx.WithTx(l.ctx, l.svcCtx.DB, func(tx *ent.Tx) error {
// Code不允许修改通过删除重建方式进行
update := tx.Role.Update().
SetNotEmptyName(in.Name).
SetNotEmptyDescription(in.Description)
if in.Status != "" {
update.SetStatus(types.ParseStatus(in.Status))
}
err := update.Exec(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
return nil
}); err != nil {
return nil, err
}
return &core.BaseResp{}, nil
return &core.BaseResp{
Code: code.StatusOK,
Msg: msg.UpdateSuccess,
}, nil
}

@ -2,9 +2,23 @@ package user
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/dal/errx"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/user"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/logic/user/meta"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/entx"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/hander"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
"git.noahlan.cn/noahlan/ntool-biz/core/orm/nent/types"
"git.noahlan.cn/noahlan/ntool/ncrypt"
"git.noahlan.cn/noahlan/ntool/nlog"
"git.noahlan.cn/noahlan/ntool/nrandom"
"git.noahlan.cn/noahlan/ntool/nstr"
"strings"
)
type CreateUserLogic struct {
@ -21,7 +35,112 @@ func NewCreateUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create
// User Management
func (l *CreateUserLogic) CreateUser(in *core.UserInfo) (*core.BaseIDResp, error) {
// todo: add your logic here and delete this line
// 检查用户
var createdUser *ent.User
err := entx.WithTx(l.ctx, l.svcCtx.DB, func(tx *ent.Tx) error {
err := l.checkUserExists(tx, in)
if err != nil {
return err
}
db := tx.User.Create().
SetStatus(types.StatusPending).
SetNillableEmail(in.Email).
SetPassword(ncrypt.BcryptEncrypt(in.Password, 0)).
SetNillablePhoneNumber(in.PhoneNumber)
if in.Email != nil {
email := strings.TrimSpace(in.GetEmail())
if !nstr.IsEmail(email) {
return nstatus.NewGrpcInternalErr("邮箱格式错误")
}
}
if in.Username == "" {
if in.GetPhoneNumber() != "" {
db.SetUsername(in.GetPhoneNumber())
} else {
db.SetUsername(nrandom.RandString(16))
}
} else {
db.SetUsername(in.Username)
}
if in.Nickname != nil {
nickname := strings.TrimSpace(*in.Nickname)
if nickname != "" {
db.SetNickname(nickname)
}
}
// metas
if len(in.Metas) > 0 {
userMetaLogic := meta.NewUserMetaLogic(l.ctx, l.svcCtx, tx)
err := userMetaLogic.UpsetUserMeta(in.ID, in.Metas)
if err != nil {
nlog.Errorw("upsert usermeta err", nlog.Field("detail", in), nlog.Field("err", err))
return nstatus.NewBizErrWithCode(errx.UpdateUserMetaErr)
}
}
// insert
createdUser, err = db.Save(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
return nil
})
if err != nil {
return nil, err
}
return &core.BaseIDResp{
ID: createdUser.ID,
Code: code.StatusOK,
Msg: msg.CreateSuccess,
}, nil
}
func (l *CreateUserLogic) checkUserExists(tx *ent.Tx, in *core.UserInfo) error {
if in.Username != "" {
exist, err := tx.User.Query().Where(user.UsernameEQ(in.Username)).Exist(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
if exist {
return nstatus.NewBizErrWithCode(errx.UsernameAlreadyExists)
}
}
if in.GetPhoneNumber() != "" {
exist, err := tx.User.Query().Where(user.PhoneNumberEQ(in.GetPhoneNumber())).Exist(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
if exist {
return nstatus.NewBizErrWithCode(errx.UserPhoneNumberAlreadyExists)
}
}
if in.GetNickname() != "" {
exist, err := tx.User.Query().Where(user.NicknameEQ(in.GetNickname())).Exist(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
if exist {
return nstatus.NewBizErrWithCode(errx.UserNicknameAlreadyExists)
}
}
if in.GetEmail() != "" {
exist, err := tx.User.Query().Where(user.EmailEQ(in.GetEmail())).Exist(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
if exist {
return nstatus.NewBizErrWithCode(errx.UserEmailAlreadyExists)
}
}
if in.ID != 0 {
exist, err := tx.User.Query().Where(user.IDEQ(in.ID)).Exist(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
if exist {
return nstatus.NewBizErrWithCode(errx.UserExists)
}
}
return &core.BaseIDResp{}, nil
return nil
}

@ -2,6 +2,10 @@ package user
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/user"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/hander"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
@ -20,7 +24,13 @@ func NewDeleteUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delete
}
func (l *DeleteUserLogic) DeleteUser(in *core.IDsReq) (*core.BaseResp, error) {
// todo: add your logic here and delete this line
return &core.BaseResp{}, nil
// TODO 级联删除?
_, err := l.svcCtx.DB.User.Delete().Where(user.IDIn(in.Ids...)).Exec(l.ctx)
if err != nil {
return nil, hander.HandleEntErr(err, in)
}
return &core.BaseResp{
Code: code.StatusOK,
Msg: msg.DeleteSuccess,
}, nil
}

@ -2,6 +2,11 @@ package user
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/predicate"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/user"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/hander"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
@ -20,7 +25,64 @@ func NewGetUserListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUs
}
func (l *GetUserListLogic) GetUserList(in *core.UserReq) (*core.UserListResp, error) {
// todo: add your logic here and delete this line
var predicates []predicate.User
if in.ID != 0 {
predicates = append(predicates, user.IDEQ(in.ID))
}
if in.Username != "" {
predicates = append(predicates, user.UsernameContains(in.Username))
}
if in.PhoneNumber != "" {
predicates = append(predicates, user.PhoneNumberContains(in.PhoneNumber))
}
if in.Email != "" {
predicates = append(predicates, user.EmailContains(in.Email))
}
if in.Nickname != "" {
predicates = append(predicates, user.NicknameContains(in.Nickname))
}
query := l.svcCtx.DB.User.Query().
Where(predicates...).
WithLoginRecord()
if in.WithRole {
query.WithRoles()
}
if in.WithSocial {
query.WithSocials()
}
if in.WithDepartment {
query.WithDepartments()
}
if in.WithToken {
query.WithToken()
}
return &core.UserListResp{}, nil
var (
pagination *core.Pagination
list []*ent.User
err error
)
if in.Page != nil {
result, pageErr := query.Page(l.ctx, in.Page.Current, in.Page.Size)
if pageErr == nil {
pagination = utils.ConvertPaginationDb(result.PageDetails)
list = result.List
} else {
err = pageErr
}
} else {
list, err = query.All(l.ctx)
}
if err != nil {
return nil, hander.HandleEntErr(err, in)
}
resp := &core.UserListResp{
Page: pagination,
Data: make([]*core.UserInfo, len(list)),
}
for i, v := range list {
resp.Data[i] = l.svcCtx.Convert.ConvertUserRpc(l.ctx, v)
}
return resp, nil
}

@ -2,6 +2,9 @@ package user
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/predicate"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/user"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/hander"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
@ -20,7 +23,42 @@ func NewGetUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserLo
}
func (l *GetUserLogic) GetUser(in *core.UserReq) (*core.UserInfo, error) {
// todo: add your logic here and delete this line
return &core.UserInfo{}, nil
var predicates []predicate.User
if in.ID != 0 {
predicates = append(predicates, user.IDEQ(in.ID))
goto Query
}
if in.Username != "" {
predicates = append(predicates, user.UsernameEQ(in.Username))
}
if in.PhoneNumber != "" {
predicates = append(predicates, user.PhoneNumberEQ(in.PhoneNumber))
}
if in.Email != "" {
predicates = append(predicates, user.EmailEQ(in.Email))
}
if in.Nickname != "" {
predicates = append(predicates, user.NicknameEQ(in.Nickname))
}
Query:
query := l.svcCtx.DB.User.Query().
Where(predicates...).
WithLoginRecord()
if in.WithRole {
query.WithRoles()
}
if in.WithSocial {
query.WithSocials()
}
if in.WithDepartment {
query.WithDepartments()
}
if in.WithToken {
query.WithToken()
}
dbData, err := query.First(l.ctx)
if err != nil {
return nil, hander.HandleEntErr(err, in)
}
return l.svcCtx.Convert.ConvertUserRpc(l.ctx, dbData), nil
}

@ -0,0 +1,50 @@
package meta
import (
"context"
"entgo.io/ent/dialect/sql"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
)
type UserMetaLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
tx *ent.Tx
}
func NewUserMetaLogic(ctx context.Context, svcCtx *svc.ServiceContext, tx *ent.Tx) *UserMetaLogic {
return &UserMetaLogic{
ctx: ctx,
svcCtx: svcCtx,
tx: tx,
}
}
func (l *UserMetaLogic) getDBClient() *ent.UserMetaClient {
if l.tx != nil {
return l.tx.UserMeta
}
return l.svcCtx.DB.UserMeta
}
func (l *UserMetaLogic) UpsetUserMeta(userId int64, metaMap map[string]string) error {
db := l.getDBClient()
bulk := make([]*ent.UserMetaCreate, 0)
for k, v := range metaMap {
bulk = append(bulk, db.Create().
SetUserID(userId).
SetKey(k).
SetValue(v))
}
err := db.CreateBulk(bulk...).
OnConflict(sql.ResolveWithNewValues()).
Exec(l.ctx)
if err != nil {
return err
}
return nil
}

@ -2,9 +2,18 @@ package user
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/user"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/logic/user/meta"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/entx"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/hander"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
"git.noahlan.cn/noahlan/ntool-biz/core/orm/nent/types"
"git.noahlan.cn/noahlan/ntool/nlog"
)
type UpdateUserLogic struct {
@ -20,7 +29,33 @@ func NewUpdateUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Update
}
func (l *UpdateUserLogic) UpdateUser(in *core.UserInfo) (*core.BaseResp, error) {
// todo: add your logic here and delete this line
return &core.BaseResp{}, nil
// phoneNumber / email / password 需要单独修改
if err := entx.WithTx(l.ctx, l.svcCtx.DB, func(tx *ent.Tx) error {
updated := tx.User.Update().Where(user.IDEQ(in.ID))
if in.Nickname != nil {
updated.SetNotEmptyNickname(in.GetNickname())
}
// metas
if len(in.Metas) > 0 {
userMetaLogic := meta.NewUserMetaLogic(l.ctx, l.svcCtx, tx)
err := userMetaLogic.UpsetUserMeta(in.ID, in.Metas)
if err != nil {
nlog.Errorw("upsert usermeta err", nlog.Field("detail", in), nlog.Field("err", err))
return nstatus.NewBizErrWithCode(errx.UpdateUserMetaErr)
}
}
// TODO status判定
updated.SetStatus(types.StatusNormal)
err := updated.Exec(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
return nil
}); err != nil {
return nil, err
}
return &core.BaseResp{
Code: code.StatusOK,
Msg: msg.UpdateSuccess,
}, nil
}

@ -0,0 +1,60 @@
package user_role
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/role"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/user"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/hander"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
)
type GetUserRolesLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewGetUserRolesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserRolesLogic {
return &GetUserRolesLogic{
ctx: ctx,
svcCtx: svcCtx,
}
}
// GetUserRoles 获取用户绑定的角色列表
func (l *GetUserRolesLogic) GetUserRoles(in *core.GetUserRolesReq) (*core.RoleListResp, error) {
var (
pagination *core.Pagination
list []*ent.Role
err error
)
query := l.svcCtx.DB.Role.Query().Where(role.HasUsersWith(user.IDEQ(in.UserId)))
if in.Page != nil {
result, pageErr := query.Page(l.ctx, in.Page.Current, in.Page.Size)
if pageErr == nil {
pagination = utils.ConvertPaginationDb(result.PageDetails)
list = result.List
} else {
err = pageErr
}
} else {
list, err = query.All(l.ctx)
}
if err != nil {
return nil, hander.HandleEntErr(err, in)
}
resp := &core.RoleListResp{
Page: pagination,
Data: make([]*core.RoleInfo, len(list)),
}
for i, v := range list {
resp.Data[i] = l.svcCtx.Convert.ConvertRoleRpc(l.ctx, v)
}
return resp, nil
}

@ -0,0 +1,70 @@
package user_role
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/role"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/user"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/entx"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/hander"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
)
type UserBindRoleLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewUserBindRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserBindRoleLogic {
return &UserBindRoleLogic{
ctx: ctx,
svcCtx: svcCtx,
}
}
// User-Role Relationship Management
func (l *UserBindRoleLogic) UserBindRole(in *core.UserRoleReq) (*core.BaseResp, error) {
if err := entx.WithTx(l.ctx, l.svcCtx.DB, func(tx *ent.Tx) error {
updated := tx.User.Update().Where(user.IDEQ(in.UserId))
updateRoleIds := make([]*ent.Role, 0)
if len(in.RoleCodes) > 0 {
tmpDb, err := tx.Role.Query().
Select(role.FieldID, role.FieldCode).
Where(role.CodeIn(in.RoleCodes...)).
All(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
updateRoleIds = append(updateRoleIds, tmpDb...)
}
if len(in.RoleIds) > 0 {
tmpDb, err := tx.Role.Query().
Select(role.FieldID, role.FieldCode).
Where(role.IDIn(in.RoleIds...)).
All(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
updateRoleIds = append(updateRoleIds, tmpDb...)
}
updated.ClearRoles()
updated.AddRoles(updateRoleIds...)
err := updated.Exec(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
return nil
}); err != nil {
return nil, err
}
return &core.BaseResp{
Code: code.StatusOK,
Msg: msg.UpdateSuccess,
}, nil
}

@ -0,0 +1,39 @@
package user_role
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/user"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/hander"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
)
type UserClearRoleLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewUserClearRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserClearRoleLogic {
return &UserClearRoleLogic{
ctx: ctx,
svcCtx: svcCtx,
}
}
// UserClearRole 用户清理角色
func (l *UserClearRoleLogic) UserClearRole(in *core.IDReq) (*core.BaseResp, error) {
err := l.svcCtx.DB.User.Update().
Where(user.IDEQ(in.ID)).
ClearRoles().
Exec(l.ctx)
if err != nil {
return nil, hander.HandleEntErr(err, in)
}
return &core.BaseResp{
Code: code.StatusOK,
Msg: msg.UpdateSuccess,
}, nil
}

@ -0,0 +1,69 @@
package user_role
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/role"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/user"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/entx"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/utils/hander"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
)
type UserUnbindRoleLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewUserUnbindRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserUnbindRoleLogic {
return &UserUnbindRoleLogic{
ctx: ctx,
svcCtx: svcCtx,
}
}
// UserUnbindRole 用户解绑角色
func (l *UserUnbindRoleLogic) UserUnbindRole(in *core.UserRoleReq) (*core.BaseResp, error) {
if err := entx.WithTx(l.ctx, l.svcCtx.DB, func(tx *ent.Tx) error {
updated := tx.User.Update().Where(user.IDEQ(in.UserId))
removedRoles := make([]*ent.Role, 0)
if len(in.RoleCodes) > 0 {
tmpDb, err := tx.Role.Query().
Select(role.FieldID, role.FieldCode).
Where(role.CodeIn(in.RoleCodes...)).
All(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
removedRoles = append(removedRoles, tmpDb...)
}
if len(in.RoleIds) > 0 {
tmpDb, err := tx.Role.Query().
Select(role.FieldID, role.FieldCode).
Where(role.IDIn(in.RoleIds...)).
All(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
removedRoles = append(removedRoles, tmpDb...)
}
updated.RemoveRoles(removedRoles...)
err := updated.Exec(l.ctx)
if err != nil {
return hander.HandleEntErr(err, in)
}
return nil
}); err != nil {
return nil, err
}
return &core.BaseResp{
Code: code.StatusOK,
Msg: msg.UpdateSuccess,
}, nil
}

@ -15,6 +15,7 @@ import (
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/logic/role"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/logic/token"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/logic/user"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/logic/user_role"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/logic/user_social"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
@ -265,6 +266,30 @@ func (s *CoreServer) DeleteUser(ctx context.Context, in *core.IDsReq) (*core.Bas
return l.DeleteUser(in)
}
// User-Role Relationship Management
func (s *CoreServer) UserBindRole(ctx context.Context, in *core.UserRoleReq) (*core.BaseResp, error) {
l := user_role.NewUserBindRoleLogic(ctx, s.svcCtx)
return l.UserBindRole(in)
}
// UserUnbindRole 用户解绑角色
func (s *CoreServer) UserUnbindRole(ctx context.Context, in *core.UserRoleReq) (*core.BaseResp, error) {
l := user_role.NewUserUnbindRoleLogic(ctx, s.svcCtx)
return l.UserUnbindRole(in)
}
// UserClearRole 用户清理角色
func (s *CoreServer) UserClearRole(ctx context.Context, in *core.IDReq) (*core.BaseResp, error) {
l := user_role.NewUserClearRoleLogic(ctx, s.svcCtx)
return l.UserClearRole(in)
}
// GetUserRoles 获取用户绑定的角色列表
func (s *CoreServer) GetUserRoles(ctx context.Context, in *core.GetUserRolesReq) (*core.RoleListResp, error) {
l := user_role.NewGetUserRolesLogic(ctx, s.svcCtx)
return l.GetUserRoles(in)
}
// User Management
func (s *CoreServer) CreateUserSocial(ctx context.Context, in *core.UserSocialInfo) (*core.BaseIDResp, error) {
l := user_social.NewCreateUserSocialLogic(ctx, s.svcCtx)

@ -0,0 +1,120 @@
package svc
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
"github.com/jinzhu/copier"
"time"
)
type Convert struct {
svcCtx *ServiceContext
}
func NewConvert(svcCtx *ServiceContext) *Convert {
return &Convert{
svcCtx: svcCtx,
}
}
func (c *Convert) ConvertRoleRpc(_ context.Context, v *ent.Role) *core.RoleInfo {
if v == nil {
return nil
}
var tmp core.RoleInfo
_ = copier.Copy(&tmp, v)
tmp.CreatedAt = v.CreatedAt.Format(time.DateTime)
tmp.UpdatedAt = v.UpdatedAt.Format(time.DateTime)
tmp.Status = v.Status.String()
return &tmp
}
func (c *Convert) ConvertUserRpc(ctx context.Context, v *ent.User) *core.UserInfo {
if v == nil {
return nil
}
var tmp core.UserInfo
_ = copier.Copy(&tmp, v)
tmp.Status = v.Status.String()
tmp.CreatedAt = v.CreatedAt.Format(time.DateTime)
tmp.UpdatedAt = v.UpdatedAt.Format(time.DateTime)
// Metadata
if len(v.Edges.Metas) > 0 {
// 导出meta数据
metaMap := make(map[string]string)
for _, item := range v.Edges.Metas {
metaMap[item.Key] = item.Value
}
tmp.Metas = metaMap
}
// Relationship
if len(v.Edges.Roles) > 0 {
tmp.Roles = make([]*core.RoleInfo, len(v.Edges.Roles))
for i, item := range v.Edges.Roles {
tmp.Roles[i] = c.ConvertRoleRpc(ctx, item)
}
}
if v.Edges.LoginRecord != nil {
tmp.LoginRecord = c.ConvertLoginRecordRpc(ctx, v.Edges.LoginRecord)
}
if len(v.Edges.Departments) > 0 {
tmp.Departments = make([]*core.DepartmentInfo, len(v.Edges.Departments))
for i, item := range v.Edges.Departments {
tmp.Departments[i] = c.ConvertDepartmentRpc(ctx, item)
}
}
if len(v.Edges.Token) > 0 {
}
if len(v.Edges.Socials) > 0 {
}
return &tmp
}
func (c *Convert) ConvertLoginRecordRpc(_ context.Context, v *ent.LoginRecord) *core.LoginRecordInfo {
if v == nil {
return nil
}
var tmp core.LoginRecordInfo
_ = copier.Copy(&tmp, v)
tmp.UserId = v.UserID
tmp.LastLoginUa = v.LastLoginUA
return &tmp
}
func (c *Convert) ConvertDepartmentRpc(ctx context.Context, v *ent.Department) *core.DepartmentInfo {
if v == nil {
return nil
}
var tmp core.DepartmentInfo
_ = copier.Copy(&tmp, v)
tmp.LeaderId = v.LeaderID
tmp.ParentId = v.ParentID
// relationship
if v.Edges.Parent != nil {
tmp.Parent = c.ConvertDepartmentRpc(ctx, v.Edges.Parent)
}
if len(v.Edges.Children) > 0 {
tmp.Children = make([]*core.DepartmentInfo, len(v.Edges.Children))
for i, item := range v.Edges.Children {
tmp.Children[i] = c.ConvertDepartmentRpc(ctx, item)
}
}
if len(v.Edges.Users) > 0 {
tmp.Users = make([]*core.UserInfo, len(v.Edges.Users))
for i, item := range v.Edges.Users {
tmp.Users[i] = c.ConvertUserRpc(ctx, item)
}
}
if v.Edges.Leader != nil {
tmp.Leader = c.ConvertUserRpc(ctx, v.Edges.Leader)
}
return &tmp
}

@ -1,26 +1,71 @@
package svc
import (
"context"
"entgo.io/ent/dialect/sql/schema"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/config"
"git.noahlan.cn/noahlan/ntool/nmapper"
"git.noahlan.cn/noahlan/ntool/nmapper/wrapper"
"github.com/zeromicro/go-zero/core/service"
"github.com/zeromicro/go-zero/core/stores/redis"
"git.noahlan.cn/noahlan/ntool-biz/core/i18n"
"git.noahlan.cn/noahlan/ntool-biz/zero/logz"
"git.noahlan.cn/noahlan/ntool/nlog"
"github.com/zeromicro/go-zero/core/logx"
// required by schema hooks.
_ "git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/runtime"
)
type ServiceContext struct {
Config config.Config
DB *ent.Client
Redis *redis.Redis
Mapper *nmapper.MapperObject
Convert *Convert
}
func NewServiceContext(c config.Config) *ServiceContext {
tmp := &ServiceContext{Config: c}
nlog.MustSetup(logz.WrapConf(c.Log))
logx.SetWriter(logz.NewWriter())
// 配置多语言
i18n.InitWithConfig(c.I18nConf)
return &ServiceContext{
Config: c,
// redis
tmp.Redis = redis.MustNewRedis(redis.RedisConf{
Host: c.RedisConf.Addr,
Type: c.RedisConf.Type,
Pass: c.RedisConf.Password,
Tls: c.RedisConf.Tls,
})
// database
dbOpts := make([]ent.Option, 0)
dbOpts = append(dbOpts, ent.Log(nlog.Info))
dbOpts = append(dbOpts, ent.Driver(c.DatabaseConf.NewNoCacheDriver()))
if c.Mode == service.DevMode || c.Mode == service.TestMode {
dbOpts = append(dbOpts, ent.Debug())
}
tmp.DB = ent.NewClient(dbOpts...)
// 初始化数据库结构
if err := tmp.DB.Schema.Create(context.Background(),
schema.WithDropColumn(true),
schema.WithDropIndex(true),
schema.WithForeignKeys(false)); err != nil {
nlog.Errorw("数据库错误", nlog.Field("err", err))
panic(err)
}
// mapper
tmp.Mapper = nmapper.NewMapper(nmapper.WithTypeWrapper(wrapper.StrWrapper()...))
// convert
tmp.Convert = NewConvert(tmp)
return tmp
}

@ -0,0 +1,37 @@
package entx
import (
"context"
"fmt"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent"
"git.noahlan.cn/noahlan/ntool/nlog"
)
// WithTx uses transaction in ent.
func WithTx(ctx context.Context, client *ent.Client, fn func(tx *ent.Tx) error) error {
tx, err := client.Tx(ctx)
if err != nil {
nlog.Errorw("failed to start transaction", nlog.Field("detail", err.Error()))
return err
}
defer func() {
if v := recover(); v != nil {
_ = tx.Rollback()
panic(v)
}
}()
if err := fn(tx); err != nil {
if rollbackErr := tx.Rollback(); rollbackErr != nil {
err = fmt.Errorf("%w: rolling back transaction: %v", err, rollbackErr)
}
nlog.Errorw("errors occur in transaction", nlog.Field("detail", err.Error()))
return err
}
if err := tx.Commit(); err != nil {
nlog.Errorw("failed to commit transaction", nlog.Field("detail", err.Error()))
return err
}
return nil
}

@ -0,0 +1,38 @@
package hander
import (
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
"git.noahlan.cn/noahlan/ntool/nlog"
)
// HandleEntErr returns errors dealing with default functions.
func HandleEntErr(err error, detail any) error {
logger := nlog.WithCallerSkip(1)
if err != nil {
switch {
case ent.IsNotFound(err):
// 未找到数据实体
logger.Errorw(err.Error(), nlog.Field("detail", detail))
return nstatus.NewBizErr(code.StatusNotFound, msg.ObjectNotFound)
case ent.IsConstraintError(err):
// 创建/更新时,发生约束错误
logger.Errorw(err.Error(), nlog.Field("detail", detail))
return nstatus.NewBizErr(code.StatusConflict, msg.ConstraintError)
case ent.IsValidationError(err):
// 数据类型错误,验证错误
logger.Errorw(err.Error(), nlog.Field("detail", detail))
return nstatus.NewBizErr(code.StatusBadRequest, msg.ValidationError)
case ent.IsNotSingular(err):
// 查询时发生非单一实体错误通常是因为记录中存在多个实体查询单个实体时未添加Limit
logger.Errorw(err.Error(), nlog.Field("detail", detail))
return nstatus.NewBizErr(code.StatusBadRequest, msg.NotSingularError)
default:
logger.Errorw("database error", nlog.Field("err", err.Error()), nlog.Field("detail", detail))
return nstatus.NewGrpcInternalErr(msg.DatabaseError)
}
}
return err
}

@ -0,0 +1,14 @@
package utils
import (
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
"git.noahlan.cn/noahlan/ntool-biz/core/page"
)
func ConvertPaginationDb(pagination *page.Pagination) *core.Pagination {
return &core.Pagination{
Size: uint64(pagination.Size),
Total: uint64(pagination.Total),
Current: uint64(pagination.Current),
}
}

File diff suppressed because it is too large Load Diff

@ -121,6 +121,19 @@ type CoreClient interface {
GetUser(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserInfo, error)
// group: user
DeleteUser(ctx context.Context, in *IDsReq, opts ...grpc.CallOption) (*BaseResp, error)
// User-Role Relationship Management
// UserBindRole 用户绑定角色
// group: user_role
UserBindRole(ctx context.Context, in *UserRoleReq, opts ...grpc.CallOption) (*BaseResp, error)
// UserUnbindRole 用户解绑角色
// group: user_role
UserUnbindRole(ctx context.Context, in *UserRoleReq, opts ...grpc.CallOption) (*BaseResp, error)
// UserClearRole 用户清理角色
// group: user_role
UserClearRole(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error)
// GetUserRoles 获取用户绑定的角色列表
// group: user_role
GetUserRoles(ctx context.Context, in *GetUserRolesReq, opts ...grpc.CallOption) (*RoleListResp, error)
// User Management
// group: user_social
CreateUserSocial(ctx context.Context, in *UserSocialInfo, opts ...grpc.CallOption) (*BaseIDResp, error)
@ -547,6 +560,42 @@ func (c *coreClient) DeleteUser(ctx context.Context, in *IDsReq, opts ...grpc.Ca
return out, nil
}
func (c *coreClient) UserBindRole(ctx context.Context, in *UserRoleReq, opts ...grpc.CallOption) (*BaseResp, error) {
out := new(BaseResp)
err := c.cc.Invoke(ctx, "/core.Core/UserBindRole", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *coreClient) UserUnbindRole(ctx context.Context, in *UserRoleReq, opts ...grpc.CallOption) (*BaseResp, error) {
out := new(BaseResp)
err := c.cc.Invoke(ctx, "/core.Core/UserUnbindRole", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *coreClient) UserClearRole(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error) {
out := new(BaseResp)
err := c.cc.Invoke(ctx, "/core.Core/UserClearRole", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *coreClient) GetUserRoles(ctx context.Context, in *GetUserRolesReq, opts ...grpc.CallOption) (*RoleListResp, error) {
out := new(RoleListResp)
err := c.cc.Invoke(ctx, "/core.Core/GetUserRoles", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *coreClient) CreateUserSocial(ctx context.Context, in *UserSocialInfo, opts ...grpc.CallOption) (*BaseIDResp, error) {
out := new(BaseIDResp)
err := c.cc.Invoke(ctx, "/core.Core/createUserSocial", in, out, opts...)
@ -695,6 +744,19 @@ type CoreServer interface {
GetUser(context.Context, *UserReq) (*UserInfo, error)
// group: user
DeleteUser(context.Context, *IDsReq) (*BaseResp, error)
// User-Role Relationship Management
// UserBindRole 用户绑定角色
// group: user_role
UserBindRole(context.Context, *UserRoleReq) (*BaseResp, error)
// UserUnbindRole 用户解绑角色
// group: user_role
UserUnbindRole(context.Context, *UserRoleReq) (*BaseResp, error)
// UserClearRole 用户清理角色
// group: user_role
UserClearRole(context.Context, *IDReq) (*BaseResp, error)
// GetUserRoles 获取用户绑定的角色列表
// group: user_role
GetUserRoles(context.Context, *GetUserRolesReq) (*RoleListResp, error)
// User Management
// group: user_social
CreateUserSocial(context.Context, *UserSocialInfo) (*BaseIDResp, error)
@ -848,6 +910,18 @@ func (UnimplementedCoreServer) GetUser(context.Context, *UserReq) (*UserInfo, er
func (UnimplementedCoreServer) DeleteUser(context.Context, *IDsReq) (*BaseResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented")
}
func (UnimplementedCoreServer) UserBindRole(context.Context, *UserRoleReq) (*BaseResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UserBindRole not implemented")
}
func (UnimplementedCoreServer) UserUnbindRole(context.Context, *UserRoleReq) (*BaseResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UserUnbindRole not implemented")
}
func (UnimplementedCoreServer) UserClearRole(context.Context, *IDReq) (*BaseResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UserClearRole not implemented")
}
func (UnimplementedCoreServer) GetUserRoles(context.Context, *GetUserRolesReq) (*RoleListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUserRoles not implemented")
}
func (UnimplementedCoreServer) CreateUserSocial(context.Context, *UserSocialInfo) (*BaseIDResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateUserSocial not implemented")
}
@ -1686,6 +1760,78 @@ func _Core_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(int
return interceptor(ctx, in, info, handler)
}
func _Core_UserBindRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UserRoleReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CoreServer).UserBindRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/core.Core/UserBindRole",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CoreServer).UserBindRole(ctx, req.(*UserRoleReq))
}
return interceptor(ctx, in, info, handler)
}
func _Core_UserUnbindRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UserRoleReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CoreServer).UserUnbindRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/core.Core/UserUnbindRole",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CoreServer).UserUnbindRole(ctx, req.(*UserRoleReq))
}
return interceptor(ctx, in, info, handler)
}
func _Core_UserClearRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IDReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CoreServer).UserClearRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/core.Core/UserClearRole",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CoreServer).UserClearRole(ctx, req.(*IDReq))
}
return interceptor(ctx, in, info, handler)
}
func _Core_GetUserRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUserRolesReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CoreServer).GetUserRoles(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/core.Core/GetUserRoles",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CoreServer).GetUserRoles(ctx, req.(*GetUserRolesReq))
}
return interceptor(ctx, in, info, handler)
}
func _Core_CreateUserSocial_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UserSocialInfo)
if err := dec(in); err != nil {
@ -1963,6 +2109,22 @@ var Core_ServiceDesc = grpc.ServiceDesc{
MethodName: "deleteUser",
Handler: _Core_DeleteUser_Handler,
},
{
MethodName: "UserBindRole",
Handler: _Core_UserBindRole_Handler,
},
{
MethodName: "UserUnbindRole",
Handler: _Core_UserUnbindRole_Handler,
},
{
MethodName: "UserClearRole",
Handler: _Core_UserClearRole_Handler,
},
{
MethodName: "GetUserRoles",
Handler: _Core_GetUserRoles_Handler,
},
{
MethodName: "createUserSocial",
Handler: _Core_CreateUserSocial_Handler,

Loading…
Cancel
Save