|
@@ -1,9 +1,7 @@
|
|
|
package com.nokia.sms.service;
|
|
|
|
|
|
-import com.nokia.common.http.R;
|
|
|
import com.nokia.sms.vo.QueryResp;
|
|
|
import com.nokia.sms.vo.RequestParams;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.dao.EmptyResultDataAccessException;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -12,7 +10,6 @@ import org.springframework.util.CollectionUtils;
|
|
|
import java.util.Collections;
|
|
|
import java.util.Map;
|
|
|
|
|
|
-@Slf4j
|
|
|
@Service
|
|
|
public class QueryService {
|
|
|
private final JdbcTemplate jdbcTemplate;
|
|
@@ -21,7 +18,7 @@ public class QueryService {
|
|
|
this.jdbcTemplate = jdbcTemplate;
|
|
|
}
|
|
|
|
|
|
- public R query(RequestParams params) {
|
|
|
+ public QueryResp query(RequestParams params) {
|
|
|
Map<String, Object> current = getBlackListInfo(params.getPhone());
|
|
|
QueryResp r = new QueryResp();
|
|
|
r.setQuerySuccess(false);
|
|
@@ -30,12 +27,12 @@ public class QueryService {
|
|
|
jdbcTemplate.queryForMap(sql, params.getPhone());
|
|
|
} catch (EmptyResultDataAccessException e) {
|
|
|
r.setQueryMessage("无加黑记录");
|
|
|
- return R.ok().data(r);
|
|
|
+ return r;
|
|
|
}
|
|
|
|
|
|
if (CollectionUtils.isEmpty(current)) {
|
|
|
r.setQueryMessage("曾在黑名单,已解黑");
|
|
|
- return R.ok().data(r);
|
|
|
+ return r;
|
|
|
}
|
|
|
|
|
|
QueryResp.QueryResultDTO dto = new QueryResp.QueryResultDTO();
|
|
@@ -47,7 +44,7 @@ public class QueryService {
|
|
|
r.setQuerySuccess(true);
|
|
|
r.setQueryMessage("当前在黑名单");
|
|
|
r.setQueryResult(dto);
|
|
|
- return R.ok().data(r);
|
|
|
+ return r;
|
|
|
}
|
|
|
|
|
|
/**
|