mirror of
https://github.com/hay-kot/homebox.git
synced 2024-11-17 06:08:42 +00:00
29 lines
733 B
Go
29 lines
733 B
Go
package services
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/hay-kot/content/backend/ent"
|
|
"github.com/hay-kot/content/backend/internal/repo"
|
|
"github.com/hay-kot/content/backend/internal/types"
|
|
)
|
|
|
|
type LocationService struct {
|
|
repos *repo.AllRepos
|
|
}
|
|
|
|
func ToLocationOut(location *ent.Location, err error) (*types.LocationOut, error) {
|
|
return &types.LocationOut{
|
|
ID: location.ID,
|
|
GroupID: location.Edges.Group.ID,
|
|
Name: location.Name,
|
|
Description: location.Description,
|
|
CreatedAt: location.CreatedAt,
|
|
UpdatedAt: location.UpdatedAt,
|
|
}, err
|
|
}
|
|
|
|
func (svc *LocationService) GetAll(ctx context.Context, groupId uuid.UUID) ([]*types.LocationOut, error) {
|
|
panic("not implemented")
|
|
}
|