change:排序方式,默认按轨迹发生时间降序
This commit is contained in:
parent
81de6559fe
commit
2881f592e0
@ -1,5 +1,3 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
|
||||
public class GetTrackInput : OrderNosInfo
|
||||
@ -17,10 +15,9 @@ public class GetTrackInput : OrderNosInfo
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序方式
|
||||
/// 排序方式,默认按轨迹发生时间降序
|
||||
/// </summary>
|
||||
[Required]
|
||||
public SortMethod SortMethod { get; set; }
|
||||
public SortMethod? SortMethod { get; set; }
|
||||
}
|
||||
|
||||
public enum SortMethod
|
||||
|
||||
@ -82,6 +82,7 @@ public partial class TrackService
|
||||
// tips:quick-sort 直接修改原list
|
||||
list.ForEach(item => item.TrackDetails.Sort((a, b) => a.Time.CompareTo(b.Time)));
|
||||
break;
|
||||
case null:
|
||||
case SortMethod.ByTrackTimeDesc:
|
||||
list.ForEach(item => item.TrackDetails.Sort((a, b) => b.Time.CompareTo(a.Time)));
|
||||
break;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user