package ppos

import (
	"PPOSUtils/utils"
)

//NewJwtNotice 令牌：信息发布子系统
func NewJwtNotice() *wtNotice {
	return &wtNotice{}
}

type wtNotice struct {
	JwtCompany
}

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

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

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