add default categories backend

This commit is contained in:
MaysWind
2020-12-04 02:42:52 +08:00
parent 9c18bc650e
commit c5cc4dee56
8 changed files with 242 additions and 2 deletions
+13
View File
@@ -37,6 +37,19 @@ type TransactionCategoryCreateRequest struct {
Comment string `json:"comment" binding:"max=255"`
}
type TransactionCategoryCreateBatchRequest struct {
Categories []*TransactionCategoryCreateWithSubCategories `json:"categories" binding:"required"`
}
type TransactionCategoryCreateWithSubCategories struct {
Name string `json:"name" binding:"required,notBlank,max=32"`
Type TransactionCategoryType `json:"type" binding:"required"`
Icon int64 `json:"icon,string" binding:"min=1"`
Color string `json:"color" binding:"required,len=6,validHexRGBColor"`
Comment string `json:"comment" binding:"max=255"`
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"`