Search in sources :

Example 1 with AppAuditLog

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);
}
Also used : AppAuditLog(com.sohu.cache.entity.AppAuditLog) BaseTest(com.sohu.test.BaseTest) Test(org.junit.Test)

Example 2 with 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;
    }
}
Also used : AppAuditLog(com.sohu.cache.entity.AppAuditLog) AppAudit(com.sohu.cache.entity.AppAudit) Date(java.util.Date)

Aggregations

AppAuditLog (com.sohu.cache.entity.AppAuditLog)2 AppAudit (com.sohu.cache.entity.AppAudit)1 BaseTest (com.sohu.test.BaseTest)1 Date (java.util.Date)1 Test (org.junit.Test)1