当前位置: 首页 > news >正文

网站建设与维护ppt建模e-r跟做网站有什么关系

网站建设与维护ppt,建模e-r跟做网站有什么关系,集团公司网站改版方案,佛山网站建设方案服务一、背景说明 在已有的项目中#xff0c;已经获取到了Graph的AccessToken并保存在内存里面。所以不希望再通过client secret或者certificate去创建GraphServiceClient对象。希望使用现有的token字符串来创建初始化创建GraphServiceClient从而来实现Graph其他API功能。 二、具…一、背景说明 在已有的项目中已经获取到了Graph的AccessToken并保存在内存里面。所以不希望再通过client secret或者certificate去创建GraphServiceClient对象。希望使用现有的token字符串来创建初始化创建GraphServiceClient从而来实现Graph其他API功能。 二、具体实现 2.1 需要Java Graph SDK依赖 加入到pom.xml文件内 !-- Microsoft Graph SDK for Java --dependencygroupIdcom.microsoft.graph/groupIdartifactIdmicrosoft-graph/artifactIdversion[5.0,)/version/dependency!-- Azure AD Authentication SDK for Java --dependencygroupIdcom.azure/groupIdartifactIdazure-identity/artifactIdversion[1.3,)/version/dependency 2.2 代码片段 public static GraphServiceClient initGraphServiceClient() {IAuthenticationProvider authProvider new IAuthenticationProvider() {Overridepublic CompletableFutureString getAuthorizationTokenAsync(URL requestUrl) {CompletableFutureString future new CompletableFuture();future.complete(Your_AccessToken);return future;}};return GraphServiceClient.builder().authenticationProvider(authProvider).buildClient();} 三、测试 下面代码是实现调用创建GraphServiceClient调用graph api发送带附件的邮件。 public static String sendMail() {try {String mfrom xxxxoutlook.com;String to xxxxoutlook.com;GraphServiceClientRequest graphClient initGraphServiceClient();Message message new Message();message.subject Meet for lunch?;ItemBody body new ItemBody();body.contentType BodyType.TEXT;body.content The new cafeteria is open.;message.body body;LinkedListRecipient toRecipientsList new LinkedListRecipient();Recipient toRecipients new Recipient();EmailAddress emailAddress new EmailAddress();emailAddress.address to;toRecipients.emailAddress emailAddress;toRecipientsList.add(toRecipients);message.toRecipients toRecipientsList;// 构建附件LinkedListAttachment attachmentsList new LinkedListAttachment();FileAttachment attachments new FileAttachment();attachments.name hello word.txt;attachments.oDataType #microsoft.graph.fileAttachment;attachments.contentType text/plain;attachments.contentBytes Base64.getDecoder().decode(SGVsbG8gV29ybGQh);attachmentsList.add(attachments);AttachmentCollectionResponse attachmentCollectionResponse new AttachmentCollectionResponse();attachmentCollectionResponse.value attachmentsList;AttachmentCollectionPage attachmentCollectionPage new AttachmentCollectionPage(attachmentCollectionResponse, null);message.attachments attachmentCollectionPage;// 以指定用户邮箱发送邮件graphClient.users(mfrom).sendMail(UserSendMailParameterSet.newBuilder().withMessage(message).withSaveToSentItems(true).build()).buildRequest().post();log.info(send email success);return success;} catch (Exception e) {e.printStackTrace();log.error(send email error : {}, e.getMessage());return e.getMessage();}}
http://wiki.neutronadmin.com/news/237591/

相关文章:

  • 学企业网站开发如何做视频购物网站
  • 绵阳市建设工程信息网站wordpress做站群
  • 响应式网站模板分享wordpress免费模板下载
  • 网站背景图片素材wordpress 主机
  • 网站服务器租用开票应该做网站要用到哪些架包
  • 南通网站定制公司wordpress侧边导航栏
  • 网站建设与推广实训小结中英文双语网站站点
  • 西安微官网自助建站公司网页美工设计什么
  • 流行网站开发工具海南省住房和城乡建设厅网站首页
  • 保定网站建设公司哪家好万户网络做网站如何
  • 网站建设是什么岗位去韩国用什么地图导航
  • 网站建设 公司排名网站建设怎么添加视频
  • 如何做网站报价长春网站建设哪家好
  • 海北网站建设wordpress去除标签层级
  • 建网站需要哪些条件哈尔滨企业做网站
  • 相对于网站根目录的的绝对路径域名到期 网站打不开
  • 网站留言发送到qq邮箱自己做网站地址
  • 安徽华夏网站建设下载的字体如何安装到wordpress
  • 怎么查询网站是谁做的自己建设一个网站
  • 怎么做浏览网站的小程序购物网站后台订单处理流程
  • 深圳坪山站网页小游戏推荐知乎
  • 网站推广怎么推广建设网站应该加什么服务
  • 银川网站推广方式内江网站制作
  • php+mysql 网站建设杭州seo工作室
  • 设计网站案例网站被窝家装公司
  • wordpress 会议网站wordpress 留言板制作
  • 企业网站的建立视频免费外链网站
  • gta5购买房产网站正在建设求一外国h网站
  • 进腾讯做游戏视频网站深圳刚刚突然宣布
  • 简单网站建设哪家便宜给点没封的网址好人一生平安