AdvertController.java 853 B

12345678910111213141516171819202122232425262728293031
  1. package com.yihu.wlyy.web.common.advert;
  2. import io.swagger.annotations.Api;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.stereotype.Controller;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.ResponseBody;
  7. import com.yihu.wlyy.service.common.advert.AdvertService;
  8. import com.yihu.wlyy.web.BaseController;
  9. @Controller
  10. @RequestMapping(value = "common")
  11. @Api(description = "广告")
  12. public class AdvertController extends BaseController {
  13. @Autowired
  14. private AdvertService advertService;
  15. @RequestMapping(value = "advert")
  16. @ResponseBody
  17. public String list(int type) {
  18. try {
  19. return write(200, "查询成功", "list" , advertService.findByType(type));
  20. } catch (Exception e) {
  21. error(e);
  22. return error(-1, "查询失败");
  23. }
  24. }
  25. }