package com.fjhx.common.controller.problem;

import com.ruoyi.common.annotation.TenantIgnore;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.common.entity.problem.vo.ProblemFeedbackVo;
import com.fjhx.common.entity.problem.dto.ProblemFeedbackSelectDto;
import com.fjhx.common.entity.problem.dto.ProblemFeedbackDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.common.service.problem.ProblemFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 问题反馈 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-05-04
 */
@RestController
@RequestMapping("/problemFeedback")
public class ProblemFeedbackController {

    @Autowired
    private ProblemFeedbackService problemFeedbackService;

    /**
     * 问题反馈分页
     */
    @TenantIgnore
    @PostMapping("/page")
    public Page<ProblemFeedbackVo> page(@RequestBody ProblemFeedbackSelectDto dto) {
        return problemFeedbackService.getPage(dto);
    }

    /**
     * 问题反馈明细
     */
    @PostMapping("/detail")
    public ProblemFeedbackVo detail(@RequestBody BaseSelectDto dto) {
        return problemFeedbackService.detail(dto.getId());
    }

    /**
     * 问题反馈新增
     */
    @PostMapping("/add")
    public void add(@RequestBody ProblemFeedbackDto problemFeedbackDto) {
        problemFeedbackService.add(problemFeedbackDto);
    }

    /**
     * 问题反馈编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody ProblemFeedbackDto problemFeedbackDto) {
        problemFeedbackService.edit(problemFeedbackDto);
    }

}
