Files
go-utils/mapper/interface.go
2025-06-16 14:49:21 +08:00

11 lines
313 B
Go

package mapper
// Mapper defines the interface for converting between Data Transfer Objects (DTOs) and Database Entities.
type Mapper[DTO any, ENTITY any] interface {
// ToEntity converts a DTO to a Database Entity.
ToEntity(*DTO) *ENTITY
// ToDTO converts a Database Entity to a DTO.
ToDTO(*ENTITY) *DTO
}