add prepare for integrate wirh clickHouse
This commit is contained in:
parent
9b27a9634f
commit
afb47bf87d
@ -68,6 +68,7 @@ type Options struct {
|
||||
KafkaGroup string `env:"KAFKA_GROUP" default:"mailnotifier"`
|
||||
TrashLogHost string `env:"TRASH_LOG_HOST" default:"localhost:7113"`
|
||||
ModuleLogger string `env:"MODULE_LOGGER" default:"core-local"`
|
||||
ClickHouseCred string `env:"CLICK_HOUSE_CRED"`
|
||||
}
|
||||
|
||||
func New(ctx context.Context, opts interface{}, ver appInit.Version) (appInit.CommonApp, error) {
|
||||
|
@ -73,4 +73,5 @@ func (s *Service) Register(app *fiber.App) {
|
||||
app.Post("/statistic/:quizID/general", s.GetGeneralStatistics)
|
||||
app.Post("/statistic/:quizID/questions", s.GetQuestionsStatistics)
|
||||
app.Post("/statistic", s.AllServiceStatistics)
|
||||
app.Get("/statistics/:quizId/pipelines", s.GetPipelinesStatistics)
|
||||
}
|
||||
|
@ -105,3 +105,18 @@ func (s *Service) AllServiceStatistics(ctx *fiber.Ctx) error {
|
||||
|
||||
return ctx.Status(fiber.StatusOK).JSON(allSvcStats)
|
||||
}
|
||||
|
||||
func (s *Service) GetPipelinesStatistics(ctx *fiber.Ctx) error {
|
||||
var req StatisticReq
|
||||
if err := ctx.BodyParser(&req); err != nil {
|
||||
ctx.Status(fiber.StatusBadRequest).SendString("Invalid request data")
|
||||
}
|
||||
|
||||
quizIDStr := ctx.Params("quizID")
|
||||
quizID, err := strconv.ParseInt(quizIDStr, 10, 64)
|
||||
if err != nil {
|
||||
return ctx.Status(fiber.StatusBadRequest).SendString("Invalid quiz ID format")
|
||||
}
|
||||
|
||||
return ctx.Status(fiber.StatusOK).JSON("allSvcStats")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user