解决冲突

This commit is contained in:
eson 2023-07-27 16:54:57 +08:00
parent d635811b5f
commit 42a965ab39
9 changed files with 35 additions and 41 deletions

5
go.mod
View File

@ -8,11 +8,8 @@ require (
github.com/bwmarrin/snowflake v0.3.0
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/google/uuid v1.3.0
<<<<<<< HEAD
github.com/hashicorp/raft v1.5.0
=======
github.com/gorilla/websocket v1.5.0
>>>>>>> d843fff73d7ba5d4e14a5d86281d5166f04cb303
github.com/hashicorp/raft v1.5.0
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
github.com/stripe/stripe-go/v74 v74.26.0

View File

@ -15,7 +15,7 @@ func UserOrderDeleteHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.UserOrderDeleteReq
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
if err != nil {
return
}

View File

@ -15,7 +15,7 @@ func OrderPaymentIntentHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.OrderPaymentIntentReq
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
if err != nil {
return
}

View File

@ -3,7 +3,9 @@ package svc
import (
"errors"
"fmt"
"fusenapi/fsm"
"fusenapi/server/pay/internal/config"
"fusenapi/utils/autoconfig"
"net/http"
"fusenapi/initalize"
@ -15,16 +17,20 @@ import (
type ServiceContext struct {
Config config.Config
SharedState *fsm.StateCluster
MysqlConn *gorm.DB
AllModels *gmodel.AllModelsGen
}
func NewServiceContext(c config.Config) *ServiceContext {
conn := initalize.InitMysql(c.SourceMysql)
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), autoconfig.AutoGetAllServerConfig(), conn)
return &ServiceContext{
Config: c,
MysqlConn: initalize.InitMysql(c.SourceMysql),
MysqlConn: conn,
SharedState: StateServer,
AllModels: gmodel.NewAllModels(initalize.InitMysql(c.SourceMysql)),
}
}

View File

@ -15,7 +15,7 @@ func GetProductTemplateTagsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc
return func(w http.ResponseWriter, r *http.Request) {
var req types.GetProductTemplateTagsReq
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
if err != nil {
return
}

View File

@ -3,7 +3,9 @@ package svc
import (
"errors"
"fmt"
"fusenapi/fsm"
"fusenapi/server/product-template-tag/internal/config"
"fusenapi/utils/autoconfig"
"net/http"
"fusenapi/initalize"
@ -15,16 +17,20 @@ import (
type ServiceContext struct {
Config config.Config
SharedState *fsm.StateCluster
MysqlConn *gorm.DB
AllModels *gmodel.AllModelsGen
}
func NewServiceContext(c config.Config) *ServiceContext {
conn := initalize.InitMysql(c.SourceMysql)
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), autoconfig.AutoGetAllServerConfig(), conn)
return &ServiceContext{
Config: c,
MysqlConn: initalize.InitMysql(c.SourceMysql),
MysqlConn: conn,
SharedState: StateServer,
AllModels: gmodel.NewAllModels(initalize.InitMysql(c.SourceMysql)),
}
}

View File

@ -12,7 +12,7 @@ import (
func RenderNotifyHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.RenderNotifyReq
_, err := basic.RequestParse(w, r, svcCtx, &req)
_, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
if err != nil {
return
}

View File

@ -3,7 +3,9 @@ package svc
import (
"errors"
"fmt"
"fusenapi/fsm"
"fusenapi/server/websocket/internal/config"
"fusenapi/utils/autoconfig"
"net/http"
"fusenapi/initalize"
@ -15,20 +17,23 @@ import (
type ServiceContext struct {
Config config.Config
SharedState *fsm.StateCluster
MysqlConn *gorm.DB
AllModels *gmodel.AllModelsGen
}
func NewServiceContext(c config.Config) *ServiceContext {
conn := initalize.InitMysql(c.SourceMysql)
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), autoconfig.AutoGetAllServerConfig(), conn)
return &ServiceContext{
Config: c,
MysqlConn: initalize.InitMysql(c.SourceMysql),
MysqlConn: conn,
SharedState: StateServer,
AllModels: gmodel.NewAllModels(initalize.InitMysql(c.SourceMysql)),
}
}
func (svcCtx *ServiceContext) ParseJwtToken(r *http.Request) (jwt.MapClaims, error) {
AuthKey := r.Header.Get("Authorization")
if AuthKey == "" {

View File

@ -13,17 +13,7 @@ service home-user-auth {
// @handler UserRegisterHandler
// post /api/user/register(RequestUserRegister) returns (response);
<<<<<<< HEAD
=======
@handler UserLoginHandler
post /api/user/login(RequestUserLogin) returns (response);
@handler AcceptCookieHandler
post /api/user/accept-cookie(request) returns (response);
>>>>>>> d843fff73d7ba5d4e14a5d86281d5166f04cb303
@handler UserFontsHandler
get /api/user/fonts(request) returns (response);
@ -53,17 +43,7 @@ service home-user-auth {
@handler UserOderDeleteHandler
post /api/user/order-delete(RequestOrderId) returns (response);
<<<<<<< HEAD
=======
@handler UserGoogleLoginHandler
get /api/user/oauth2/login/google(RequestGoogleLogin) returns (response);
@handler UserEmailRegisterHandler
get /api/user/oauth2/login/register(RequestEmailRegister) returns (response);
>>>>>>> d843fff73d7ba5d4e14a5d86281d5166f04cb303
//订单列表
@handler UserOrderListHandler
get /api/user/order-list (UserOrderListReq) returns (response);