adjust dto
This commit is contained in:
@@ -19,7 +19,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -29,6 +28,7 @@ type FilterDto struct {
|
||||
Uom_Code string `json:"uom-code"`
|
||||
Infra_Id *uint16 `json:"infra-id"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -14,7 +14,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -22,6 +21,7 @@ type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
IndName string `json:"indName"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -15,7 +15,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
@@ -24,6 +23,7 @@ type FilterDto struct {
|
||||
Regency_Code string `json:"regency-code"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -18,7 +18,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -28,6 +27,7 @@ type FilterDto struct {
|
||||
Name string `json:"name"`
|
||||
HeadStatus *bool `json:"head-status"`
|
||||
Employee_Id *uint `json:"employee-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -14,7 +14,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
OnlyHaveChildren bool `json:"only-have-children"`
|
||||
}
|
||||
@@ -23,6 +22,7 @@ type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Parent_Id *uint16 `json:"parent-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -13,13 +13,13 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -24,7 +24,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
OnlyHaveChildren bool `json:"only-have-children"`
|
||||
}
|
||||
@@ -35,6 +34,7 @@ type FilterDto struct {
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup-code"`
|
||||
Parent_Id *uint16 `json:"parent-id"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -16,7 +16,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -24,6 +23,7 @@ type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
EncounterClass_Code ere.EncounterClassCode `json:"encounterClass-code"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -17,7 +17,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -27,6 +26,7 @@ type FilterDto struct {
|
||||
Regency_Code *string `json:"regency-code"`
|
||||
Address string `json:"address"`
|
||||
PhoneNumber string `json:"phoneNumber"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -19,7 +19,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -30,6 +29,7 @@ type FilterDto struct {
|
||||
Uom_Code *string `json:"uom-code"`
|
||||
Infra_Id *uint16 `json:"infra-id"`
|
||||
Stock *int `json:"stock"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -13,13 +13,13 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -20,7 +20,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -31,6 +30,7 @@ type FilterDto struct {
|
||||
Infra_Id *uint16 `json:"infra-id"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -16,7 +16,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -24,6 +23,7 @@ type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Scope_Code *ere.CheckupScopeCode `json:"scope-code"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -16,7 +16,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -24,6 +23,7 @@ type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
McuSrcCategory_Code *string `json:"mcuSrcCategory-code"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -17,7 +17,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -25,6 +24,7 @@ type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
CheckupCategory_Code *string `json:"checkupCategory-code"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -15,7 +15,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -23,6 +22,7 @@ type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -13,13 +13,13 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -13,13 +13,13 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -25,7 +25,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -39,6 +38,7 @@ type FilterDto struct {
|
||||
Infra_Id *uint16 `json:"infra-id"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -14,7 +14,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -22,6 +21,7 @@ type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Regency_Code string `json:"regency-code"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -14,7 +14,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -22,6 +21,7 @@ type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
IndName string `json:"indName"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -14,14 +14,14 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -15,7 +15,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
@@ -24,6 +23,7 @@ type FilterDto struct {
|
||||
Province_Code string `json:"province-code"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -14,7 +14,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -22,6 +21,7 @@ type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Unit_Id *uint16 `json:"unit-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -14,7 +14,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -22,6 +21,7 @@ type FilterDto struct {
|
||||
Code *string `json:"code"`
|
||||
Name *string `json:"name"`
|
||||
Specialist_Id *uint16 `json:"specialist-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -15,7 +15,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
@@ -23,6 +22,7 @@ type FilterDto struct {
|
||||
Installation_Id *uint16 `json:"installation-id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -13,13 +13,13 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -14,7 +14,6 @@ type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
@@ -23,6 +22,7 @@ type FilterDto struct {
|
||||
District_Code string `json:"district-code"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -53,15 +53,12 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Pr
|
||||
}
|
||||
}
|
||||
|
||||
tx = plh.SearchCodeOrName(input.Search, tx)
|
||||
|
||||
tx = plh.Sort(input.Sort, tx)
|
||||
|
||||
tx = tx.
|
||||
tx = tx.Debug().
|
||||
Model(&e.Province{}).
|
||||
Scopes(gh.Filter(input.FilterDto)).
|
||||
Count(&count).
|
||||
Scopes(gh.Paginate(input, &pagination))
|
||||
// Scopes(gh.Sort(input.Sort))
|
||||
|
||||
if err := tx.Find(&data).Error; err != nil {
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
|
||||
Reference in New Issue
Block a user