1
This commit is contained in:
@@ -85,7 +85,20 @@ func (s *ServerService) GetServer() []model.ServerList {
|
||||
return item
|
||||
|
||||
}
|
||||
func (s *ServerService) StartUPdate(OnlineID uint16) model.ServerList {
|
||||
|
||||
m := cool.DBM(s.Model).Where("online_id", OnlineID)
|
||||
|
||||
var tttt model.ServerList
|
||||
m.Scan(&tttt)
|
||||
|
||||
tttt.IsOpen = 0
|
||||
|
||||
m.Save(tttt)
|
||||
// s.CleanCache()
|
||||
return tttt
|
||||
|
||||
}
|
||||
func (s *ServerService) SetServerID(OnlineID uint16, Port uint16) error {
|
||||
|
||||
m := cool.DBM(s.Model).Where("online_id", OnlineID)
|
||||
@@ -94,6 +107,7 @@ func (s *ServerService) SetServerID(OnlineID uint16, Port uint16) error {
|
||||
m.Scan(&tttt)
|
||||
tttt.Port = Port
|
||||
tttt.OnlineID = OnlineID
|
||||
tttt.IsOpen = 1
|
||||
|
||||
m.Save(tttt)
|
||||
// s.CleanCache()
|
||||
@@ -108,9 +122,7 @@ func (s *ServerService) GetServerID(OnlineID uint16) model.ServerList {
|
||||
|
||||
}
|
||||
|
||||
// func (s *ServerService) CleanCache() {
|
||||
// g.DB().GetCore().ClearCache(context.TODO(), s.Model.TableName())
|
||||
// }
|
||||
// 保存版本号
|
||||
func (s *ServerService) SetServerScreen(id uint16, name string) {
|
||||
|
||||
dbm(s.Model).Where("online_id", id).Data("old_screen", name).Update()
|
||||
@@ -149,7 +161,7 @@ func (s *ServerService) GetFile() string {
|
||||
return files[i].Time > files[j].Time
|
||||
})
|
||||
|
||||
return "http://sun.72wo.cn/" + files[0].Name
|
||||
return files[0].Name
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user