package com.qnfhq.modules.business.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qnfhq.common.utils.Result;
import com.qnfhq.modules.business.entity.HelpCenter;
import com.qnfhq.modules.business.service.ITHelpCenterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/helpcenter")
public class AppHelpCenterController{

    @Autowired
    private ITHelpCenterService tHelpCenterService;

    /**
     * 查询帮助中心列表
     */
    @GetMapping("/getHelpList")
    public Result<IPage<HelpCenter>> getHelpList(@RequestParam(defaultValue = "1") Integer pageNum,
                              @RequestParam(defaultValue = "10") Integer pageSize,
                              @RequestParam(required = true) Integer type,
                              @RequestParam(defaultValue = "1") String enable){
        IPage<HelpCenter> helpList = tHelpCenterService.getHelpList(pageNum, pageSize, type, enable);
        return new Result().ok(helpList);
    }

}
