package com.sunxung.factoring.web.biddingManagement;

import com.sunxung.factoring.component.annotation.OperationLog;
import com.sunxung.factoring.component.enums.OperationTypeEnum;
import com.sunxung.factoring.entity.ResponseJson;
import com.sunxung.factoring.entity.biddingManagement.CBiddingBasicInfo;
import com.sunxung.factoring.service.biddingManagement.ICBiddingBasicInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 招投标管理对外controller
 * @Author Yafan Wang
 * @Date 2023/11/20 16:44
 */
@RestController
@RequestMapping("api/biddingManagement/")
public class BiddingManagementApiController {

    @Autowired
    private ICBiddingBasicInfoService biddingBasicInfoService;

    @RequestMapping("startProcess")
    @OperationLog(operationModule = "业务管理", operationType = OperationTypeEnum.INSERT, description = "新建业务")
    public ResponseJson startProcess(@RequestBody @Validated CBiddingBasicInfo biddingBasicInfo) {
        biddingBasicInfoService.startProcess(biddingBasicInfo);
        return new ResponseJson("操作成功！");
    }

    @RequestMapping("handleProcess")
    public ResponseJson handleProcess(@RequestBody @Validated CBiddingBasicInfo biddingBasicInfo) {
        biddingBasicInfoService.handleProcess(biddingBasicInfo);
        return new ResponseJson("操作成功！");
    }

}
