package com.ruoyi.web.controller.api;

import cn.hutool.core.bean.BeanUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.mall.domain.Bo.QuestionFeedbackBo;
import com.ruoyi.mall.domain.BusinessBulletin;
import com.ruoyi.mall.domain.QuestionFeedback;
import com.ruoyi.mall.domain.Vo.BusinessBulletinResponse;
import com.ruoyi.mall.service.IBusinessBulletinService;
import com.ruoyi.mall.service.IQuestionFeedbackService;
import org.springframework.web.bind.annotation.*;

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

/**问题反馈
 **/
@RestController
@RequestMapping("/api/feedback")
public class ApiFeedBackController extends BaseController {

    @Resource
    private IQuestionFeedbackService businessBulletinService;
    /**
     * 新增反馈
     */
    @PostMapping("/addFeedback")
    public AjaxResult getBulletinList(@RequestBody QuestionFeedbackBo bo) {
        try{
            QuestionFeedback feedback = BeanUtil.toBean(bo,QuestionFeedback.class);
            int i = businessBulletinService.insertQuestionFeedback(feedback);
            return AjaxResult.success("提交成功，感谢您的建议！");
        } catch (Exception e) {
            e.printStackTrace();
            return AjaxResult.error("提交失败");
        }
    }




}
