package com.ruoyi.api.controller;

import com.ruoyi.api.domain.BroadCountNumber;
import com.ruoyi.api.service.impl.BroadApiService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.manage.domain.BaseStore;
import com.ruoyi.manage.domain.LedgerRfid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author wanghao
 * @date 2024/3/1  13:29
 */
@Controller
@RequestMapping("/api")
public class BroadApiController {

    @Autowired
    private BroadApiService service;

    //获取区域
    @PostMapping("/getArea")
    @ResponseBody
    public AjaxResult getArea() {
        List<BaseStore> list = service.getArea();
        return AjaxResult.success(list);
    }
    //获取统计
    @PostMapping("/getCountNumberById")
    @ResponseBody
    public AjaxResult getCountNumberById(int id) {
        List<BroadCountNumber> list = service.getCountNumberById(id);

        return AjaxResult.success(list);
    }
    //获取详细轮挡
    @PostMapping("/getLedgerByCode")
    @ResponseBody
    public AjaxResult getLedgerByCode(String locationCode){
        List<LedgerRfid> list=service.getLedgerByCode(locationCode);
        return AjaxResult.success(list);
    }



}
