This commit is contained in:
walker 2024-01-18 13:11:55 +08:00
commit b253a18791
11 changed files with 319 additions and 247 deletions

View File

@ -83,7 +83,7 @@ func queryTrainInfoList(c *gin.Context) {
// @Tags 列车管理Api // @Tags 列车管理Api
// @Accept json // @Accept json
// @Produce json // @Produce json
// @Param trainInfoDto query dto.TrainInfoDto true "创建的列车信息" // @Param trainInfoDto body dto.TrainInfoDto true "创建的列车信息"
// @Success 200 {object} nil // @Success 200 {object} nil
// @Failure 401 {object} dto.ErrorDto // @Failure 401 {object} dto.ErrorDto
// @Failure 404 {object} dto.ErrorDto // @Failure 404 {object} dto.ErrorDto

View File

@ -4361,49 +4361,13 @@ const docTemplate = `{
"summary": "创建列车", "summary": "创建列车",
"parameters": [ "parameters": [
{ {
"type": "integer", "description": "创建的列车信息",
"name": "carriage_length", "name": "trainInfoDto",
"in": "query" "in": "body",
}, "required": true,
{ "schema": {
"type": "string", "$ref": "#/definitions/dto.TrainInfoDto"
"name": "description", }
"in": "query"
},
{
"type": "integer",
"name": "id",
"in": "query"
},
{
"type": "integer",
"name": "max_diameter",
"in": "query"
},
{
"type": "integer",
"name": "min_diameter",
"in": "query"
},
{
"type": "string",
"name": "name",
"in": "query"
},
{
"type": "integer",
"name": "total_length",
"in": "query"
},
{
"type": "integer",
"name": "train_model",
"in": "query"
},
{
"type": "string",
"name": "train_sets",
"in": "query"
} }
], ],
"responses": { "responses": {
@ -5006,7 +4970,7 @@ const docTemplate = `{
"dto.AddTrainReqDtoNew": { "dto.AddTrainReqDtoNew": {
"type": "object", "type": "object",
"properties": { "properties": {
"ConfigTrain": { "configTrain": {
"description": "列车数据配置", "description": "列车数据配置",
"allOf": [ "allOf": [
{ {
@ -5014,22 +4978,6 @@ const docTemplate = `{
} }
] ]
}, },
"TrainEndsA": {
"description": "车辆A端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"TrainEndsB": {
"description": "车辆B端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"devicePort": { "devicePort": {
"description": "道岔端口", "description": "道岔端口",
"type": "string" "type": "string"
@ -5058,6 +5006,22 @@ const docTemplate = `{
"description": "仿真id", "description": "仿真id",
"type": "string" "type": "string"
}, },
"trainEndsA": {
"description": "车辆A端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"trainEndsB": {
"description": "车辆B端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"trainLength": { "trainLength": {
"description": "列车长度", "description": "列车长度",
"type": "integer" "type": "integer"
@ -5316,26 +5280,6 @@ const docTemplate = `{
"dto.ConfigTrainReqDto": { "dto.ConfigTrainReqDto": {
"type": "object", "type": "object",
"properties": { "properties": {
"TrainEndsA": {
"description": "车辆A端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"TrainEndsB": {
"description": "车辆B端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"TrainId": {
"description": "列车Id",
"type": "integer"
},
"configData": { "configData": {
"$ref": "#/definitions/dto.ConfigTrainData" "$ref": "#/definitions/dto.ConfigTrainData"
}, },
@ -5346,6 +5290,26 @@ const docTemplate = `{
"simulationId": { "simulationId": {
"type": "string" "type": "string"
}, },
"trainEndsA": {
"description": "车辆A端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"trainEndsB": {
"description": "车辆B端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"trainId": {
"description": "列车Id",
"type": "integer"
},
"wheelDiameter": { "wheelDiameter": {
"description": "轮径mm", "description": "轮径mm",
"type": "integer" "type": "integer"
@ -5834,9 +5798,6 @@ const docTemplate = `{
"dto.TrainInfoDto": { "dto.TrainInfoDto": {
"type": "object", "type": "object",
"properties": { "properties": {
"TrainConfigData": {
"$ref": "#/definitions/dto.ConfigTrainData"
},
"carriage_length": { "carriage_length": {
"type": "integer" "type": "integer"
}, },
@ -5858,6 +5819,9 @@ const docTemplate = `{
"total_length": { "total_length": {
"type": "integer" "type": "integer"
}, },
"trainConfigData": {
"$ref": "#/definitions/dto.ConfigTrainData"
},
"train_model": { "train_model": {
"type": "integer" "type": "integer"
}, },

View File

@ -4355,49 +4355,13 @@
"summary": "创建列车", "summary": "创建列车",
"parameters": [ "parameters": [
{ {
"type": "integer", "description": "创建的列车信息",
"name": "carriage_length", "name": "trainInfoDto",
"in": "query" "in": "body",
}, "required": true,
{ "schema": {
"type": "string", "$ref": "#/definitions/dto.TrainInfoDto"
"name": "description", }
"in": "query"
},
{
"type": "integer",
"name": "id",
"in": "query"
},
{
"type": "integer",
"name": "max_diameter",
"in": "query"
},
{
"type": "integer",
"name": "min_diameter",
"in": "query"
},
{
"type": "string",
"name": "name",
"in": "query"
},
{
"type": "integer",
"name": "total_length",
"in": "query"
},
{
"type": "integer",
"name": "train_model",
"in": "query"
},
{
"type": "string",
"name": "train_sets",
"in": "query"
} }
], ],
"responses": { "responses": {
@ -5000,7 +4964,7 @@
"dto.AddTrainReqDtoNew": { "dto.AddTrainReqDtoNew": {
"type": "object", "type": "object",
"properties": { "properties": {
"ConfigTrain": { "configTrain": {
"description": "列车数据配置", "description": "列车数据配置",
"allOf": [ "allOf": [
{ {
@ -5008,22 +4972,6 @@
} }
] ]
}, },
"TrainEndsA": {
"description": "车辆A端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"TrainEndsB": {
"description": "车辆B端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"devicePort": { "devicePort": {
"description": "道岔端口", "description": "道岔端口",
"type": "string" "type": "string"
@ -5052,6 +5000,22 @@
"description": "仿真id", "description": "仿真id",
"type": "string" "type": "string"
}, },
"trainEndsA": {
"description": "车辆A端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"trainEndsB": {
"description": "车辆B端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"trainLength": { "trainLength": {
"description": "列车长度", "description": "列车长度",
"type": "integer" "type": "integer"
@ -5310,26 +5274,6 @@
"dto.ConfigTrainReqDto": { "dto.ConfigTrainReqDto": {
"type": "object", "type": "object",
"properties": { "properties": {
"TrainEndsA": {
"description": "车辆A端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"TrainEndsB": {
"description": "车辆B端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"TrainId": {
"description": "列车Id",
"type": "integer"
},
"configData": { "configData": {
"$ref": "#/definitions/dto.ConfigTrainData" "$ref": "#/definitions/dto.ConfigTrainData"
}, },
@ -5340,6 +5284,26 @@
"simulationId": { "simulationId": {
"type": "string" "type": "string"
}, },
"trainEndsA": {
"description": "车辆A端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"trainEndsB": {
"description": "车辆B端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"trainId": {
"description": "列车Id",
"type": "integer"
},
"wheelDiameter": { "wheelDiameter": {
"description": "轮径mm", "description": "轮径mm",
"type": "integer" "type": "integer"
@ -5828,9 +5792,6 @@
"dto.TrainInfoDto": { "dto.TrainInfoDto": {
"type": "object", "type": "object",
"properties": { "properties": {
"TrainConfigData": {
"$ref": "#/definitions/dto.ConfigTrainData"
},
"carriage_length": { "carriage_length": {
"type": "integer" "type": "integer"
}, },
@ -5852,6 +5813,9 @@
"total_length": { "total_length": {
"type": "integer" "type": "integer"
}, },
"trainConfigData": {
"$ref": "#/definitions/dto.ConfigTrainData"
},
"train_model": { "train_model": {
"type": "integer" "type": "integer"
}, },

View File

@ -37,18 +37,10 @@ definitions:
- PictureType_TrainData - PictureType_TrainData
dto.AddTrainReqDtoNew: dto.AddTrainReqDtoNew:
properties: properties:
ConfigTrain: configTrain:
allOf: allOf:
- $ref: '#/definitions/dto.ConfigTrainData' - $ref: '#/definitions/dto.ConfigTrainData'
description: 列车数据配置 description: 列车数据配置
TrainEndsA:
allOf:
- $ref: '#/definitions/dto.ConfigTrainEnds'
description: 车辆A端
TrainEndsB:
allOf:
- $ref: '#/definitions/dto.ConfigTrainEnds'
description: 车辆B端
devicePort: devicePort:
description: 道岔端口 description: 道岔端口
type: string type: string
@ -70,6 +62,14 @@ definitions:
simulationId: simulationId:
description: 仿真id description: 仿真id
type: string type: string
trainEndsA:
allOf:
- $ref: '#/definitions/dto.ConfigTrainEnds'
description: 车辆A端
trainEndsB:
allOf:
- $ref: '#/definitions/dto.ConfigTrainEnds'
description: 车辆B端
trainLength: trainLength:
description: 列车长度 description: 列车长度
type: integer type: integer
@ -249,17 +249,6 @@ definitions:
type: object type: object
dto.ConfigTrainReqDto: dto.ConfigTrainReqDto:
properties: properties:
TrainEndsA:
allOf:
- $ref: '#/definitions/dto.ConfigTrainEnds'
description: 车辆A端
TrainEndsB:
allOf:
- $ref: '#/definitions/dto.ConfigTrainEnds'
description: 车辆B端
TrainId:
description: 列车Id
type: integer
configData: configData:
$ref: '#/definitions/dto.ConfigTrainData' $ref: '#/definitions/dto.ConfigTrainData'
length: length:
@ -267,6 +256,17 @@ definitions:
type: integer type: integer
simulationId: simulationId:
type: string type: string
trainEndsA:
allOf:
- $ref: '#/definitions/dto.ConfigTrainEnds'
description: 车辆A端
trainEndsB:
allOf:
- $ref: '#/definitions/dto.ConfigTrainEnds'
description: 车辆B端
trainId:
description: 列车Id
type: integer
wheelDiameter: wheelDiameter:
description: 轮径mm description: 轮径mm
type: integer type: integer
@ -597,8 +597,6 @@ definitions:
type: object type: object
dto.TrainInfoDto: dto.TrainInfoDto:
properties: properties:
TrainConfigData:
$ref: '#/definitions/dto.ConfigTrainData'
carriage_length: carriage_length:
type: integer type: integer
description: description:
@ -617,6 +615,8 @@ definitions:
type: integer type: integer
train_sets: train_sets:
type: string type: string
trainConfigData:
$ref: '#/definitions/dto.ConfigTrainData'
type: object type: object
dto.UpdateTrainReqDto: dto.UpdateTrainReqDto:
properties: properties:
@ -3741,33 +3741,12 @@ paths:
- application/json - application/json
description: 创建列车数据 description: 创建列车数据
parameters: parameters:
- in: query - description: 创建的列车信息
name: carriage_length in: body
type: integer name: trainInfoDto
- in: query required: true
name: description schema:
type: string $ref: '#/definitions/dto.TrainInfoDto'
- in: query
name: id
type: integer
- in: query
name: max_diameter
type: integer
- in: query
name: min_diameter
type: integer
- in: query
name: name
type: string
- in: query
name: total_length
type: integer
- in: query
name: train_model
type: integer
- in: query
name: train_sets
type: string
produces: produces:
- application/json - application/json
responses: responses:

View File

@ -75,20 +75,20 @@ type AddTrainReqDtoNew struct {
MapId int32 `json:"mapId" from:"mapId"` MapId int32 `json:"mapId" from:"mapId"`
WheelDiameter int32 `json:"wheelDiameter" from:"wheelDiameter"` WheelDiameter int32 `json:"wheelDiameter" from:"wheelDiameter"`
// 列车数据配置 // 列车数据配置
ConfigTrain ConfigTrainData `json:"ConfigTrain" from:"mapId"` ConfigTrain ConfigTrainData `json:"configTrain" from:"mapId"`
TrainEndsA ConfigTrainEnds `json:"TrainEndsA"` // 车辆A端 TrainEndsA ConfigTrainEnds `json:"trainEndsA"` // 车辆A端
TrainEndsB ConfigTrainEnds `json:"TrainEndsB"` // 车辆B端 TrainEndsB ConfigTrainEnds `json:"trainEndsB"` // 车辆B端
} }
// 为反正列车修改对应的测试配置 // 为反正列车修改对应的测试配置
type ConfigTrainReqDto struct { type ConfigTrainReqDto struct {
SimulationId string `json:"simulationId" form:"simulationId"` SimulationId string `json:"simulationId" form:"simulationId"`
// 列车Id // 列车Id
TrainId int `json:"TrainId" form:"TrainId"` TrainId int `json:"trainId" form:"trainId"`
Length int64 `json:"length"` // 列车的长度cm Length int64 `json:"length"` // 列车的长度cm
ConfigData ConfigTrainData ConfigData ConfigTrainData
TrainEndsA ConfigTrainEnds `json:"TrainEndsA"` // 车辆A端 TrainEndsA ConfigTrainEnds `json:"trainEndsA"` // 车辆A端
TrainEndsB ConfigTrainEnds `json:"TrainEndsB"` // 车辆B端 TrainEndsB ConfigTrainEnds `json:"trainEndsB"` // 车辆B端
WheelDiameter int32 `json:"wheelDiameter"` // 轮径mm WheelDiameter int32 `json:"wheelDiameter"` // 轮径mm
} }
type ConfigTrainEnds struct { type ConfigTrainEnds struct {

View File

@ -3394,11 +3394,16 @@ var file_device_state_proto_rawDesc = []byte{
0x6e, 0x45, 0x6e, 0x64, 0x73, 0x41, 0x12, 0x36, 0x0a, 0x0a, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x45, 0x6e, 0x64, 0x73, 0x41, 0x12, 0x36, 0x0a, 0x0a, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x45,
0x6e, 0x64, 0x73, 0x42, 0x18, 0x40, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6e, 0x64, 0x73, 0x42, 0x18, 0x40, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x64, 0x73, 0x53, 0x74, 0x61, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x64, 0x73, 0x53, 0x74, 0x61,
<<<<<<< HEAD
0x74, 0x65, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x64, 0x73, 0x42, 0x22, 0x56, 0x74, 0x65, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x64, 0x73, 0x42, 0x22, 0x56,
=======
0x74, 0x65, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x64, 0x73, 0x42, 0x22, 0x40,
>>>>>>> a6010772643399ddeab8d963aeba2d4ed988b780
0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02,
0x78, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x78, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x78, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x78, 0x68, 0x12, 0x12, 0x0a, 0x04,
0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65,
<<<<<<< HEAD
0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52,
0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x49, 0x0a, 0x0b, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x49, 0x0a, 0x0b, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e,
0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
@ -3531,6 +3536,139 @@ var file_device_state_proto_rawDesc = []byte{
0x63, 0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x63, 0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65,
0x72, 0x76, 0x65, 0x72, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
=======
0x22, 0x49, 0x0a, 0x0b, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12,
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12,
0x12, 0x0a, 0x04, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64,
0x6f, 0x77, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x34, 0x0a, 0x0a, 0x41,
0x6c, 0x61, 0x72, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74,
0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76,
0x65, 0x22, 0x34, 0x0a, 0x0a, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12,
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12,
0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52,
0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x5b, 0x0a, 0x08, 0x50, 0x73, 0x64, 0x53, 0x74,
0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x02, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x09, 0x61, 0x73, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73,
0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x41,
0x73, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x09, 0x61, 0x73, 0x64, 0x53, 0x74, 0x61, 0x74,
0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x67, 0x6a, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52,
0x03, 0x6d, 0x67, 0x6a, 0x22, 0x58, 0x0a, 0x08, 0x41, 0x73, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65,
0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04,
0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x6d, 0x64, 0x77, 0x18, 0x02, 0x20, 0x01,
0x28, 0x08, 0x52, 0x04, 0x6b, 0x6d, 0x64, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6d, 0x64, 0x77,
0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x67, 0x6d, 0x64, 0x77, 0x12, 0x10, 0x0a, 0x03,
0x6d, 0x67, 0x6a, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x6d, 0x67, 0x6a, 0x22, 0x2e,
0x0a, 0x08, 0x4b, 0x65, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x65,
0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x67, 0x65, 0x61, 0x72, 0x22, 0x52,
0x0a, 0x09, 0x4d, 0x6b, 0x78, 0x4a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63,
0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12,
0x31, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x70, 0x6c,
0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61,
0x74, 0x65, 0x22, 0x67, 0x0a, 0x0b, 0x42, 0x61, 0x6c, 0x69, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74,
0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69,
0x64, 0x12, 0x2c, 0x0a, 0x02, 0x6b, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e,
0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4b, 0x69, 0x6c, 0x6f,
0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x02, 0x6b, 0x6d, 0x12,
0x1a, 0x0a, 0x08, 0x74, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x08, 0x74, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x22, 0xa1, 0x02, 0x0a, 0x0f,
0x56, 0x61, 0x72, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,
0x38, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x18,
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x54, 0x72,
0x61, 0x69, 0x6e, 0x4d, 0x61, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0c, 0x75, 0x70, 0x64,
0x61, 0x74, 0x65, 0x64, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x65, 0x6d,
0x6f, 0x76, 0x65, 0x64, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28,
0x09, 0x52, 0x0e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x49,
0x64, 0x12, 0x38, 0x0a, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x53, 0x77, 0x69, 0x74,
0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65,
0x2e, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x75, 0x70,
0x64, 0x61, 0x74, 0x65, 0x64, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x3b, 0x0a, 0x0e, 0x75,
0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
0x64, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61,
0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11,
0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74,
0x65, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22,
0x88, 0x05, 0x0a, 0x10, 0x41, 0x6c, 0x6c, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x53, 0x74,
0x61, 0x74, 0x75, 0x73, 0x12, 0x34, 0x0a, 0x0a, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61,
0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65,
0x2e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x4d, 0x61, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0a,
0x74, 0x72, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x34, 0x0a, 0x0b, 0x73, 0x77,
0x69, 0x74, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x12, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x53, 0x74,
0x61, 0x74, 0x65, 0x52, 0x0b, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x65,
0x12, 0x37, 0x0a, 0x0c, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65,
0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0c, 0x73, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x31, 0x0a, 0x0a, 0x72, 0x65, 0x70,
0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e,
0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65,
0x52, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x34, 0x0a, 0x0b,
0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x12, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c,
0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x61,
0x74, 0x65, 0x12, 0x34, 0x0a, 0x0b, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74,
0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e,
0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0b, 0x62, 0x75, 0x74,
0x74, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x31, 0x0a, 0x0a, 0x41, 0x6c, 0x61, 0x72,
0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x73,
0x74, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x6c, 0x61, 0x72, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52,
0x0a, 0x41, 0x6c, 0x61, 0x72, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x31, 0x0a, 0x0a, 0x4c,
0x69, 0x67, 0x68, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x11, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x53, 0x74, 0x61,
0x74, 0x65, 0x52, 0x0a, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2b,
0x0a, 0x08, 0x70, 0x73, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x0f, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x50, 0x73, 0x64, 0x53, 0x74, 0x61, 0x74,
0x65, 0x52, 0x08, 0x70, 0x73, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x4b,
0x65, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e,
0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x08,
0x4b, 0x65, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3a, 0x0a, 0x0d, 0x70, 0x6c, 0x61, 0x74,
0x66, 0x6f, 0x72, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x14, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d,
0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53,
0x74, 0x61, 0x74, 0x65, 0x12, 0x34, 0x0a, 0x0b, 0x62, 0x61, 0x6c, 0x69, 0x73, 0x65, 0x53, 0x74,
0x61, 0x74, 0x65, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x74, 0x61, 0x74,
0x65, 0x2e, 0x42, 0x61, 0x6c, 0x69, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0b, 0x62,
0x61, 0x6c, 0x69, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0x94, 0x01, 0x0a, 0x13, 0x50,
0x75, 0x73, 0x68, 0x65, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74,
0x75, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52,
0x03, 0x61, 0x6c, 0x6c, 0x12, 0x34, 0x0a, 0x09, 0x76, 0x61, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e,
0x56, 0x61, 0x72, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
0x09, 0x76, 0x61, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x35, 0x0a, 0x09, 0x61, 0x6c,
0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e,
0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x6c, 0x6c, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x22, 0xd8, 0x01, 0x0a, 0x10, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x69,
0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x3d, 0x0a, 0x05, 0x73, 0x74,
0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x73, 0x74, 0x61, 0x74,
0x65, 0x2e, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74,
0x75, 0x73, 0x2e, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61,
0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73,
0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3f, 0x0a, 0x0f, 0x53,
0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x09,
0x0a, 0x05, 0x50, 0x41, 0x55, 0x53, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x54, 0x41,
0x52, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x12,
0x0b, 0x0a, 0x07, 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x10, 0x03, 0x2a, 0x37, 0x0a, 0x0b,
0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x41,
0x6e, 0x79, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x78, 0x6c, 0x65, 0x10, 0x01, 0x12, 0x09,
0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x68, 0x79,
0x73, 0x69, 0x63, 0x10, 0x03, 0x42, 0x67, 0x0a, 0x25, 0x63, 0x6c, 0x75, 0x62, 0x2e, 0x6a, 0x6f,
0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x62, 0x6a, 0x72, 0x74, 0x73, 0x73, 0x2e, 0x61, 0x74, 0x73,
0x2e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x42, 0x10,
0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x5a, 0x2c, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63, 0x6c, 0x75, 0x62, 0x2f, 0x62,
0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x64,
0x74, 0x6f, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
>>>>>>> a6010772643399ddeab8d963aeba2d4ed988b780
} }
var ( var (

View File

@ -2,6 +2,7 @@ package dto
import ( import (
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
"joylink.club/bj-rtsts-server/dto/common_proto"
"joylink.club/bj-rtsts-server/dto/data_proto" "joylink.club/bj-rtsts-server/dto/data_proto"
) )
@ -16,16 +17,16 @@ type TrainInfoReqDto struct {
} }
type TrainInfoDto struct { type TrainInfoDto struct {
Id int32 `json:"id" form:"id"` Id int32 `json:"id" form:"id"`
Name string `json:"name" form:"name"` Name string `json:"name" form:"name"`
TrainModel int32 `json:"train_model" form:"train_model"` TrainModel int32 `json:"train_model" form:"train_model"`
CarriageLength int32 `json:"carriage_length" form:"carriage_length"` CarriageLength int32 `json:"carriage_length" form:"carriage_length"`
TotalLength int32 `json:"total_length" form:"total_length"` TotalLength int32 `json:"total_length" form:"total_length"`
MinDiameter int32 `json:"min_diameter" form:"min_diameter"` MinDiameter int32 `json:"min_diameter" form:"min_diameter"`
MaxDiameter int32 `json:"max_diameter" form:"max_diameter"` MaxDiameter int32 `json:"max_diameter" form:"max_diameter"`
TrainSets string `json:"train_sets" form:"train_sets"` TrainSets string `json:"train_sets" form:"train_sets"`
Description string `json:"description" form:"description"` Description string `json:"description" form:"description"`
TrainConfigData ConfigTrainData `json:"TrainConfigData" form:"TrainConfigData"` TrainConfigData *ConfigTrainData `json:"trainConfigData" form:"trainConfigData"`
} }
func ConvertToTrainDto(trailInfos []*PublishedDto) []*TrainInfoDto { func ConvertToTrainDto(trailInfos []*PublishedDto) []*TrainInfoDto {
@ -35,19 +36,31 @@ func ConvertToTrainDto(trailInfos []*PublishedDto) []*TrainInfoDto {
} }
return result return result
} }
func TrainConfigToDtoConvert(dc *common_proto.TrainDynamicConfig) *ConfigTrainData {
if dc != nil {
return &ConfigTrainData{
BaseResistanceParamA: dc.BaseResistanceParamA, BaseResistanceParamB: dc.BaseResistanceParamB, BaseResistanceParamC: dc.BaseResistanceParamC,
CurveResistanceParamR1: dc.CurveResistanceParamR1, CurveResistanceParamR2: dc.CurveResistanceParamR2, CurveResistanceParamR3: dc.CurveResistanceParamR3,
CurveResistanceParamR4: dc.CurveResistanceParamR4, RevolvingMassParam: dc.RevolvingMassParam,
Jump: dc.Jump, Slip: dc.Slip, Slide: dc.Slide,
StopSign: dc.StopSign,
}
}
return nil
}
func ConvertDtoFromTrain(t *PublishedDto) *TrainInfoDto { func ConvertDtoFromTrain(t *PublishedDto) *TrainInfoDto {
message := &data_proto.Train{} message := &data_proto.Train{}
proto.Unmarshal(t.Proto, message) proto.Unmarshal(t.Proto, message)
return &TrainInfoDto{ return &TrainInfoDto{
Id: t.ID, Id: t.ID,
Name: t.Name, Name: t.Name,
Description: t.Note, Description: t.Note,
TrainModel: int32(message.TrainModel), TrainModel: int32(message.TrainModel),
CarriageLength: message.CarriageLength, CarriageLength: message.CarriageLength,
TotalLength: message.TotalLength, TotalLength: message.TotalLength,
MinDiameter: message.MinDiameter, MinDiameter: message.MinDiameter,
MaxDiameter: message.MaxDiameter, MaxDiameter: message.MaxDiameter,
TrainSets: message.TrainSets, TrainSets: message.TrainSets,
TrainConfigData: TrainConfigToDtoConvert(message.DynamicConfig),
} }
} }

View File

@ -146,6 +146,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU=
github.com/ebitengine/purego v0.1.0/go.mod h1:Eh8I3yvknDYZeCuXH9kRNaPuHEwvXDCk378o9xszmHg= github.com/ebitengine/purego v0.1.0/go.mod h1:Eh8I3yvknDYZeCuXH9kRNaPuHEwvXDCk378o9xszmHg=
github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
github.com/go-faster/city v1.0.1/go.mod h1:jKcUJId49qdW3L1qKHH/3wPeUstCVpVSXTM6vO3VcTw=
github.com/go-faster/errors v0.6.1/go.mod h1:5MGV2/2T9yvlrbhe9pD9LO5Z/2zCSq2T8j+Jpi2LAyY=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20220806181222-55e207c401ad/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20220806181222-55e207c401ad/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@ -161,6 +163,7 @@ github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/S
github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4=
github.com/jezek/xgb v1.0.1/go.mod h1:nrhwO0FX/enq75I7Y7G8iN1ubpSGZEiA3v9e9GyRFlk= github.com/jezek/xgb v1.0.1/go.mod h1:nrhwO0FX/enq75I7Y7G8iN1ubpSGZEiA3v9e9GyRFlk=
@ -171,10 +174,14 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk
github.com/nats-io/nats.go v1.31.0/go.mod h1:di3Bm5MLsoB4Bx61CBTsxuarI36WbhAwOm8QrW39+i8= github.com/nats-io/nats.go v1.31.0/go.mod h1:di3Bm5MLsoB4Bx61CBTsxuarI36WbhAwOm8QrW39+i8=
github.com/nats-io/nkeys v0.4.6/go.mod h1:4DxZNzenSVd1cYQoAa8948QY3QDjrHfcfVADymtkpts= github.com/nats-io/nkeys v0.4.6/go.mod h1:4DxZNzenSVd1cYQoAa8948QY3QDjrHfcfVADymtkpts=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/paulmach/orb v0.7.1/go.mod h1:FWRlTgl88VI1RBx/MkrwWDRhQ96ctqMCh8boXhmqB/A=
github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk= github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sagikazarmark/crypt v0.17.0/go.mod h1:SMtHTvdmsZMuY/bpZoqokSoChIrcJ/epOxZN58PbZDg= github.com/sagikazarmark/crypt v0.17.0/go.mod h1:SMtHTvdmsZMuY/bpZoqokSoChIrcJ/epOxZN58PbZDg=
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
@ -198,4 +205,5 @@ google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc=
google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
gorm.io/driver/clickhouse v0.5.0/go.mod h1:cIKAlFw+IVK75g0bDcm0M9qRA4EAgsn23Si+zCXQ1Lc=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=

View File

@ -317,6 +317,9 @@ func convertTrainState(v *state_proto.TrainState) *state_proto.TrainMapState {
RightDoorCloseCommand: v.VobcState.RightDoorCloseCommand, RightDoorCloseCommand: v.VobcState.RightDoorCloseCommand,
AllDoorClose: v.VobcState.AllDoorClose, AllDoorClose: v.VobcState.AllDoorClose,
VobcInterruption: v.VobcState.UdpInterruption, VobcInterruption: v.VobcState.UdpInterruption,
TrainDynamicConfig: v.TrainDynamicConfig,
TrainEndsA: v.TrainEndsA,
TrainEndsB: v.TrainEndsB,
} }
return t return t
} }

View File

@ -57,14 +57,17 @@ func ListTrainByProject(query *dto.TrainInfoReqDto) []*dto.TrainInfoDto {
func CreateTrain(td *dto.TrainInfoDto, user *model.User) bool { func CreateTrain(td *dto.TrainInfoDto, user *model.User) bool {
publishData(&dto.PublishedDto{ publishData(&dto.PublishedDto{
Name: td.Name, Name: td.Name,
Proto: convertTrainProto(td), Proto: convertTrainDtoToProto(td),
Type: trainDataType, Type: trainDataType,
UserID: user.ID, UserID: user.ID,
Note: td.Description, Note: td.Description,
}, true) }, true)
return true return true
} }
func TrainConfigToProtoConvert(t dto.ConfigTrainData) *common_proto.TrainDynamicConfig { func TrainConfigToProtoConvert(t *dto.ConfigTrainData) *common_proto.TrainDynamicConfig {
if t == nil {
return nil
}
return &common_proto.TrainDynamicConfig{ return &common_proto.TrainDynamicConfig{
BaseResistanceParamA: t.BaseResistanceParamA, BaseResistanceParamA: t.BaseResistanceParamA,
BaseResistanceParamB: t.BaseResistanceParamB, BaseResistanceParamB: t.BaseResistanceParamB,
@ -81,7 +84,7 @@ func TrainConfigToProtoConvert(t dto.ConfigTrainData) *common_proto.TrainDynamic
} }
// 转成列车proto // 转成列车proto
func convertTrainProto(t *dto.TrainInfoDto) []byte { func convertTrainDtoToProto(t *dto.TrainInfoDto) []byte {
message := &data_proto.Train{ message := &data_proto.Train{
TrainModel: data_proto.Train_TrainModel(t.TrainModel), TrainModel: data_proto.Train_TrainModel(t.TrainModel),
CarriageLength: t.CarriageLength, CarriageLength: t.CarriageLength,
@ -124,7 +127,7 @@ func UpdateTrain(id int32, td *dto.TrainInfoDto, user *model.User) bool {
panic(sys_error.New("更新列车信息错误", err)) panic(sys_error.New("更新列车信息错误", err))
} }
pvdn := &model.PublishedVersion{ pvdn := &model.PublishedVersion{
Proto: convertTrainProto(td), Proto: convertTrainDtoToProto(td),
UserID: user.ID, UserID: user.ID,
PublishAt: time.Now(), PublishAt: time.Now(),
Note: td.Description, Note: td.Description,

View File

@ -193,7 +193,7 @@ func AddTrainStateNew(vs *VerifySimulation, status *state_proto.TrainState, conf
func createOrUpdateStateDynamicConfig(trainState *state_proto.TrainState, configTrainData dto.ConfigTrainData, trainEndsA dto.ConfigTrainEnds, func createOrUpdateStateDynamicConfig(trainState *state_proto.TrainState, configTrainData dto.ConfigTrainData, trainEndsA dto.ConfigTrainEnds,
trainEndsB dto.ConfigTrainEnds) { trainEndsB dto.ConfigTrainEnds) {
trainState.TrainDynamicConfig = service.TrainConfigToProtoConvert(configTrainData) trainState.TrainDynamicConfig = service.TrainConfigToProtoConvert(&configTrainData)
/*if trainState.TrainDynamicConfig == nil { /*if trainState.TrainDynamicConfig == nil {
trainState.TrainDynamicConfig = &common_proto.TrainDynamicConfig{} trainState.TrainDynamicConfig = &common_proto.TrainDynamicConfig{}