package com.yifu.cloud.plus.v1.batch.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.batch.entity.TTaskArchiveRelation;
import com.yifu.cloud.plus.v1.batch.service.TTaskArchiveRelationService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
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;

/**
 * 电子档案上传任务和档案明细关系表
 *
 * @author huych
 * @date 2025-12-17 11:02:01
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/ttaskarchiverelation" )
@Tag(name = "电子档案上传任务和档案明细关系表管理")
public class TTaskArchiveRelationController {

    private final TTaskArchiveRelationService tTaskArchiveRelationService;
    
    /**
     * 简单分页查询
     * @param page 分页对象
     * @param tTaskArchiveRelation 电子档案上传任务和档案明细关系表
     * @return
     */
    @Operation(description = "简单分页查询")
    @GetMapping("/page")
    public R<IPage<TTaskArchiveRelation>> getTTaskArchiveRelationPage(Page<TTaskArchiveRelation> page, TTaskArchiveRelation tTaskArchiveRelation) {
        return  new R<>(tTaskArchiveRelationService.getTTaskArchiveRelationPage(page,tTaskArchiveRelation));
    }

    /**
     * 通过id查询电子档案上传任务和档案明细关系表
     * @param id id
     * @return R
     */
    @Operation(summary = "通过id查询", description = "通过id查询")
    @GetMapping("/{id}" )
    public R<TTaskArchiveRelation> getById(@PathVariable("id" ) String id) {
        return R.ok(tTaskArchiveRelationService.getById(id));
    }

}
