[feat] 调整验证码

This commit is contained in:
what 2024-01-30 16:50:17 +08:00
parent d0a72dfd0b
commit 50f103ab0c
2 changed files with 5 additions and 7 deletions

View File

@ -1,13 +1,7 @@
package contracts
import (
"net/http"
"github.com/samber/do"
)
type Captcha interface {
HttpMiddleware(container *do.Injector) func(next http.Handler) http.Handler
RouteMiddleware
Verify(id int64, answer string, clear bool) error
Generate(captchaUuid, recipient, ip string, u User) (body string, id int64, err error)
}

View File

@ -70,6 +70,10 @@ type Route interface {
MakeRequest(r *http.Request, params map[string]any) (*http.Request, error)
}
type RouteMiddleware interface {
HttpMiddleware(r Route) func(next http.Handler) http.Handler
}
type WsClientGroup string
type WsClientID uint