
package org.sky.scientific.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.sky.core.boot.ctrl.KdController;
import org.sky.core.tool.api.R;
import org.sky.scientific.pojo.dto.XmJtbDTO;
import org.sky.scientific.pojo.entity.XmJtbEntity;
import org.sky.scientific.pojo.vo.XmJtbVO;
import org.sky.scientific.service.IXmJtbService;
import org.springframework.web.bind.annotation.*;

/**
 * 科研项目-项目结题表 控制器
 *
 * @author Kd
 * @since 2025-07-01
 */
@RestController
@AllArgsConstructor
@RequestMapping("/xm/jtb")
@Tag(name = "科研项目-项目结题表", description = "科研项目-项目结题表接口")
public class XmJtbController extends KdController {

	private final IXmJtbService service;

	@GetMapping("/detail")
	@ApiOperationSupport(order = 1)
	@Operation(summary = "详情", description  = "传入xmJtb")
	public R<XmJtbVO> detail(XmJtbDTO xmJtb) {
		XmJtbVO detail = service.selectByCondition(xmJtb);
		return R.data(detail);
	}

	@PostMapping("/submit")
	@ApiOperationSupport(order = 6)
	@Operation(summary = "暂存/确定结题/取消结题", description  = "status,0:暂存,1:确定结题.2:取消结题")
	public R submit(@RequestBody XmJtbEntity xmJtb) {
		return R.status(service.submit(xmJtb));
	}

}
