use of org.mx.dal.entity.OperateLog in project main by JohnPeng739.
the class AbstractOperateLogService method writeLog.
/**
* 写入日志
*
* @param system 系统
* @param module 模块
* @param operateType 操作类型
* @param content 操作内容
* @param accessor 具体化的数据库访问器
* @throws UserInterfaceDalErrorException 操作过程中发生的异常
*/
protected void writeLog(String system, String module, OperateLog.OperateType operateType, String content, GeneralAccessor accessor) throws UserInterfaceDalErrorException {
OperateLog log = EntityFactory.createEntity(OperateLog.class);
log.setSystem(system);
log.setModule(module);
if (operateType != null) {
log.setOperateType(operateType);
}
log.setContent(content);
accessor.save(log);
}
use of org.mx.dal.entity.OperateLog in project main by JohnPeng739.
the class AccountManageResource method logs.
@Path("logs")
@POST
@AuthenticateAround(returnValueClass = PaginationDataVO.class)
public PaginationDataVO<List<OperateLogVO>> logs(Pagination pagination, @Context Request request) {
if (pagination == null) {
pagination = new Pagination();
}
try {
List<OperateLog> logs = accessor.list(pagination, OperateLog.class);
List<OperateLogVO> vos = OperateLogVO.transform(logs);
return new PaginationDataVO(pagination, vos);
} catch (UserInterfaceException ex) {
return new PaginationDataVO<>(ex);
} catch (Exception ex) {
if (logger.isErrorEnabled()) {
logger.error("List logs fail.", ex);
}
return new PaginationDataVO<>(new UserInterfaceSystemErrorException(UserInterfaceSystemErrorException.SystemErrors.SYSTEM_OTHER_FAIL));
}
}
Aggregations