package org.docksidestage.app.web.wx.json;

import java.util.Arrays;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author jflute
 */
@Controller
@RequestMapping("/wx/json")
public class WxJsonController {

    // ===================================================================================
    //                                                                              Entry
    //                                                                             =======
    // http://localhost:8080/wx/json/emptybody
    @RequestMapping(method = RequestMethod.GET, value = "emptybody")
    @ResponseBody
    public void emptybody() {
        return;
    }

    // http://localhost:8080/wx/json/emptyobj
    @RequestMapping(method = RequestMethod.GET, value = "emptyobj")
    @ResponseBody
    public EmptyObj emptyobj() {
        return new EmptyObj();
    }

    public static class EmptyObj {
    }

    // http://localhost:8080/wx/json/emptylist
    @RequestMapping(method = RequestMethod.GET, value = "emptylist")
    @ResponseBody
    public List<String> emptylist() {
        return Arrays.asList("sea", "land", "piari");
    }
}

@@ -601,12 +601,13 @@
     
-Entr
+ Empt
 y%0A  
@@ -687,18 +687,18 @@
         
-==
+  
 =====%0A  
@@ -854,24 +854,44 @@
 mptybody() %7B
+ // contentType=null
 %0A        ret
@@ -1378,11 +1378,222 @@
 );%0A    %7D
+%0A%0A    // http://localhost:8080/wx/json/strval%0A    @RequestMapping(method = RequestMethod.GET, value = %22strval%22)%0A    @ResponseBody%0A    public String strval() %7B // contentType=text/html%0A        return %22sea%22;%0A    %7D
 %0A%7D%0A

add WxJsonController