package models

import "log"

type RaspMinerData struct {
	Id 			int64 	`json:"id" gorm:"PRIMARY_KEY"`
	TicketCount        int64 `json:"ticket_count"`
}

func GetMinerDataList() ([]*RaspMinerData,error) {
	var list []*RaspMinerData
	if err := db.Model(&RaspMinerData{}).Find(&list).Error; err != nil {
		return nil,err
	}
	return list,nil
}

func UpdateMinerData(fd RaspMinerData)bool{
	if err:=db.Create(&fd).Error;err != nil {
		log.Println(err)
		return false
	}
	return true
}
