package com.chinaitop.depot.intelligent.ventilation.controller;

import com.chinaitop.depot.intelligent.ventilation.service.AerationBypeService;
import com.unissoft.model.ResponseEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

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

@RestController
@RequestMapping(value = "/intelligents/aeratioBypte")
@Api(value = "AeratioBypteController", description = "获取通风类型")

public class AeratioBypteController {
    @Resource
    private AerationBypeService aerationBypeService;


    @RequestMapping(value = "/getUpOrDownMap", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
    @ApiOperation(value = "获取通风类型", notes = "获取通风类型")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "type", value = "仓上0仓下1类型", paramType = "query")
    })
    public ResponseEntity<Map<Integer, String>> getUpOrDownMap(String type) {
        Map<Integer, String> upOrDownList = aerationBypeService.getUpOrDownList(type);
        return ResponseEntity.ok(upOrDownList);
    }


}
