保存为了 websocket
This commit is contained in:
parent
440f13bee8
commit
8c07a5f5d7
1
go.mod
1
go.mod
|
@ -61,6 +61,7 @@ require (
|
|||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
|
||||
github.com/valyala/fastrand v1.1.0 // indirect
|
||||
github.com/valyala/histogram v1.2.0 // indirect
|
||||
github.com/yhat/wsutil v0.0.0-20170731153501-1d66fa95c997 // indirect
|
||||
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 // indirect
|
||||
golang.org/x/crypto v0.11.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691 // indirect
|
||||
|
|
2
go.sum
2
go.sum
|
@ -550,6 +550,8 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:
|
|||
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI=
|
||||
github.com/yhat/wsutil v0.0.0-20170731153501-1d66fa95c997 h1:1+FQ4Ns+UZtUiQ4lP0sTCyKSQ0EXoiwAdHZB0Pd5t9Q=
|
||||
github.com/yhat/wsutil v0.0.0-20170731153501-1d66fa95c997/go.mod h1:DIGbh/f5XMAessMV/uaIik81gkDVjUeQ9ApdaU7wRKE=
|
||||
github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg=
|
||||
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM=
|
||||
github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc=
|
||||
|
|
|
@ -117,11 +117,11 @@ func init() {
|
|||
EmailTasks: make(chan *EmailFormat, 10),
|
||||
Auth: smtp.PlainAuth(
|
||||
"",
|
||||
"user@example.com",
|
||||
"password",
|
||||
"support@fusenpack.com",
|
||||
"Fusenpack2021",
|
||||
"smtp.gmail.com",
|
||||
),
|
||||
FromEmail: "user@example.com",
|
||||
FromEmail: "support@fusenpack.com",
|
||||
emailSending: make(map[string]*EmailTask, 10),
|
||||
ResendTimeLimit: time.Minute * 1,
|
||||
semaphore: make(chan struct{}, 10), // Initialize semaphore with a capacity of 10
|
||||
|
|
|
@ -71,7 +71,7 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma
|
|||
return
|
||||
}
|
||||
|
||||
log.Println(jwtToken)
|
||||
log.Println(jwtToken) // 通过websocket去, 送回通道
|
||||
|
||||
case "facebook":
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ func (l *UserEmailRegisterLogic) UserEmailRegister(req *types.RequestEmailRegist
|
|||
|
||||
// 确认email 重新序列化
|
||||
token.Email = req.Email
|
||||
token.WCId = req.WCId
|
||||
token.WId = req.Wid
|
||||
token.GuestId = req.GuestId
|
||||
|
||||
clurl, err := l.svcCtx.TokenManger.Generate(token)
|
||||
|
|
|
@ -67,7 +67,7 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us
|
|||
ctx := context.WithValue(context.Background(), oauth2.HTTPClient, customClient)
|
||||
|
||||
var googleOauthConfig = &oauth2.Config{
|
||||
RedirectURL: "http://localhost:9900/api/user/oauth2/login/google",
|
||||
RedirectURL: fmt.Sprintf("http://%s/api/user/oauth2/login/google", l.svcCtx.Config.MainAddress),
|
||||
ClientID: l.svcCtx.Config.OAuth.Google.Appid,
|
||||
ClientSecret: l.svcCtx.Config.OAuth.Google.Secret,
|
||||
Scopes: []string{"https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"},
|
||||
|
@ -79,6 +79,7 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us
|
|||
logx.Error(err)
|
||||
resp.SetStatus(basic.CodeApiErr)
|
||||
}
|
||||
|
||||
ses := requests.NewSession()
|
||||
ses.Config().SetProxy("socks5://127.0.0.1:1080") // 代理 为了测试功能
|
||||
|
||||
|
@ -91,7 +92,6 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us
|
|||
log.Println(r.Json())
|
||||
|
||||
googleId := r.Json().Get("id").Int()
|
||||
|
||||
user, err := l.svcCtx.AllModels.FsUser.FindUserByGoogleId(context.TODO(), googleId)
|
||||
if err != nil {
|
||||
if err != gorm.ErrRecordNotFound {
|
||||
|
|
|
@ -23,7 +23,7 @@ type RequestEmailConfirmation struct {
|
|||
|
||||
type RequestEmailRegister struct {
|
||||
Email string `json:"email"`
|
||||
WCId uint64 `json:"wcid"`
|
||||
Wid uint64 `json:"wid"`
|
||||
GuestId uint64 `json:"guest_id"`
|
||||
RegisterToken string `json:"register_token"`
|
||||
}
|
||||
|
|
|
@ -10,56 +10,56 @@ info (
|
|||
import "basic.api"
|
||||
|
||||
service home-user-auth {
|
||||
|
||||
|
||||
// @handler UserRegisterHandler
|
||||
// post /api/user/register(RequestUserRegister) returns (response);
|
||||
|
||||
@handler UserFontsHandler
|
||||
get /api/user/fonts(request) returns (response);
|
||||
|
||||
|
||||
@handler UserGetTypeHandler
|
||||
get /api/user/get-type(request) returns (response);
|
||||
|
||||
|
||||
@handler UserSaveBasicInfoHandler
|
||||
post /api/user/basic-info(RequestBasicInfoForm) returns (response);
|
||||
|
||||
|
||||
@handler UserStatusConfigHandler
|
||||
get /api/user/status-config(request) returns (response);
|
||||
|
||||
|
||||
@handler UserBasicInfoHandler
|
||||
get /api/user/basic-info(request) returns (response);
|
||||
|
||||
|
||||
@handler UserAddressListHandler
|
||||
get /api/user/address-list(request) returns (response);
|
||||
|
||||
|
||||
@handler UserAddAddressHandler
|
||||
post /api/user/add-address(RequestAddAddress) returns (response);
|
||||
|
||||
|
||||
@handler UserContactServiceHandler
|
||||
post /api/user/contact-service (RequestContactService) returns (response);
|
||||
|
||||
|
||||
// @handler UserOderListHandler
|
||||
// get /api/user/order-list(RequestOrderId) returns (response);
|
||||
|
||||
|
||||
@handler UserOderDeleteHandler
|
||||
post /api/user/order-delete(RequestOrderId) returns (response);
|
||||
|
||||
//订单列表
|
||||
@handler UserOrderListHandler
|
||||
get /api/user/order-list (UserOrderListReq) returns (response);
|
||||
|
||||
|
||||
//删除订单
|
||||
@handler UserOrderDeleteHandler
|
||||
get /api/user/order-delete (UserOrderDeleteReq) returns (response);
|
||||
|
||||
|
||||
//取消订单
|
||||
@handler UserOrderCancelHandler
|
||||
get /api/user/order-cancel (UserOrderCancelReq) returns (response);
|
||||
|
||||
|
||||
// 用户logo列表
|
||||
@handler UserLogoListHandler
|
||||
get /api/user/logo-list (UserLogoListReq) returns (response);
|
||||
|
||||
|
||||
// 再来一单
|
||||
@handler UserAgainOrderHandler
|
||||
get /api/user/one-more-order (UserAgainOrderReq) returns (response);
|
||||
|
|
|
@ -16,7 +16,7 @@ type RegisterToken struct {
|
|||
OperateType // 操作的类型, 验证的token 必须要继承这个
|
||||
Id int64 // 注册的 id
|
||||
GuestId uint64 // guest_id 需要继承
|
||||
WCId uint64 // websocket 通道id
|
||||
WId uint64 // websocket 通道id
|
||||
Email string // email
|
||||
Password string // 密码
|
||||
Platform string // 平台
|
||||
|
|
|
@ -11,7 +11,7 @@ func TestGCM(t *testing.T) {
|
|||
token := &auth.RegisterToken{
|
||||
OperateType: auth.OpTypeRegister,
|
||||
Password: "fusen_password",
|
||||
WCId: 123,
|
||||
WId: 123,
|
||||
}
|
||||
|
||||
key := "fusen123321"
|
||||
|
@ -31,7 +31,7 @@ func BenchmarkCRT(b *testing.B) {
|
|||
token := &auth.RegisterToken{
|
||||
OperateType: auth.OpTypeRegister,
|
||||
Password: "fusen_password",
|
||||
WCId: 123,
|
||||
WId: 123,
|
||||
}
|
||||
|
||||
key := "fusen123321"
|
||||
|
@ -52,7 +52,7 @@ func BenchmarkGCM(b *testing.B) {
|
|||
token := &auth.RegisterToken{
|
||||
OperateType: auth.OpTypeRegister,
|
||||
Password: "fusen_password",
|
||||
WCId: 123,
|
||||
WId: 123,
|
||||
}
|
||||
|
||||
key := "fusen123321"
|
||||
|
@ -72,7 +72,7 @@ func TestCRT(t *testing.T) {
|
|||
token := &auth.RegisterToken{
|
||||
OperateType: auth.OpTypeRegister,
|
||||
Password: "fusen_password",
|
||||
WCId: 123,
|
||||
WId: 123,
|
||||
}
|
||||
|
||||
key := "fusen123321"
|
||||
|
|
Loading…
Reference in New Issue
Block a user