package com.xinelu.mobile.controller.info;

import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.manage.domain.info.Info;
import com.xinelu.manage.service.info.IInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

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

/**
 * 微信端获取资讯信息
 * 资讯信息Controller
 */
@Slf4j
@RestController
@RequestMapping("/postDischarge")
public class MobileInfoController extends BaseController {


    @Resource
    private IInfoService infoService;


    //@PreAuthorize("@ss.hasPermi('mobile:info:list')")
    @GetMapping("/list")
    public TableDataInfo list(Info info) {
        startPage();
        List<Info> list = infoService.selectInfoList(info);
        return getDataTable(list);
    }

    @GetMapping("/getInfoById")
    public AjaxResult getInfoById(Long id) {
        return AjaxResult.success(infoService.selectInfoById(id));
    }

}
