Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
341c105e
authored
Jan 29, 2019
by
Huang Linyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加查询验证码页面模块
parent
d2c18a1a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
125 additions
and
0 deletions
src/main/java/com/ctrip/fun/admin/controller/tools/SendMessageController.java
src/main/java/com/ctrip/fun/admin/service/tools/SendMessageService.java
src/main/resources/properties/service.properties
src/main/webapp/WEB-INF/templates/common/layout.ftl
src/main/webapp/WEB-INF/templates/tools/verifycode/list.ftl
src/main/java/com/ctrip/fun/admin/controller/tools/SendMessageController.java
View file @
341c105e
package
com
.
ctrip
.
fun
.
admin
.
controller
.
tools
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.validation.Valid
;
...
...
@@ -11,6 +13,7 @@ import org.springframework.web.bind.annotation.ModelAttribute;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ctrip.fun.admin.form.PaginationForm
;
import
com.ctrip.fun.admin.form.tools.SmsForm
;
import
com.ctrip.fun.admin.service.tools.SendMessageService
;
...
...
@@ -20,6 +23,8 @@ import com.ctrip.fun.common.vo.basic.SmsBean;
import
com.ctrip.fun.common.vo.basic.SmsQuery
;
import
com.ctrip.fun.common.vo.basic.SmsStatus
;
import
com.ctrip.fun.common.vo.basic.SmsType
;
import
com.ctrip.fun.common.vo.user.UserVerifyCodeBean
;
import
com.ctrip.fun.common.vo.user.VerifyCodeBean
;
@Controller
@RequestMapping
(
"/sendMessage"
)
...
...
@@ -114,4 +119,35 @@ public class SendMessageController {
return
"redirect:queryList"
;
}
/**
* 短信列表
* @param request
* @param dto
* @param model
* @return
*/
@RequestMapping
(
value
=
"/verifycode/list"
,
method
=
RequestMethod
.
GET
)
public
String
verifycodeList
(
HttpServletRequest
request
,
@ModelAttribute
(
"dto"
)
UserVerifyCodeBean
query
,
ModelMap
model
)
{
int
currentPage
=
0
;
int
pageSize
=
20
;
int
total
;
int
pageCount
;
if
(
null
!=
request
.
getParameter
(
"page"
))
{
currentPage
=
Integer
.
parseInt
(
request
.
getParameter
(
"page"
));
}
query
.
setPagerOffset
(
currentPage
*
query
.
getPagerPerPage
());
query
.
setSortField
(
"id"
);
PagedResponseBean
<
UserVerifyCodeBean
>
response
=
sendMessageService
.
queryVerifyCodeList
((
String
)
request
.
getAttribute
(
"userName"
),
query
);
total
=
response
.
getCount
();
pageCount
=
(
0
==
total
%
pageSize
)
?
(
total
/
pageSize
)
:
(
total
/
pageSize
+
1
);
model
.
put
(
"list"
,
response
.
getResult
());
model
.
put
(
"paginationData"
,
new
PaginationForm
(
currentPage
,
pageSize
,
pageCount
,
total
));
return
"tools/verifycode/list"
;
}
}
src/main/java/com/ctrip/fun/admin/service/tools/SendMessageService.java
View file @
341c105e
...
...
@@ -9,13 +9,17 @@ import org.slf4j.LoggerFactory;
import
org.springframework.core.ParameterizedTypeReference
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ctrip.fun.admin.service.BaseService
;
import
com.ctrip.fun.common.vo.PagedResponseBean
;
import
com.ctrip.fun.common.vo.Request
;
import
com.ctrip.fun.common.vo.Response
;
import
com.ctrip.fun.common.vo.basic.SmsBean
;
import
com.ctrip.fun.common.vo.basic.SmsQuery
;
import
com.ctrip.fun.common.vo.user.UserVerifyCodeBean
;
import
com.ctrip.fun.common.vo.user.VerifyCodeBean
;
/**
* 短信列表
...
...
@@ -94,4 +98,25 @@ public class SendMessageService extends BaseService {
return
retKey
;
}
public
PagedResponseBean
<
UserVerifyCodeBean
>
queryVerifyCodeList
(
String
userId
,
UserVerifyCodeBean
query
)
{
String
uri
=
super
.
getServiceUri
(
"uri.message.verifycode.list"
);
Request
<
UserVerifyCodeBean
>
request
=
new
Request
<
UserVerifyCodeBean
>(
userId
,
query
);
PagedResponseBean
<
UserVerifyCodeBean
>
responseBean
=
null
;
HttpEntity
<
Request
<
UserVerifyCodeBean
>>
entity
=
new
HttpEntity
<
Request
<
UserVerifyCodeBean
>>(
request
);
Response
<
PagedResponseBean
<
UserVerifyCodeBean
>>
response
=
super
.
exchange
(
uri
,
HttpMethod
.
POST
,
entity
,
new
ParameterizedTypeReference
<
Response
<
PagedResponseBean
<
UserVerifyCodeBean
>>>()
{
}).
getBody
();
if
(
response
.
getStatus
()
==
0
)
{
responseBean
=
response
.
getBody
();
}
else
{
logger
.
error
(
String
.
format
(
"[获取短信列表] status: %d, msg: %s"
,
response
.
getStatus
(),
response
.
getMessage
()));
responseBean
=
new
PagedResponseBean
<
UserVerifyCodeBean
>(
0
,
new
ArrayList
<
UserVerifyCodeBean
>());
}
return
responseBean
;
}
// public Response<PagedResponseBean<Map<String,Object>>> verifycodeList(@RequestBody Request<UserVerifyCodeQuery> request) {
// public Response<PagedResponseBean<JSONObject>> verifycodeList(@RequestBody Request<UserVerifyCodeQuery> request) {
}
src/main/resources/properties/service.properties
View file @
341c105e
...
...
@@ -288,6 +288,7 @@ uri.Tools.asmCourseList=/fun-golf-service/asmCourseData/queryCourseList
uri.message.queryList
=
/fun-golf-service/message/queryList
uri.message.add
=
/fun-golf-service/message/add
uri.message.addBatch
=
/fun-golf-service/message/addBatch
uri.message.verifycode.list
=
/fun-golf-service/message/verifycode/list
#ad
uri.Advertiser.add
=
/fun-golf-service/advertiser/add
...
...
src/main/webapp/WEB-INF/templates/common/layout.ftl
View file @
341c105e
...
...
@@ -319,6 +319,9 @@ ${pageCss}
<li
<#
if
current =
=
"
sendMessage_call
"
>
class="active"
</
#
if>
>
<a
href=
"/sendMessage/call"
>
快捷拨号
</a>
</li>
<li
<#
if
current =
=
"
sendMessage_verifycode
"
>
class="active"
</
#
if>
>
<a
href=
"/sendMessage/verifycode/list"
>
验证码查询
</a>
</li>
<li
class=
"nav-header"
>
站内信息
</li>
<li
<#
if
current =
=
"
insideSms_create
"
>
class="active"
</
#
if>
>
...
...
src/main/webapp/WEB-INF/templates/tools/verifycode/list.ftl
0 → 100644
View file @
341c105e
<#assign pageJsContent>
</#assign>
<#assign pageCssContent>
<style>
.table th, .table td{ text-align:center;vertical-align:middle;}
.widthShow {
width: 1100px;
}
</style>
</#assign>
<@com.layout title="查询短信" module="tools" current="sendMessage_verifycode" pageCss=pageCssContent pageJs=pageJsContent>
<form class="form-inline search-box widthShow" action="" method="get" autocomplete="off" >
<@com.textInput "dto.phoneOrEmail" "style=\"margin-left: 5px;\"" "手机号"/>
<button type="submit" class="btn btn-primary">查询</button>
<div style="font-color:red">注意: 请勿随意使用客户的验证码!</div>
</form>
<table class="table table-bordered table-striped widthShow">
<thead>
<tr>
<th style="width:8%">id</th>
<th style="width:18%">手机号码</th>
<th style="width:18%">验证码</th>
<th style="width:19%">有效时间</th>
<th style="width:19%">校验时间</th>
<th style="width:10%">验证次数</th>
<th style="width:8%">验证码类型</th>
</tr>
</thead>
<tbody>
<#list list as item>
<tr>
<td>${item.id!}</td>
<td>${item.phoneOrEmail!}</td>
<td>${item.verifyCode!}</td>
<td>
${item.expireTime?string("yyyy-MM-dd HH:mm:ss")}
</td>
<td>
${item.verifyTime?string("yyyy-MM-dd HH:mm:ss")}
</td>
<td>${item.verifyTimes!}</td>
<td>${item.codeType!}</td>
</tr>
</#list>
</tbody>
</table>
<div class="pagination pagination-right widthShow">
<ul>
<@paginator.first />
<@paginator.previous />
<@paginator.numbers separator=""/>
<@paginator.next />
<@paginator.last />
</ul>
<@paginator.statistics />
</div>
</@com.layout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment