package com.gz.controller.welcome;

import com.alibaba.fastjson.JSONObject;
import com.gz.rvo.welcome.BorrowCountRVO;
import com.gz.rvo.welcome.BorrowRecordRVO;
import com.gz.service.welcome.StatisticsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 首页统计控制器
 * @author LiuchangLan
 * @date 2021/3/2 9:24
 */
@RestController
@RequestMapping("welcome/statistics")
public class AdminStatisticsController {

    @Resource
    private StatisticsService service;

    @GetMapping("selectWaitHandleRecord")
    List<BorrowRecordRVO> selectWaitHandleRecord(){
        return service.selectWaitHandleRecord();
    }

    @GetMapping("selectWaitReturnRecord")
    List<BorrowRecordRVO> selectWaitReturnRecord(){
        return service.selectWaitReturnRecord();
    }

    @GetMapping("selectArchiveByType")
    JSONObject selectArchiveByType(){
        return service.selectArchiveByType();
    }

    @GetMapping("selectArchiveByYear")
    JSONObject selectArchiveByYear(){
        return service.selectArchiveByYear();
    }

    @GetMapping("selectBorrowCountByDate")
    Map selectBorrowCountByDate(){
        return service.selectBorrowCountByDate();
    }

}
