package main

import (
	"sync"
	"time"
)

type DeesUserStat struct {
	Uuid        string    `json:"uuid"`
	Username    string    `json:"username"`
	State       int       `json:"state"`
	RefreshTime time.Time `json:"refreshTime"`
	ExpireTime  time.Time `json:"expireTime"`
	UserRole    int       `json:"userrole"`

	lck sync.RWMutex
}

func (d *DeesUserStat) Lock() {
	d.lck.Lock()
}

func (d *DeesUserStat) Unlock() {
	d.lck.Unlock()
}

func (d *DeesUserStat) RLock() {
	d.lck.RLock()
}

func (d *DeesUserStat) RUnlock() {
	d.lck.RUnlock()
}

var (
	deesUserStatMap map[string]*DeesUserStat

	deesUserStatMaplck sync.RWMutex
)

func init() {
	deesUserStatMap = make(map[string]*DeesUserStat)
}
