我正在尝试弄清楚如何发送 Cognito 登录验证电子邮件:
对于第一个,我发现了这个问题,答案建议使用带有自定义属性的 Lambda 触发器进行语言选择。该解决方案看起来很有希望,我一定会尝试一下。
对于第二个在电子邮件中包含图像的图像,我在电子邮件签名中发现了base64 编码的图像,这表明了两种方式:
<img>标签内的数据 URI 嵌入图像我试过 (1) 并且它适用于 Thunderbird 电子邮件客户端,但不适用于 Gmail。
有没有办法发送带有图像的认知验证电子邮件?
受这篇文章http://mydailyjava.blogspot.com/2022/02/using-byte-buddy-for-proxy-creation.html的启发,我成功拦截了一个方法调用,检查所有方法参数的值,并返回一个模拟回应。
但是,我无法获取参数的实际名称(如源代码中所示)。我只能得到诸如“arg0”之类的名称。
我所做的最大努力是,在方法匹配器中,我可以访问方法的 MethodDescription,并且可以获得参数的 ParameterDescription。
@Override
public DynamicType.Builder<?> apply(DynamicType.Builder<?> builder, TypeDescription typeDescription, ClassFileLocator classFileLocator) {
logger.info("OiiPlugin processing "+typeDescription);
return builder
.method(new ElementMatcher<MethodDescription>() {
@Override
public boolean matches(MethodDescription target) {
boolean isTarget = target.getDeclaredAnnotations().isAnnotationPresent(MockMe.class);
if (isTarget) {
ParameterDescription p = target.getParameters().get(0);
logger.info(
"Parameter 0 NAME:"+p.getActualName()+":"+p.getName()+":"+p.getInternalName());
};
return isTarget;
}
})
.intercept(MethodDelegation.to(
OiiInterceptor.class
));
}
Run Code Online (Sandbox Code Playgroud)
然而,它的 getActualName() 返回空字符串。
[INFO] OiiPlugin processing class com.example.research.oii.client.ExampleClient
[INFO] Parameter 0 NAME::arg0:arg0
Run Code Online (Sandbox Code Playgroud)
我确实通过 maven 插件配置添加了 javac -g:vars 参数,以指示 javac 将参数名称放入 .class 文件中。
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version> …Run Code Online (Sandbox Code Playgroud) 我在 swagger 2.0“定义”部分定义了以下内容。我首先定义了时间戳的格式,我将在许多对象的属性中出于不同目的使用该格式,例如创建的时间戳和上次更新的时间戳。
definitions:
TimeStamp:
title: Timestamp format
description: ISO 8681, "2016-08-18T17:33:00Z"
type: string
pattern: \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z
Application:
title: An application
type: object
properties:
cDtm:
title: Creation timestamp
description: Some description
type: string
pattern:\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z
Run Code Online (Sandbox Code Playgroud)
但是,在定义“Application”对象的“cDtm”属性时,我找不到重用时间戳定义的方法。如果我将“$ref”与“标题”和“描述”一起使用,则会收到警告“不允许与“$ref”一起使用同级值”。如果我不使用“$ref”,我需要重复上面的类型和模式定义。
所以,我的问题是,有没有办法使用 $ref 重用字符串模式定义,但仍然能够为定义的属性提供新的标题和描述?
谢谢!
必应