Files
iotlcm/admin-svr/server/internal/controller/system/system_v1_captcha.go

18 lines
428 B
Go

package system
import (
"context"
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/system/v1"
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
)
func (c *ControllerV1) GetCaptcha(ctx context.Context, req *v1.GetCaptchaReq) (res *v1.GetCaptchaRes, err error) {
key, image, err := service.SysCaptcha().GenerateCaptcha(ctx)
res = &v1.GetCaptchaRes{
CaptchaID: key,
CaptchaImage: image,
}
return
}