Commit 75ce25b28831f62a18770206d459287afe705313
1 parent
c832139712
Exists in
master
and in
1 other branch
code update
Showing 1 changed file with 34 additions and 5 deletions
platform-data-api/src/main/java/com/lyms/platform/data/controller/SmsController.java
View file @
75ce25b
1 | 1 | package com.lyms.platform.data.controller; |
2 | 2 | |
3 | +import com.lyms.platform.common.utils.ResultUtils; | |
3 | 4 | import com.lyms.platform.data.service.SmsService; |
4 | 5 | import org.springframework.beans.factory.annotation.Autowired; |
5 | 6 | import org.springframework.stereotype.Controller; |
6 | 7 | import org.springframework.web.bind.annotation.RequestMapping; |
8 | +import org.springframework.web.bind.annotation.RequestParam; | |
7 | 9 | |
8 | 10 | import javax.servlet.http.HttpServletResponse; |
9 | 11 | |
... | ... | @@ -21,7 +23,14 @@ |
21 | 23 | * @param response |
22 | 24 | */ |
23 | 25 | @RequestMapping(value = "/template") |
24 | - public void productSms(HttpServletResponse response){ | |
26 | + public void productSms(HttpServletResponse response,@RequestParam("token")String token){ | |
27 | + | |
28 | + if (!"lyms@2016!000".equals(token)) | |
29 | + { | |
30 | + ResultUtils.buildParameterErrorResultAndWrite(response, "没有token"); | |
31 | + return; | |
32 | + } | |
33 | + | |
25 | 34 | smsService.productTemplateSms(); |
26 | 35 | smsService.productChanAmsSms(); |
27 | 36 | smsService.productYunAmsSms(); |
28 | 37 | |
29 | 38 | |
30 | 39 | |
... | ... | @@ -30,25 +39,45 @@ |
30 | 39 | } |
31 | 40 | |
32 | 41 | @RequestMapping(value = "/smsTemplate") |
33 | - public void smsTemplate(HttpServletResponse response){ | |
42 | + public void smsTemplate(HttpServletResponse response,@RequestParam("token")String token){ | |
43 | + if (!"lyms@2016!000".equals(token)) | |
44 | + { | |
45 | + ResultUtils.buildParameterErrorResultAndWrite(response, "没有token"); | |
46 | + return; | |
47 | + } | |
34 | 48 | smsService.productTemplateSms(); |
35 | 49 | writeString(response, "sms template success"); |
36 | 50 | } |
37 | 51 | |
38 | 52 | @RequestMapping(value = "/productChanAmsSms") |
39 | - public void productChanAmsSms(HttpServletResponse response){ | |
53 | + public void productChanAmsSms(HttpServletResponse response,@RequestParam("token")String token){ | |
54 | + if (!"lyms@2016!000".equals(token)) | |
55 | + { | |
56 | + ResultUtils.buildParameterErrorResultAndWrite(response, "没有token"); | |
57 | + return; | |
58 | + } | |
40 | 59 | smsService.productChanAmsSms(); |
41 | 60 | writeString(response, "chan ams success"); |
42 | 61 | } |
43 | 62 | |
44 | 63 | @RequestMapping(value = "/productYunAmsSms") |
45 | - public void productYunAmsSms(HttpServletResponse response){ | |
64 | + public void productYunAmsSms(HttpServletResponse response,@RequestParam("token")String token){ | |
65 | + if (!"lyms@2016!000".equals(token)) | |
66 | + { | |
67 | + ResultUtils.buildParameterErrorResultAndWrite(response, "没有token"); | |
68 | + return; | |
69 | + } | |
46 | 70 | smsService.productYunAmsSms(); |
47 | 71 | writeString(response, "yun ams success"); |
48 | 72 | } |
49 | 73 | |
50 | 74 | @RequestMapping(value = "/productChildAmsSms") |
51 | - public void productChildAmsSms(HttpServletResponse response){ | |
75 | + public void productChildAmsSms(HttpServletResponse response,@RequestParam("token")String token){ | |
76 | + if (!"lyms@2016!000".equals(token)) | |
77 | + { | |
78 | + ResultUtils.buildParameterErrorResultAndWrite(response, "没有token"); | |
79 | + return; | |
80 | + } | |
52 | 81 | smsService.productChildAmsSms(); |
53 | 82 | writeString(response, "child ams success"); |
54 | 83 | } |