package platform.modules.mobile; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import platform.common.base.controller.BaseController; import platform.common.base.model.CompanyNotify; import platform.common.util.ShiroUtils; import platform.modules.build.DTO.*; import platform.modules.build.entity.CompanyShow; import platform.modules.build.entity.ElectricWater; import platform.modules.build.entity.Maintenance; import platform.modules.build.entity.Tenancy; import platform.modules.build.service.CompanyService; import platform.modules.build.service.CompanyShowService; import platform.modules.build.service.ElectricWaterService; import platform.modules.build.service.MaintenanceService; import platform.modules.build.service.TenancyService; import platform.modules.government.dto.NotifyDto; import platform.modules.government.entity.Notify; import platform.modules.government.service.NotifyService; import platform.modules.sys.web.ResponseMessage; import java.util.List; @Controller @RequestMapping(value = "/mobile/home") public class MobileHomeController extends BaseController { @Autowired private NotifyService notifyService; @GetMapping(value = "") public String page() { return BASE_MOBIl_PATH + "index"; } /** * 获取手机端通知列表 * @param modelMap * @return */ @PostMapping(value="/getInfo") @ResponseBody public ResponseMessage getNoticeInfo(ModelMap modelMap){ try { Integer build_id = ShiroUtils.getUserEntity().getBuild_id(); Integer company_id = ShiroUtils.getUserEntity().getCompany_id(); //通知公告 int notifyCount = 10; NotifyDto notifyDto = new NotifyDto(); notifyDto.setCompany_id(company_id); notifyDto.setCount(notifyCount); notifyDto.setIs_read(false); // todo List notifyList = notifyService.findNotifyList(notifyDto); modelMap.put("notifyList", notifyList); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return new ResponseMessage(true, "查询成功", modelMap); } }