use of com.sohu.cache.entity.AppAuditLog in project cachecloud by sohutv.
the class AppAuditLogDaoTest method getAuditByType.
@Test
public void getAuditByType() {
Long appAuditId = 75L;
AppAuditLog appAuditLog = appAuditLogDao.getAuditByType(appAuditId, AppAuditLogTypeEnum.APP_CHECK.value());
logger.info("{}", appAuditLog);
}
use of com.sohu.cache.entity.AppAuditLog in project cachecloud by sohutv.
the class AppDeployCenterImpl method createApp.
@Override
public boolean createApp(AppDesc appDesc, AppUser appUser, String memSize) {
try {
appService.save(appDesc);
// 保存应用和用户的关系
appService.saveAppToUser(appDesc.getAppId(), appDesc.getUserId());
// 更新appKey
long appId = appDesc.getAppId();
appService.updateAppKey(appId);
// 保存应用审批信息
AppAudit appAudit = new AppAudit();
appAudit.setAppId(appId);
appAudit.setUserId(appUser.getId());
appAudit.setUserName(appUser.getName());
appAudit.setModifyTime(new Date());
appAudit.setParam1(memSize);
appAudit.setParam2(appDesc.getTypeDesc());
appAudit.setInfo("类型:" + appDesc.getTypeDesc() + ";初始申请空间:" + memSize);
appAudit.setStatus(AppCheckEnum.APP_WATING_CHECK.value());
appAudit.setType(AppAuditType.APP_AUDIT.getValue());
appAuditDao.insertAppAudit(appAudit);
// 发邮件
appEmailUtil.noticeAppResult(appDesc, appAudit);
// 保存申请日志
AppAuditLog appAuditLog = AppAuditLog.generate(appDesc, appUser, appAudit.getId(), AppAuditLogTypeEnum.APP_DESC_APPLY);
if (appAuditLog != null) {
appAuditLogDao.save(appAuditLog);
}
return true;
} catch (Exception e) {
logger.error(e.getMessage(), e);
return false;
}
}
Aggregations