package com.ruoyi.web.controller.fbs;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.fbs.domain.dto.AppTaskDTO;
import com.ruoyi.fbs.domain.vo.AppTaskDetailVO;
import com.ruoyi.fbs.domain.vo.AppTaskVO;
import com.ruoyi.fbs.service.IFbsProjectTaskService;
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.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;

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

    private final IFbsProjectTaskService iFbsProjectTaskService;

    /**
     * app项目任务列表
     */
    @ApiOperation("App包工头任务列表")
    @GetMapping("/list")
    public TableDataInfo<AppTaskVO> list(@Validated AppTaskDTO dto) {
        return iFbsProjectTaskService.appQueryPageList(dto);
    }


	@ApiOperation("App获取项目任务详细信息")
	@GetMapping("/{id}")
	public AjaxResult<AppTaskDetailVO> getInfo(@NotNull(message = "主键不能为空")
											  @PathVariable("id") Long id) {
		return AjaxResult.success(iFbsProjectTaskService.appQueryById(id));
	}

}
