mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
code refactor
This commit is contained in:
@@ -62,6 +62,10 @@ type Account struct {
|
|||||||
DeletedUnixTime int64
|
DeletedUnixTime int64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type AccountGetRequest struct {
|
||||||
|
Id int64 `form:"id,string" binding:"required,min=1"`
|
||||||
|
}
|
||||||
|
|
||||||
type AccountCreateRequest struct {
|
type AccountCreateRequest struct {
|
||||||
Name string `json:"name" binding:"required,notBlank,max=32"`
|
Name string `json:"name" binding:"required,notBlank,max=32"`
|
||||||
Category AccountCategory `json:"category" binding:"required"`
|
Category AccountCategory `json:"category" binding:"required"`
|
||||||
@@ -73,10 +77,6 @@ type AccountCreateRequest struct {
|
|||||||
SubAccounts []*AccountCreateRequest `json:"subAccounts" binding:"omitempty"`
|
SubAccounts []*AccountCreateRequest `json:"subAccounts" binding:"omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AccountGetRequest struct {
|
|
||||||
Id int64 `form:"id,string" binding:"required,min=1"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type AccountModifyRequest struct {
|
type AccountModifyRequest struct {
|
||||||
Id int64 `json:"id,string" binding:"required,min=1"`
|
Id int64 `json:"id,string" binding:"required,min=1"`
|
||||||
Name string `json:"name" binding:"required,notBlank,max=32"`
|
Name string `json:"name" binding:"required,notBlank,max=32"`
|
||||||
|
|||||||
@@ -28,6 +28,15 @@ type TransactionCategory struct {
|
|||||||
DeletedUnixTime int64
|
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 {
|
type TransactionCategoryCreateRequest struct {
|
||||||
Name string `json:"name" binding:"required,notBlank,max=32"`
|
Name string `json:"name" binding:"required,notBlank,max=32"`
|
||||||
Type TransactionCategoryType `json:"type" binding:"required"`
|
Type TransactionCategoryType `json:"type" binding:"required"`
|
||||||
@@ -50,15 +59,6 @@ type TransactionCategoryCreateWithSubCategories struct {
|
|||||||
SubCategories []*TransactionCategoryCreateRequest `json:"subCategories" binding:"required"`
|
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 {
|
type TransactionCategoryModifyRequest struct {
|
||||||
Id int64 `json:"id,string" binding:"required,min=1"`
|
Id int64 `json:"id,string" binding:"required,min=1"`
|
||||||
Name string `json:"name" binding:"required,notBlank,max=32"`
|
Name string `json:"name" binding:"required,notBlank,max=32"`
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ type TransactionTag struct {
|
|||||||
UpdatedUnixTime int64
|
UpdatedUnixTime int64
|
||||||
}
|
}
|
||||||
|
|
||||||
type TransactionTagCreateRequest struct {
|
|
||||||
Name string `json:"name" binding:"required,notBlank,max=32"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type TransactionTagGetRequest struct {
|
type TransactionTagGetRequest struct {
|
||||||
Id int64 `form:"id,string" binding:"required,min=1"`
|
Id int64 `form:"id,string" binding:"required,min=1"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type TransactionTagCreateRequest struct {
|
||||||
|
Name string `json:"name" binding:"required,notBlank,max=32"`
|
||||||
|
}
|
||||||
|
|
||||||
type TransactionTagModifyRequest struct {
|
type TransactionTagModifyRequest struct {
|
||||||
Id int64 `json:"id,string" binding:"required,min=1"`
|
Id int64 `json:"id,string" binding:"required,min=1"`
|
||||||
Name string `json:"name" binding:"required,notBlank,max=32"`
|
Name string `json:"name" binding:"required,notBlank,max=32"`
|
||||||
|
|||||||
Reference in New Issue
Block a user