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"`
	Date string `json:"date"`
}

//
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"],Date:params["date"]}).FirstOrCreate(&version).Error
	if err != nil  {
		return err
	}
	return nil
}

