package beilv.web.controller.system;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import beilv.common.core.page.PageDomain;
import beilv.common.core.page.TableSupport;
import beilv.shopping.domain.QmjsShoppingMall;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import beilv.common.annotation.Log;
import beilv.common.core.controller.BaseController;
import beilv.common.core.domain.AjaxResult;
import beilv.common.core.page.TableDataInfo;
import beilv.common.enums.BusinessType;
import beilv.system.domain.SysNotice;
import beilv.system.service.ISysNoticeService;

/**
 * 公告 信息操作处理
 *
 * @author ruoyi
 */
@RestController
@RequestMapping("/app-api/notice")
public class SysNoticeAppController extends BaseController {
    private String prefix = "app-api/notice";

    @Autowired
    private ISysNoticeService noticeService;

    /**
     * 小程序查询公告详细
     */
    @GetMapping(value = "/{noticeId}")
    public AjaxResult getInfo(@PathVariable Long noticeId) {
        return success(noticeService.selectNoticeById(noticeId));
    }

    /**
     * 小程序获取通知公告列表
     */
    @GetMapping("/appList")
    public AjaxResult appList(SysNotice notice) {
        startPage();
        List<SysNotice> list = noticeService.selectNoticeListApp(notice);
        return AjaxResult.success(getDataTable(list).getRows());
    }
}
