rts-sim-testing-service/dto/trainManage.go

47 lines
1.2 KiB
Go
Raw Normal View History

package dto
import "joylink.club/bj-rtsts-server/db/model"
type PageTrainManageReqDto struct {
PageQueryDto
Name string `json:"name" form:"name"`
}
type TrainManageReqDto struct {
Name string `json:"name" form:"name"`
}
type TrainModelDto struct {
Id int32 `json:"id" form:"id"`
Name string `json:"name" form:"name"`
}
type TrainSizeDto struct {
Id int32 `json:"id" form:"id"`
Name string `json:"name" form:"name"`
CarriageLength int32 `json:"carriage_length" form:"carriage_length"`
TotalLength int32 `json:"total_length" form:"total_length"`
Description string `json:"description" form:"description"`
}
func ConvertFromTrainSizeDto(giSlice []*model.TrainSize) []*TrainSizeDto {
var result []*TrainSizeDto
for _, gi := range giSlice {
result = append(result, &TrainSizeDto{
Id: gi.ID,
Name: gi.Name,
CarriageLength: gi.CarriageLength,
2023-08-28 13:39:28 +08:00
TotalLength: gi.TotalLength,
Description: gi.Description,
})
}
return result
}
type TrainWheelDto struct {
Id int32 `json:"id" form:"id"`
Name string `json:"name" form:"name"`
MinDiameter int32 `json:"min_diameter" form:"min_diameter"`
MaxDiameter int32 `json:"max_diameter" form:"max_diameter"`
}