01 | package com.shequ.controller.api; |
02 |
03 | import com.alibaba.fastjson.JSON; |
04 | import com.shequ.pojo.Message; |
05 | import com.shequ.service.MessageService; |
06 | import com.shequ.service.RepairService; |
07 | import org.springframework.beans.factory.annotation.Autowired; |
08 | import org.springframework.stereotype.Controller; |
09 | import org.springframework.web.bind.annotation.*; |
10 |
11 | import java.util.List; |
12 |
13 |
14 | @Controller |
15 | public class MessageApi { |
16 | @Autowired |
17 | MessageService messageService; |
18 | @Autowired |
19 | RepairService repairService; |
20 |
21 | /* |
22 | 微信小程序端提供json接口的。显示社区公告数据 |
23 | */ |
24 | @ResponseBody |
25 | @RequestMapping (value = "/getAllMessage" ,produces= "application/json;charset=UTF-8" ) |
26 | public String findAllMessage(){ |
27 | List<Message> messages = messageService.findAllMessage(); |
28 | String result = JSON.toJSONString(messages); |
29 | return result; |
30 | } |
31 |
32 | } |

DFwang LV5
3月14日
新哥新奇士橙 LV4
1月26日
zolscy LV24
2024年11月27日
唐僧洗头爱飘柔 LV22
2024年9月13日
lo8lukoukoum LV4
2024年4月9日
ningningnn LV3
2024年2月24日
晴曛 LV6
2023年12月29日
阿狸哦 LV2
2023年12月2日
lzpsuifeng LV3
2023年10月13日
348835269 LV11
2023年9月27日