Search in sources :

Example 1 with RetlStatisticVO

use of com.ds.retl.rest.vo.statistic.RetlStatisticVO in project main by JohnPeng739.

the class RetlStatisticResource method getRetlStatistic.

@Path("retl-statistic")
@GET
public DataVO<RetlStatisticVO> getRetlStatistic() {
    // 尚未真正实现,这里模拟山东省的数据
    String[] cities = { "济南市", "青岛市", "烟台市", "德州市", "泰安市", "临沂市", "威海市", "东营市", "济宁市", "日照市", "淄博市", "枣庄市", "潍坊市", "滨州市", "菏泽市", "莱芜市", "聊城市" };
    RetlStatisticVO vo = new RetlStatisticVO();
    Random random = new Random();
    for (String city : cities) {
        int total = random.nextInt(5000);
        int error = random.nextInt(total);
        vo.add(city, total, error);
    }
    return new DataVO<>(vo);
}
Also used : RetlStatisticVO(com.ds.retl.rest.vo.statistic.RetlStatisticVO) Random(java.util.Random) DataVO(org.mx.rest.vo.DataVO) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Aggregations

RetlStatisticVO (com.ds.retl.rest.vo.statistic.RetlStatisticVO)1 Random (java.util.Random)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 DataVO (org.mx.rest.vo.DataVO)1