ws
CI / changes (push) Successful in 1m28s
CI / ad (push) Successful in 0s
CI / admin (push) Successful in 0s
CI / bff (push) Successful in 24s
CI / chore (push) Successful in 0s
CI / equipment (push) Successful in 23s
CI / express (push) Failing after 7s
CI / factory (push) Successful in 0s
CI / message (push) Successful in 0s
CI / order (push) Successful in 0s
CI / payment (push) Successful in 0s
CI / percutaneous (push) Successful in 17s
CI / product (push) Successful in 0s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 0s
CI / support (push) Successful in 0s
CI / task (push) Successful in 0s
CI / user (push) Successful in 0s
CI / wecom (push) Successful in 0s

This commit is contained in:
2026-10-09 11:57:01 +08:00
parent 9260e75aa4
commit efcb717acf
24 changed files with 809 additions and 1082 deletions
@@ -46,7 +46,6 @@ func NewWsAddUserStreamLogic(ctx context.Context, svcCtx *svc.ServiceContext) *W
}
}
// 添加用户
func (l *WsAddUserStreamLogic) WsAddUserStream(stream percutaneous.Percutaneous_WsAddUserStreamServer) error {
ctx := stream.Context()
timeout := time.Duration(utils.GetConfigInt("ws.out_time")) * time.Second
@@ -55,7 +54,6 @@ func (l *WsAddUserStreamLogic) WsAddUserStream(stream percutaneous.Percutaneous_
cancel()
}()
// BFF自动发来第一条消息,读取host_code
recvFrame, err := stream.Recv()
if err != nil {
l.Logger.Errorf("recv host_code failed: %v", err)
@@ -64,7 +62,6 @@ func (l *WsAddUserStreamLogic) WsAddUserStream(stream percutaneous.Percutaneous_
var hostCode struct {
Code string `json:"host_code"`
}
// 保留你确认的 !err 判断
if ok := utils.JsonStringToStruct(string(recvFrame.RawBody), &hostCode); !ok {
return status.Errorf(codes.InvalidArgument, "device code parse error")
}
@@ -102,7 +99,6 @@ func (l *WsAddUserStreamLogic) getUserInfo(id int64) *userInfo {
if id == utils.NumberZero {
return nil
}
logx.Errorf("get user id: %v", id)
cli, err := svc.GetRpcClient(l.svcCtx.UserName)
if err != nil {
logx.Errorf("get user err: %v", err)