(c *gin.Context, eid int64, userID int64, conversationIDValue interface{})
| 263 | } |
| 264 | |
| 265 | func handlePlatformConversationID(c *gin.Context, eid int64, userID int64, conversationIDValue interface{}) bool { |
| 266 | conversationID, ok := parsePlatformConversationID(conversationIDValue) |
| 267 | if !ok { |
| 268 | writeConversationNotFound(c) |
| 269 | return false |
| 270 | } |
| 271 | conversation, err := model.GetConversationByIdAndUserId(eid, conversationID, userID) |
| 272 | if err != nil { |
| 273 | writeConversationNotFound(c) |
| 274 | return false |
| 275 | } |
| 276 | c.Set(session.SESSION_CONVERSATION_ID, conversationID) |
| 277 | c.Set(session.SESSION_CONVERSATION, conversation) |
| 278 | return true |
| 279 | } |
| 280 | |
| 281 | func parsePlatformConversationID(conversationIDValue interface{}) (int64, bool) { |
| 282 | switch v := conversationIDValue.(type) { |
no test coverage detected