package com.elink.esua.epdc.modules.analysis.controller;

import com.elink.esua.epdc.common.token.dto.TokenDto;
import com.elink.esua.epdc.commons.tools.annotation.LoginUser;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.topic.form.HotTopicFormDTO;
import com.elink.esua.epdc.dto.topic.form.NewHotTopicFormDTO;
import com.elink.esua.epdc.modules.analysis.service.AnalysisTopicService;
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 LPF
 * @Date 2019/11/18 13:32
 */
@RestController
@RequestMapping("analysis/topic")
public class ApiAnalysisTopicController {

    @Autowired
    private AnalysisTopicService analysisTopicService;


    /**
     * 测试demo

     * @Return: com.elink.esua.epdc.commons.tools.utils.Result<>
     * @Author: lipengfei
     * @Date: 2019/11/19 16:34
     */
    @GetMapping("test")
    public Result test(@LoginUser TokenDto tokenDto) {
        return analysisTopicService.test();
    }

    /**
     * 最热话题接口

     * @Return: com.elink.esua.epdc.commons.tools.utils.Result<>
     * @Author: wgf
     * @Date: 2020/02/11 09:45
     */
    @GetMapping("getHotTopicList")
    public Result getHotTopicList(HotTopicFormDTO hotTopicFormDTO) {
        return analysisTopicService.getHotTopicList(hotTopicFormDTO);
    }

    /**
     * 最新发布话题接口

     * @Return: com.elink.esua.epdc.commons.tools.utils.Result<>
     * @Author: wgf
     * @Date: 2020/02/11 09:45
     */
    @GetMapping("getNewTopicList")
    public Result getNewTopicList(NewHotTopicFormDTO newHotTopicFormDTO) {
        return analysisTopicService.getNewTopicList(newHotTopicFormDTO);
    }
}
