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.issue.form.HotIssueFormDTO;
import com.elink.esua.epdc.dto.issue.form.IssueStatisticsInfoFormDTO;
import com.elink.esua.epdc.dto.issue.form.NewIssueFormDTO;
import com.elink.esua.epdc.dto.issue.result.HotIssueResultDTO;
import com.elink.esua.epdc.dto.issue.result.IssueStatisticsInfoResultDTO;
import com.elink.esua.epdc.dto.issue.result.NewIssueResultDTO;
import com.elink.esua.epdc.modules.analysis.service.AnalysisIssueService;
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;

import java.util.List;

/**
 * 移动端接口-数据分析模块(项目)
 * @Author LPF
 * @Date 2019/11/18 13:32
 */
@RestController
@RequestMapping("analysis/issue")
public class ApiAnalysisIssueController {

    @Autowired
    private AnalysisIssueService analysisIssueService;


    /**
     * 测试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 analysisIssueService.test();
    }

    /**
     * @Description: 议题项目数量类目分析
     * @Param: [formDto]
     * @return: com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.issue.result.IssueStatisticsInfoResultDTO>>
     * @Author: zy
     * @Date: 2020-02-11
     */
    @GetMapping("getStatisticsByCategory")
    public Result<List<IssueStatisticsInfoResultDTO>> getStatisticsByCategory(IssueStatisticsInfoFormDTO formDto) {
        return analysisIssueService.listStatisticsByCategory(formDto);
    }

    /**
     * @Description: 最新发布议题接口
     * @Param: [formDto]
     * @return: com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.issue.result.IssueStatisticsInfoResultDTO>>
     * @Author: wgf
     * @Date: 2020-02-11
     */
    @GetMapping("getNewIssueList")
    public Result<List<NewIssueResultDTO>> getNewIssueList(NewIssueFormDTO formDto) {
        return analysisIssueService.getNewIssueList(formDto);
    }

    /**
     * @Description: 最热议题接口
     * @Param: [formDto]
     * @return: com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.issue.result.IssueStatisticsInfoResultDTO>>
     * @Author: wgf
     * @Date: 2020-02-11
     */
    @GetMapping("getHotIssueList")
    public Result<List<HotIssueResultDTO>> getHotIssueList(HotIssueFormDTO formDto) {
        return analysisIssueService.getHotIssueList(formDto);
    }
}
