Nuke all storage computation

Doesn't fucking work
This commit is contained in:
2025-10-11 11:05:06 +02:00
parent 77287c6361
commit a36ce8ff78
4 changed files with 229 additions and 200 deletions

View File

@@ -50,7 +50,7 @@ func (rh *RouteHandler) SetupRoutes(r *router.Router) {
// New endpoints
r.GET("/extractors/{characterName}", rh.handleGetExtractors)
r.GET("/storage/{characterName}", rh.handleGetStorage)
// r.GET("/storage/{characterName}", rh.handleGetStorage)
}
// handleRoot handles the root endpoint
@@ -266,30 +266,30 @@ func (rh *RouteHandler) handleGetExtractors(ctx *fasthttp.RequestCtx) {
}
// handleGetStorage returns storage information for a character
func (rh *RouteHandler) handleGetStorage(ctx *fasthttp.RequestCtx) {
characterName := ctx.UserValue("characterName").(string)
logger.Info("Getting storage for character: %s", characterName)
// func (rh *RouteHandler) handleGetStorage(ctx *fasthttp.RequestCtx) {
// characterName := ctx.UserValue("characterName").(string)
// logger.Info("Getting storage for character: %s", characterName)
// Get character info
char, err := rh.SSO.GetCharacter(context.Background(), characterName)
if err != nil {
logger.Error("Failed to get character %s: %v", characterName, err)
ctx.SetStatusCode(fasthttp.StatusInternalServerError)
ctx.SetBodyString("Failed to get character")
return
}
// // Get character info
// char, err := rh.SSO.GetCharacter(context.Background(), characterName)
// if err != nil {
// logger.Error("Failed to get character %s: %v", characterName, err)
// ctx.SetStatusCode(fasthttp.StatusInternalServerError)
// ctx.SetBodyString("Failed to get character")
// return
// }
// Get storage using the standalone function
storage, err := GetStorageForCharacter(rh.ESI, int(char.ID), char.AccessToken)
if err != nil {
logger.Error("Failed to get storage for character %s: %v", characterName, err)
ctx.SetStatusCode(fasthttp.StatusInternalServerError)
ctx.SetBodyString("Failed to get storage")
return
}
// // Get storage using the standalone function
// storage, err := GetStorageForCharacter(rh.ESI, int(char.ID), char.AccessToken)
// if err != nil {
// logger.Error("Failed to get storage for character %s: %v", characterName, err)
// ctx.SetStatusCode(fasthttp.StatusInternalServerError)
// ctx.SetBodyString("Failed to get storage")
// return
// }
// Return storage as JSON
ctx.SetContentType("application/json")
ctx.SetStatusCode(fasthttp.StatusOK)
json.NewEncoder(ctx).Encode(storage)
}
// // Return storage as JSON
// ctx.SetContentType("application/json")
// ctx.SetStatusCode(fasthttp.StatusOK)
// json.NewEncoder(ctx).Encode(storage)
// }