package models

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

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

