package com.keao.edu.user.controller;


import com.keao.edu.common.controller.BaseController;
import com.keao.edu.common.page.QueryInfo;
import com.keao.edu.user.entity.SysSuggestion;
import com.keao.edu.user.service.SysSuggestionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("sysSuggestion")
@Api(tags = "意见反馈")
@RestController
public class SysSuggestionController extends BaseController {

    @Autowired
    private SysSuggestionService sysSuggestionService;

    @ApiOperation(value = "新增")
    @RequestMapping("/add")
    @PreAuthorize("@pcs.hasPermissions('sysSuggestion/add')")
    public Object add(SysSuggestion sysSuggestion) {
        sysSuggestionService.insert(sysSuggestion);
        return succeed();
    }

    @ApiOperation(value = "删除")
    @RequestMapping("/del")
    @PreAuthorize("@pcs.hasPermissions('sysSuggestion/del')")
    public Object del(Long id) {
        sysSuggestionService.delete(id);
        return succeed();
    }

    @ApiOperation(value = "分页查询")
    @RequestMapping("/queryPage")
    @PreAuthorize("@pcs.hasPermissions('sysSuggestion/queryPage')")
    public Object queryPage(QueryInfo queryInfo) {
        return succeed(sysSuggestionService.queryPage(queryInfo));
    }

}
