refactor: 将端口和在线ID类型从uint16改为uint32
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
This commit is contained in:
@@ -29,7 +29,7 @@ func NewServerService() *ServerService {
|
||||
var rr []g.MapStrAny
|
||||
r, _ := gconv.Map(data)["list"].(gdb.Result)
|
||||
for i := 0; i < len(r); i++ {
|
||||
t, ok := cool.GetClient(gconv.Uint16(r[i].Map()["port"]))
|
||||
t, ok := cool.GetClient(10000*gconv.Uint32(r[i].Map()["online_id"])+gconv.Uint32(r[i].Map()["port"]))
|
||||
// tt.Friends = v.Friends
|
||||
subm := r[i].GMap()
|
||||
|
||||
@@ -74,7 +74,7 @@ func (s *ServerService) GetPort(DepartmentID uint) gdb.List {
|
||||
var res gdb.Result
|
||||
m := cool.DBM(s.Model).Where("is_open", 1).Fields("ip", "port", "online_id", "is_vip", "name")
|
||||
if DepartmentID != 1 {
|
||||
|
||||
|
||||
res, _ = m.All()
|
||||
|
||||
} else {
|
||||
@@ -107,7 +107,7 @@ func (s *ServerService) StartUPdate(OnlineID uint16, isinstall int) model.Server
|
||||
return tttt
|
||||
|
||||
}
|
||||
func (s *ServerService) SetServerID(OnlineID uint16, Port uint16) error {
|
||||
func (s *ServerService) SetServerID(OnlineID uint32, Port uint32) error {
|
||||
|
||||
m := cool.DBM(s.Model).Where("online_id", OnlineID)
|
||||
|
||||
@@ -122,7 +122,7 @@ func (s *ServerService) SetServerID(OnlineID uint16, Port uint16) error {
|
||||
return nil
|
||||
|
||||
}
|
||||
func (s *ServerService) GetServerID(OnlineID uint16) model.ServerList {
|
||||
func (s *ServerService) GetServerID(OnlineID uint32) model.ServerList {
|
||||
var tttt model.ServerList
|
||||
cool.DBM(s.Model).Where("online_id", OnlineID).Scan(&tttt)
|
||||
|
||||
@@ -131,7 +131,7 @@ func (s *ServerService) GetServerID(OnlineID uint16) model.ServerList {
|
||||
}
|
||||
|
||||
// 保存版本号
|
||||
func (s *ServerService) SetServerScreen(id uint16, name string) {
|
||||
func (s *ServerService) SetServerScreen(id uint32, name string) {
|
||||
|
||||
cool.DBM(s.Model).Where("online_id", id).Data("old_screen", name).Update()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user