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 db.Where(RaspAddrAccounts{Account: account.Account}).First(account).RecordNotFound() {
		return db.Create(account).Error
	}
	return nil
}
