groupLimits.go 561 Bytes
Newer Older
hujiebin's avatar
hujiebin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
package group_m

import (
	"git.hilo.cn/hilo-common/domain"
	"git.hilo.cn/hilo-common/resource/mysql"
)

type GroupUserLimits struct {
	mysql.Entity
	UserId  uint64
	MaxJoin uint
}

func (guLimit *GroupUserLimits) Set(model *domain.Model) error {
	return model.Db.Where(guLimit).Create(guLimit).Error
}

func (guLimit *GroupUserLimits) Get(model *domain.Model) error {
	return model.Db.Where(guLimit).First(guLimit).Error
}

func (guLimit *GroupUserLimits) Delete(model *domain.Model) error {
	return model.Db.Where(guLimit).Delete(&GroupUserLimits{}).Error
}