package models

type RaspAddrAccounts struct {
	Id         int64  `json:"id" gorm:"PRIMARY_KEY"`
	Addr       string `json:"addr"`
	Account    string `json:"account"`
	Balance    int64  `json:"balance"`
	Frozen     int64  `json:"frozen"`
	Label      string `json:"label"`
	AddTime    int64  `json:"add_time"`
	UpdateTime int64  `json:"update_time"`
}

func InsertNewAccounts(account *RaspAddrAccounts) error {
	if err := db.Where(RaspAddrAccounts{Account: account.Account}).Assign(account).FirstOrCreate(account).Error; err != nil {
		return err
	}
	return nil
}
