backend/app/brahma/api/murder/internal/handler/journey_h.go

28 lines
618 B
Go
Raw Normal View History

2022-01-27 18:30:14 +08:00
package handler
import (
"fmt"
"git.icechen.cn/monorepo/backend/app/brahma/api/murder/internal/error_process"
"git.icechen.cn/monorepo/backend/app/brahma/api/murder/internal/service"
"github.com/gofiber/fiber/v2"
ctxLogger "github.com/luizsuper/ctxLoggers"
"go.uber.org/zap"
)
func GetJourneyH(ctx *fiber.Ctx) error {
journey, err := service.GetJourney(ctx)
if err != nil {
return err
}
if err != nil {
ctxLogger.FError(ctx, error_process.ServiceErr, zap.String("", fmt.Sprintf("%+v", err)))
return ctx.JSON(fail(nil))
}
return ctx.JSON(success(&Data{
Elements: journey,
Total: 64,
}))
}