package com.qxueyou.scc.portal.homepage.controller; //import com.qxueyou.appraisal.web.homepage.serivce.IHomepageService; //import com.qxueyou.model.Result; import com.qxueyou.scc.base.model.Result; import com.qxueyou.scc.portal.homepage.serivce.IHomepageService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @author ZERO 2021-03-03 09:06 */ @RestController @CrossOrigin @RequestMapping("/homepage") @Api(tags = "首页相关接口") public class HomepageController { @Autowired private IHomepageService homepageService; @GetMapping(value = "/tab",produces = "application/json;charset=utf-8") @ApiOperation("获取标签") public Result getTabs() { return new Result(true, "tab",homepageService.getTabs()); } @GetMapping(value = "/home") @ApiOperation("获取列表") public Result getIndexDetail() { // System.err.println("=====>获取列表"); return new Result(true,"", homepageService.getIndexDetail()); } @GetMapping(value = "/getExcellentTeaching") @ApiOperation("获取精品教学") public Result getExcellentTeaching() { // System.err.println("=====>获取列表"); return new Result(true,"", homepageService.getExcellentTeaching()); } @GetMapping("/article") @ApiOperation("获取文章列表") public Result getArticle(String type, String subColumn, String numbers, int page, int size, String keyword) { System.err.println("=====>获取文章列表"); return new Result(true, "article",homepageService.getArticle(type, subColumn, numbers, page, size, keyword)); } @GetMapping("/article/detail") @ApiOperation("获取文章详情") public Result getArticleDetail(String id) { return new Result(true,"detail", homepageService.getArticleDetail(id)); } @GetMapping("/getArticle") @ApiOperation("获取文章") public Result getGetArticle(String type, String subColumn) { return new Result(true,"getArticle", homepageService.getArticlesType(type, subColumn)); } @GetMapping("/video") public Result getVideo(String type, String subColumn, int page, int size) { return new Result(true, "video",homepageService.getVideo(type, subColumn, page, size)); } }