code refactor

This commit is contained in:
MaysWind
2021-03-10 23:33:18 +08:00
parent cd7756013b
commit ac6d449227
4 changed files with 54 additions and 54 deletions
+6 -6
View File
@@ -132,16 +132,16 @@ func (c *TransactionCategory) ToTransactionCategoryInfoResponse() *TransactionCa
type TransactionCategoryInfoResponseSlice []*TransactionCategoryInfoResponse
// Len returns the count of items
func (c TransactionCategoryInfoResponseSlice) Len() int {
return len(c)
func (s TransactionCategoryInfoResponseSlice) Len() int {
return len(s)
}
// Swap swaps two items
func (c TransactionCategoryInfoResponseSlice) Swap(i, j int) {
c[i], c[j] = c[j], c[i]
func (s TransactionCategoryInfoResponseSlice) Swap(i, j int) {
s[i], s[j] = s[j], s[i]
}
// Less reports whether the first item is less than the second one
func (c TransactionCategoryInfoResponseSlice) Less(i, j int) bool {
return c[i].DisplayOrder < c[j].DisplayOrder
func (s TransactionCategoryInfoResponseSlice) Less(i, j int) bool {
return s[i].DisplayOrder < s[j].DisplayOrder
}