Commit d129b5ea705d632fd929b3cade8830ab64610bab
1 parent
833e8b474e
Exists in
master
and in
6 other branches
add jws
Showing 1 changed file with 22 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/EnumsController.java
View file @
d129b5e
| ... | ... | @@ -353,6 +353,27 @@ |
| 353 | 353 | List<Map> list =CsRemarkTypeEnums.getCSTypeEnums(); |
| 354 | 354 | return list; |
| 355 | 355 | } |
| 356 | + @RequestMapping(value = "/getjws", method = RequestMethod.GET) | |
| 357 | + public void geJws(HttpServletResponse response) { | |
| 358 | + int cacheTime =30000; | |
| 359 | + String json = JsonUtil.array2JsonString(basicConfigFacade.getBaseicConfigByParentId(SystemConfig.JIWANGSHI_ID)); | |
| 360 | + writeJsonWithCache(response,json,cacheTime); | |
| 361 | + } | |
| 356 | 362 | |
| 363 | + public void writeJsonWithCache(HttpServletResponse response, String json,int cacheTime) { | |
| 364 | + response.setContentType("application/json;charset=UTF-8"); | |
| 365 | + response.setCharacterEncoding("UTF-8"); | |
| 366 | + response.setHeader("Cache-Control", "max-age=" + cacheTime); | |
| 367 | + try { | |
| 368 | + PrintWriter out = response.getWriter(); | |
| 369 | + out.print(json); | |
| 370 | + } catch (IOException e) { | |
| 371 | + ExceptionUtils.catchException(e,"writeJsonWithCache Error."); | |
| 372 | + } | |
| 373 | + } | |
| 374 | + | |
| 375 | + | |
| 376 | + @Autowired | |
| 377 | + private BasicConfigFacade basicConfigFacade; | |
| 357 | 378 | } |