fix: update DoubleRotate to match new signature with all parameters
This commit is contained in:
@@ -227,13 +227,21 @@ func (h *CaptchaHandler) DoubleRotate(c *gin.Context) {
|
|||||||
return
|
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 {
|
if err != nil {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(http.StatusOK, model.CaptchaResult{Result: angle})
|
c.JSON(http.StatusOK, model.CaptchaResult{Result: result.Angle})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 图标检测
|
// 图标检测
|
||||||
|
|||||||
@@ -67,8 +67,13 @@ type RotateRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type DoubleRotateRequest struct {
|
type DoubleRotateRequest struct {
|
||||||
InsideBase64 string `json:"inside_base64" binding:"required"`
|
InsideBase64 string `json:"inside_base64" binding:"required"`
|
||||||
OutsideBase64 string `json:"outside_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 {
|
type DetectIconRequest struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user