package org.springblade.modules.app.web.admin;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springblade.common.auth.permission.DisableLoginVerify;
import com.wn.common.controller.BaseController;
import com.wn.common.datamodel.ResultDTO;
import org.springblade.modules.app.common.dto.EnteringZhejiangFilingDTO;
import org.springblade.modules.app.common.query.EnteringZhejiangFilingQuery;
import org.springblade.modules.app.manager.EnteringZhejiangFilingManager;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 入浙备案登记信息管理端 前端控制器
 * </p>
 *
 * @author huyinuo
 * @since 2022-01-11
 */
@RestController
@RequestMapping("app/admin/entering/zhejiang/filing")
public class AdminEnteringZhejiangFilingController extends BaseController {

    @Autowired
    private EnteringZhejiangFilingManager enteringZhejiangFilingManager;

    //@ApiOperation(value = "查询省外养殖场登记信息列表")
    @GetMapping("/page")
    public ResponseEntity<ResultDTO<Page<EnteringZhejiangFilingDTO>>> pageEnteringZhejiangFiling(EnteringZhejiangFilingQuery enteringZhejiangFilingQuery) {
        return success(enteringZhejiangFilingManager.pageEnteringZhejiangFiling(enteringZhejiangFilingQuery));
    }

    //@ApiOperation(value = "修改状态为已查看")
    @PutMapping("{id}")
    public ResponseEntity<ResultDTO<Boolean>> modifyEnteringZhejiangFiling(@PathVariable Long id) {
        return success(enteringZhejiangFilingManager.modifyEnteringZhejiangFiling(id));
    }

    //@ApiOperation(value = "导出Excel")
    @GetMapping("/export")
    @DisableLoginVerify
    public void exportEnteringZhejiangFiling(String ids, HttpServletResponse response) throws Exception{
        enteringZhejiangFilingManager.exportEnteringZhejiangFilings(ids, response);
    }
}
