package com.fjhx.oa.controller.daily;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.oa.entity.daily.vo.DailyReportCommentsVo;
import com.fjhx.oa.entity.daily.dto.DailyReportCommentsSelectDto;
import com.fjhx.oa.entity.daily.dto.DailyReportCommentsDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.oa.service.daily.DailyReportCommentsService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 报表评论 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-04-04
 */
@RestController
@RequestMapping("/dailyReportComments")
public class DailyReportCommentsController {

    @Autowired
    private DailyReportCommentsService dailyReportCommentsService;

    /**
     * 报表评论分页
     */
    @PostMapping("/page")
    public Page<DailyReportCommentsVo> page(@RequestBody DailyReportCommentsSelectDto dto) {
        return dailyReportCommentsService.getPage(dto);
    }

    /**
     * 报表评论明细
     */
    @PostMapping("/detail")
    public DailyReportCommentsVo detail(@RequestBody BaseSelectDto dto) {
        return dailyReportCommentsService.detail(dto.getId());
    }

    /**
     * 报表评论新增
     */
    @PostMapping("/add")
    public void add(@RequestBody DailyReportCommentsDto dailyReportCommentsDto) {
        dailyReportCommentsService.add(dailyReportCommentsDto);
    }

    /**
     * 报表评论编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody DailyReportCommentsDto dailyReportCommentsDto) {
        dailyReportCommentsService.edit(dailyReportCommentsDto);
    }

    /**
     * 报表评论删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        dailyReportCommentsService.delete(dto.getId());
    }

}
