service/api/message/json_param_entry.go

21 lines
384 B
Go
Raw Permalink Normal View History

2024-06-18 17:10:42 +08:00
package message
import "strings"
type JsonParamEntry struct {
Name string
Value any
}
type JsonParamEntrySortable []*JsonParamEntry
func (p JsonParamEntrySortable) Len() int {
return len(p)
}
func (p JsonParamEntrySortable) Less(i, j int) bool {
return strings.Compare(p[i].Name, p[j].Name) == -1
}
func (p JsonParamEntrySortable) Swap(i, j int) {
p[i], p[j] = p[j], p[i]
}