当前位置: 首页 > 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://www.sadfv.cn/news/237591/

相关文章:

  • cms建站系统免费鞍山人才网站
  • 南宁网站设计方案wordpress 评论分页排序
  • 上海平台网站开发做交通招聘的网站
  • 网站排名优化培训2008服务器网站
  • 国内网站漳州网站建设哪家最正规
  • 网站上传模板后sem推广
  • 做网站用什么软件?网站404页面模板
  • 家具做网站企业网站维护建设项目实践报告
  • 信息技术初二做网站网站开发音乐
  • 南通做网站厉害的公司网页模板下载
  • 扫二维码做自己网站小米路由器3 做网站
  • 泰安做网站公司wordpress添加注册页面
  • 做网站备案须知网站开发类投标文件
  • 免费网站建设免代码推广app赚佣金平台有哪些
  • 黔东网站建设青岛公路建设集团网站
  • 蓬莱网站建设价格广告公司管理系统软件
  • 百度网站建设电话wordpress企业官网主题
  • 网站分哪几种wordpress放音乐播放器
  • 金融网站模板源代码腾讯云服务器网站域名备案
  • 做网站的经验和体会云计算公司排名
  • 网站建设实训经验总结网站空间免费
  • led 网站建设网页代理软件
  • 做网站的哪家比较好南宁网站排名优化电话
  • 网站保持排名柬埔寨网站开发
  • 上海建设网站浦东新区污水管网工程wordpress dux主题5.2
  • 建网站怎么弄中文搜索引擎有哪些
  • 贵港网站营销快速seo优化
  • 黄山网站建设策划wordpress字体插件下载
  • 汉子由来 外国人做的网站珠海企业网站建设公司
  • 关于网站建设的调查问卷北京住房和城乡建设部网站首页