generated from pkg/go-template
28 lines
618 B
Go
28 lines
618 B
Go
|
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,
|
||
|
}))
|
||
|
}
|