🏗️ microservice fabric splitting

This commit is contained in:
2024-12-24 00:38:41 +08:00
parent 462e811742
commit 89d64336f5
311 changed files with 18384 additions and 2428 deletions

View File

@@ -0,0 +1,38 @@
package initialize
import (
"github.com/wenlng/go-captcha-assets/resources/images"
"github.com/wenlng/go-captcha-assets/resources/shapes"
"github.com/wenlng/go-captcha/v2/base/option"
"github.com/wenlng/go-captcha/v2/click"
)
// NewClickShapeCaptcha 初始化点击形状验证码
func NewClickShapeCaptcha() click.Captcha {
builder := click.NewBuilder(
click.WithRangeLen(option.RangeVal{Min: 3, Max: 6}),
click.WithRangeVerifyLen(option.RangeVal{Min: 2, Max: 3}),
click.WithRangeThumbBgDistort(1),
click.WithIsThumbNonDeformAbility(true),
)
// shape
// click.WithUseShapeOriginalColor(false) -> Random rewriting of graphic colors
shapeMaps, err := shapes.GetShapes()
if err != nil {
panic(err)
}
// background images
imgs, err := images.GetImages()
if err != nil {
panic(err)
}
// set resources
builder.SetResources(
click.WithShapes(shapeMaps),
click.WithBackgrounds(imgs),
)
return builder.MakeWithShape()
}