use of org.mx.service.rest.vo.PaginationDataVO in project main by JohnPeng739.
the class AccountManageResource method loginHistories.
@Path("loginHistories")
@POST
@AuthenticateAround(returnValueClass = PaginationDataVO.class)
public PaginationDataVO<List<LoginHistoryVO>> loginHistories(Pagination pagination) {
if (pagination == null) {
pagination = new Pagination();
}
try {
List<LoginHistory> histories = accessor.list(pagination, LoginHistory.class);
List<LoginHistoryVO> vos = LoginHistoryVO.transform(histories);
return new PaginationDataVO(pagination, vos);
} catch (UserInterfaceException ex) {
return new PaginationDataVO<>(ex);
} catch (Exception ex) {
if (logger.isErrorEnabled()) {
logger.error("List login histories fail.", ex);
}
return new PaginationDataVO<>(new UserInterfaceSystemErrorException(UserInterfaceSystemErrorException.SystemErrors.SYSTEM_OTHER_FAIL));
}
}
use of org.mx.service.rest.vo.PaginationDataVO in project main by JohnPeng739.
the class AccreditManageResource method accredits.
@Path("accredits")
@POST
@AuthenticateAround(returnValueClass = PaginationDataVO.class)
public PaginationDataVO<List<AccreditVO>> accredits(Pagination pagination) {
if (pagination == null) {
pagination = new Pagination();
}
try {
List<Accredit> accredits = accessor.list(pagination, Accredit.class);
List<AccreditVO> list = AccreditVO.transform(accredits);
return new PaginationDataVO<>(pagination, list);
} catch (UserInterfaceException ex) {
return new PaginationDataVO<>(ex);
} catch (Exception ex) {
if (logger.isErrorEnabled()) {
logger.error("List accredits fail.", ex);
}
return new PaginationDataVO<>(new UserInterfaceSystemErrorException(UserInterfaceSystemErrorException.SystemErrors.SYSTEM_OTHER_FAIL));
}
}
use of org.mx.service.rest.vo.PaginationDataVO in project main by JohnPeng739.
the class DepartmentManageResource method departments.
@Path("departments")
@POST
@AuthenticateAround(returnValueClass = PaginationDataVO.class)
public PaginationDataVO<List<DepartmentVO>> departments(Pagination pagination) {
if (pagination == null) {
pagination = new Pagination();
}
try {
List<Department> departments = accessor.list(pagination, Department.class);
List<DepartmentVO> vos = DepartmentVO.transform(departments);
return new PaginationDataVO<>(pagination, vos);
} catch (UserInterfaceException ex) {
return new PaginationDataVO<>(ex);
} catch (Exception ex) {
if (logger.isErrorEnabled()) {
logger.error("List departments fail.", ex);
}
return new PaginationDataVO<>(new UserInterfaceSystemErrorException(UserInterfaceSystemErrorException.SystemErrors.SYSTEM_OTHER_FAIL));
}
}
use of org.mx.service.rest.vo.PaginationDataVO in project main by JohnPeng739.
the class PrivilegeManageResource method privileges.
@Path("privileges")
@POST
@AuthenticateAround(returnValueClass = PaginationDataVO.class)
public PaginationDataVO<List<PrivilegeVO>> privileges(Pagination pagination) {
if (pagination == null) {
pagination = new Pagination();
}
try {
List<Privilege> privileges = accessor.list(pagination, Privilege.class);
List<PrivilegeVO> vos = PrivilegeVO.transform(privileges);
return new PaginationDataVO<>(pagination, vos);
} catch (UserInterfaceException ex) {
return new PaginationDataVO<>(ex);
} catch (Exception ex) {
if (logger.isErrorEnabled()) {
logger.error("List privileges fail.", ex);
}
return new PaginationDataVO<>(new UserInterfaceSystemErrorException(UserInterfaceSystemErrorException.SystemErrors.SYSTEM_OTHER_FAIL));
}
}
use of org.mx.service.rest.vo.PaginationDataVO in project main by JohnPeng739.
the class RoleManageResource method roles.
@Path("roles")
@POST
@AuthenticateAround(returnValueClass = PaginationDataVO.class)
public PaginationDataVO<List<RoleVO>> roles(Pagination pagination) {
if (pagination == null) {
pagination = new Pagination();
}
try {
List<Role> roles = accessor.list(pagination, Role.class);
List<RoleVO> vos = RoleVO.transform(roles);
return new PaginationDataVO<>(pagination, vos);
} catch (UserInterfaceException ex) {
return new PaginationDataVO<>(ex);
} catch (Exception ex) {
if (logger.isErrorEnabled()) {
logger.error("List roles fail.", ex);
}
return new PaginationDataVO<>(new UserInterfaceSystemErrorException(UserInterfaceSystemErrorException.SystemErrors.SYSTEM_OTHER_FAIL));
}
}
Aggregations