mapper

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapBbox

func MapBbox(src [4]float64) [4]float64

func MapCenter

func MapCenter(src [2]float64) [2]float64

func MapDrivingLicense

func MapDrivingLicense(drivingLicense domain.DrivingLicense) entities.DrivingLicense

func MapDrivingLicenseReq

func MapDrivingLicenseReq(drivingLicense entities.DrivingLicense) domain.DrivingLicense

func MapLatestDataToResponse

func MapLatestDataToResponse(sensorData *domain.SensorData) *entities.SensorDataResponse

func MapSensorStatus

func MapSensorStatus(src domain.SensorStatus) entities.SensorStatus

func MapSoilCondition

func MapSoilCondition(condition domain.TreeSoilCondition) entities.TreeSoilCondition

func MapSoilConditionReq

func MapSoilConditionReq(condition entities.TreeSoilCondition) domain.TreeSoilCondition

func MapTreeClusterToID

func MapTreeClusterToID(treeCluster *domain.TreeCluster) *int32

func MapTreesToIDs

func MapTreesToIDs(trees []*domain.Tree) []*int32

func MapUUIDReq

func MapUUIDReq(userIDs []string) []*uuid.UUID

func MapUUIDs

func MapUUIDs(source []*uuid.UUID) []*uuid.UUID

func MapUserRoles

func MapUserRoles(userRole domain.UserRole) entities.UserRole

func MapUserStatus

func MapUserStatus(userStatus domain.UserStatus) entities.UserStatus

func MapVehicleStatus

func MapVehicleStatus(vehicleStatus domain.VehicleStatus) entities.VehicleStatus

func MapVehicleStatusReq

func MapVehicleStatusReq(vehicleStatus entities.VehicleStatus) domain.VehicleStatus

func MapVehicleType

func MapVehicleType(vehicleType domain.VehicleType) entities.VehicleType

func MapVehicleTypeReq

func MapVehicleTypeReq(vehicleType entities.VehicleType) domain.VehicleType

func MapWateringStatus

func MapWateringStatus(status domain.WateringStatus) entities.WateringStatus

Types

type EvaluationHTTPMapper

type EvaluationHTTPMapper interface {
	FromResponse(src *domain.Evaluation) *entities.EvaluationResponse
}

goverter:converter

type InfoHTTPMapper

type InfoHTTPMapper interface {
	ToResponse(src *domain.App) *entities.AppInfoResponse
	FromResponse(src *entities.AppInfoResponse) *domain.App
}

goverter:converter goverter:extend github.com/green-ecolution/backend/internal/utils:TimeToTime github.com/green-ecolution/backend/internal/utils:URLToURL github.com/green-ecolution/backend/internal/utils:TimeDurationToTimeDuration github.com/green-ecolution/backend/internal/utils:StringToTime github.com/green-ecolution/backend/internal/utils:StringToURL github.com/green-ecolution/backend/internal/utils:StringToNetIP goverter:extend github.com/green-ecolution/backend/internal/utils:StringToDuration github.com/green-ecolution/backend/internal/utils:TimeToString github.com/green-ecolution/backend/internal/utils:NetURLToString github.com/green-ecolution/backend/internal/utils:NetIPToString github.com/green-ecolution/backend/internal/utils:TimeDurationToString goverter:extend MapCenter MapBbox

type RegionHTTPMapper

type RegionHTTPMapper interface {
	FromResponse(src *domain.Region) *entities.RegionResponse
}

goverter:converter goverter:extend github.com/green-ecolution/backend/internal/utils:TimeToTime

type SensorHTTPMapper

type SensorHTTPMapper interface {
	FromResponse(src *domain.Sensor) *entities.SensorResponse
	FromDataResponse(src *domain.SensorData) *entities.SensorDataResponse
	FromWatermarkResponse(src *domain.Watermark) *entities.WatermarkResponse
}

goverter:converter goverter:extend github.com/green-ecolution/backend/internal/utils:TimeToTime goverter:extend github.com/green-ecolution/backend/internal/utils:MapKeyValueInterface goverter:extend MapSensorStatus MapLatestDataToResponse

type TreeClusterHTTPMapper

