public void CreateTest() { var albumEdit = new AliAlbumEdit(); albumEdit.AlbumAuthority = AliAlbumAuthority.PasswordAlbum; albumEdit.AlbumName = "测试相册20150818-1"; albumEdit.Description = "测试使用"; albumEdit.Password = "******"; var result = AliContext.Static.Album.Create( albumEdit); }
public void EditTest() { var albumEdit = new AliAlbumEdit(); albumEdit.AlbumId = 161232622; albumEdit.AlbumAuthority = AliAlbumAuthority.PasswordAlbum; albumEdit.AlbumName = "测试相册20150818-4"; albumEdit.Description = "测试使用"; albumEdit.Password = "******"; var result = AliContext.Static.Album.Edit( albumEdit); }
/// <summary> /// 修改相册信息功能 /// </summary> /// <param name="aliAlbumEdit">阿里相册编辑实体</param> /// <returns>是否创建成功。取值如下:true-成功;false-失败</returns> public bool Edit(AliAlbumEdit aliAlbumEdit) { if (_context.AccessToken.IsNullOrEmpty()) { throw new AliTokenException("修改相册信息"); } string url = "http://gw.open.1688.com/openapi/param2/1/cn.alibaba.open/ibank.album.modify/{0}".FormatStr(_context.Config.AppKey); var otherParas = _context.GetParas(); otherParas.Add("albumId", aliAlbumEdit.AlbumId + ""); otherParas.Add("name", aliAlbumEdit.AlbumName); otherParas.Add("description", aliAlbumEdit.Description); otherParas.Add("authority", ((int)aliAlbumEdit.AlbumAuthority) + ""); otherParas.Add("password", aliAlbumEdit.Password); _context.Util.AddAliApiUrlSignPara(url, otherParas); var results = _context.Util.Send<AliResult<AliResultList<dynamic>>>(url, otherParas); return results.Result.Success; }
/// <summary> /// 实现创建相册功能 /// </summary> /// <param name="aliAlbumEdit">阿里相册编辑实体</param> /// <returns>是否创建成功。取值如下:true-成功;false-失败</returns> public AliAlbumEditResult Create(AliAlbumEdit aliAlbumEdit) { if (_context.AccessToken.IsNullOrEmpty()) { throw new AliTokenException("创建相册"); } string url = "http://gw.open.1688.com/openapi/param2/1/cn.alibaba.open/ibank.album.create/{0}".FormatStr(_context.Config.AppKey); var otherParas = _context.GetParas(); otherParas.Add("name", aliAlbumEdit.AlbumName); otherParas.Add("description", aliAlbumEdit.Description); otherParas.Add("authority", ((int)aliAlbumEdit.AlbumAuthority) + ""); otherParas.Add("password", aliAlbumEdit.Password); _context.Util.AddAliApiUrlSignPara(url, otherParas); var results = _context.Util.Send<AliResult<AliResultList<AliAlbumEditResult>>>(url, otherParas); if (results.Result.Total > 0) { return results.Result.ToReturn.First(); } return null; }