mirror of https://github.com/sunface/rust-course
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
325 B
15 lines
325 B
package models
|
|
|
|
type Following struct {
|
|
ID string `json:"id"`
|
|
Weight int `json:"weight"`
|
|
}
|
|
|
|
type Followings []*Following
|
|
|
|
func (s Followings) Len() int { return len(s) }
|
|
func (s Followings) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
|
func (s Followings) Less(i, j int) bool {
|
|
return s[i].Weight > s[j].Weight
|
|
}
|