From 2ef0e36bfbf2a35f89fed6ae74c9a36238bc805d Mon Sep 17 00:00:00 2001 From: Ryan Su Date: Fri, 29 Dec 2023 07:54:40 +0800 Subject: [PATCH 1/3] chore: upgrade docker image --- Dockerfile-api | 2 +- Dockerfile-rpc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile-api b/Dockerfile-api index 90601716..94ee55c4 100644 --- a/Dockerfile-api +++ b/Dockerfile-api @@ -1,4 +1,4 @@ -FROM alpine:3.18.5 +FROM alpine:3.19 # Define the project name | 定义项目名称 ARG PROJECT=core diff --git a/Dockerfile-rpc b/Dockerfile-rpc index 88d28b60..c7173407 100644 --- a/Dockerfile-rpc +++ b/Dockerfile-rpc @@ -1,4 +1,4 @@ -FROM alpine:3.18.5 +FROM alpine:3.19 # Define the project name | 定义项目名称 ARG PROJECT=core From 36c328dc6c084acf4cbd6e3bba7c06924c00e8b5 Mon Sep 17 00:00:00 2001 From: Ryan Su Date: Wed, 3 Jan 2024 21:21:45 +0800 Subject: [PATCH 2/3] chore: update deps --- .../oauthprovider/oauth_callback_logic.go | 4 +- .../logic/publicuser/login_by_email_logic.go | 2 +- .../logic/publicuser/login_by_sms_logic.go | 2 +- api/internal/logic/publicuser/login_logic.go | 2 +- go.mod | 32 +++++----- go.sum | 64 +++++++++---------- .../logic/token/create_token_logic.go | 2 +- .../logic/user/get_user_by_id_logic.go | 4 +- .../logic/user/get_user_by_username_logic.go | 4 +- 9 files changed, 58 insertions(+), 58 deletions(-) diff --git a/api/internal/logic/oauthprovider/oauth_callback_logic.go b/api/internal/logic/oauthprovider/oauth_callback_logic.go index a7e1e67f..9307fb50 100644 --- a/api/internal/logic/oauthprovider/oauth_callback_logic.go +++ b/api/internal/logic/oauthprovider/oauth_callback_logic.go @@ -46,7 +46,7 @@ func (l *OauthCallbackLogic) OauthCallback() (resp *types.CallbackResp, err erro strings.Join(result.RoleCodes, ","))) // add token into database - expiredAt := time.Now().Add(time.Second * 259200).Unix() + expiredAt := time.Now().Add(time.Second * time.Duration(l.svcCtx.Config.Auth.AccessExpire)).UnixMilli() _, err = l.svcCtx.CoreRpc.CreateToken(l.ctx, &core.TokenInfo{ Uuid: result.Id, Token: pointy.GetPointer(token), @@ -62,6 +62,6 @@ func (l *OauthCallbackLogic) OauthCallback() (resp *types.CallbackResp, err erro return &types.CallbackResp{ UserId: *result.Id, Token: token, - Expire: uint64(time.Now().Add(time.Second * 259200).Unix()), + Expire: uint64(expiredAt), }, nil } diff --git a/api/internal/logic/publicuser/login_by_email_logic.go b/api/internal/logic/publicuser/login_by_email_logic.go index f190679c..a5f75572 100644 --- a/api/internal/logic/publicuser/login_by_email_logic.go +++ b/api/internal/logic/publicuser/login_by_email_logic.go @@ -66,7 +66,7 @@ func (l *LoginByEmailLogic) LoginByEmail(req *types.LoginByEmailReq) (resp *type } // add token into database - expiredAt := time.Now().Add(time.Second * time.Duration(l.svcCtx.Config.Auth.AccessExpire)).Unix() + expiredAt := time.Now().Add(time.Second * time.Duration(l.svcCtx.Config.Auth.AccessExpire)).UnixMilli() _, err = l.svcCtx.CoreRpc.CreateToken(l.ctx, &core.TokenInfo{ Uuid: userData.Data[0].Id, Token: pointy.GetPointer(token), diff --git a/api/internal/logic/publicuser/login_by_sms_logic.go b/api/internal/logic/publicuser/login_by_sms_logic.go index 015b38fd..576da7a3 100644 --- a/api/internal/logic/publicuser/login_by_sms_logic.go +++ b/api/internal/logic/publicuser/login_by_sms_logic.go @@ -66,7 +66,7 @@ func (l *LoginBySmsLogic) LoginBySms(req *types.LoginBySmsReq) (resp *types.Logi } // add token into database - expiredAt := time.Now().Add(time.Second * time.Duration(l.svcCtx.Config.Auth.AccessExpire)).Unix() + expiredAt := time.Now().Add(time.Second * time.Duration(l.svcCtx.Config.Auth.AccessExpire)).UnixMilli() _, err = l.svcCtx.CoreRpc.CreateToken(l.ctx, &core.TokenInfo{ Uuid: userData.Data[0].Id, Token: pointy.GetPointer(token), diff --git a/api/internal/logic/publicuser/login_logic.go b/api/internal/logic/publicuser/login_logic.go index f75ba0cf..e7d1074e 100644 --- a/api/internal/logic/publicuser/login_logic.go +++ b/api/internal/logic/publicuser/login_logic.go @@ -59,7 +59,7 @@ func (l *LoginLogic) Login(req *types.LoginReq) (resp *types.LoginResp, err erro } // add token into database - expiredAt := time.Now().Add(time.Second * time.Duration(l.svcCtx.Config.Auth.AccessExpire)).Unix() + expiredAt := time.Now().Add(time.Second * time.Duration(l.svcCtx.Config.Auth.AccessExpire)).UnixMilli() _, err = l.svcCtx.CoreRpc.CreateToken(l.ctx, &core.TokenInfo{ Uuid: user.Id, Token: pointy.GetPointer(token), diff --git a/go.mod b/go.mod index ce0195db..021889a2 100644 --- a/go.mod +++ b/go.mod @@ -5,18 +5,18 @@ go 1.21.0 require ( entgo.io/ent v0.12.5 github.com/bsm/redislock v0.9.4 - github.com/casbin/casbin/v2 v2.80.0 + github.com/casbin/casbin/v2 v2.81.0 github.com/duke-git/lancet/v2 v2.2.8 github.com/gofrs/uuid/v5 v5.0.0 github.com/mojocn/base64Captcha v1.3.6 github.com/redis/go-redis/v9 v9.3.1 - github.com/suyuan32/simple-admin-common v1.3.0 - github.com/suyuan32/simple-admin-job v1.3.0 - github.com/suyuan32/simple-admin-message-center v1.3.0 + github.com/suyuan32/simple-admin-common v1.3.1 + github.com/suyuan32/simple-admin-job v1.3.1 + github.com/suyuan32/simple-admin-message-center v1.3.1 github.com/zeromicro/go-zero v1.6.1 golang.org/x/oauth2 v0.15.0 google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.1-0.20231027082548-f4a6c1f6e5c1 + google.golang.org/protobuf v1.32.0 ) require ( @@ -74,7 +74,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-sqlite3 v1.14.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect @@ -83,10 +83,10 @@ require ( github.com/openzipkin/zipkin-go v0.4.2 // indirect github.com/pelletier/go-toml/v2 v2.1.1 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.17.0 // indirect - github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.11.1 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/zclconf/go-cty v1.13.1 // indirect go.etcd.io/etcd/api/v3 v3.5.11 // indirect @@ -106,7 +106,7 @@ require ( go.uber.org/automaxprocs v1.5.3 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect golang.org/x/image v0.13.0 // indirect golang.org/x/mod v0.12.0 // indirect @@ -116,9 +116,9 @@ require ( golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231211222908-989df2bf70f3 // indirect + google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // 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 @@ -127,10 +127,10 @@ require ( k8s.io/client-go v0.29.0 // indirect k8s.io/klog/v2 v2.110.1 // indirect k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect - k8s.io/utils v0.0.0-20231127182322-b307cd553661 // indirect + k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) -replace github.com/zeromicro/go-zero v1.6.1 => github.com/suyuan32/simple-admin-tools v1.6.3 +replace github.com/zeromicro/go-zero v1.6.1 => github.com/suyuan32/simple-admin-tools v1.6.4 diff --git a/go.sum b/go.sum index 19919f53..6f29b8d2 100644 --- a/go.sum +++ b/go.sum @@ -55,8 +55,8 @@ github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0 github.com/bsm/redislock v0.9.4 h1:X/Wse1DPpiQgHbVYRE9zv6m070UcKoOGekgvpNhiSvw= github.com/bsm/redislock v0.9.4/go.mod h1:Epf7AJLiSFwLCiZcfi6pWFO/8eAYrYpQXFxEDPoDeAk= github.com/casbin/casbin/v2 v2.29.2/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= -github.com/casbin/casbin/v2 v2.80.0 h1:khGQBLnC+4XuAoGH/KW1JvyY0/nfFG8AhgzDrQKCH/g= -github.com/casbin/casbin/v2 v2.80.0/go.mod h1:jX8uoN4veP85O/n2674r2qtfSXI6myvxW85f6TH50fw= +github.com/casbin/casbin/v2 v2.81.0 h1:vNwJXK7a+TJZElZ5saP+SFJvweZNtJ3MlVP6P4IuRqE= +github.com/casbin/casbin/v2 v2.81.0/go.mod h1:jX8uoN4veP85O/n2674r2qtfSXI6myvxW85f6TH50fw= github.com/casbin/ent-adapter v0.3.0 h1:4lkhB/BwXAhj84iSrZG/gQ4avkO4uPwz4kdDP1VEnww= github.com/casbin/ent-adapter v0.3.0/go.mod h1:U6saAFuVDEOWLCtrgx35d95M12FC0uh5GtJL82QunRM= github.com/casbin/govaluate v1.1.0 h1:6xdCWIpE9CwHdZhlVQW+froUrCsjb6/ZYNcXODfLT+E= @@ -354,8 +354,8 @@ github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI= github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -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/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -410,21 +410,21 @@ github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4 github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= -github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= -github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/redis/go-redis/v9 v9.3.1 h1:KqdY8U+3X6z+iACvumCNxnoluToB+9Me+TvyFa21Mds= github.com/redis/go-redis/v9 v9.3.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= @@ -480,14 +480,14 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o 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/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/suyuan32/simple-admin-common v1.3.0 h1:DQZ6XnRl1cP8aAEbLp35V5RiXe88X1gPQUy8+FmVjhU= -github.com/suyuan32/simple-admin-common v1.3.0/go.mod h1:MI5f0TIeUpiXx7sVvmuYlOm5R5W/wAOBD4BU1nCCs4E= -github.com/suyuan32/simple-admin-job v1.3.0 h1:w+/Qo0tK1jt1XhNaN/nJ4M168j0Z9KCJU65fTIiD3xc= -github.com/suyuan32/simple-admin-job v1.3.0/go.mod h1:xcWTU7/ECUKoagw97t4DJ/i7UpxUNCYVSEhognCpueM= -github.com/suyuan32/simple-admin-message-center v1.3.0 h1:VEl1xUqKAsesqco731sescf390Pfyl6chBZh7uW9KWk= -github.com/suyuan32/simple-admin-message-center v1.3.0/go.mod h1:vz4XCEkkmHU9EZ10J+v3AJRgZaBWFGE/uFOhl2Qic1I= -github.com/suyuan32/simple-admin-tools v1.6.3 h1:BgasHW7GBJfbOhQqvdnovATYpGEsEEd2PtGS0xfksuQ= -github.com/suyuan32/simple-admin-tools v1.6.3/go.mod h1:TxS7kvMSnTI0HrqCXUjDoSfuQh+WfJ1x073DzVs3UAc= +github.com/suyuan32/simple-admin-common v1.3.1 h1:bpS39kbjg9BHGQN5guHo7GKc/eeh4mXkTDIeKDEzr/U= +github.com/suyuan32/simple-admin-common v1.3.1/go.mod h1:WsrW+h0L0IgIZkiojYdPnXniG4a30S9CI5jQZe+3bRI= +github.com/suyuan32/simple-admin-job v1.3.1 h1:Fyc0GEZNkIzqMsQDajmQ7rQTQQueorItNHwNHm75TRE= +github.com/suyuan32/simple-admin-job v1.3.1/go.mod h1:q6W5V3WPve3Q+JsuaLsEb1IJwu6Tb2cvXPljr9IF/Gg= +github.com/suyuan32/simple-admin-message-center v1.3.1 h1:RbxEh4P+qmiP68pBbrl+YVe5KKz/KF1s1NWqHzBnNuE= +github.com/suyuan32/simple-admin-message-center v1.3.1/go.mod h1:PoMbujDoGRUzlOfxaMtK3o9UVo0iXwmos3qTgQh30ZQ= +github.com/suyuan32/simple-admin-tools v1.6.4 h1:JZ1mj4MbbpMoV0CGr6zHwU18cdD09dI29kE/LPq/A2c= +github.com/suyuan32/simple-admin-tools v1.6.4/go.mod h1:F02Swh4+lg6i17gkedxrRuAKPKjUG425wU9q2hCxefQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -564,8 +564,8 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -751,12 +751,12 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 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-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 h1:1hfbdAfFbkmpg41000wDVqr7jUpK/Yo+LPnIxxGzmkg= -google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= -google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1:s1w3X6gQxwrLEpxnLd/qXTVLgQE2yXwaOaoa6IlY/+o= -google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231211222908-989df2bf70f3 h1:kzJAXnzZoFbe5bhZd4zjUuHos/I31yH4thfMb/13oVY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231211222908-989df2bf70f3/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= +google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos= +google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= +google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM= +google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= 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= @@ -777,8 +777,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD 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.31.1-0.20231027082548-f4a6c1f6e5c1 h1:fk72uXZyuZiTtW5tgd63jyVK6582lF61nRC/kGv6vCA= -google.golang.org/protobuf v1.31.1-0.20231027082548-f4a6c1f6e5c1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 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= @@ -819,8 +819,8 @@ k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= -k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI= -k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= +k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= diff --git a/rpc/internal/logic/token/create_token_logic.go b/rpc/internal/logic/token/create_token_logic.go index c5864f84..9e20520c 100644 --- a/rpc/internal/logic/token/create_token_logic.go +++ b/rpc/internal/logic/token/create_token_logic.go @@ -36,7 +36,7 @@ func (l *CreateTokenLogic) CreateToken(in *core.TokenInfo) (*core.BaseUUIDResp, SetNotNilToken(in.Token). SetNotNilSource(in.Source). SetNotNilUsername(in.Username). - SetNotNilExpiredAt(pointy.GetTimePointer(in.ExpiredAt, 0)). + SetNotNilExpiredAt(pointy.GetTimeMilliPointer(in.ExpiredAt)). Save(l.ctx) if err != nil { return nil, dberrorhandler.DefaultEntError(l.Logger, err, in) diff --git a/rpc/internal/logic/user/get_user_by_id_logic.go b/rpc/internal/logic/user/get_user_by_id_logic.go index cd66c8ea..6097ad75 100644 --- a/rpc/internal/logic/user/get_user_by_id_logic.go +++ b/rpc/internal/logic/user/get_user_by_id_logic.go @@ -50,8 +50,8 @@ func (l *GetUserByIdLogic) GetUserById(in *core.UUIDReq) (*core.UserInfo, error) Password: &result.Password, Description: &result.Description, DepartmentId: &result.DepartmentID, - CreatedAt: pointy.GetPointer(result.CreatedAt.Unix()), - UpdatedAt: pointy.GetPointer(result.UpdatedAt.Unix()), + CreatedAt: pointy.GetPointer(result.CreatedAt.UnixMilli()), + UpdatedAt: pointy.GetPointer(result.UpdatedAt.UnixMilli()), }, nil } diff --git a/rpc/internal/logic/user/get_user_by_username_logic.go b/rpc/internal/logic/user/get_user_by_username_logic.go index d2acdfcf..f54c237a 100644 --- a/rpc/internal/logic/user/get_user_by_username_logic.go +++ b/rpc/internal/logic/user/get_user_by_username_logic.go @@ -48,7 +48,7 @@ func (l *GetUserByUsernameLogic) GetUserByUsername(in *core.UsernameReq) (*core. HomePath: &result.HomePath, Description: &result.Description, DepartmentId: &result.DepartmentID, - CreatedAt: pointy.GetPointer(result.CreatedAt.Unix()), - UpdatedAt: pointy.GetPointer(result.UpdatedAt.Unix()), + CreatedAt: pointy.GetPointer(result.CreatedAt.UnixMilli()), + UpdatedAt: pointy.GetPointer(result.UpdatedAt.UnixMilli()), }, nil } From 0da99986b2a0518d350dd70abb52319cfc24ca7d Mon Sep 17 00:00:00 2001 From: Ryan Su Date: Wed, 3 Jan 2024 21:25:45 +0800 Subject: [PATCH 3/3] chore: update system version --- api/core.go | 2 +- core.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/core.go b/api/core.go index b4c4e92a..42be45d6 100644 --- a/api/core.go +++ b/api/core.go @@ -5,7 +5,7 @@ // Schemes: http, https // Host: localhost:9100 // BasePath: / -// Version: 1.3.0 +// Version: 1.3.1 // Contact: yuansu.china.work@gmail.com // SecurityDefinitions: // Token: diff --git a/core.json b/core.json index 1cf11540..1542d815 100644 --- a/core.json +++ b/core.json @@ -16,7 +16,7 @@ "contact": { "email": "yuansu.china.work@gmail.com" }, - "version": "1.3.0" + "version": "1.3.1" }, "host": "localhost:9100", "basePath": "/",