package com.playlet.web.controller.app;

import com.github.pagehelper.PageInfo;
import com.playlet.common.core.domain.Result;
import com.playlet.system.domain.PlayletAdviceFeedback;
import com.playlet.web.service.app.PlayletFeedbackAppService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@Api(tags = "短剧视频*意见反馈")
@RestController
@RequestMapping(value = "/app/feedback")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class PlayletFeedbackAppController {

    private final PlayletFeedbackAppService playletFeedbackAppService;

    @ResponseBody
    @PostMapping("/add")
    @ApiOperation(value = "新增意见反馈")
    public Result<String> add(@RequestBody PlayletAdviceFeedback playletAdviceFeedback) {
        playletFeedbackAppService.add(playletAdviceFeedback);
        return Result.success();
    }

    @ResponseBody
    @PostMapping("/getFeedBackList")
    @ApiOperation(value = "分页查询反馈列表")
    public Result<PageInfo<PlayletAdviceFeedback>> getFeedBackList(@RequestBody PlayletAdviceFeedback playletAdviceFeedback,
                                                     @RequestParam(value = "pageNum")Integer pageNum,
                                                     @RequestParam(value = "pageSize")Integer pageSize) {
        return Result.success(playletFeedbackAppService.getFeedBackList(playletAdviceFeedback, pageNum, pageSize));
    }

}
