##### Coverage Report - jp.co.y_net.amm.api.ApiLogout

Classes in this File | Line Coverage | Branch Coverage | Complexity

ApiLogout

0% | 0/12

0% | 0/2

0.0;0

ApiLogout$Result

0% | 0/1

N/A | N/A

0.0;0

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"); // URLデコード

30

0

             } catch (UnsupportedEncodingException e) {

31

0

                 throw new RuntimeException(e);

32

             }

33

34

0

             logout.execute(loginid);

35

36

             /* JSONのレスポンスを設定 */

37

0

             setResponse(result);

38

0

         }

39

         /**

40

          * 処理結果

41

          * @author k_inaba

42

          */

43

0

         public static class Result extends ApiResult{

44

     //        public boolean value;

45

         }

46

47

     }