problem description
Restful"s api can be used for regular add, delete, modify and other operations, but if my api is to do "statistics" for resources, how should I design such Api?
the environmental background of the problem
currently, I have a resource for reporting alarms, (alert),. I need to count the number of alarms added within a month, the number of alarms of emergency types, and the alarm data of corrective types.
related codes
{
method: "GET",
path: "/api/alert/alertByCategoryMonth",
config: {
tags: ["api", "alert", "category", "day"],
description: " ",
handler: { async: controller.AlertByCategoryMonth },
},
},
result
this weird api / api/alert/alertByCategoryMonth makes me feel completely different from other rest api styles. I wonder if there is a rest api? suitable for this type
.