(ctx *gin.Context)
| 52 | } |
| 53 | |
| 54 | func (i *imlMcpController) AppHandleSSE(ctx *gin.Context) { |
| 55 | apikey := ctx.Request.URL.Query().Get("apikey") |
| 56 | appId := ctx.Param("app") |
| 57 | if appId == "" { |
| 58 | ctx.AbortWithStatusJSON(403, gin.H{"code": -1, "msg": "invalid app id", "success": "fail"}) |
| 59 | return |
| 60 | } |
| 61 | ok, err := i.authorizationModule.CheckAPIKeyAuthorizationByApp(ctx, appId, apikey) |
| 62 | if err != nil { |
| 63 | ctx.AbortWithStatusJSON(403, gin.H{"code": -1, "msg": err.Error(), "success": "fail"}) |
| 64 | return |
| 65 | } |
| 66 | if !ok { |
| 67 | ctx.AbortWithStatusJSON(403, gin.H{"code": -1, "msg": "invalid apikey", "success": "fail"}) |
| 68 | return |
| 69 | } |
| 70 | |
| 71 | ctx.Request.URL.Path = fmt.Sprintf("/openapi/v1/%s/sse", mcp_server.GlobalBasePath) |
| 72 | i.handleSSE(ctx, i.openSseServer, SessionInfo{ |
| 73 | Apikey: apikey, |
| 74 | App: appId, |
| 75 | }) |
| 76 | } |
| 77 | |
| 78 | func (i *imlMcpController) AppHandleMessage(ctx *gin.Context) { |
| 79 | appId := ctx.Param("app") |
nothing calls this directly
no test coverage detected