派生自 projectDept/qhighschool

dengqingliu
2022-12-02 e61a65c45a2a6a943be7ec56413162deefdda165
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * @author ZERO 2021-03-03 09:06
 */
@RestController
@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
//    @ApiOperation("获取列表")
//    public Result getIndexDetail() {
////        System.err.println("=====>获取列表");
//        return new Result(true,"", homepageService.getIndexDetail());
//    }
 
    @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));
    }
}