/// <summary> /// 新建文件夹 /// </summary> /// <param name="token">token凭证</param> /// <param name="parentFolderId">父文件夹id</param> /// <param name="folderName">文件夹名称</param> /// <returns>ResultInt:Result=0成功,ResultValue:文件夹编号</returns> public static ResultInt CreateFolder(string token, int parentFolderId, string folderName) { try { var uploadFileApiProvider = new DocumentApiProvider(); var organizationApiProvider = new OrganizationApiProvider(); ResultEDocUserInfo eDocUserInfo = organizationApiProvider.GetUserInfoByToken(token); ResultInt result = uploadFileApiProvider.CreateFolder( token, parentFolderId, folderName, string.Empty, 0, 0, 0, string.Empty, string.Empty, 1, DateTime.Now, DateTime.Now, eDocUserInfo.UserInfo.UserRealName, eDocUserInfo.UserInfo.UserRealName ); if (result.Result != 0) { throw new Exception("CreateFolder出错,result=" + result.Result); } return(result); } catch (Exception ex) { throw new Exception("CreateFolder出现异常,exMessage=" + ex.Message); } }
/// <summary> /// 根据token获取用户信息 /// </summary> /// <returns></returns> public static EDocUserInfo GetUserInfoByToken(string token) { //ResultInt:Result=0成功,ResultValue:文件编号 try { var organizationApiProvider = new OrganizationApiProvider(); ResultEDocUserInfo result = organizationApiProvider.GetUserInfoByToken(token); if (result.Result != 0) { throw new Exception("GetUserInfoByToken出错,result=" + result.Result); } return(result.UserInfo); } catch (Exception ex) { throw new Exception("GetUserInfoByToken出现异常,exMessage=" + ex.Message); } }