refactor: refactor interface

This commit is contained in:
clz 2023-06-10 15:19:41 +08:00
parent eab8c63e3d
commit 751bab15d1

View File

@ -20,7 +20,7 @@ func NewBillService(r BillRepository) BillService {
// - date is {year, month} when return a month bills // - date is {year, month} when return a month bills
// - date is {year} when return a year bills // - date is {year} when return a year bills
// - date is {} when return all bills // - date is {} when return all bills
func (b *billService) GetBills(ctx context.Context, date BDate) (*[]Bill, error) { func (b *billService) GetBills(ctx context.Context, date BDate) ([]Bill, error) {
if date.Year == 0 && (date.Month != 0 || date.Day != 0) { if date.Year == 0 && (date.Month != 0 || date.Day != 0) {
date.Year = time.Now().Year() date.Year = time.Now().Year()
} else if date.Month == 0 && date.Day != 0 { } else if date.Month == 0 && date.Day != 0 {