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

50 lines
1.5 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 TrainWheelDiameterDto struct {
Id int32 `json:"id" form:"id"`
Name string `json:"name" form:"name"`
Diameter int32 `json:"diameter" form:"diameter"`
MinDiameter int32 `json:"min_diameter" form:"min_diameter"`
MaxDiameter int32 `json:"max_diameter" form:"max_diameter"`
AxialPosition int32 `json:"axial_position" form:"axial_position"`
InstallDirection string `json:"install_direction" form:"install_direction"`
}