feat: linux文件排序

This commit is contained in:
meilin.huang
2022-09-26 18:08:12 +08:00
parent cfb7fd5b29
commit 2db4c20dd3
65 changed files with 76 additions and 65 deletions

View File

@@ -64,7 +64,15 @@ type MachineFileInfo struct {
ModTime string `json:"modTime"`
}
type RoleVO struct {
Id *int64
Name *string
type MachineFileInfos []MachineFileInfo
func (s MachineFileInfos) Len() int { return len(s) }
func (s MachineFileInfos) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
func (s MachineFileInfos) Less(i, j int) bool {
if s[i].Type != s[j].Type {
return s[i].Type > s[j].Type
}
return s[i].Name < s[j].Name
}