fix
This commit is contained in:
parent
36aad6a088
commit
88a59bbdea
|
@ -7,6 +7,7 @@ import (
|
||||||
// fs_pay 支付记录
|
// fs_pay 支付记录
|
||||||
type FsPay struct {
|
type FsPay struct {
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||||||
|
PayNo *string `gorm:"default:'';" json:"pay_no"` // 支付编号
|
||||||
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户id
|
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户id
|
||||||
OrderNumber *string `gorm:"default:'';" json:"order_number"` // 订单编号
|
OrderNumber *string `gorm:"default:'';" json:"order_number"` // 订单编号
|
||||||
TradeNo *string `gorm:"index;default:'';" json:"trade_no"` // 第三方支付编号
|
TradeNo *string `gorm:"index;default:'';" json:"trade_no"` // 第三方支付编号
|
||||||
|
|
26
model/gmodel/fs_resources_gen.go
Normal file
26
model/gmodel/fs_resources_gen.go
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// fs_resources 资源表
|
||||||
|
type FsResources struct {
|
||||||
|
ResourceId string `gorm:"primary_key;default:'';" json:"resource_id"` // 资源 ID
|
||||||
|
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户 ID
|
||||||
|
GuestId *int64 `gorm:"index;default:0;" json:"guest_id"` // 访客 ID
|
||||||
|
ResourceType *string `gorm:"index;default:'';" json:"resource_type"` // 资源类型
|
||||||
|
ResourceUrl *string `gorm:"default:'';" json:"resource_url"` // 资源 URL
|
||||||
|
UploadedAt *time.Time `gorm:"index;default:'0000-00-00 00:00:00';" json:"uploaded_at"` // 上传时间
|
||||||
|
Metadata *string `gorm:"default:'';" json:"metadata"` // 元数据,json格式,存储图像分率
|
||||||
|
MetaKey1 *string `gorm:"index;default:'';" json:"meta_key1"` // 需要关键信息查询的自定义属性1,可以动态增加
|
||||||
|
}
|
||||||
|
type FsResourcesModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFsResourcesModel(db *gorm.DB) *FsResourcesModel {
|
||||||
|
return &FsResourcesModel{db: db, name: "fs_resources"}
|
||||||
|
}
|
2
model/gmodel/fs_resources_logic.go
Normal file
2
model/gmodel/fs_resources_logic.go
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
package gmodel
|
||||||
|
// TODO: 使用model的属性做你想做的
|
|
@ -79,6 +79,7 @@ type AllModelsGen struct {
|
||||||
FsQuotationRemarkTemplate *FsQuotationRemarkTemplateModel // fs_quotation_remark_template 报价单备注模板
|
FsQuotationRemarkTemplate *FsQuotationRemarkTemplateModel // fs_quotation_remark_template 报价单备注模板
|
||||||
FsQuotationSaler *FsQuotationSalerModel // fs_quotation_saler 报价单业务员表
|
FsQuotationSaler *FsQuotationSalerModel // fs_quotation_saler 报价单业务员表
|
||||||
FsRefundReason *FsRefundReasonModel // fs_refund_reason
|
FsRefundReason *FsRefundReasonModel // fs_refund_reason
|
||||||
|
FsResources *FsResourcesModel // fs_resources 资源表
|
||||||
FsStandardLogo *FsStandardLogoModel // fs_standard_logo 标准logo
|
FsStandardLogo *FsStandardLogoModel // fs_standard_logo 标准logo
|
||||||
FsTags *FsTagsModel // fs_tags 产品分类表
|
FsTags *FsTagsModel // fs_tags 产品分类表
|
||||||
FsToolLogs *FsToolLogsModel // fs_tool_logs 3d设计工具日志表
|
FsToolLogs *FsToolLogsModel // fs_tool_logs 3d设计工具日志表
|
||||||
|
@ -169,6 +170,7 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen {
|
||||||
FsQuotationRemarkTemplate: NewFsQuotationRemarkTemplateModel(gdb),
|
FsQuotationRemarkTemplate: NewFsQuotationRemarkTemplateModel(gdb),
|
||||||
FsQuotationSaler: NewFsQuotationSalerModel(gdb),
|
FsQuotationSaler: NewFsQuotationSalerModel(gdb),
|
||||||
FsRefundReason: NewFsRefundReasonModel(gdb),
|
FsRefundReason: NewFsRefundReasonModel(gdb),
|
||||||
|
FsResources: NewFsResourcesModel(gdb),
|
||||||
FsStandardLogo: NewFsStandardLogoModel(gdb),
|
FsStandardLogo: NewFsStandardLogoModel(gdb),
|
||||||
FsTags: NewFsTagsModel(gdb),
|
FsTags: NewFsTagsModel(gdb),
|
||||||
FsToolLogs: NewFsToolLogsModel(gdb),
|
FsToolLogs: NewFsToolLogsModel(gdb),
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
package logic
|
package logic
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"fusenapi/constants"
|
"fusenapi/constants"
|
||||||
"fusenapi/server/websocket/internal/types"
|
"fusenapi/server/websocket/internal/types"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
"net/http"
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
@ -32,12 +34,24 @@ func NewDataTransferLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Data
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
//升级
|
buffPool = sync.Pool{
|
||||||
|
New: func() interface{} {
|
||||||
|
return bytes.Buffer{}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
//升级websocket
|
||||||
upgrade = websocket.Upgrader{
|
upgrade = websocket.Upgrader{
|
||||||
|
//握手超时时间15s
|
||||||
|
HandshakeTimeout: time.Second * 15,
|
||||||
//允许跨域
|
//允许跨域
|
||||||
CheckOrigin: func(r *http.Request) bool {
|
CheckOrigin: func(r *http.Request) bool {
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
Error: func(w http.ResponseWriter, r *http.Request, status int, reason error) {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, reason)
|
||||||
|
return
|
||||||
|
},
|
||||||
|
WriteBufferPool: &buffPool,
|
||||||
}
|
}
|
||||||
//连接map池
|
//连接map池
|
||||||
mapConnPool = sync.Map{}
|
mapConnPool = sync.Map{}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user