| | |
| | | import com.sandu.ximon.admin.utils.response.*; |
| | | import com.sandu.ximon.dao.domain.LedPlayerEntity; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.http.NameValuePair; |
| | | import org.apache.http.message.BasicNameValuePair; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.net.URISyntaxException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | /** |
| | | * 获取播放器列表 |
| | | * |
| | | * @param count 每次读取数量,默认20,取值范围:1~100 |
| | | * @param start 从第几条记录开始读取,默认0 |
| | | * @return |
| | | */ |
| | | public VnnoxPlayerListResponse getPlayerList(Integer count, Integer start) { |
| | | // public VnnoxPlayerListResponse getPlayerList(Integer count, Integer start) { |
| | | // |
| | | // String result = VnnoxRequestUtil.GetWithHeader( |
| | | // VnnoxUrl.getUrl(VnnoxUrl.GET_PLAYER_LIST), |
| | | // new VnnoxGetPlayerListRequest(count, start).toJson(), |
| | | // new CommonHeader(CommonHeader.JSON, true) |
| | | // ); |
| | | // VnnoxPlayerListResponse response = |
| | | // new VnnoxPlayerListResponse().parse(JSON.parseObject(result, CommonResponse.class)); |
| | | // System.out.println("----------------------------------------"); |
| | | // System.out.println("----------------------------------------"); |
| | | // System.out.println("----------------------------------------"); |
| | | // System.out.println(response); |
| | | // return response; |
| | | // } |
| | | public VnnoxPlayerListResponse getPlayerList(Integer count, Integer start,String name) throws URISyntaxException { |
| | | |
| | | List<NameValuePair> urlParameters = new ArrayList<>(); |
| | | urlParameters.add(new BasicNameValuePair("count",count.toString())); |
| | | urlParameters.add(new BasicNameValuePair("start",start.toString())); |
| | | urlParameters.add(new BasicNameValuePair("name",name)); |
| | | |
| | | String result = VnnoxRequestUtil.GetWithHeader( |
| | | VnnoxUrl.getUrl(VnnoxUrl.GET_PLAYER_LIST), |
| | | new VnnoxGetPlayerListRequest(count, start).toJson(), |
| | | urlParameters, |
| | | new CommonHeader(CommonHeader.JSON, true) |
| | | ); |
| | | VnnoxPlayerListResponse response = |
| | | new VnnoxPlayerListResponse().parse(JSON.parseObject(result, CommonResponse.class)); |
| | | return response; |
| | | return new VnnoxPlayerListResponse().parse(JSON.parseObject(result,CommonResponse.class)); |
| | | } |
| | | |
| | | /** |