package com.stylefeng.guns.modular.api;
|
|
import com.stylefeng.guns.modular.system.service.ITNoticesService;
|
import com.stylefeng.guns.modular.system.util.ResultUtil;
|
import com.stylefeng.guns.modular.system.warpper.TNoticeWarpper;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.List;
|
|
/**
|
* 公告控制器
|
*/
|
@Api
|
@RestController
|
@RequestMapping("/base/notice")
|
public class TNoticeController {
|
|
@Autowired
|
private ITNoticesService noticeService;
|
|
|
/**
|
* 获取公告列表
|
* @param type
|
* @return
|
*/
|
@ResponseBody
|
@PostMapping("/queryNotices")
|
@ApiOperation(value = "获取滚动消息", tags = {"用户端-首页"}, notes = "")
|
@ApiImplicitParams({
|
@ApiImplicitParam(value = "数据类型(1:滚动消息)", name = "type", required = true, dataType = "int")
|
})
|
public ResultUtil<List<TNoticeWarpper>> queryNotices(Integer type){
|
try {
|
List<TNoticeWarpper> list = noticeService.queryNotices(type);
|
return ResultUtil.success(list);
|
}catch (Exception e){
|
e.printStackTrace();
|
return ResultUtil.runErr();
|
}
|
}
|
}
|