| 1 | |
package jp.co.y_net.amm.api; |
| 2 | |
|
| 3 | |
import java.util.ArrayList; |
| 4 | |
import java.util.List; |
| 5 | |
|
| 6 | |
import jp.co.y_net.amm.dao.Inf; |
| 7 | |
import jp.co.y_net.amm.dao.InfDao; |
| 8 | |
|
| 9 | |
import org.apache.wicket.request.mapper.parameter.PageParameters; |
| 10 | |
import org.apache.wicket.spring.injection.annot.SpringBean; |
| 11 | |
|
| 12 | |
public class ApiInfo extends ApiPage { |
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
@SpringBean(name="infDao") |
| 17 | |
protected InfDao infDao; |
| 18 | |
|
| 19 | 0 | public ApiInfo(PageParameters pageParams) { |
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | 0 | List<Result> listResult = new ArrayList<Result>(); |
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | 0 | Inf cnd = new Inf(); |
| 33 | 0 | cnd.setStatus(Inf.STATUS_掲載中); |
| 34 | 0 | List<Inf> listInf = infDao.get(cnd); |
| 35 | 0 | for(Inf i: listInf) { |
| 36 | 0 | Result r = new Result(); |
| 37 | 0 | r.infid = i.getInfid(); |
| 38 | 0 | r.title = i.getTitle(); |
| 39 | 0 | r.pubdate = i.getPubdate(); |
| 40 | 0 | listResult.add(r); |
| 41 | |
} |
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | 0 | setResponse(listResult); |
| 46 | 0 | } |
| 47 | |
|
| 48 | |
|
| 49 | |
|
| 50 | |
|
| 51 | 0 | public static class Result extends ApiResult{ |
| 52 | |
public Integer infid; |
| 53 | |
public String title; |
| 54 | |
public Long pubdate; |
| 55 | |
} |
| 56 | |
|
| 57 | |
} |