```
feat(config): 添加服务器screen参数字段 添加OldScreen字段用于存储服务器的screen会话名称 --- fix(fight): 修复攻击值结构体格式 格式化AttackValue结构体字段对齐,并添加Offensive字段用于存储攻击力 --- feat(fight): 计算并存储技能攻击力 在技能计算过程中添加攻击力计算并存储到AttackValue结构体中 --- fix(base): 修正JWT密钥配置 将JWT密钥从
This commit is contained in:
@@ -78,7 +78,19 @@ func (s *ServerService) GetServer() []model.ServerList {
|
||||
return item
|
||||
|
||||
}
|
||||
func (s *ServerService) GetFileList() File {
|
||||
func (s *ServerService) GetServerByID(id uint32) model.ServerList {
|
||||
var item model.ServerList
|
||||
dbm(s.Model).Where("online_id", id).Scan(&item)
|
||||
|
||||
return item
|
||||
|
||||
}
|
||||
func (s *ServerService) SetServerScreen(id uint16, name string) {
|
||||
|
||||
dbm(s.Model).Where("online_id", id).Data("old_screen", name).Update()
|
||||
|
||||
}
|
||||
func (s *ServerService) GetFile() string {
|
||||
var files []File
|
||||
prefix := "logic"
|
||||
delimiter := "" // 用于分隔目录
|
||||
@@ -86,7 +98,7 @@ func (s *ServerService) GetFileList() File {
|
||||
for {
|
||||
entries, _, nextMarker, hasNext, err := s.manager.ListFiles(s.bucket, prefix, delimiter, marker, 100)
|
||||
if err != nil {
|
||||
return File{}
|
||||
return ""
|
||||
}
|
||||
// 添加文件到结果列表
|
||||
for _, entry := range entries {
|
||||
@@ -111,7 +123,7 @@ func (s *ServerService) GetFileList() File {
|
||||
return files[i].Time > files[j].Time
|
||||
})
|
||||
|
||||
return files[0]
|
||||
return "http://sun.72wo.cn/" + files[0].Name
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user