package com.ruoyi.web.controller.fbs;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.fbs.domain.FbsProjectTaskApply;
import com.ruoyi.fbs.service.IFbsProjectTaskApplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 分包商项目任务申请Controller
 *
 * @author ruoyi
 * @date 2025-02-17
 */
@Api(value = "分包商项目任务申请控制器", tags = {"分包商项目任务申请管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/app/fbs/apply")
public class AppFbsProjectTaskApplyController extends BaseController {

    private final IFbsProjectTaskApplyService iFbsProjectTaskApplyService;


    /**
     * 新增分包商项目任务申请
     */
    @ApiOperation("App申请承接")
    @Log(title = "App项目任务申请承接", businessType = BusinessType.INSERT)
    @RepeatSubmit
    @PostMapping()
    public AjaxResult<Void> add(@Validated @RequestBody FbsProjectTaskApply bo) {
        return toAjax(iFbsProjectTaskApplyService.insert(bo) ? 1 : 0);
    }


}
