| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.sandu.ximon.admin.config.VnnoxUrl; |
| | | import com.sandu.ximon.admin.dto.nova.AirDataProgram; |
| | | import com.sandu.ximon.admin.utils.request.CommonHeader; |
| | | import com.sandu.ximon.admin.dto.nova.PlayerProgram; |
| | | import com.sandu.ximon.admin.dto.nova.ProgramSchedule; |
| | | import com.sandu.ximon.admin.utils.request.CommonHeader; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxResultResponse; |
| | | import com.sandu.ximon.admin.vo.NovaWeatherVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | @Autowired |
| | | private RedisUtils redisUtils; |
| | | |
| | | public static VnnoxProgramAPIUtil getBean(){ |
| | | public static VnnoxProgramAPIUtil getBean() { |
| | | return (VnnoxProgramAPIUtil) SpringContextUtil.getBean("VnnoxProgramAPIUtil"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 普通节目播放 |
| | | * 大气信息推送 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | //public VnnoxResultResponse normalProgram(Map<String,Object> program) { |
| | | public VnnoxResultResponse normalProgram(AirDataProgram program) { |
| | | public VnnoxResultResponse emergencyProgram(NovaWeatherVO program) { |
| | | |
| | | String result = VnnoxRequestUtil.PostWithHeader( |
| | | VnnoxUrl.getUrl(VnnoxUrl.EMERGENCY_PROGRAM), |
| | | program.toJson(), |
| | | new CommonHeader(CommonHeader.JSON, true) |
| | | ); |
| | | System.out.println(program.toJson()); |
| | | System.out.println("节目播放response:" + JSON.parse(result)); |
| | | return JSON.parseObject(result, VnnoxResultResponse.class); |
| | | } |
| | | |
| | | /** |
| | | * 大气信息推送 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | public VnnoxResultResponse emergencyProgram(AirDataProgram program) { |
| | | |
| | | String result = VnnoxRequestUtil.PostWithHeader( |
| | | VnnoxUrl.getUrl(VnnoxUrl.NORMAL_PROGRAM), |
| | | program.toJson(), |
| | | new CommonHeader(CommonHeader.JSON, true) |
| | | ); |
| | | LogUtils.error("节目播放response:"+result); |
| | | return JSON.parseObject(result,VnnoxResultResponse.class); |
| | | System.out.println(program.toJson()); |
| | | LogUtils.error("节目播放response:" + result); |
| | | return JSON.parseObject(result, VnnoxResultResponse.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 普通节目播放 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | public VnnoxResultResponse normalProgram(PlayerProgram program) { |
| | | |
| | | String result = VnnoxRequestUtil.PostWithHeader( |
| | | VnnoxUrl.getUrl(VnnoxUrl.WEATHER), |
| | | program.toJson(), |
| | | new CommonHeader(CommonHeader.JSON, true) |
| | | ); |
| | | System.out.println(program.toJson()); |
| | | LogUtils.error("普通节目播放response:" + result); |
| | | return JSON.parseObject(result, VnnoxResultResponse.class); |
| | | } |
| | | |
| | | /** |
| | | * 实时节目播放 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | public VnnoxResultResponse pushProgram(PlayerProgram program) { |
| | | |
| | | String result = VnnoxRequestUtil.PostWithHeader( |
| | | VnnoxUrl.getUrl(VnnoxUrl.WEATHER), |
| | | program.toJson(), |
| | | new CommonHeader(CommonHeader.JSON, true) |
| | | ); |
| | | System.out.println(program.toJson()); |
| | | LogUtils.error("普通节目播放response:" + result); |
| | | return JSON.parseObject(result, VnnoxResultResponse.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时节目播放 |
| | | * |
| | | * @param program |
| | | * @return |
| | | */ |
| | | public VnnoxResultResponse timeProgram(PlayerProgram program) { |
| | | public VnnoxResultResponse timeProgram(ProgramSchedule program) { |
| | | String result = VnnoxRequestUtil.PostWithHeader( |
| | | VnnoxUrl.getUrl(VnnoxUrl.TIMING_CONTROL), |
| | | program.toJson(), |
| | | new CommonHeader(CommonHeader.JSON, true) |
| | | ); |
| | | LogUtils.error("定时节目播放response:"+result); |
| | | return JSON.parseObject(result,VnnoxResultResponse.class); |
| | | LogUtils.error("定时任务response:" + result); |
| | | return JSON.parseObject(result, VnnoxResultResponse.class); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |