| | |
| | | import com.bstek.dorado.annotation.DataProvider; |
| | | import com.bstek.dorado.annotation.Expose; |
| | | import com.fzzy.api.Constant; |
| | | import com.fzzy.api.data.GatewayDeviceProtocol; |
| | | import com.fzzy.api.data.GatewayProtocol; |
| | | import com.fzzy.api.data.PushProtocol; |
| | | import com.fzzy.api.data.SyncProtocol; |
| | | import com.fzzy.api.data.*; |
| | | import com.fzzy.api.entity.ApiTrigger; |
| | | import com.fzzy.api.utils.RedisConst; |
| | | import com.fzzy.api.utils.RedisUtil; |
| | | import com.fzzy.api.view.repository.ApiTriggerRep; |
| | | |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | private String DEFAULT_MAP_KEY = "DEFAULT"; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private ApiTriggerRep apiTriggerRep; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 在线或者不在线 |
| | | * <p> |
| | | * ${dorado.getDataProvider("apiTriggerService#triggerOnline").getResult()} |
| | | * |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public List<ApiTrigger> triggerOnline() { |
| | | List<ApiTrigger> list = new ArrayList<>(); |
| | | list.add(new ApiTrigger(Constant.YN_N,"离线")); |
| | | list.add(new ApiTrigger(Constant.YN_Y,"在线")); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 页面下拉框使用,根据父编码获取,父编码的定注意在 @See Constant |
| | | * <p> |
| | | * ${dorado.getDataProvider("apiTriggerService#trigger").getResult("PARENT_CODE")} |
| | |
| | | */ |
| | | @DataProvider |
| | | public List<ApiTrigger> triggerPushProtocol() { |
| | | List<ApiTrigger> list = new ArrayList<>(); |
| | | list.add(new ApiTrigger(PushProtocol.GB_DEFAULT.getCode(), PushProtocol.GB_DEFAULT.getName())); |
| | | list.add(new ApiTrigger(PushProtocol.GB_2022.getCode(), PushProtocol.GB_2022.getName())); |
| | | list.add(new ApiTrigger(PushProtocol.SB_SH_2021.getCode(), PushProtocol.SB_SH_2021.getName())); |
| | | list.add(new ApiTrigger(PushProtocol.SB_SC_2021.getCode(), PushProtocol.SB_SC_2021.getName())); |
| | | list.add(new ApiTrigger(PushProtocol.SB_GD_2022.getCode(), PushProtocol.SB_GD_2022.getName())); |
| | | list.add(new ApiTrigger(PushProtocol.SB_GD_2020.getCode(), PushProtocol.SB_GD_2020.getName())); |
| | | list.add(new ApiTrigger(PushProtocol.SB_HN_2022.getCode(), PushProtocol.SB_HN_2022.getName())); |
| | | list.add(new ApiTrigger(PushProtocol.SB_WHJL_2023.getCode(), PushProtocol.SB_WHJL_2023.getName())); |
| | | list.add(new ApiTrigger(PushProtocol.HB_FZZY_JG_2022.getCode(), PushProtocol.HB_FZZY_JG_2022.getName())); |
| | | list.add(new ApiTrigger(PushProtocol.SB_SHJdJW_2023.getCode(), PushProtocol.SB_SHJdJW_2023.getName())); |
| | | list.add(new ApiTrigger(PushProtocol.SB_SH_2023.getCode(), PushProtocol.SB_SH_2023.getName())); |
| | | |
| | | list.add(new ApiTrigger(PushProtocol.GATEWAY_SC_2023.getCode(), PushProtocol.GATEWAY_SC_2023.getName())); |
| | | return list; |
| | | return PushProtocol.listTrigger(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @DataProvider |
| | | public List<ApiTrigger> triggerSyncProtocol() { |
| | | List<ApiTrigger> list = new ArrayList<>(); |
| | | list.add(new ApiTrigger(SyncProtocol.GB_DEFAULT.getCode(), SyncProtocol.GB_DEFAULT.getName())); |
| | | list.add(new ApiTrigger(SyncProtocol.FZZY_V30_GB.getCode(), SyncProtocol.FZZY_V30_GB.getName())); |
| | | list.add(new ApiTrigger(SyncProtocol.FZZY_V35_GB.getCode(), SyncProtocol.FZZY_V35_GB.getName())); |
| | | list.add(new ApiTrigger(SyncProtocol.FZZY_V40_GB.getCode(), SyncProtocol.FZZY_V40_GB.getName())); |
| | | list.add(new ApiTrigger(SyncProtocol.FZZY_V40_WHJL.getCode(), SyncProtocol.FZZY_V40_WHJL.getName())); |
| | | list.add(new ApiTrigger(SyncProtocol.FZZY_V35_SHYZ.getCode(), SyncProtocol.FZZY_V35_SHYZ.getName())); |
| | | return list; |
| | | return SyncProtocol.listTrigger(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @DataProvider |
| | | public List<ApiTrigger> triggerGatewayProtocol() { |
| | | List<ApiTrigger> list = new ArrayList<>(); |
| | | list.add(new ApiTrigger(GatewayProtocol.GATE_HTTP.getCode(), GatewayProtocol.GATE_HTTP.getName())); |
| | | list.add(new ApiTrigger(GatewayProtocol.GATE_MQTT.getCode(), GatewayProtocol.GATE_MQTT.getName())); |
| | | list.add(new ApiTrigger(GatewayProtocol.GATE_WEBSOCKET.getCode(), GatewayProtocol.GATE_WEBSOCKET.getName())); |
| | | list.add(new ApiTrigger(GatewayProtocol.GATE_TEST.getName(), GatewayProtocol.GATE_TEST.getName())); |
| | | return list; |
| | | return GatewayProtocol.listTrigger(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @DataProvider |
| | | public List<ApiTrigger> triggerGatewayDeviceProtocol() { |
| | | List<ApiTrigger> list = new ArrayList<>(); |
| | | list.add(new ApiTrigger(GatewayDeviceProtocol.GRAIN_FZZY_ZH_2023.getCode(), GatewayDeviceProtocol.GRAIN_FZZY_ZH_2023.getName())); |
| | | return GatewayDeviceProtocol.listTrigger(); |
| | | } |
| | | |
| | | list.add(new ApiTrigger(GatewayDeviceProtocol.DEVICE_WEIGHT_HTTP.getCode(), GatewayDeviceProtocol.DEVICE_WEIGHT_HTTP.getName())); |
| | | list.add(new ApiTrigger(GatewayDeviceProtocol.DEVICE_IDCARD_HTTP.getCode(), GatewayDeviceProtocol.DEVICE_IDCARD_HTTP.getName())); |
| | | list.add(new ApiTrigger(GatewayDeviceProtocol.DEVICE_LED_HTTP.getCode(), GatewayDeviceProtocol.DEVICE_LED_HTTP.getName())); |
| | | list.add(new ApiTrigger(GatewayDeviceProtocol.DEVICE_LPR_HTTP.getCode(), GatewayDeviceProtocol.DEVICE_LPR_HTTP.getName())); |
| | | list.add(new ApiTrigger(GatewayDeviceProtocol.DEVICE_TEST.getCode(), GatewayDeviceProtocol.DEVICE_TEST.getName())); |
| | | |
| | | return list; |
| | | /** |
| | | * ${dorado.getDataProvider("apiTriggerService#triggerGatewayDeviceType").getResult()} |
| | | * 系统与网关直接的通讯协议 |
| | | * |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public List<ApiTrigger> triggerGatewayDeviceType() { |
| | | return GatewayDeviceType.listTrigger(); |
| | | } |
| | | |
| | | |