add total amount in home page

This commit is contained in:
MaysWind
2021-01-10 21:24:02 +08:00
parent a470752d42
commit a5474d0d65
15 changed files with 576 additions and 7 deletions
+21
View File
@@ -0,0 +1,21 @@
package models
// TransactionOverviewRequest represents all parameters of transaction overview request
type TransactionOverviewRequest struct {
Query string `form:"query"`
}
// TransactionOverviewRequestItem represents an item of transaction overview request
type TransactionOverviewRequestItem struct {
Name string
StartTime int64
EndTime int64
}
// TransactionOverviewResponseItem represents an item of transaction overview
type TransactionOverviewResponseItem struct {
StartTime int64 `json:"startTime"`
EndTime int64 `json:"endTime"`
IncomeAmount int64 `json:"incomeAmount"`
ExpenseAmount int64 `json:"expenseAmount"`
}
+6
View File
@@ -44,6 +44,12 @@ type Transaction struct {
DeletedUnixTime int64
}
type TransactionTotalAmount struct {
Uid int64
Type TransactionDbType
TotalAmount int64 `xorm:"NOT NULL"`
}
// TransactionCreateRequest represents all parameters of transaction creation request
type TransactionCreateRequest struct {
Type TransactionType `json:"type" binding:"required"`