use of beans.response.QuerySecondLevelServiceListResponse in project MSEC by Tencent.
the class QuerySecondLevelServiceList method exec.
public QuerySecondLevelServiceListResponse exec(QuerySecondLevelServiceListRequest request) {
QuerySecondLevelServiceListResponse resp = new QuerySecondLevelServiceListResponse();
String result = checkIdentity();
if (!result.equals("success")) {
resp.setStatus(99);
resp.setMessage(result);
return resp;
}
DBUtil util = new DBUtil();
if (util.getConnection() == null) {
resp.setStatus(100);
resp.setMessage("db connect failed!");
return resp;
}
List<SecondLevelService> serviceList;
String sql = "select first_level_service_name, second_level_service_name from t_second_level_service where type='standard' ";
List<Object> params = new ArrayList<Object>();
try {
serviceList = util.findMoreRefResult(sql, params, SecondLevelService.class);
} catch (Exception e) {
resp.setStatus(100);
resp.setMessage("db query exception!");
e.printStackTrace();
return resp;
} finally {
util.releaseConn();
}
resp.setService_list((ArrayList<SecondLevelService>) serviceList);
resp.setMessage("success");
resp.setStatus(0);
return resp;
}
Aggregations