use of com.ibeiliao.deployment.admin.vo.account.Role in project Corgi by kevinYin.
the class RoleServiceImpl method save.
/**
* 保存角色数据
*
* @param entity
* 角色数据
*/
private void save(Role entity) {
validate(entity);
Role role = getRoleByName(entity.getRoleName());
if (role != null) {
throw new ServiceException(ApiCode.FAILURE, "角色已存在:" + entity.getRoleName());
} else {
RolePO po = VOUtil.from(entity, RolePO.class);
Date now = new Date();
po.setOperator(AdminContext.getAccountId());
po.setCreateTime(now);
po.setLastModify(now);
roleDao.save(po);
}
logger.info("admin#role#save | 更新角色成功 | roleName: {}, operator: {}", entity.getRoleName(), AdminContext.getAccountId());
}
Aggregations