package com.chy.borrow.controller;

import com.chy.borrow.service.StatisticsService;
import com.chy.borrow.service.impl.StatisticsServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Controller
@CrossOrigin
@RequestMapping("/statistics")
public class StatisticsController extends BaseController{

    @Autowired
    StatisticsService statisticsService;

    @RequestMapping("/statisticsStatusByUser")
    @ResponseBody
    public String statisticsStatusByUser(@RequestHeader String userId) {
        return statisticsService.statisticsStatusByUser(userId);
    }

    @RequestMapping("/statisticsByUser")
    @ResponseBody
    public String statisticsByUser(@RequestHeader String userId,@RequestBody Map map) {
        return statisticsService.statisticsByUser(userId,map);
    }

    @RequestMapping("/missionByUser")
    @ResponseBody
    public String missionByUser(@RequestHeader String userId) {
        return statisticsService.missionByUser(userId);
    }
}
