Files
kami_backend/internal/controller/common/common_v1_get_captcha.go
2023-11-15 14:31:37 +08:00

26 lines
422 B
Go

package common
import (
"context"
"kami/internal/service"
"kami/api/common/v1"
)
func (c *ControllerV1) GetCaptcha(ctx context.Context, req *v1.GetCaptchaReq) (res *v1.GetCaptchaRes, err error) {
var (
idKeyC, base64stringC string
)
idKeyC, base64stringC, err = service.Captcha().GetVerifyImgString(ctx)
if err != nil {
return
}
res = &v1.GetCaptchaRes{
Key: idKeyC,
Img: base64stringC,
}
return
}