code refactor
This commit is contained in:
@@ -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"`
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user