p04_search_style.go 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  1. package query
  2. import (
  3. "adm-data/errors"
  4. "adm-data/model"
  5. "adm-data/parser"
  6. v1 "adm-data/pb/v1"
  7. "context"
  8. "encoding/json"
  9. "fmt"
  10. jsoniter "github.com/json-iterator/go"
  11. "git.getensh.com/common/gopkgsv2/database"
  12. "git.getensh.com/common/gopkgsv2/logger"
  13. "go.uber.org/zap"
  14. "google.golang.org/grpc/status"
  15. )
  16. type Aircondition struct {
  17. AirconditionControlType string `json:"aircondition_control_type"`
  18. CarAirPurifier string `json:"car_air_purifier"`
  19. FragranceSystem string `json:"fragrance_system"`
  20. NegativeIonGenerator string `json:"negative_ion_generator"`
  21. Pm25Device string `json:"pm25_device"`
  22. RearIndependentAirConditioner string `json:"rear_independent_air_conditioner"`
  23. RearSeatAirOutlet string `json:"rear_seat_air_outlet"`
  24. Refrigerator string `json:"refrigerator"`
  25. TemperatureZoneControl string `json:"temperature_zone_control"`
  26. }
  27. type Basic struct {
  28. Alternator string `json:"alternator"`
  29. BrakingDistanceMeasure string `json:"braking_distance_measure"`
  30. BrandName string `json:"brand_name"`
  31. EmissionStandard string `json:"emission_standard"`
  32. Engine string `json:"engine"`
  33. FastChargeAmount string `json:"fast_charge_amount"`
  34. FastChargingTime string `json:"fast_charging_time"`
  35. FuelTypeDetail string `json:"fuel_type_detail"`
  36. GearboxDesc string `json:"gearbox_desc"`
  37. HundredAccelerate string `json:"hundred_accelerate"`
  38. HundredAccelerateMeasure string `json:"hundred_accelerate_measure"`
  39. Level string `json:"level"`
  40. Lwh string `json:"lwh"`
  41. Maker string `json:"maker"`
  42. MaximumPower string `json:"maximum_power"`
  43. MaximumSimulationMilage string `json:"maximum_simulation_milage"`
  44. MaximumSimulationMilageMeasure string `json:"maximum_simulation_milage_measure"`
  45. MaximumSpeed string `json:"maximum_speed"`
  46. MaximumTorque string `json:"maximum_torque"`
  47. ModelYear string `json:"model_year"`
  48. OilWearComrehensive string `json:"oil_wear_comrehensive"`
  49. OilWearMeasure string `json:"oil_wear_measure"`
  50. Price string `json:"price"`
  51. PriceYuan string `json:"price_yuan"`
  52. SeriesId string `json:"series_id"`
  53. SeriesImg string `json:"series_img"`
  54. SeriesName string `json:"series_name"`
  55. SlowChargingTime string `json:"slow_charging_time"`
  56. StyleId string `json:"style_id"`
  57. StyleName string `json:"style_name"`
  58. SubLevel string `json:"sub_level"`
  59. VehicleStructure string `json:"vehicle_structure"`
  60. VehicleWarranty string `json:"vehicle_warranty"`
  61. BrandId string `json:"brand_id"`
  62. }
  63. type Body struct {
  64. BackWheelDistance string `json:"back_wheel_distance"`
  65. DoorNumber string `json:"door_number"`
  66. FrontWheelDistance string `json:"front_wheel_distance"`
  67. High string `json:"high"`
  68. Long string `json:"long"`
  69. MinimumGroundClearance string `json:"minimum_ground_clearance"`
  70. OilboxVolume string `json:"oilbox_volume"`
  71. SeatNumber string `json:"seat_number"`
  72. TrunkVolume string `json:"trunk_volume"`
  73. UnladenMass string `json:"unladen_mass"`
  74. Wheelbase string `json:"wheelbase"`
  75. Wide string `json:"wide"`
  76. }
  77. type Chassis struct {
  78. AssistType string `json:"assist_type"`
  79. BackSuspentionType string `json:"back_suspention_type"`
  80. BodyStructure string `json:"body_structure"`
  81. DriveType string `json:"drive_type"`
  82. FrontSuspentionType string `json:"front_suspention_type"`
  83. }
  84. type Control struct {
  85. AirSuspension string `json:"air_suspension"`
  86. AscentAssist string `json:"ascent_assist"`
  87. AutoHold string `json:"auto_hold"`
  88. AutomaticDrivingAssistance string `json:"automatic_driving_assistance"`
  89. AutomaticParking string `json:"automatic_parking"`
  90. BackParkingRador string `json:"back_parking_rador"`
  91. CentralDiffLock string `json:"central_diff_lock"`
  92. CruiseSystem string `json:"cruise_system"`
  93. DrivingModeSelection string `json:"driving_mode_selection"`
  94. EInductionSuspension string `json:"e_induction_suspension"`
  95. Edl string `json:"edl"`
  96. EngineStartStopTechnology string `json:"engine_start_stop_technology"`
  97. FrontParkingRador string `json:"front_parking_rador"`
  98. Hdc string `json:"hdc"`
  99. OverallActiveSteeringSystem string `json:"overall_active_steering_system"`
  100. ReverseVehicleSideWarningSystem string `json:"reverse_vehicle_side_warning_system"`
  101. VariableSteeringRatio string `json:"variable_steering_ratio"`
  102. VariableSuspension string `json:"variable_suspension"`
  103. WadeSensingSystem string `json:"wade_sensing_system"`
  104. }
  105. type Electric struct {
  106. BackElectricMaximumPower string `json:"back_electric_maximum_power"`
  107. BackElectricTorque string `json:"back_electric_torque"`
  108. BatteryEnergy string `json:"battery_energy"`
  109. BatteryPackWarranty string `json:"battery_pack_warranty"`
  110. BatteryType string `json:"battery_type"`
  111. FrontElectricMaximumPower string `json:"front_electric_maximum_power"`
  112. FrontElectricTorque string `json:"front_electric_torque"`
  113. HundredElectricityConsumption string `json:"hundred_electricity_consumption"`
  114. MaximumSimulationMilage string `json:"maximum_simulation_milage"`
  115. MotorLayout string `json:"motor_layout"`
  116. MotorNumber string `json:"motor_number"`
  117. MotorType string `json:"motor_type"`
  118. SystemIntegratedPower string `json:"system_integrated_power"`
  119. SystemIntegratedTorque string `json:"system_integrated_torque"`
  120. TotalMotorPower string `json:"total_motor_power"`
  121. TotalMotorTorque string `json:"total_motor_torque"`
  122. }
  123. type Internal struct {
  124. ActiveNoiseReduction string `json:"active_noise_reduction"`
  125. CarDrivingRecorder string `json:"car_driving_recorder"`
  126. DrivingComputerDisplay string `json:"driving_computer_display"`
  127. ElectricallyAdjustablePedal string `json:"electrically_adjustable_pedal"`
  128. FullLcdDashboard string `json:"full_lcd_dashboard"`
  129. FullLcdDashboardSize string `json:"full_lcd_dashboard_size"`
  130. HudRisingNumberDisplay string `json:"hud_rising_number_display"`
  131. MobilePhoneWirelessCharging string `json:"mobile_phone_wireless_charging"`
  132. MultiFunctionalSteeringWheel string `json:"multi_functional_steering_wheel"`
  133. SteeringWheelAdjustment string `json:"steering_wheel_adjustment"`
  134. SteeringWheelHeating string `json:"steering_wheel_heating"`
  135. SteeringWheelMaterial string `json:"steering_wheel_material"`
  136. SteeringWheelRemember string `json:"steering_wheel_remember"`
  137. SteeringWheelShift string `json:"steering_wheel_shift"`
  138. }
  139. type Engine struct {
  140. AirIntakForm string `json:"air_intak_form"`
  141. CylinderArrangement string `json:"cylinder_arrangement"`
  142. CylinderDiameter string `json:"cylinder_diameter"`
  143. CylinderHeadMaterial string `json:"cylinder_head_material"`
  144. CylinderMaterial string `json:"cylinder_material"`
  145. CylinderNumber string `json:"cylinder_number"`
  146. CylinderValveNumber string `json:"cylinder_valve_number"`
  147. Displacement string `json:"displacement"`
  148. DisplacementL string `json:"displacement_l"`
  149. EngineTechnology string `json:"engine_technology"`
  150. EngineType string `json:"engine_type"`
  151. FuelLable string `json:"fuel_lable"`
  152. FuelTypeDetail string `json:"fuel_type_detail"`
  153. MaximumHorsepower string `json:"maximum_horsepower"`
  154. MaximumPowerRpm string `json:"maximum_power_rpm"`
  155. OilSupplyMode string `json:"oil_supply_mode"`
  156. PistonStroke string `json:"piston_stroke"`
  157. ReductionRatio string `json:"reduction_ratio"`
  158. Rpm string `json:"rpm"`
  159. ValveMechanism string `json:"valve_mechanism"`
  160. }
  161. type External struct {
  162. ActiveIntakeGrille string `json:"active_intake_grille"`
  163. BatteryPreHeating string `json:"battery_pre_heating"`
  164. CentralControlLock string `json:"central_control_lock"`
  165. ElectricTrunk string `json:"electric_trunk"`
  166. ElectronicAntiTheft string `json:"electronic_anti_theft"`
  167. Eosd string `json:"eosd"`
  168. FramelessDesignDoor string `json:"frameless_design_door"`
  169. HideElectricDoorHandle string `json:"hide_electric_door_handle"`
  170. InductiveTrunk string `json:"inductive_trunk"`
  171. KeyType string `json:"key_type"`
  172. KeylessEntrySystem string `json:"keyless_entry_system"`
  173. KeylessStartSystem string `json:"keyless_start_system"`
  174. OutsidePedal string `json:"outside_pedal"`
  175. RearCompartmentPositionMemory string `json:"rear_compartment_position_memory"`
  176. RemoteStart string `json:"remote_start"`
  177. RimMaterial string `json:"rim_material"`
  178. RoofLuggageRack string `json:"roof_luggage_rack"`
  179. SideSlidingDoor string `json:"side_sliding_door"`
  180. SkylightType string `json:"skylight_type"`
  181. SportsAppearanceKit string `json:"sports_appearance_kit"`
  182. Tail string `json:"tail"`
  183. TheTailgateGlassOpensIndependently string `json:"the_tailgate_glass_opens_independently"`
  184. }
  185. type Gearbox struct {
  186. GearNumber string `json:"gear_number"`
  187. GearboxDesc string `json:"gearbox_desc"`
  188. GearboxType string `json:"gearbox_type"`
  189. }
  190. type Intelligent struct {
  191. AuxiliaryDrivingChip string `json:"auxiliary_driving_chip"`
  192. ChipComputingPower string `json:"chip_computing_power"`
  193. NumberOfCameras string `json:"number_of_cameras"`
  194. NumberOfLidars string `json:"number_of_lidars"`
  195. NumberOfMillimeterWaveRadars string `json:"number_of_millimeter_wave_radars"`
  196. NumberOfUltrasonicRadars string `json:"number_of_ultrasonic_radars"`
  197. }
  198. type Light struct {
  199. AdaptiveFarNear string `json:"adaptive_far_near"`
  200. Atmosphere string `json:"atmosphere"`
  201. AutoHead string `json:"auto_head"`
  202. Clean string `json:"clean"`
  203. Daytime string `json:"daytime"`
  204. Far string `json:"far"`
  205. Fog string `json:"fog"`
  206. HeadlampDelayOff string `json:"headlamp_delay_off"`
  207. HeadlampRainFogMode string `json:"headlamp_rain_fog_mode"`
  208. HeightAdjustable string `json:"height_adjustable"`
  209. LightingFeatures string `json:"lighting_features"`
  210. Near string `json:"near"`
  211. SideTurn string `json:"side_turn"`
  212. SteeringAssistLamp string `json:"steering_assist_lamp"`
  213. TouchReadingLamp string `json:"touch_reading_lamp"`
  214. }
  215. type Media struct {
  216. BackLcd string `json:"back_lcd"`
  217. CarInternet string `json:"car_internet"`
  218. CarPhone string `json:"car_phone"`
  219. CarTv string `json:"car_tv"`
  220. CdDvd string `json:"cd_dvd"`
  221. CenterConsoleLargeScreenSize string `json:"center_console_large_screen_size"`
  222. CentralColourScreen string `json:"central_colour_screen"`
  223. CentralLcdSplitScreen string `json:"central_lcd_split_screen"`
  224. ChargingInterface string `json:"charging_interface"`
  225. FaceRecognition string `json:"face_recognition"`
  226. GestureControl string `json:"gesture_control"`
  227. Gps string `json:"gps"`
  228. InterfaceOf12V string `json:"interface_of12v"`
  229. MobileInternet string `json:"mobile_internet"`
  230. NavigationTrafficInformationDisplay string `json:"navigation_traffic_information_display"`
  231. NumberOfInterfaces string `json:"number_of_interfaces"`
  232. Ota string `json:"ota"`
  233. PowerOf220V string `json:"power_of220v"`
  234. RearControlMultimedia string `json:"rear_control_multimedia"`
  235. RoadRescueCall string `json:"road_rescue_call"`
  236. SpeakerBrand string `json:"speaker_brand"`
  237. SpeakerNumber string `json:"speaker_number"`
  238. VoiceControl string `json:"voice_control"`
  239. }
  240. type Optional struct {
  241. BodyColour string `json:"body_colour"`
  242. InteriorColor string `json:"interior_color"`
  243. }
  244. type Rearview struct {
  245. AntiPinchHand string `json:"anti_pinch_hand"`
  246. BackElectricWindow string `json:"back_electric_window"`
  247. BackSidePrivacy string `json:"back_side_privacy"`
  248. BackSideSunshade string `json:"back_side_sunshade"`
  249. BackSunshade string `json:"back_sunshade"`
  250. BackWiper string `json:"back_wiper"`
  251. Cosmetic string `json:"cosmetic"`
  252. ExteriorRearviewMirrorFunction string `json:"exterior_rearview_mirror_function"`
  253. FrontElectricWindow string `json:"front_electric_window"`
  254. FrontWiper string `json:"front_wiper"`
  255. HeatableSprayNozzle string `json:"heatable_spray_nozzle"`
  256. InteriorRearviewMirrorFunction string `json:"interior_rearview_mirror_function"`
  257. MultilayerSoundInsulationGlass string `json:"multilayer_sound_insulation_glass"`
  258. WindowOneKey string `json:"window_one_key"`
  259. }
  260. type Safety struct {
  261. Abs string `json:"abs"`
  262. ActiveBrake string `json:"active_brake"`
  263. AsrTcsTrc string `json:"asr_tcs_trc"`
  264. AuxiliarySeatAirbag string `json:"auxiliary_seat_airbag"`
  265. BackBeltAirbag string `json:"back_belt_airbag"`
  266. BackHeadAirbag string `json:"back_head_airbag"`
  267. BackSideAirbag string `json:"back_side_airbag"`
  268. EbaBasBa string `json:"eba_bas_ba"`
  269. EbdCbc string `json:"ebd_cbc"`
  270. Esp string `json:"esp"`
  271. FatigueDrivingWarning string `json:"fatigue_driving_warning"`
  272. FontHeadAirbag string `json:"font_head_airbag"`
  273. FrontMiddleAirbag string `json:"front_middle_airbag"`
  274. FrontSideAirbag string `json:"front_side_airbag"`
  275. IsoFix string `json:"iso_fix"`
  276. KneeAirbag string `json:"knee_airbag"`
  277. LaneDepartureWarningSystem string `json:"lane_departure_warning_system"`
  278. LaneKeeping string `json:"lane_keeping"`
  279. MainSeatAirbag string `json:"main_seat_airbag"`
  280. NightVision string `json:"night_vision"`
  281. ParallelAuxiliary string `json:"parallel_auxiliary"`
  282. PassengerSeatCushionAirbag string `json:"passenger_seat_cushion_airbag"`
  283. PassivePedestrianProtection string `json:"passive_pedestrian_protection"`
  284. RearCentralAirbag string `json:"rear_central_airbag"`
  285. RearSeatAntiSlideAirbag string `json:"rear_seat_anti_slide_airbag"`
  286. RoadTrafficSignRecognition string `json:"road_traffic_sign_recognition"`
  287. RunFlatTire string `json:"run_flat_tire"`
  288. SeatBeltWarning string `json:"seat_belt_warning"`
  289. TirePresureMonitor string `json:"tire_presure_monitor"`
  290. }
  291. type Seat struct {
  292. AuxiliaryAdjustableButton string `json:"auxiliary_adjustable_button"`
  293. AuxiliaryElectricAdust string `json:"auxiliary_electric_adust"`
  294. AuxiliarySeatAdjustmentMode string `json:"auxiliary_seat_adjustment_mode"`
  295. BackCupHolder string `json:"back_cup_holder"`
  296. BackDownType string `json:"back_down_type"`
  297. BackFoldTable string `json:"back_fold_table"`
  298. BackHandrail string `json:"back_handrail"`
  299. ElectricSeatRemeber string `json:"electric_seat_remeber"`
  300. FrontHandrail string `json:"front_handrail"`
  301. FrontSeatFunction string `json:"front_seat_function"`
  302. HeatingCoolingCupHolder string `json:"heating_cooling_cup_holder"`
  303. MainElectricAdust string `json:"main_electric_adust"`
  304. MainSeatAdjustmentMode string `json:"main_seat_adjustment_mode"`
  305. RearSeatElectricAdjustment string `json:"rear_seat_electric_adjustment"`
  306. RearSeatFunction string `json:"rear_seat_function"`
  307. RearSeatPowerDown string `json:"rear_seat_power_down"`
  308. SeatLayoutForm string `json:"seat_layout_form"`
  309. SeatMaterial string `json:"seat_material"`
  310. SecondIndependent string `json:"second_independent"`
  311. SecondRowSeatAdjustment string `json:"second_row_seat_adjustment"`
  312. SportSeat string `json:"sport_seat"`
  313. }
  314. type Wheelbrake struct {
  315. BackBrakeType string `json:"back_brake_type"`
  316. BackWheelSpecification string `json:"back_wheel_specification"`
  317. FrontBrakeType string `json:"front_brake_type"`
  318. FrontWheelSpecification string `json:"front_wheel_specification"`
  319. ParkingBrakeType string `json:"parking_brake_type"`
  320. SpareWheelSpecification string `json:"spare_wheel_specification"`
  321. }
  322. type p04Response struct {
  323. Aircondition Aircondition `json:"aircondition"`
  324. Basic Basic `json:"basic"`
  325. Body Body `json:"body"`
  326. Chassis Chassis `json:"chassis"`
  327. Control Control `json:"control"`
  328. Electric Electric `json:"electric"`
  329. Engine Engine `json:"engine"`
  330. External External `json:"external"`
  331. Gearbox Gearbox `json:"gearbox"`
  332. Intelligent Intelligent `json:"intelligent"`
  333. Internal Internal `json:"internal"`
  334. Light Light `json:"light"`
  335. Media Media `json:"media"`
  336. Optional Optional `json:"optional"`
  337. Rearview Rearview `json:"rearview"`
  338. Safety Safety `json:"safety"`
  339. Seat Seat `json:"seat"`
  340. Wheelbrake Wheelbrake `json:"wheelbrake"`
  341. }
  342. type p04Request struct {
  343. StyleId string `json:"style_id"`
  344. }
  345. func SearchStyle(ctx context.Context, params string) (reply *v1.QueryResponse, err error) {
  346. reply = &v1.QueryResponse{}
  347. // 捕获各个task中的异常并返回给调用者
  348. defer func() {
  349. if r := recover(); r != nil {
  350. err = fmt.Errorf("%+v", r)
  351. e := &status.Status{}
  352. if er := json.Unmarshal([]byte(err.Error()), e); er != nil {
  353. logger.Error("err",
  354. zap.String("system_err", err.Error()),
  355. zap.Stack("stacktrace"))
  356. }
  357. }
  358. }()
  359. var req p04Request
  360. err = jsoniter.UnmarshalFromString(params, &req)
  361. if err != nil || req.StyleId == "" {
  362. return nil, errors.ParamsError
  363. }
  364. info, err := model.NewAds5Model().Get(database.DB().Where("style_id = ?", req.StyleId))
  365. if err != nil {
  366. return reply, errors.DataNotExistError
  367. }
  368. res := p04Response{}
  369. res.Aircondition = Aircondition{
  370. AirconditionControlType: info.AirconditionControlType,
  371. CarAirPurifier: info.CarAirPurifier,
  372. FragranceSystem: info.FragranceSystem,
  373. NegativeIonGenerator: info.NegativeIonGenerator,
  374. Pm25Device: info.Pm25Device,
  375. RearIndependentAirConditioner: info.RearIndependentAirConditioner,
  376. RearSeatAirOutlet: info.RearSeatAirOutlet,
  377. Refrigerator: info.Refrigerator,
  378. TemperatureZoneControl: info.TemperatureZoneControl,
  379. }
  380. res.Basic = Basic{
  381. BrandId: info.BrandId,
  382. Alternator: info.Alternator,
  383. BrakingDistanceMeasure: info.BrakingDistanceMeasure,
  384. BrandName: info.BrandName,
  385. EmissionStandard: info.EmissionStandard,
  386. Engine: info.Engine,
  387. FastChargeAmount: info.FastChargeAmount,
  388. FastChargingTime: info.FastChargingTime,
  389. FuelTypeDetail: info.FuelTypeDetail,
  390. GearboxDesc: info.GearboxDesc,
  391. HundredAccelerate: info.HundredAccelerate,
  392. HundredAccelerateMeasure: info.HundredAccelerateMeasure,
  393. Level: info.Level,
  394. Lwh: info.Lwh,
  395. Maker: info.Maker,
  396. MaximumPower: info.MaximumPower,
  397. MaximumSimulationMilage: info.MaximumSimulationMilage,
  398. MaximumSimulationMilageMeasure: info.MaximumSimulationMilageMeasure,
  399. MaximumSpeed: info.MaximumSpeed,
  400. MaximumTorque: info.MaximumTorque,
  401. ModelYear: info.ModelYear,
  402. OilWearComrehensive: info.OilWearComrehensive,
  403. OilWearMeasure: info.OilWearMeasure,
  404. Price: info.Price,
  405. PriceYuan: info.PriceYuan,
  406. SeriesId: info.SeriesId,
  407. SeriesImg: parser.Conf.Oss.SeriesImage + info.SeriesId + ".png",
  408. SeriesName: info.SeriesName,
  409. SlowChargingTime: info.SlowChargingTime,
  410. StyleId: info.StyleId,
  411. StyleName: info.StyleName,
  412. SubLevel: info.SubLevel,
  413. VehicleStructure: info.VehicleStructure,
  414. VehicleWarranty: info.VehicleWarranty,
  415. }
  416. res.Body = Body{
  417. BackWheelDistance: info.BackWheelDistance,
  418. DoorNumber: info.DoorNumber,
  419. FrontWheelDistance: info.FrontWheelDistance,
  420. High: info.High,
  421. Long: info.Long,
  422. MinimumGroundClearance: info.MinimumGroundClearance,
  423. OilboxVolume: info.OilboxVolume,
  424. SeatNumber: info.SeatNumber,
  425. TrunkVolume: info.TrunkVolume,
  426. UnladenMass: info.UnladenMass,
  427. Wheelbase: info.Wheelbase,
  428. Wide: info.Wide,
  429. }
  430. res.Chassis = Chassis{
  431. AssistType: info.AssistType,
  432. BackSuspentionType: info.BackSuspentionType,
  433. BodyStructure: info.BodyStructure,
  434. DriveType: info.DriveType,
  435. FrontSuspentionType: info.FrontSuspentionType,
  436. }
  437. res.Control = Control{
  438. AirSuspension: info.AirSuspension,
  439. AscentAssist: info.AscentAssist,
  440. AutoHold: info.AutoHold,
  441. AutomaticDrivingAssistance: info.AutomaticDrivingAssistance,
  442. AutomaticParking: info.AutomaticParking,
  443. BackParkingRador: info.BackParkingRador,
  444. CentralDiffLock: info.CentralDiffLock,
  445. CruiseSystem: info.CruiseSystem,
  446. DrivingModeSelection: info.DrivingModeSelection,
  447. EInductionSuspension: info.EInductionSuspension,
  448. Edl: info.Edl,
  449. EngineStartStopTechnology: info.EngineStartStopTechnology,
  450. FrontParkingRador: info.FrontParkingRador,
  451. Hdc: info.Hdc,
  452. OverallActiveSteeringSystem: info.OverallActiveSteeringSystem,
  453. ReverseVehicleSideWarningSystem: info.ReverseVehicleSideWarningSystem,
  454. VariableSteeringRatio: info.VariableSteeringRatio,
  455. VariableSuspension: info.VariableSuspension,
  456. WadeSensingSystem: info.WadeSensingSystem,
  457. }
  458. res.Electric = Electric{
  459. BackElectricMaximumPower: info.BackElectricMaximumPower,
  460. BackElectricTorque: info.BackElectricTorque,
  461. BatteryEnergy: info.BatteryEnergy,
  462. BatteryPackWarranty: info.BatteryPackWarranty,
  463. BatteryType: info.BatteryType,
  464. FrontElectricMaximumPower: info.FrontElectricMaximumPower,
  465. FrontElectricTorque: info.FrontElectricTorque,
  466. HundredElectricityConsumption: info.HundredElectricityConsumption,
  467. MaximumSimulationMilage: info.MaximumSimulationMilage,
  468. MotorLayout: info.MotorLayout,
  469. MotorNumber: info.MotorNumber,
  470. MotorType: info.MotorType,
  471. SystemIntegratedPower: info.SystemIntegratedPower,
  472. SystemIntegratedTorque: info.SystemIntegratedTorque,
  473. TotalMotorPower: info.TotalMotorPower,
  474. TotalMotorTorque: info.TotalMotorTorque,
  475. }
  476. res.Engine = Engine{
  477. AirIntakForm: info.AirIntakForm,
  478. CylinderArrangement: info.CylinderArrangement,
  479. CylinderDiameter: info.CylinderDiameter,
  480. CylinderHeadMaterial: info.CylinderHeadMaterial,
  481. CylinderMaterial: info.CylinderMaterial,
  482. CylinderNumber: info.CylinderNumber,
  483. CylinderValveNumber: info.CylinderValveNumber,
  484. Displacement: info.Displacement,
  485. DisplacementL: info.DisplacementL,
  486. EngineTechnology: info.EngineTechnology,
  487. EngineType: info.EngineType,
  488. FuelLable: info.FuelLable,
  489. FuelTypeDetail: info.FuelTypeDetail,
  490. MaximumHorsepower: info.MaximumHorsepower,
  491. MaximumPowerRpm: info.MaximumPowerRpm,
  492. OilSupplyMode: info.OilSupplyMode,
  493. PistonStroke: info.PistonStroke,
  494. ReductionRatio: info.ReductionRatio,
  495. Rpm: info.Rpm,
  496. ValveMechanism: info.ValveMechanism,
  497. }
  498. res.External = External{
  499. ActiveIntakeGrille: info.ActiveIntakeGrille,
  500. BatteryPreHeating: info.BatteryPreHeating,
  501. CentralControlLock: info.CentralControlLock,
  502. ElectricTrunk: info.ElectricTrunk,
  503. ElectronicAntiTheft: info.ElectronicAntiTheft,
  504. Eosd: info.Eosd,
  505. FramelessDesignDoor: info.FramelessDesignDoor,
  506. HideElectricDoorHandle: info.HideElectricDoorHandle,
  507. InductiveTrunk: info.InductiveTrunk,
  508. KeyType: info.KeyType,
  509. KeylessEntrySystem: info.KeylessEntrySystem,
  510. KeylessStartSystem: info.KeylessStartSystem,
  511. OutsidePedal: info.OutsidePedal,
  512. RearCompartmentPositionMemory: info.RearCompartmentPositionMemory,
  513. RemoteStart: info.RemoteStart,
  514. RimMaterial: info.RimMaterial,
  515. RoofLuggageRack: info.RoofLuggageRack,
  516. SideSlidingDoor: info.SideSlidingDoor,
  517. SkylightType: info.SkylightType,
  518. SportsAppearanceKit: info.SportsAppearanceKit,
  519. Tail: info.Tail,
  520. TheTailgateGlassOpensIndependently: info.TheTailgateGlassOpensIndependently,
  521. }
  522. res.Gearbox = Gearbox{
  523. GearNumber: info.GearNumber,
  524. GearboxDesc: info.GearboxDesc,
  525. GearboxType: info.GearboxType,
  526. }
  527. res.Internal = Internal{
  528. ActiveNoiseReduction: info.ActiveNoiseReduction,
  529. CarDrivingRecorder: info.CarDrivingRecorder,
  530. DrivingComputerDisplay: info.DrivingComputerDisplay,
  531. ElectricallyAdjustablePedal: info.ElectricallyAdjustablePedal,
  532. FullLcdDashboard: info.FullLcdDashboard,
  533. FullLcdDashboardSize: info.FullLcdDashboardSize,
  534. HudRisingNumberDisplay: info.HudRisingNumberDisplay,
  535. MobilePhoneWirelessCharging: info.MobilePhoneWirelessCharging,
  536. MultiFunctionalSteeringWheel: info.MultiFunctionalSteeringWheel,
  537. SteeringWheelAdjustment: info.SteeringWheelAdjustment,
  538. SteeringWheelHeating: info.SteeringWheelHeating,
  539. SteeringWheelMaterial: info.SteeringWheelMaterial,
  540. SteeringWheelRemember: info.SteeringWheelRemember,
  541. SteeringWheelShift: info.SteeringWheelShift,
  542. }
  543. res.Light = Light{
  544. AdaptiveFarNear: info.AdaptiveFarNear,
  545. Atmosphere: info.Atmosphere,
  546. AutoHead: info.AutoHead,
  547. Clean: info.Clean,
  548. Daytime: info.Daytime,
  549. Far: info.Far,
  550. Fog: info.Fog,
  551. HeadlampDelayOff: info.HeadlampDelayOff,
  552. HeadlampRainFogMode: info.HeadlampRainFogMode,
  553. HeightAdjustable: info.HeightAdjustable,
  554. LightingFeatures: info.LightingFeatures,
  555. Near: info.Near,
  556. SideTurn: info.SideTurn,
  557. SteeringAssistLamp: info.SteeringAssistLamp,
  558. TouchReadingLamp: info.TouchReadingLamp,
  559. }
  560. res.Media = Media{
  561. BackLcd: info.BackLcd,
  562. CarInternet: info.CarInternet,
  563. CarPhone: info.CarPhone,
  564. CarTv: info.CarTv,
  565. CdDvd: info.CdDvd,
  566. CenterConsoleLargeScreenSize: info.CenterConsoleLargeScreenSize,
  567. CentralColourScreen: info.CentralColourScreen,
  568. CentralLcdSplitScreen: info.CentralLcdSplitScreen,
  569. ChargingInterface: info.ChargingInterface,
  570. FaceRecognition: info.FaceRecognition,
  571. GestureControl: info.GestureControl,
  572. Gps: info.Gps,
  573. InterfaceOf12V: info.InterfaceOf12v,
  574. MobileInternet: info.MobileInternet,
  575. NavigationTrafficInformationDisplay: info.NavigationTrafficInformationDisplay,
  576. NumberOfInterfaces: info.NumberOfInterfaces,
  577. Ota: info.Ota,
  578. PowerOf220V: info.PowerOf220v,
  579. RearControlMultimedia: info.RearControlMultimedia,
  580. RoadRescueCall: info.RoadRescueCall,
  581. SpeakerBrand: info.SpeakerBrand,
  582. SpeakerNumber: info.SpeakerNumber,
  583. VoiceControl: info.VoiceControl,
  584. }
  585. res.Optional = Optional{
  586. BodyColour: info.BodyColour,
  587. InteriorColor: info.InteriorColor,
  588. }
  589. res.Rearview = Rearview{
  590. AntiPinchHand: info.AntiPinchHand,
  591. BackElectricWindow: info.BackElectricWindow,
  592. BackSidePrivacy: info.BackSidePrivacy,
  593. BackSideSunshade: info.BackSideSunshade,
  594. BackSunshade: info.BackSunshade,
  595. BackWiper: info.BackWiper,
  596. Cosmetic: info.Cosmetic,
  597. ExteriorRearviewMirrorFunction: info.ExteriorRearviewMirrorFunction,
  598. FrontElectricWindow: info.FrontElectricWindow,
  599. FrontWiper: info.FrontWiper,
  600. HeatableSprayNozzle: info.HeatableSprayNozzle,
  601. InteriorRearviewMirrorFunction: info.InteriorRearviewMirrorFunction,
  602. MultilayerSoundInsulationGlass: info.MultilayerSoundInsulationGlass,
  603. WindowOneKey: info.WindowOneKey,
  604. }
  605. res.Safety = Safety{
  606. Abs: info.Abs,
  607. ActiveBrake: info.ActiveBrake,
  608. AsrTcsTrc: info.AsrTcsTrc,
  609. AuxiliarySeatAirbag: info.AuxiliarySeatAirbag,
  610. BackBeltAirbag: info.BackBeltAirbag,
  611. BackHeadAirbag: info.BackHeadAirbag,
  612. BackSideAirbag: info.BackSideAirbag,
  613. EbaBasBa: info.EbaBasBa,
  614. EbdCbc: info.EbdCbc,
  615. Esp: info.Esp,
  616. FatigueDrivingWarning: info.FatigueDrivingWarning,
  617. FontHeadAirbag: info.FontHeadAirbag,
  618. FrontMiddleAirbag: info.FrontMiddleAirbag,
  619. FrontSideAirbag: info.FrontSideAirbag,
  620. IsoFix: info.IsoFix,
  621. KneeAirbag: info.KneeAirbag,
  622. LaneDepartureWarningSystem: info.LaneDepartureWarningSystem,
  623. LaneKeeping: info.LaneKeeping,
  624. MainSeatAirbag: info.MainSeatAirbag,
  625. NightVision: info.NightVision,
  626. ParallelAuxiliary: info.ParallelAuxiliary,
  627. PassengerSeatCushionAirbag: info.PassengerSeatCushionAirbag,
  628. PassivePedestrianProtection: info.PassivePedestrianProtection,
  629. RearCentralAirbag: info.RearCentralAirbag,
  630. RearSeatAntiSlideAirbag: info.RearSeatAntiSlideAirbag,
  631. RoadTrafficSignRecognition: info.RoadTrafficSignRecognition,
  632. RunFlatTire: info.RunFlatTire,
  633. SeatBeltWarning: info.SeatBeltWarning,
  634. TirePresureMonitor: info.TirePresureMonitor,
  635. }
  636. res.Seat = Seat{
  637. AuxiliaryAdjustableButton: info.AuxiliaryAdjustableButton,
  638. AuxiliaryElectricAdust: info.AuxiliaryElectricAdust,
  639. AuxiliarySeatAdjustmentMode: info.AuxiliarySeatAdjustmentMode,
  640. BackCupHolder: info.BackCupHolder,
  641. BackDownType: info.BackDownType,
  642. BackFoldTable: info.BackFoldTable,
  643. BackHandrail: info.BackHandrail,
  644. ElectricSeatRemeber: info.ElectricSeatRemeber,
  645. FrontHandrail: info.FrontHandrail,
  646. FrontSeatFunction: info.FrontSeatFunction,
  647. HeatingCoolingCupHolder: info.HeatingCoolingCupHolder,
  648. MainElectricAdust: info.MainElectricAdust,
  649. MainSeatAdjustmentMode: info.MainSeatAdjustmentMode,
  650. RearSeatElectricAdjustment: info.RearSeatElectricAdjustment,
  651. RearSeatFunction: info.RearSeatFunction,
  652. RearSeatPowerDown: info.RearSeatPowerDown,
  653. SeatLayoutForm: info.SeatLayoutForm,
  654. SeatMaterial: info.SeatMaterial,
  655. SecondIndependent: info.SecondIndependent,
  656. SecondRowSeatAdjustment: info.SecondRowSeatAdjustment,
  657. SportSeat: info.SportSeat,
  658. }
  659. res.Wheelbrake = Wheelbrake{
  660. BackBrakeType: info.BackBrakeType,
  661. BackWheelSpecification: info.BackWheelSpecification,
  662. FrontBrakeType: info.FrontBrakeType,
  663. FrontWheelSpecification: info.FrontWheelSpecification,
  664. ParkingBrakeType: info.ParkingBrakeType,
  665. SpareWheelSpecification: info.SpareWheelSpecification,
  666. }
  667. reply.Data, _ = jsoniter.MarshalToString(res)
  668. return reply, nil
  669. }