This commit is contained in:
eson 2023-08-08 14:20:57 +08:00
parent 8bea89754b
commit 0adaa00a4c
13 changed files with 34 additions and 10 deletions

View File

@ -15,7 +15,7 @@ func UserLogoListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.UserLogoListReq
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 OrderRefundHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.OrderRefundReq
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
if err != nil {
return
}

View File

@ -25,7 +25,7 @@ func StripeWebhookHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
var req types.StripeWebhookReq
// 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 UploadCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.UploadCallbackReq
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 UploadFileBaseHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.UploadFileBaseReq
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 UploadFilesBackendHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.UploadFilesReq
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 UploadFilesFrontendHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.UploadFilesReq
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 UploadLogoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.UploadLogoReq
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
if err != nil {
return
}

View File

@ -8,14 +8,16 @@ import (
"fusenapi/utils/auth"
"fusenapi/utils/id_generator"
"fusenapi/utils/websocket_data"
"github.com/gorilla/websocket"
"net/http"
"sync"
"time"
"github.com/gorilla/websocket"
"context"
"fusenapi/server/websocket/internal/svc"
"github.com/zeromicro/go-zero/core/logx"
)

View File

@ -5,6 +5,7 @@ import (
"encoding/json"
"fusenapi/constants"
"fusenapi/utils/websocket_data"
"github.com/zeromicro/go-zero/core/logx"
)

View File

@ -5,6 +5,7 @@ import (
"fusenapi/constants"
"fusenapi/utils/hash"
"fusenapi/utils/websocket_data"
"github.com/zeromicro/go-zero/core/logx"
)

View File

@ -5,6 +5,23 @@ import (
"fusenapi/utils/basic"
)
type RequestToUnity struct {
}
type RequestReadImages struct {
}
type RenderNotifyReq struct {
Sign string `json:"sign"`
Time int64 `json:"time"`
Info NotifyInfo `json:"info"`
}
type NotifyInfo struct {
TaskId string `json:"task_id"` //任务id
Image string `json:"image"`
}
type Request struct {
}
@ -72,4 +89,4 @@ func (resp *Response) SetStatusWithMessage(sr *basic.StatusResponse, msg string,
newResp.Data = data[0]
}
return newResp
}
}

View File

@ -81,6 +81,9 @@ var (
CodeAesCbcEncryptionErr = &StatusResponse{5106, "encryption data err"} // 加密数据失败
CodeAesCbcDecryptionErr = &StatusResponse{5107, "decryption data err"} // 解密数据失败
CodeSharedStateErr = &StatusResponse{5201, "shared state server err"} // 状态机错误
CodeEmailConfirmationErr = &StatusResponse{5202, "email confirmation err"} // email 验证错误
CodeFileUploadErr = &StatusResponse{5110, "file upload err"} // 文件上传失败
CodeFileUploadLogoErr = &StatusResponse{5111, "logo upload err"} // 用户上传LOGO失败
)