FragmentController.java 994 B

123456789101112131415161718192021222324252627282930
  1. package com.goafanti.fragment.controller;
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.web.bind.annotation.PathVariable;
  4. import org.springframework.web.bind.annotation.RequestMapping;
  5. import org.springframework.web.bind.annotation.RequestMethod;
  6. import org.springframework.web.bind.annotation.RestController;
  7. import com.goafanti.common.controller.BaseApiController;
  8. import com.goafanti.fragment.service.FragmentService;
  9. @RestController
  10. @RequestMapping(value = "/open/html/")
  11. public class FragmentController extends BaseApiController {
  12. @Autowired
  13. FragmentService fragmentService;
  14. @RequestMapping(value = "/get/{id}", method = RequestMethod.GET)
  15. public String get(@PathVariable String id) {
  16. return fragmentService.selectById(id);
  17. }
  18. @RequestMapping(value = "/json/{id}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
  19. public String json(@PathVariable String id) {
  20. return fragmentService.selectById(id);
  21. }
  22. }