This commit is contained in:
eson 2023-10-16 15:19:25 +08:00
parent 7f88233f28
commit 8af873ac42
4 changed files with 22 additions and 2 deletions

View File

@ -32,7 +32,16 @@ func (m *FsGuestModel) GenerateGuestID(ctx context.Context, AccessSecret uint64)
logx.Error(err)
return err
}
return nil
uinfo := &FsUserInfo{
Module: FsString("module"),
UserId: FsInt64(0),
GuestId: &record.GuestId,
Metadata: FsBytes("{}"),
Ctime: &now,
Utime: &now,
}
return tx.Model(FsUserInfo{}).Create(uinfo).Error
})
if err != nil {

View File

@ -36,6 +36,11 @@ func FsBool(v bool) *bool {
return &v
}
func FsBytes(v string) *[]byte {
bs := []byte(v)
return &bs
}
// SubscriptionStatus 订阅状态
type SubscriptionStatus struct {
NotificationEmail struct {

View File

@ -48,7 +48,6 @@ func FinishRegister(svcCtx *svc.ServiceContext, user *gmodel.FsUser, token *auth
)
if err != nil {
return err
}

View File

@ -10,21 +10,27 @@ info (
import "basic.api"
service auth {
// 登录接口
@handler UserLoginHandler
post /api/auth/login(RequestUserLogin) returns (response);
// 注册
@handler UserRegisterHandler
post /api/auth/register(RequestUserRegister) returns (response);
// 获取cookie, 成为游客
@handler AcceptCookieHandler
post /api/auth/accept-cookie(request) returns (response);
// 谷歌第三方登录
@handler UserGoogleLoginHandler
get /api/auth/oauth2/login/google(RequestGoogleLogin) returns (response);
// 邮箱校验
@handler UserEmailConfirmationHandler
get /api/auth/email/confirmation(RequestEmailConfirmation) returns (response);
// 第三方登录,确认使用邮箱
@handler UserEmailRegisterHandler
post /api/auth/oauth2/register(RequestEmailRegister) returns (response);
@ -40,6 +46,7 @@ service auth {
@handler UserResetPasswordHtmlHandler
get /api/auth/reset/password/html(RequestUserResetHtml) returns (response);
// 用于debug 删除帐号
@handler DebugAuthDeleteHandler
post /api/auth/debug/delete(RequestAuthDelete) returns (response);
}