|
|
@ -35,6 +35,11 @@ func (items *Items) Swap(i, j int) {
|
|
|
|
reflect.Swapper(items.data)(i, j)
|
|
|
|
reflect.Swapper(items.data)(i, j)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
功能:将数组的结构体进行排序
|
|
|
|
|
|
|
|
作者:吴缤
|
|
|
|
|
|
|
|
日期:2020-07-09
|
|
|
|
|
|
|
|
*/
|
|
|
|
func SortItems(i interface{}, str string, sortType string) {
|
|
|
|
func SortItems(i interface{}, str string, sortType string) {
|
|
|
|
if reflect.ValueOf(i).Kind() != reflect.Slice {
|
|
|
|
if reflect.ValueOf(i).Kind() != reflect.Slice {
|
|
|
|
return
|
|
|
|
return
|
|
|
|