/** * Function: 根据用户ID,获得圈子相册下拉菜单 * * <p>Produce describe: * * @param userId * @return * @throws DBException * @author: JT 2008-4-22 */ public List getPhotoAlbumList(long userId) throws DBException { // 得到圈子ID long circleId = circleUserBo.getCircleIdByUserId(userId); // 得到圈子相册列表 List list = photoAlbumBo.getPhotoAlbumListByCircleId(circleId); return list; }
/** * Function: 添加一个圈子相册 * * <p>Produce describe: * * @param circleId * @param photoAlbumName * @throws DBException * @throws LogicException * @author: JT 2008-4-22 */ public List addPhotoAlbum(long circleId, String photoAlbumName) throws DBException, LogicException { if (StringUtils.isEmpty(photoAlbumName)) { throw new LogicException("相册名不能为空"); } if (circleId == 0) { throw new LogicException("圈子不存在"); } if (photoAlbumDao.getPhotoAlbumByName(circleId, photoAlbumName) == null) { PhotoAlbum photoAlbumPo = new PhotoAlbum(); // 初始化相册对象 photoAlbumBo.initPhotoAlbum(photoAlbumPo); // 对象_ID photoAlbumPo.setObjectId(circleId); // 对象表名称 photoAlbumPo.setObjectTableName(SystemConstant.KG_CIRCLE_INFO_TABLE_NAME); // 相册名字 photoAlbumPo.setPhotoAlbumName(photoAlbumName); photoAlbumBo.save(photoAlbumPo); List list = photoAlbumBo.getPhotoAlbumListByCircleId(circleId); return list; } else { throw new LogicException("该相册名已存在"); } }