| 1 | |
package jp.co.y_net.amm.api; |
| 2 | |
|
| 3 | |
import java.io.UnsupportedEncodingException; |
| 4 | |
import java.net.URLDecoder; |
| 5 | |
|
| 6 | |
import jp.co.y_net.amm.service.Logout; |
| 7 | |
|
| 8 | |
import org.apache.wicket.request.mapper.parameter.PageParameters; |
| 9 | |
import org.apache.wicket.spring.injection.annot.SpringBean; |
| 10 | |
|
| 11 | |
public class ApiLogout extends ApiPage { |
| 12 | |
|
| 13 | |
@SpringBean(name="logout") |
| 14 | |
private Logout logout; |
| 15 | |
|
| 16 | 0 | public ApiLogout(PageParameters pageParams) { |
| 17 | |
|
| 18 | 0 | String loginid = pageParams.get("loginid").toString(); |
| 19 | |
|
| 20 | |
|
| 21 | 0 | Result result = new Result(); |
| 22 | |
|
| 23 | 0 | if(loginid == null) { |
| 24 | 0 | setResponse(result.err("パラメータ loginid が指定されていません。")); |
| 25 | 0 | return; |
| 26 | |
} |
| 27 | |
|
| 28 | |
try { |
| 29 | 0 | loginid = URLDecoder.decode(loginid, "UTF-8"); |
| 30 | 0 | } catch (UnsupportedEncodingException e) { |
| 31 | 0 | throw new RuntimeException(e); |
| 32 | |
} |
| 33 | |
|
| 34 | 0 | logout.execute(loginid); |
| 35 | |
|
| 36 | |
|
| 37 | 0 | setResponse(result); |
| 38 | 0 | } |
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | 0 | public static class Result extends ApiResult{ |
| 44 | |
|
| 45 | |
} |
| 46 | |
|
| 47 | |
} |