class SysDeptRestApi {

  @PUT
  @Path("/resetParentDept")
  @SubmarineApi
  public Response resetParentDept() {
    LOG.info("resetParentDept()");
    try (SqlSession sqlSession = MyBatisUtil.getSqlSession()) {
      SysDeptMapper sysDeptMapper = sqlSession.getMapper(SysDeptMapper.class);
      sysDeptMapper.resetDeptLevel();
      sqlSession.commit();
    } catch (Exception e) {
      LOG.error(e.getMessage(), e);
      return new JsonResponse.Builder<>(Response.Status.OK)
          .message("Reset department level failed!").success(false).build();
    }

    return new JsonResponse.Builder<>(Response.Status.OK).success(true)
        .message("Reset department level successfully!").build();
  }

  @Inject public  SysDeptRestApi();

}