Nuke all storage computation
Doesn't fucking work
This commit is contained in:
@@ -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)
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user