syntax = "proto3"; package phase_server; service PhaseService { //获取异常路口 rpc ExceptionPhaseCross (EmptyRequest) returns (ExceptionPhaseCrossResponse); //异常路口详情列表 rpc ExceptionPhaseCrossInfo (ExceptionPhaseCrossInfoRequest) returns (ExceptionPhaseCrossInfoResponse); //根据路口ID返回异常配时 rpc ExceptionPhaseByCrossIDs (ExceptionPhaseByCrossIDsRequest) returns (ExceptionPhaseByCrossIDsResponse); //根据路口ID返回路口配时方案详情 rpc GetCrossPhaseDetailByCrossIDs (GetCrossPhaseDetailByCrossIDsRequest) returns (GetCrossPhaseDetailByCrossIDsResponse); //获取有配时方案路口列表 rpc GetPhaseCrossID (EmptyRequest) returns (GetPhaseCrossIDResponse); //获取配时方案协调/非协调方向绿灯时长比 rpc PhaseGreenRatio (PhaseGreenRatioRequest) returns (PhaseGreenRatioResponse); //获取配时方案协调/非协调方向绿灯时长比 rpc CrossList (CrossListRequest) returns (CrossListResponse); //依据日期,时刻查询多路口配时方案与相对相位差 rpc QueryCrossPhaseRelativeOffset (QueryCrossPhaseRelativeOffsetRequest) returns (QueryCrossPhaseRelativeOffsetResponse); //单条绿波配时方案时段与路口配时方案时段校验 rpc GreenWaveCrossPhaseTpCheck (GreenWaveCrossPhaseTpCheckRequest) returns (GreenWaveCrossPhaseTpCheckResponse); //路口运行中的配时方案 rpc CrossRunningPhase (CrossRunningPhaseRequest) returns (CrossRunningPhaseResponse); //路口配时方案诊断列表 rpc CrossPhaseDiagnosis (CrossPhaseDiagnosisRequest) returns (CrossPhaseDiagnosisResponse); } message EmptyRequest {} message ExceptionPhaseCrossResponse { int32 code = 1; string msg = 2; repeated List data = 4; message List { int32 nodeid = 1; string crossid = 2; } } message ExceptionPhaseCrossInfoRequest { repeated int32 citycode = 1; } message ExceptionPhaseCrossInfoResponse { int32 code = 1; string msg = 2; int32 total = 3; int32 cross_total = 4; repeated List data = 5; message List { int32 citycode = 1; string crossid = 2; int32 scheduleid = 3; int32 planid = 4; string plan_name = 5; string tp_start = 6; string days = 7; string type = 8; } } message ExceptionPhaseByCrossIDsRequest { int32 citycode = 1; repeated string crossid = 2; } message ExceptionPhaseByCrossIDsResponse { int32 code = 1; string msg = 2; repeated List data = 5; message List { int32 citycode = 1; string crossid = 2; string cross_name = 3; int32 scheduleid = 4; int32 planid = 5; string plan_name = 6; string tp_start = 7; string date = 8; string week = 9; string type = 10; } } message GetCrossPhaseDetailByCrossIDsRequest { int32 citycode = 1; repeated string crossids = 2; string gw_src_dir = 3; string tp_start = 4; string tp_end = 5; string week = 6; string wave_id = 7; } message GetCrossPhaseDetailByCrossIDsResponse { int32 code = 1; string msg = 2; int32 cycle = 3; //公共周期 repeated List data = 4; message List { string crossid = 1; int32 green_forward = 2; //正向绿灯时长 int32 green_revers = 3; //逆向绿灯时长 int32 offset = 4; //正向相位差 int32 offset_r = 5; //正向相位差 int32 cycle = 6; //周期 int32 day = 7; //天 int32 month = 8; //月 int32 weekday = 9; //周 int32 scheduleid = 10; //计划号 int32 planid = 11; //方案号 string plan_name = 12; //方案名称 int32 coord_phaseid = 13; //协调相位号 string type = 14; //类型:weekday(周),date(特殊日),month(月) } } message GetPhaseCrossIDResponse { int32 code = 1; string msg = 2; repeated List data = 3; message List { int32 citycode = 1; string crossid = 2; } } message PhaseGreenRatioRequest { int32 citycode = 1; repeated string crossids = 2; string gw_src_dir = 3; string tp_start = 4; string tp_end = 5; string week = 6; //周 string wave_id = 7; } message PhaseGreenRatioResponse { int32 code = 1; string msg = 2; repeated List data = 3; message List { string crossid = 1; float s2l = 2; //协直/协左 string s2l_remark = 3; int32 s2l_s_green = 4; int32 s2l_l_green = 5; float s2unl = 6; //协直/非协左 string s2unl_remark = 7; int32 s2unl_s_green = 8; int32 s2unl_unl_green = 9; float s2uns = 10; //协直/非协直 string s2uns_remark = 11; int32 s2uns_s_green = 12; int32 s2uns_uns_green = 13; float fwd2rev = 14; //协直正/反 string fwd2rev_remark = 15; int32 fwd2rev_fwd_green = 16; int32 fwd2rev_rev_green = 17; int32 planid = 18; //方案号 int32 day = 19; //天 int32 month = 20; //月 int32 weekday = 21; //周 int32 scheduleid = 22; //计划号 string plan_name = 23; //方案名称 string type = 24; //类型:weekday(周),date(特殊日),month(月) } } message CrossListRequest { int32 nodeid = 1; } message CrossListResponse { int32 code = 1; string msg = 2; repeated List data = 3; message List { string crossid = 1; int32 type = 2; string name = 3; string location = 4; repeated string src_dir = 5; } } message QueryCrossPhaseRelativeOffsetRequest { repeated string crossids = 1; int32 citycode = 2; string tp = 3; string day = 4; } message QueryCrossPhaseRelativeOffsetResponse { int32 code = 1; string msg = 2; repeated List data = 3; message List { string crossid = 1; int32 day = 2; //天 int32 month = 3; //月 int32 weekday = 4; //周 int32 scheduleid = 5; string tp_start = 6; string control_mode = 7; int32 planid = 8; string plan_name = 9; int32 cycle = 10; int32 offset = 11; int32 relative_offset = 12; string type = 13; int32 coord_phaseid = 14; repeated stage_data stages = 15; } message stage_data { int32 stageid = 1; string stage_name = 2; int32 stage_duration = 3; int32 green = 4; int32 yellow = 5; int32 allred = 6; int32 redyellow = 7; string phaseids = 8; string phaseid_names = 9; } } message GreenWaveCrossPhaseTpCheckRequest { string waveid = 1; int32 citycode = 2; } message GreenWaveCrossPhaseTpCheckResponse { int32 code = 1; string msg = 2; } message CrossRunningPhaseRequest { int32 citycode = 1; repeated string crossids = 2; } //路口运行中方案 message CrossRunningPhaseResponse { int32 code = 1; string msg = 2; repeated List data = 3; //数据列表 message List { int32 citycode = 1; //城市ID string crossid = 2; //路口ID string jj_crossid = 3; //交警路口ID int32 scheduleid = 4; //日计划号 string schedule_week = 5; //日计划执行周,'1,2,3,4,5' string schedule_name = 6; //日计划执行名称,'工作日'或者'周末' repeated tps_list tps = 7; //时段列表 } message tps_list { string tp_start = 1; //时段开始时间,'05:00' string tp_end = 2; //时段结束时间,'17:00' int32 planid = 3; //方案号 string plan_name = 4; //方案名称 string control_mode = 5; //控制模式,'固定模式' int32 cycle = 6; //周期,180 int32 coord_phaseid = 7; //协调相位ID int32 offset = 8; //相位差 repeated stages stage_list = 9; //一个方案中的多个阶段 } message stages { int32 stageid = 1; //阶段ID int32 stage_duration = 2; //阶段时长 string stage_name = 3; //阶段名称 int32 green = 4; //绿灯时长 int32 yellow = 5; //黄灯时长 int32 allred = 6; //全红时长 string phases = 7; //相位ID列表,'1,2,3' string phases_name = 8; //相位名称列表,'北左转,北直行,南左转,南直行,东北直行,南行人' int32 min_green = 9; //最小绿灯时长 int32 max_green = 10; //最大绿灯时长 } } message CrossPhaseDiagnosisRequest { int32 citycode = 1; string crossid = 2; repeated string date_list = 3; } message CrossPhaseDiagnosisResponse { int32 code = 1; string msg = 2; repeated List data = 3; message List { string item = 1; repeated details detail_list = 2; string suggestions = 3; string reason = 4; } message details { repeated item_detail detail = 1; } message item_detail { string text = 1; string crossid = 2; int32 nodeid = 3; string color = 5; int32 scheduleid = 6; string schedule_week = 7; string schedule_name = 8; int32 plan_id = 9; string plan_name = 10; } }