package ppos

import (
	"PPOSUtils/utils"
)

//NewJwtEvents 令牌：赛事子系统
func NewJwtEvents() *wtEvents {
	return &wtEvents{}
}

type wtEvents struct {
	JwtCompany
}

func (that *wtEvents) init() {
	if that.paramsMp == nil {
		that.JwtCompany.init()
	}
}

//生成应用令牌
func (that *wtEvents) CreateJwt(params ...utils.Mp) (string, error) {
	//
	that.init()
	_jwtString, _err := that.JwtCompany.CreateJwt(params...)
	if _err != nil {
		return "", _err
	}
	return _jwtString, nil
}

func (that *wtEvents) ParseParams() (utils.Mp, error) {
	//
	that.init()
	if _, _err := that.JwtCompany.ParseParams(); _err != nil {
		return nil, _err
	}
	return that.paramsMp, nil
}
