package com.ruoyi.web.controller.bgt;

import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
import com.ruoyi.bgt.domain.dto.BgtProjectRecruitApplyQueryDTO;
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO;
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
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 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.*;

import java.util.List;

/**
 * 包工头招工申请Controller
 *
 * @author ruoyi
 * @date 2025-02-18
 */
@Api(value = "App包工头招工申请控制器", tags = {"App包工头招工申请管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/app/bgt/apply")
public class AppBgtProjectRecruitApplyController extends BaseController {

    private final IBgtProjectRecruitApplyService iBgtProjectRecruitApplyService;



	@ApiOperation("App务工者列表")
	@GetMapping("/list")
	public List<BgtProjectRecruitApplyVO> list(@Validated BgtProjectRecruitApplyQueryDTO dto) {
		return iBgtProjectRecruitApplyService.appQueryList(dto);
	}


    /**
     * 新增包工头招工申请
     */
    @ApiOperation("App务工者招工报名")
    @Log(title = "App务工者招工报名", businessType = BusinessType.INSERT)
    @RepeatSubmit
    @PostMapping()
    public AjaxResult<Void> add(@Validated @RequestBody BgtProjectRecruitApply bo) {
        return toAjax(iBgtProjectRecruitApplyService.insert(bo) ? 1 : 0);
    }



}
