From 2dab5e4a78efb25edb05a358d361fd5427f2e55d Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 10 May 2022 11:57:25 +0800 Subject: [PATCH] add ParseToken --- internal/api/auth/auth.go | 2 +- pkg/base_info/auth_api_struct.go | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go index c4e944acc..d27cbb684 100644 --- a/internal/api/auth/auth.go +++ b/internal/api/auth/auth.go @@ -118,7 +118,7 @@ func ParseToken(c *gin.Context) { return } - resp := api.ParseTokenResp{CommResp: api.CommResp{ErrCode: 0, ErrMsg: ""}, ExpireTime: expireTime} + resp := api.ParseTokenResp{CommResp: api.CommResp{ErrCode: 0, ErrMsg: ""}, ExpireTime: api.ExpireTime{ExpireTimeSeconds: expireTime}} log.NewInfo(params.OperationID, "ParseToken return ", resp) c.JSON(http.StatusOK, resp) } diff --git a/pkg/base_info/auth_api_struct.go b/pkg/base_info/auth_api_struct.go index 1f1bdc6ba..1735e74ea 100644 --- a/pkg/base_info/auth_api_struct.go +++ b/pkg/base_info/auth_api_struct.go @@ -42,7 +42,16 @@ type ParseTokenReq struct { OperationID string `json:"operationID" binding:"required"` } +//type ParseTokenResp struct { +// CommResp +// ExpireTime int64 `json:"expireTime" binding:"required"` +//} + +type ExpireTime struct { + ExpireTimeSeconds int64 `json:"expireTimeSeconds" ` +} + type ParseTokenResp struct { CommResp - ExpireTime int64 `json:"expireTime" binding:"required"` + ExpireTime ExpireTime `json:"expireTime"` }