package interceptor

import (
	"bindbox-game/internal/pkg/core"
	"bindbox-game/internal/pkg/logger"
	"bindbox-game/internal/proposal"
	"bindbox-game/internal/repository/mysql"
)

var _ Interceptor = (*interceptor)(nil)

type Interceptor interface {
    // AdminTokenAuthVerify 管理端授权验证
    AdminTokenAuthVerify(ctx core.Context) (sessionUserInfo proposal.SessionUserInfo, err core.BusinessError)

    // AppTokenAuthVerify APP端授权验证
    AppTokenAuthVerify(ctx core.Context) (sessionUserInfo proposal.SessionUserInfo, err core.BusinessError)

    RequireAdminRole() core.HandlerFunc
    RequireAdminAction(mark string) core.HandlerFunc

    // i 为了避免被其他包实现
    i()
}

type interceptor struct {
	logger logger.CustomLogger
	db     mysql.Repo
}

func New(logger logger.CustomLogger, db mysql.Repo) Interceptor {
	return &interceptor{
		logger: logger,
		db:     db,
	}
}

func (i *interceptor) i() {}
