发布代码生成、更新20+表单组件,优化数据字典,gf版本更新到2.3.1

This commit is contained in:
孟帅
2023-01-18 16:23:39 +08:00
parent 50207ded90
commit 87c27a17a3
386 changed files with 27926 additions and 44297 deletions

View File

@@ -9,13 +9,13 @@ package websocket
import (
"context"
"github.com/gogf/gf/v2/container/garray"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/ghttp"
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/util/guid"
"github.com/gorilla/websocket"
"hotgo/internal/consts"
"hotgo/internal/library/contexts"
"hotgo/internal/library/location"
"hotgo/internal/model"
@@ -164,12 +164,6 @@ func (c *Client) close() {
return
}
c.SendClose = true
//if _, ok := <-c.Send; !ok {
// g.Log().Warningf(ctxManager, "close of closed channel, client.id:%v", c.ID)
//} else {
// // 关闭 chan
// close(c.Send)
//}
c.closeSignal <- struct{}{}
}
@@ -187,7 +181,7 @@ func SendSuccess(client *Client, event string, data ...interface{}) {
client.SendMsg(&WResponse{
Event: event,
Data: d,
Code: consts.CodeOK,
Code: gcode.CodeOK.Code(),
Timestamp: gtime.Now().Unix(),
})
before(client)
@@ -197,7 +191,7 @@ func SendSuccess(client *Client, event string, data ...interface{}) {
func SendError(client *Client, event string, err error) {
client.SendMsg(&WResponse{
Event: event,
Code: consts.CodeNil,
Code: gcode.CodeNil.Code(),
ErrorMsg: err.Error(),
Timestamp: gtime.Now().Unix(),
})

View File

@@ -31,7 +31,7 @@ var (
// Start 启动
func Start(c context.Context) {
ctxManager = c
g.Log().Info(ctxManager, "启动WebSocket")
g.Log().Debug(ctxManager, "start websocket..")
go clientManager.start()
go clientManager.ping()
}

View File

@@ -18,7 +18,7 @@ type WRequest struct {
type WResponse struct {
Event string `json:"event"` // 事件名称
Data interface{} `json:"data,omitempty"` // 数据
Code int64 `json:"code"` // 状态码
Code int `json:"code"` // 状态码
ErrorMsg string `json:"errorMsg,omitempty"` // 错误消息
Timestamp int64 `json:"timestamp"` // 服务器时间
}