package com.dsk.biz.controller;

import com.dsk.biz.domain.BusinessOpenTender;
import com.dsk.biz.domain.bo.BusinessOpenTenderDto;
import com.dsk.biz.domain.bo.BusinessSearchDto;
import com.dsk.biz.service.IBusinessOpenTenderService;
import com.dsk.common.annotation.RepeatSubmit;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.domain.R;
import com.dsk.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 项目开标记录
 *
 * @author lcl
 * @date 2023-10-23
 */
@RestController
@RequestMapping("/business/open/tender")
public class BusinessOpenTenderController extends BaseController {

    @Autowired
    private IBusinessOpenTenderService baseService;

    /**
     * 开标记录列表
     */
    @GetMapping("/list")
    public TableDataInfo<BusinessOpenTender> list(BusinessOpenTenderDto dto, PageQuery pageQuery){
        return baseService.selectList(dto, pageQuery);
    }

    /**
     * 添加开标记录
     */
    @PostMapping
    @RepeatSubmit()
    public R<Void> add(@RequestBody BusinessOpenTender bo){
        return toAjax(baseService.add(bo));
    }

    /**
     * 修改开标记录
     */
    @PutMapping
    @RepeatSubmit()
    public R<Void> edit(@RequestBody BusinessOpenTender bo){
        return toAjax(baseService.edit(bo));
    }

    /**
     * 删除开标记录
     */
    @DeleteMapping("/{ids}")
    @RepeatSubmit()
    public R<Void> remove(@PathVariable Long[] ids){
        return toAjax(baseService.remove(ids));
    }

}
