package com.ruoyi.web.v3.controller;


import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.v3.entity.HbSlaughterSummaryMonthlyEntity;
import com.ruoyi.web.v3.model.request.HbSlaughterSummaryMonthlyPageReq;
import com.ruoyi.web.v3.service.IHbSlaughterSummaryMonthlyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

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

/**
 * <p>
 * v3.0 屠宰情况月汇总 前端控制器
 * </p>
 *
 */
@RestController
@RequestMapping("/v3/hb-slaughter-summary-monthly")
@Api("3.0 屠宰情况月汇总")
public class HbSlaughterSummaryMonthlyController {

    @Resource
    private IHbSlaughterSummaryMonthlyService slaughterSummaryMonthlyService;

    @ApiOperation("屠宰情况月汇总记录添加")
    @PostMapping("/add")
    public AjaxResult add(@RequestBody HbSlaughterSummaryMonthlyEntity request){
        return slaughterSummaryMonthlyService.add(request);
    }

    @ApiOperation("屠宰情况月汇总记录修改")
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody HbSlaughterSummaryMonthlyEntity request){
        return slaughterSummaryMonthlyService.edit(request);
    }

    @ApiOperation("屠宰情况月汇总记录删除")
    @PostMapping("/delete")
    public AjaxResult delete(@RequestBody Map<String, String> paramsMap) {
        String ids = paramsMap.get("ids");
        return slaughterSummaryMonthlyService.delete(ids);
    }

    @ApiOperation("屠宰情况月汇总记录分页查询")
    @GetMapping("/page")
    public AjaxResult page(@ModelAttribute HbSlaughterSummaryMonthlyPageReq request) {
        return slaughterSummaryMonthlyService.page(request);
    }


    @ApiOperation("屠宰情况月汇总记录列表全量查询")
    @GetMapping("/list")
    public AjaxResult listAll(){
        return slaughterSummaryMonthlyService.listAll();
    }

}
