package com.ruoyi.gysl.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.gysl.entity.Xmpjqd;
import com.ruoyi.gysl.entity.request.XmpjqdPageReq;
import com.ruoyi.gysl.entity.response.XmhxResponse;
import com.ruoyi.gysl.entity.response.XmpjqdOneResponse;
import com.ruoyi.gysl.service.XmpjqdService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;

/**
 * 项目评价清单(Xmpjqd)表控制层
 *
 * @author makejava
 * @since 2025-03-22 09:22:33
 */
@Api(tags ="项目评价清单(包括详情页)" )
@RestController
@RequestMapping("/gysl/xmpjqd")
public class XmpjqdController {
    /**
     * 服务对象
     */
    @Resource
    private XmpjqdService xmpjqdService;

    /**
     * 分页查询所有项目评价清单
     *
     * @return 所有数据
     */
    @ApiOperation("分页查询所有项目评价清单")
    @GetMapping("/page")
    public AjaxResult selectAll( XmpjqdPageReq req) {
        Page<Xmpjqd> page = new Page<>();
        page.setSize(req.getSize());
        page.setCurrent(req.getCurrent());
        return AjaxResult.success(xmpjqdService.page(page, req));
    }

    /**
     * 。
     * 通过主键查询单条项目评价清单
     *
     * @param id 主键
     * @return 单条数据
     */
    @ApiOperation(value = "通过主键查询单条项目评价清单",response = XmpjqdOneResponse.class)
    @GetMapping("/{id}")
    public AjaxResult selectOne(@PathVariable Long id) {
        return AjaxResult.success(xmpjqdService.selectOnePj(id));
    }

    /**
     * 通过主键查询单条项目画像
     *
     * @param id 主键
     * @return 单条数据
     */
    @ApiOperation(value = "通过主键查询单条项目画像",response = XmhxResponse.class)
    @GetMapping("/oneXmhx/{id}")
    public AjaxResult oneXmhx(@PathVariable Long id) {
        return AjaxResult.success(xmpjqdService.oneXmhx(id));
    }
}

