change datatype parent_id
This commit is contained in:
@@ -5,15 +5,15 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Parent_Id *int16 `json:"parent_id"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Parent_Id *int16 `json:"parent_id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
@@ -42,9 +42,9 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.SmallMain
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Parent_Id *int16 `json:"parent_id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
}
|
||||
|
||||
func (d Division) ToResponse() ResponseDto {
|
||||
|
||||
@@ -8,7 +8,7 @@ type Division struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:10"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Parent_Id *int16 `json:"parent_id"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
Parent *Division `gorm:"foreignKey:Parent_Id;references:Id"`
|
||||
Childrens []Division `gorm:"foreignKey:Parent_Id"` // may need references to self
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user