mirror of
https://github.com/dromara/tianai-captcha.git
synced 2026-05-08 22:53:04 +08:00
1.5.0正式版
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package example.readme;
|
||||
|
||||
import cloud.tianai.captcha.application.ImageCaptchaApplication;
|
||||
import cloud.tianai.captcha.application.TACBuilder;
|
||||
import cloud.tianai.captcha.application.vo.CaptchaResponse;
|
||||
import cloud.tianai.captcha.application.vo.ImageCaptchaVO;
|
||||
import cloud.tianai.captcha.resource.common.model.dto.Resource;
|
||||
|
||||
public class TACBuilderTest {
|
||||
|
||||
public static void main(String[] args) {
|
||||
TACBuilder builder = TACBuilder.builder();
|
||||
ImageCaptchaApplication application = builder
|
||||
.addDefaultTemplate()
|
||||
.addResource("SLIDER", new Resource("classpath", "META-INF/cut-image/resource/1.jpg"))
|
||||
.build();
|
||||
CaptchaResponse<ImageCaptchaVO> response = application.generateCaptcha("SLIDER");
|
||||
System.out.println(response);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user