(ctx context.Context, userId, msgType, body, outType string)
| 77 | } |
| 78 | |
| 79 | func SendServerNotice(ctx context.Context, userId, msgType, body, outType string) error { |
| 80 | apiClient := GetHttpClient(time.Minute * 1) |
| 81 | defer apiClient.CloseIdleConnections() |
| 82 | req := sendNoticeRequest{ |
| 83 | UserID: userId, |
| 84 | Content: struct { |
| 85 | MsgType string `json:"msgtype,omitempty"` |
| 86 | Body string `json:"body,omitempty"` |
| 87 | }(struct { |
| 88 | MsgType string |
| 89 | Body string |
| 90 | }{MsgType: msgType, Body: body}), |
| 91 | Type: outType, |
| 92 | StateKey: "", |
| 93 | } |
| 94 | res := struct { |
| 95 | EventId string `json:"event_id,omitempty"` |
| 96 | }{} |
| 97 | return PostJSONNoSpan(ctx, &apiClient, LocalServerUrl+ServerNoticePath, req, &res) |
| 98 | } |
| 99 | |
| 100 | func SendRoomNotice(ctx context.Context, userId, msgType, body, outType, roomId string) error { |
| 101 | apiClient := GetHttpClient(time.Minute * 1) |
nothing calls this directly
no test coverage detected