/*
 * @description:账号组相关
 * @Author: CP
 * @Date: 2020-10-10 16:00:05
 * @FilePath: \construction_management\comm\account_group.go
 */
package comm

import "errors"

type AccountGroup struct {
	JSDW int
	JLDW int
	SGDW int
	SJDW int
	DJDW int
	GZSJ int
	QT   int
}

func NewAccountGroup() *AccountGroup {
	return &AccountGroup{
		JSDW: 1,
		JLDW: 2,
		SGDW: 3,
		SJDW: 4,
		DJDW: 5,
		GZSJ: 6,
		QT:   7,
	}
}

// 验证输入
func (a *AccountGroup) ValidRule(index int) error {
	if a.JSDW == index || a.JLDW == index || a.SGDW == index || a.SJDW == index || a.DJDW == index || a.GZSJ == index || a.QT == index {
		return nil
	} else {
		return errors.New("账号组不正确")
	}
}

// ID转文字描述

// const AccountGroup:=map[string]int{
// 	"JSDW": 1,
//     "JLDW": 2,
//     "SGDW": 3,
//     "SJDW": 4,
//     "DJDW": 5,
//     "GZSJ": 6,
//     "QT": 7,
// }

// const Group:=[...]string{
// 	AccountGroup.
// }
