seed complete
This commit is contained in:
@@ -7,10 +7,10 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Id *uint `json:"id"`
|
||||
Installation_Code string `json:"installation_code"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Id *uint `json:"id"`
|
||||
Installation_Code *string `json:"installation_code"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -25,8 +25,9 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.Specialist) {
|
||||
func setBulkData(input []e.CreateDto) (data []e.Specialist) {
|
||||
for _, i := range input {
|
||||
data = append(data, e.Specialist{
|
||||
Code: i.Code,
|
||||
Name: i.Name,
|
||||
Code: i.Code,
|
||||
Name: i.Name,
|
||||
Installation_Code: i.Installation_Code,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -36,10 +36,10 @@ func SeedSpecialist(event *pl.Event, tx *db.Dualtx) error {
|
||||
|
||||
speCode := strconv.Itoa(int(v.No))
|
||||
|
||||
var insCode string
|
||||
var insCode *string
|
||||
if v.KdUnit != 0 {
|
||||
code := strconv.Itoa(v.KdUnit)
|
||||
insCode = code
|
||||
insCode = &code
|
||||
}
|
||||
|
||||
speData = append(speData, es.CreateDto{
|
||||
|
||||
Reference in New Issue
Block a user