Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
Hiven 2023-08-15 14:52:04 +08:00
commit e8f7bda7b2
39 changed files with 27 additions and 54 deletions

View File

@ -12,8 +12,6 @@ const (
WEBSOCKET_REQUEST_RESUME_LAST_CONNECT = "WEBSOCKET_REQUEST_RESUME_LAST_CONNECT"
//请求恢复为上次连接的标识错误
WEBSOCKET_REQUEST_RESUME_LAST_CONNECT_ERR = "WEBSOCKET_REQUEST_RESUME_LAST_CONNECT_ERR"
//请求恢复为上次连接的标识成功
WEBSOCKET_REQUEST_RESUME_LAST_CONNECT_SUCCESS = "WEBSOCKET_REQUEST_RESUME_LAST_CONNECT_SUCCESS"
//渲染前数据组装
WEBSOCKET_RENDER_IMAGE_ASSEMBLE = "WEBSOCKET_RENDER_IMAGE_ASSEMBLE"
//图片渲染

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/utils/auth"
@ -23,7 +22,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {
}))
defer server.Stop()

View File

@ -1,6 +1,7 @@
Name: assistant
Host: 0.0.0.0
Port: 9950
Timeout: 15000 #服务超时时间
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth:
AccessSecret: fusen2023

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/server/backend/internal/config"
"fusenapi/server/backend/internal/handler"
@ -22,7 +21,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {

View File

@ -1,6 +1,7 @@
Name: backend
Host: 0.0.0.0
Port: 9901
Timeout: 15000 #服务超时时间
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth:
AccessSecret: fusen_backend_2023

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/utils/auth"
@ -23,7 +22,7 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {
}))
defer server.Stop()

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/server/canteen/internal/config"
"fusenapi/server/canteen/internal/handler"
@ -23,8 +22,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {

View File

@ -1,6 +1,7 @@
Name: canteen
Host: 0.0.0.0
Port: 9902
Timeout: 15000 #服务超时时间
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth:
AccessSecret: fusen2023

View File

@ -8,7 +8,6 @@ import (
svc2 "fusenapi/server/data-transfer/internal/svc"
"fusenapi/utils/auth"
"net/http"
"time"
"github.com/zeromicro/go-zero/core/conf"
"github.com/zeromicro/go-zero/rest"
@ -21,7 +20,6 @@ func main() {
var c config2.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {

View File

@ -1,6 +1,7 @@
Name: data-transfer
Host: 0.0.0.0
Port: 9903
Timeout: 15000 #服务超时时间
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth:
AccessSecret: fusen2023

View File

@ -1,6 +1,7 @@
Name: home-user-auth
Host: 0.0.0.0
Port: 9904
Timeout: 15000 #服务超时时间
MainAddress: "http://localhost:9900"
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/server/home-user-auth/internal/config"
"fusenapi/server/home-user-auth/internal/handler"
@ -23,7 +22,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {

View File

@ -1,7 +1,7 @@
Name: inventory
Host: 0.0.0.0
Port: 9905
Timeout: 15000 #服务超时时间
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth:
AccessSecret: fusen2023

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/server/inventory/internal/config"
"fusenapi/server/inventory/internal/handler"
@ -22,7 +21,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {

View File

@ -1,6 +1,7 @@
Name: map-library
Host: 0.0.0.0
Port: 9906
Timeout: 15000 #服务超时时间
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth:
AccessSecret: fusen2023

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/server/map-library/internal/config"
"fusenapi/server/map-library/internal/handler"
@ -22,7 +21,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {

View File

@ -1,6 +1,7 @@
Name: orders
Host: 0.0.0.0
Port: 9907
Timeout: 15000 #服务超时时间
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth:
AccessSecret: fusen2023

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/server/orders/internal/config"
"fusenapi/server/orders/internal/handler"
@ -22,7 +21,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {

View File

@ -1,6 +1,7 @@
Name: pay
Host: 0.0.0.0
Port: 9915
Timeout: 15000 #服务超时时间
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth:
AccessSecret: fusen2023

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/utils/auth"
@ -23,7 +22,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {
}))
defer server.Stop()

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/server/product-model/internal/config"
"fusenapi/server/product-model/internal/handler"
@ -22,7 +21,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {

View File

@ -1,6 +1,7 @@
Name: product-template-tag
Host: 0.0.0.0
Port: 9917
Timeout: 15000 #服务超时时间
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth:
AccessSecret: fusen2023

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/utils/auth"
@ -23,7 +22,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {
}))
defer server.Stop()

View File

@ -1,6 +1,7 @@
Name: product-template
Host: 0.0.0.0
Port: 9910
Timeout: 15000 #服务超时时间
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth:
AccessSecret: fusen2023

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/server/product-template/internal/config"
"fusenapi/server/product-template/internal/handler"
@ -22,7 +21,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {

View File

@ -1,6 +1,7 @@
Name: product
Host: 0.0.0.0
Port: 9908
Timeout: 15000 #服务超时时间
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth:
AccessSecret: fusen2023

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/server/product/internal/config"
"fusenapi/server/product/internal/handler"
@ -22,7 +21,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {

View File

@ -1,6 +1,7 @@
Name: render
Host: 0.0.0.0
Port: 9919
Timeout: 15000 #服务超时时间
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth:
AccessSecret: fusen2023

View File

@ -7,7 +7,6 @@ import (
"fusenapi/constants"
"fusenapi/server/render/consumer"
"net/http"
"time"
"fusenapi/utils/auth"
@ -26,7 +25,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {
}))
defer server.Stop()

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/utils/auth"
@ -23,7 +22,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {
}))
defer server.Stop()

View File

@ -1,6 +1,7 @@
Name: shopping-cart-confirmation
Host: 0.0.0.0
Port: 9911
Timeout: 15000 #服务超时时间
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth:
AccessSecret: fusen2023

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/server/shopping-cart-confirmation/internal/config"
"fusenapi/server/shopping-cart-confirmation/internal/handler"
@ -22,7 +21,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {

View File

@ -1,6 +1,7 @@
Name: upload
Host: 0.0.0.0
Port: 9912
Timeout: 15000 #服务超时时间
SourceMysql: "fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest"
Env: "test"
Auth:

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/server/upload/internal/config"
"fusenapi/server/upload/internal/handler"
@ -22,7 +21,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {

View File

@ -1,6 +1,7 @@
Name: webset
Host: 0.0.0.0
Port: 9913
Timeout: 15000 #服务超时时间
SourceMysql: "fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest"
Auth:
AccessSecret: fusen2023

View File

@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"net/http"
"time"
"fusenapi/server/webset/internal/config"
"fusenapi/server/webset/internal/handler"
@ -22,7 +21,6 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {

View File

@ -59,7 +59,6 @@ func (w *wsConnectItem) renderImage(data []byte) {
renderImageData.RenderData.Logo = "https://s3.us-west-1.amazonaws.com/storage.fusenpack.com/f5ccd11365099fa47a6316b1cd639f6dd6064dcd2d37c8d2fcd0a322160b33cc"
} else {
renderImageData.RenderData.Logo = *userMaterial.ResourceUrl
renderImageData.RenderData.UserMaterialId = userMaterial.Id
}
//用户id赋值
renderImageData.RenderData.UserId = w.userId

View File

@ -21,7 +21,7 @@ func (w *wsConnectItem) resumeLateConnect(data []byte) {
}
//重新绑定
w.uniqueId = clientId
rsp := w.respondDataFormat(constants.WEBSOCKET_REQUEST_RESUME_LAST_CONNECT_SUCCESS, clientId)
rsp := w.respondDataFormat(constants.WEBSOCKET_CONNECT_SUCCESS, clientId)
w.sendToOutChan(rsp)
return
}

View File

@ -12,16 +12,15 @@ type RenderImageReqMsg struct {
RenderData RenderData `json:"render_data"`
}
type RenderData struct {
TemplateTag string `json:"template_tag"` //模板标签
ProductId int64 `json:"product_id"` //产品id
UserMaterialId int64 `json:"user_material_id"` //用户素材id
Logo string `json:"logo"` //log资源地址(websocket连接建立再赋值)
Website string `json:"website"` //网站
Slogan string `json:"slogan"` //slogan
Address string `json:"address"` //地址
Phone string `json:"phone"` //电话
UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值)
GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值)
TemplateTag string `json:"template_tag"` //模板标签(必须)
ProductId int64 `json:"product_id"` //产品id(必须)
Website string `json:"website"` //网站(可选)
Slogan string `json:"slogan"` //slogan(可选)
Address string `json:"address"` //地址(可选)
Phone string `json:"phone"` //电话(可选)
UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值)
GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值)
Logo string `json:"logo"` //log资源地址(websocket连接建立再赋值)
}
// websocket发送渲染完的数据