package dao

import (
	"ordonnance/common/db"
	"ordonnance/server/model"
)

func GetIUserServerByUid(uid int, version string) (list []model.LUserServer, err error) {
	err = db.GDB.Where("userId=? AND version=?", uid, version).
		Find(&list).Error
	return
}

func GetAllServer(version string) (list []model.TServer, err error) {
	err = db.GDB.Where("version=?", version).
		Find(&list).Error
	return
}

func GetServerInfo(serverId string) (info model.TServerInfo, err error) {
	err = db.GDB.Where("id=?", serverId).
		First(&info).Error
	return
}
