package interceptor

import (
	"mini-chat/internal/pkg/core"
	"mini-chat/internal/pkg/logger"
	"mini-chat/internal/proposal"
	"mini-chat/internal/repository/mysql"
)

var _ Interceptor = (*interceptor)(nil)

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

	// 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() {}
