mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 08:14:25 +08:00
code refactor
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user