package models

type RaspDevVersion struct {
	//Model
	Id   int64 `json:"id" gorm:"PRIMARY_KEY"`
	Version   string `json:"version"`
	Addr string `json:"addr"`
}

//
func UpdateDevVersion(params map[string]string)  error {
	var version RaspDevVersion
	err := db.Where(RaspDevVersion{Addr: params["addr"]}).Assign(RaspDevVersion{Version: params["version"]}).FirstOrCreate(&version).Error
	if err != nil  {
		return err
	}
	return nil
}

