package com.dsh.course.controller;
|
|
import com.dsh.course.model.dto.TNoticeListWarpper;
|
import com.dsh.course.model.dto.TNoticeWarpper;
|
import com.dsh.course.service.ITNoticesService;
|
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.RestController;
|
|
import java.util.List;
|
|
@RestController
|
@RequestMapping("/notice")
|
public class NoticeController {
|
|
@Autowired
|
private ITNoticesService noticesService;
|
|
|
/**
|
* 获取系统公告列表
|
* @param type
|
* @return
|
*/
|
@PostMapping("/queryNoticesList")
|
public TNoticeListWarpper queryNoticesList(Integer type){
|
try {
|
List<TNoticeWarpper> tNoticeWarppers = noticesService.queryNotices(type);
|
TNoticeListWarpper listWarpper = new TNoticeListWarpper();
|
listWarpper.setList(tNoticeWarppers);
|
return listWarpper;
|
}catch (Exception e){
|
e.printStackTrace();
|
return null;
|
}
|
}
|
}
|