enterprise/common/model/user_config.go

32 lines
907 B
Go
Raw Normal View History

2023-08-10 20:38:57 +08:00
package model
import "encoding/json"
var (
2023-09-01 20:01:30 +08:00
CheckinOndutyMoneyEnable = "checkin.onduty.money.enable" //上班打卡红包
CheckinOffdutyMoneyEnable = "checkin.offduty.money.enable" //下班打卡红包
CheckinOndutyMoney = "checkin.onduty.money" //上班打卡金额
CheckinOffdutyMoney = "checkin.offduty.money" //下班打卡金额
StaffSalaryExpDiscount = "staff.salary.exp.discount" //试用期薪资折扣
StaffSalarySocialInsurence = "staff.salary.social.insurence" //社保扣除金额
2023-08-10 20:38:57 +08:00
)
2023-08-31 22:20:40 +08:00
var (
UserConfigStatusNormal = 1
UserConfigStatusDisable = 2
)
2023-08-10 20:38:57 +08:00
type UserConfig struct {
Id int64
Username string
Config string
2023-08-31 22:20:40 +08:00
Status int
2023-08-10 20:38:57 +08:00
CreateTime int64
UpdateTime int64
}
func (u *UserConfig) Get(key string) interface{} {
config := make(map[string]interface{})
json.Unmarshal([]byte(u.Config), &config)
return config[key]
}