type TreeClusterHTTPMapper interface {
	FromResponse(*domain.TreeCluster) *entities.TreeClusterResponse
	FromResponseList([]*domain.TreeCluster) []*entities.TreeClusterInListResponse
	FromCreateRequest(*entities.TreeClusterCreateRequest) *domain.TreeClusterCreate
	FromUpdateRequest(*entities.TreeClusterUpdateRequest) *domain.TreeClusterUpdate

	// goverter:map Trees TreeIDs
	FromInListResponse(*domain.TreeCluster) *entities.TreeClusterInListResponse
}

goverter:converter goverter:extend github.com/green-ecolution/backend/internal/utils:TimeToTime goverter:extend github.com/green-ecolution/backend/internal/utils:TimeToTimePtr goverter:extend github.com/green-ecolution/backend/internal/utils:MapKeyValueInterface goverter:extend MapWateringStatus MapSoilCondition MapSoilConditionReq MapTreesToIDs MapSensorStatus goverter:ignoreMissing

type TreeHTTPMapper

type TreeHTTPMapper interface {
	// goverter:map TreeCluster TreeClusterID
	// goverter:ignore Sensor
	FromResponse(*domain.Tree) *entities.TreeResponse
	FromResponseList([]*domain.Tree) []*entities.TreeResponse
	FromUpdateRequest(*entities.TreeUpdateRequest) *domain.TreeUpdate
	FromCreateRequest(*entities.TreeCreateRequest) *domain.TreeCreate
}

goverter:converter goverter:extend github.com/green-ecolution/backend/internal/utils:TimeToTime goverter:extend github.com/green-ecolution/backend/internal/utils:MapKeyValueInterface goverter:extend MapTreeClusterToID MapWateringStatus

type UserHTTPMapper

type UserHTTPMapper interface {
	FromResponse(*domain.User) *entities.UserResponse
	FromResponseList([]*domain.User) []*entities.UserResponse
}

goverter:converter goverter:extend github.com/green-ecolution/backend/internal/utils:TimeToTime goverter:extend github.com/green-ecolution/backend/internal/utils:UUIDToString goverter:extend github.com/green-ecolution/backend/internal/utils:URLToString goverter:extend MapDrivingLicense MapUserRoles MapUserStatus

type VehicleHTTPMapper

type VehicleHTTPMapper interface {
	FromResponse(*domain.Vehicle) *entities.VehicleResponse
	FromResponseList([]*domain.Vehicle) []*entities.VehicleResponse
	FromCreateRequest(*entities.VehicleCreateRequest) *domain.VehicleCreate
	FromUpdateRequest(*entities.VehicleUpdateRequest) *domain.VehicleUpdate
}

goverter:converter goverter:extend github.com/green-ecolution/backend/internal/utils:TimeToTime goverter:extend github.com/green-ecolution/backend/internal/utils:TimeToTimePtr goverter:extend github.com/green-ecolution/backend/internal/utils:TimeToPtrTime goverter:extend github.com/green-ecolution/backend/internal/utils:MapKeyValueInterface goverter:extend MapVehicleStatus MapVehicleType MapVehicleStatusReq MapVehicleTypeReq MapDrivingLicense MapDrivingLicenseReq

type WateringPlanHTTPMapper

type WateringPlanHTTPMapper interface {
	FromResponse(*domain.WateringPlan) *entities.WateringPlanResponse
	FromResponseList([]*domain.WateringPlan) []*entities.WateringPlanResponse
	FromCreateRequest(*entities.WateringPlanCreateRequest) *domain.WateringPlanCreate
	FromUpdateRequest(*entities.WateringPlanUpdateRequest) *domain.WateringPlanUpdate

	FromInListResponse(*domain.WateringPlan) *entities.WateringPlanInListResponse
	// goverter:map Trees TreeIDs
	FromTreeClusterInListResponse(*domain.TreeCluster) *entities.TreeClusterInListResponse
}

goverter:converter goverter:extend github.com/green-ecolution/backend/internal/utils:TimeToTime goverter:extend github.com/green-ecolution/backend/internal/utils:TimeToTimePtr goverter:extend github.com/green-ecolution/backend/internal/utils:TimeToPtrTime goverter:extend github.com/green-ecolution/backend/internal/utils:DurationToPtrFloat64 goverter:extend github.com/green-ecolution/backend/internal/utils:MapKeyValueInterface goverter:extend MapWateringPlanStatus MapVehicleStatus MapVehicleType MapDrivingLicense MapWateringPlanStatusReq goverter:extend MapWateringStatus MapSensorStatus MapSoilCondition MapTreesToIDs MapUUIDs MapUUIDReq

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL