package com.ruoyi.web.v3.controller;


import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.v3.entity.HbReleaseRecordEntity;
import com.ruoyi.web.v3.model.request.HbReleaseRecordPageReq;
import com.ruoyi.web.v3.service.IHbReleaseRecordService;
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-release-record")
@Api("3.0出厂情况登记管理")
public class HbReleaseRecordController {

    @Resource
    private IHbReleaseRecordService releaseRecordService;

    @ApiOperation("出厂情况登记记录添加")
    @PostMapping("/add")
    public AjaxResult add(@RequestBody HbReleaseRecordEntity request){
        return releaseRecordService.add(request);
    }

    @ApiOperation("出厂情况登记记录修改")
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody HbReleaseRecordEntity request){
        return releaseRecordService.edit(request);
    }

    @ApiOperation("出厂情况登记记录删除")
    @PostMapping("/delete")
    public AjaxResult delete(@RequestBody Map<String, String> paramsMap) {
        String ids = paramsMap.get("ids");
        return releaseRecordService.delete(ids);
    }

    @ApiOperation("出厂情况登记记录分页查询")
    @GetMapping("/page")
    public AjaxResult page(@ModelAttribute HbReleaseRecordPageReq request) {
        return releaseRecordService.page(request);
    }


    @ApiOperation("出厂情况登记记录列表全量查询")
    @GetMapping("/list")
    public AjaxResult listAll(){
        return releaseRecordService.listAll();
    }

}
