diff --git a/pkg/models/account.go b/pkg/models/account.go index a39f79bf..7bd5af9f 100644 --- a/pkg/models/account.go +++ b/pkg/models/account.go @@ -62,6 +62,10 @@ type Account struct { DeletedUnixTime int64 } +type AccountGetRequest struct { + Id int64 `form:"id,string" binding:"required,min=1"` +} + type AccountCreateRequest struct { Name string `json:"name" binding:"required,notBlank,max=32"` Category AccountCategory `json:"category" binding:"required"` @@ -73,10 +77,6 @@ type AccountCreateRequest struct { SubAccounts []*AccountCreateRequest `json:"subAccounts" binding:"omitempty"` } -type AccountGetRequest struct { - Id int64 `form:"id,string" binding:"required,min=1"` -} - type AccountModifyRequest struct { Id int64 `json:"id,string" binding:"required,min=1"` Name string `json:"name" binding:"required,notBlank,max=32"` diff --git a/pkg/models/transaction_category.go b/pkg/models/transaction_category.go index 2f65eab6..10972525 100644 --- a/pkg/models/transaction_category.go +++ b/pkg/models/transaction_category.go @@ -28,6 +28,15 @@ type TransactionCategory struct { DeletedUnixTime int64 } +type TransactionCategoryListRequest struct { + Type TransactionCategoryType `form:"type" binding:"min=0"` + ParentId int64 `form:"parent_id,string,default=-1" binding:"min=-1"` +} + +type TransactionCategoryGetRequest struct { + Id int64 `form:"id,string" binding:"required,min=1"` +} + type TransactionCategoryCreateRequest struct { Name string `json:"name" binding:"required,notBlank,max=32"` Type TransactionCategoryType `json:"type" binding:"required"` @@ -50,15 +59,6 @@ type TransactionCategoryCreateWithSubCategories struct { SubCategories []*TransactionCategoryCreateRequest `json:"subCategories" binding:"required"` } -type TransactionCategoryListRequest struct { - Type TransactionCategoryType `form:"type" binding:"min=0"` - ParentId int64 `form:"parent_id,string,default=-1" binding:"min=-1"` -} - -type TransactionCategoryGetRequest struct { - Id int64 `form:"id,string" binding:"required,min=1"` -} - type TransactionCategoryModifyRequest struct { Id int64 `json:"id,string" binding:"required,min=1"` Name string `json:"name" binding:"required,notBlank,max=32"` diff --git a/pkg/models/transaction_tag.go b/pkg/models/transaction_tag.go index 1d6ed2f1..2f44b7d4 100644 --- a/pkg/models/transaction_tag.go +++ b/pkg/models/transaction_tag.go @@ -10,14 +10,14 @@ type TransactionTag struct { UpdatedUnixTime int64 } -type TransactionTagCreateRequest struct { - Name string `json:"name" binding:"required,notBlank,max=32"` -} - type TransactionTagGetRequest struct { Id int64 `form:"id,string" binding:"required,min=1"` } +type TransactionTagCreateRequest struct { + Name string `json:"name" binding:"required,notBlank,max=32"` +} + type TransactionTagModifyRequest struct { Id int64 `json:"id,string" binding:"required,min=1"` Name string `json:"name" binding:"required,notBlank,max=32"`