package org.dromara.zhishu.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import lombok.RequiredArgsConstructor;
import org.dromara.common.web.core.BaseController;
import org.dromara.zhishu.domain.Statistic;

import org.dromara.zhishu.service.CountService;
import org.dromara.zhishu.util.CnumberUtils;
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 ruoyi
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/zhishu/statistic")
public class CountController extends BaseController {

    @Autowired
    private CountService countService;


    /**
     * 获取库房总数，货架总数
     */
    @SaIgnore
//    @SaCheckPermission("zhishu:statistic:statistic")
    @GetMapping("/statistic")
    public Statistic list() {
        //获取当前用户id
        Statistic  message = countService.selectStatistic();
//        System.out.println(message);
        return message;
    }

    @GetMapping("/isbn")
    @SaIgnore
    public String getIsbn() {
        return CnumberUtils.generateRandomIsbn();
    }

}
