add transaction count api

This commit is contained in:
MaysWind
2021-03-28 17:19:48 +08:00
parent 3ed9250811
commit baebee94c7
4 changed files with 133 additions and 119 deletions
+15
View File
@@ -80,6 +80,16 @@ type TransactionModifyRequest struct {
Comment string `json:"comment" binding:"max=255"`
}
// TransactionCountRequest represents transaction count request
type TransactionCountRequest struct {
Type TransactionDbType `form:"type" binding:"min=0,max=4"`
CategoryId int64 `form:"category_id" binding:"min=0"`
AccountId int64 `form:"account_id" binding:"min=0"`
Keyword string `form:"keyword"`
MaxTime int64 `form:"max_time" binding:"min=0"`
MinTime int64 `form:"min_time" binding:"min=0"`
}
// TransactionListByMaxTimeRequest represents all parameters of transaction listing by max time request
type TransactionListByMaxTimeRequest struct {
Type TransactionDbType `form:"type" binding:"min=0,max=4"`
@@ -143,6 +153,11 @@ type TransactionInfoResponse struct {
Editable bool `json:"editable"`
}
// TransactionCountResponse represents transaction count response
type TransactionCountResponse struct {
Count int64 `json:"count"`
}
// TransactionInfoPageWrapperResponse represents a response of transaction which contains items and next id
type TransactionInfoPageWrapperResponse struct {
Items TransactionInfoResponseSlice `json:"items"`