2023-10-19 09:33:40 +08:00
|
|
|
package third_party
|
|
|
|
|
2024-01-22 13:10:10 +08:00
|
|
|
import (
|
|
|
|
"joylink.club/bj-rtsts-server/dto/state_proto"
|
|
|
|
"joylink.club/bj-rtsts-server/third_party/dynamics"
|
|
|
|
"joylink.club/bj-rtsts-server/third_party/tpapi"
|
|
|
|
)
|
2023-10-26 15:06:26 +08:00
|
|
|
|
2024-01-22 13:10:10 +08:00
|
|
|
func GetRunningServiceStates(t state_proto.SimulationThirdPartyApiService_Type) *state_proto.SimulationThirdPartyApiService {
|
|
|
|
ss := &state_proto.SimulationThirdPartyApiService{}
|
|
|
|
switch dynamics.Default().State() {
|
|
|
|
case tpapi.ThirdPartyState_Normal:
|
|
|
|
ss.States = append(ss.States, &state_proto.SimulationThirdPartyApiServiceState{
|
|
|
|
Type: state_proto.SimulationThirdPartyApiService_Dynamics,
|
|
|
|
State: state_proto.SimulationThirdPartyApiService_Normal,
|
|
|
|
})
|
|
|
|
case tpapi.ThirdPartyState_Broken:
|
|
|
|
ss.States = append(ss.States, &state_proto.SimulationThirdPartyApiServiceState{
|
|
|
|
Type: state_proto.SimulationThirdPartyApiService_Dynamics,
|
|
|
|
State: state_proto.SimulationThirdPartyApiService_Error,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
return ss
|
2023-10-19 09:33:40 +08:00
|
|
|
}
|