| | |
| | | package com.yeshi.buwan.controller.admin.api; |
| | | |
| | | import java.io.PrintWriter; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.buwan.domain.system.DetailSystemConfig; |
| | | import com.yeshi.buwan.service.imp.DetailSystemConfigService; |
| | | import com.yeshi.buwan.util.EHCacheManager; |
| | | import com.yeshi.buwan.util.JsonUtil; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.SystemUtil; |
| | | import org.json.JSONArray; |
| | | import org.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.yeshi.buwan.domain.system.DetailSystemConfig; |
| | | import com.yeshi.buwan.service.imp.DetailSystemConfigService; |
| | | import javax.annotation.Resource; |
| | | import java.io.PrintWriter; |
| | | import java.util.List; |
| | | |
| | | @Controller |
| | | @RequestMapping("admin/new/api/config") |
| | |
| | | private EHCacheManager ehCacheManager; |
| | | |
| | | @RequestMapping("configList") |
| | | public void configList(Long detailSystemId, String key, PrintWriter out) { |
| | | public void configList(Long detailSystemId, String key, String type, PrintWriter out) { |
| | | key = StringUtil.isNullOrEmpty(key) ? "" : key.trim(); |
| | | List<DetailSystemConfig> list = configService.listConfig(detailSystemId, key); |
| | | List<DetailSystemConfig> list = null; |
| | | if ("value".equalsIgnoreCase(type)) { |
| | | list = configService.listConfigByValue(detailSystemId, key); |
| | | } else { |
| | | list = configService.listConfig(detailSystemId, key); |
| | | } |
| | | JSONObject json = new JSONObject(); |
| | | json.put("code", "0"); |
| | | JSONArray listJson = new JSONArray(list); |