Files
scraper/status/status.go
T
junv ba39729ec7 - Fix the auction date null issue
- Update clearance rate
- Reformat
2020-06-14 09:55:00 +10:00

25 lines
474 B
Go

package status
import "github.com/jinzhu/gorm"
type ResultStatus struct {
gorm.Model
Latest string
City string `gorm:"index:city"`
URL string `gorm:"index:url"`
}
type Handler struct {
DB *gorm.DB
}
func (handler *Handler) GetStatus(city, url string) *ResultStatus {
var status ResultStatus
handler.DB.First(&status, "city = ? and url = ?", city, url)
return &status
}
func (handler *Handler) SaveStatus(status *ResultStatus) {
handler.DB.Save(&status)
}