(ctx *gin.Context)
| 217 | } |
| 218 | |
| 219 | func (i *imlMcpController) ServiceHandleSSE(ctx *gin.Context) { |
| 220 | apikey := ctx.Request.URL.Query().Get("apikey") |
| 221 | serviceId := ctx.Param("serviceId") |
| 222 | if serviceId == "" { |
| 223 | ctx.AbortWithStatusJSON(403, gin.H{"code": -1, "msg": "invalid service id", "success": "fail"}) |
| 224 | return |
| 225 | } |
| 226 | ok, err := i.authorizationModule.CheckAPIKeyAuthorizationByService(ctx, serviceId, apikey) |
| 227 | if err != nil { |
| 228 | ctx.AbortWithStatusJSON(403, gin.H{"code": -1, "msg": err.Error(), "success": "fail"}) |
| 229 | return |
| 230 | } |
| 231 | if !ok { |
| 232 | ctx.AbortWithStatusJSON(403, gin.H{"code": -1, "msg": "invalid apikey", "success": "fail"}) |
| 233 | return |
| 234 | } |
| 235 | |
| 236 | i.handleSSE(ctx, mcp_server.DefaultMCPServer(), SessionInfo{ |
| 237 | Apikey: apikey, |
| 238 | }) |
| 239 | } |
| 240 | |
| 241 | func (i *imlMcpController) ServiceHandleMessage(ctx *gin.Context) { |
| 242 | i.handleMessage(ctx, mcp_server.DefaultMCPServer()) |
nothing calls this directly
no test coverage detected