diff --git a/internal/handler/captcha.go b/internal/handler/captcha.go index 9bf58f5..76e2deb 100644 --- a/internal/handler/captcha.go +++ b/internal/handler/captcha.go @@ -227,13 +227,21 @@ func (h *CaptchaHandler) DoubleRotate(c *gin.Context) { return } - angle, err := h.handler.DoubleRotate(req.InsideBase64, req.OutsideBase64) + result, err := h.handler.DoubleRotate( + req.InsideBase64, + req.OutsideBase64, + req.CheckPixel, + req.SpeedRatio, + req.Grayscale, + req.Anticlockwise, + req.CutPixelValue, + ) if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) return } - c.JSON(http.StatusOK, model.CaptchaResult{Result: angle}) + c.JSON(http.StatusOK, model.CaptchaResult{Result: result.Angle}) } // 图标检测 diff --git a/internal/model/models.go b/internal/model/models.go index 34c2017..74c11cf 100644 --- a/internal/model/models.go +++ b/internal/model/models.go @@ -67,8 +67,13 @@ type RotateRequest struct { } type DoubleRotateRequest struct { - InsideBase64 string `json:"inside_base64" binding:"required"` - OutsideBase64 string `json:"outside_base64" binding:"required"` + InsideBase64 string `json:"inside_base64" binding:"required"` + OutsideBase64 string `json:"outside_base64" binding:"required"` + CheckPixel int `json:"check_pixel"` // 检查像素,默认0 + SpeedRatio float64 `json:"speed_ratio"` // 速度比例,默认0 + Grayscale bool `json:"grayscale"` // 灰度处理 + Anticlockwise bool `json:"anticlockwise"` // 逆时针旋转 + CutPixelValue int `json:"cut_pixel_value"` // 割像素值,默认0 } type DetectIconRequest struct {