feat: mapper.

This commit is contained in:
Bobo
2025-06-11 23:03:10 +08:00
parent 41c8b6d9dd
commit f48c7373d7
7 changed files with 274 additions and 0 deletions

10
mapper/interface.go Normal file
View File

@@ -0,0 +1,10 @@
package mapper
// Mapper defines the interface for converting between DTOs and models.
type Mapper[DTO any, MODEL any] interface {
// ToModel converts a DTO to a MODEL.
ToModel(*DTO) *MODEL
// ToDto converts a MODEL to a DTO.
ToDto(*MODEL) *DTO
}