17222f429c27bdfe9f3651430a42e3f66bbd8c2e.svn-base 852 B

1234567891011121314151617181920212223242526272829303132333435
  1. package com.yihu.platform.action;
  2. import javax.servlet.http.HttpServletRequest;
  3. import org.springframework.stereotype.Controller;
  4. import org.springframework.web.bind.annotation.RequestMapping;
  5. import org.springframework.web.bind.annotation.ResponseBody;
  6. import com.yihu.platform.utils.ApiUtil;
  7. import net.sf.json.JSONObject;
  8. /**
  9. * action 测试类 Created by wengsb on 2016/12/01.
  10. */
  11. @Controller
  12. @RequestMapping("common")
  13. public class CommonAction {
  14. @RequestMapping("testAction")
  15. @ResponseBody
  16. public String testAction(HttpServletRequest request) {
  17. try {
  18. String param = request.getParameter("param");
  19. JSONObject rv = ApiUtil.getRespJSON(10000, "成功");
  20. rv.put("param", param);
  21. return rv.toString();
  22. } catch (Exception e) {
  23. e.printStackTrace();
  24. return ApiUtil.getRespJSON(-10000, e.getMessage()).toString();
  25. }
  26. }
  27. }