diff --git a/entity/token.go b/entity/token.go index 360ccac..77ab851 100644 --- a/entity/token.go +++ b/entity/token.go @@ -12,9 +12,8 @@ type Token struct { } type AuthData struct { - AppName string - ApplicationGroupId int - AppId int - ExpireTime int - CreatedAt time.Time + AppName string + AppId int + ExpireTime int + CreatedAt time.Time } diff --git a/repository/token.go b/repository/token.go index da1c7f0..f884bbd 100644 --- a/repository/token.go +++ b/repository/token.go @@ -112,12 +112,10 @@ func (r Token) AuthDataByToken(ctx context.Context, token string) (*entity.AuthD ctx = sql_metrics.OperationLabelToContext(ctx, "Token.AuthDataByToken") q := ` -SELECT application_group_id, app_id, application.name AS app_name , token.expire_time, token.created_at +SELECT app_id, application.name AS app_name , token.expire_time, token.created_at FROM token LEFT JOIN application ON token.app_id = application.id -LEFT JOIN application_group - ON application.application_group_id = application_group.id WHERE token = $1 ` result := entity.AuthData{}