IndexController.java 1.88 KB
package com.server.web.controller;

import com.server.web.common.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 首页相关
 * Created by weiwenfu@163.com on 2018/12/12 下午 3:03.
 */
@RestController
@RequestMapping(value = BaseController.WX_NAMESPACE + "/index", produces = "application/json")
public class IndexController {

    @Autowired
    private IndexService indexService;

    /**
     * banner
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/banner", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
    public Map<String, Object> banner() {
        return indexService.banner();
    }

    /**
     * 首页分类
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/categoryList", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
    public Map<String, Object> categoryList() {
        return indexService.categoryList();
    }

    /**
     * 首页分类-两条数据
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/categoryDetail", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
    public Map<String, Object> categoryDetail() {
        return indexService.categoryDetail();
    }

    /**
     * 首页直播课
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/livingCourseToday", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
    public Map<String, Object> livingCourseToday() {
        return indexService.livingCourseToday();
    }


}