PageRenderTime 199ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/Server/tomcat/WEB-INF/src/com/drhelper/android/service/UpdateMenuTypeService.java

https://github.com/weiganyi/dr-helper
Java | 35 lines | 25 code | 7 blank | 3 comment | 2 complexity | 00250bb5b77b56da71ebb93c40dada4b MD5 | raw file
  1. package com.drhelper.android.service;
  2. import java.util.ArrayList;
  3. import javax.servlet.http.HttpSession;
  4. import com.alibaba.fastjson.JSON;
  5. import com.drhelper.android.bean.com.MenuTypeList;
  6. import com.drhelper.common.db.DBManager;
  7. import com.drhelper.common.entity.MenuType;
  8. public class UpdateMenuTypeService extends Service {
  9. public String doAction(HttpSession session, String reqBody) {
  10. MenuTypeList respMenuTypeList = null;
  11. String respBody = null;
  12. respMenuTypeList = new MenuTypeList();
  13. //get the meny type list
  14. DBManager db = new DBManager();
  15. ArrayList<MenuType> menuTypeList = db.getMenuTypeList();
  16. if (menuTypeList == null) {
  17. respMenuTypeList.setResult(false);
  18. respBody = JSON.toJSONString(respMenuTypeList);
  19. return respBody;
  20. }
  21. //create the resp object
  22. respMenuTypeList.setList(menuTypeList);
  23. respMenuTypeList.setResult(true);
  24. //serialize the object
  25. respBody = JSON.toJSONString(respMenuTypeList);
  26. return respBody;
  27. }
  28. }