package user

import (
	"context"
	"fmt"
	"github.com/gogf/gf/v2/frame/g"

	"server/api/user/v1"
)

func (c *ControllerV1) Logout(ctx context.Context, req *v1.LogoutReq) (res *v1.LogoutRes, err error) {
	g.Redis().Do(ctx, "SETEX", fmt.Sprintf("blacklist:%s", g.RequestFromCtx(ctx).GetCtxVar("jti").String()), "1")
	return &v1.LogoutRes{
		Success: true,
	}, nil
}
