Search in sources :

Example 1 with QuerySecondLevelServiceListResponse

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;
}
Also used : SecondLevelService(beans.dbaccess.SecondLevelService) QuerySecondLevelServiceListResponse(beans.response.QuerySecondLevelServiceListResponse) DBUtil(ngse.org.DBUtil) ArrayList(java.util.ArrayList)

Aggregations

SecondLevelService (beans.dbaccess.SecondLevelService)1 QuerySecondLevelServiceListResponse (beans.response.QuerySecondLevelServiceListResponse)1 ArrayList (java.util.ArrayList)1 DBUtil (ngse.org.DBUtil)1