refactor: разделил приложение на domain application adapters и HTTP DTO

This commit is contained in:
2026-10-20 21:44:59 +03:00
parent 13ee5a0e56
commit 3f69970b05
59 changed files with 1324 additions and 1087 deletions
+26
View File
@@ -0,0 +1,26 @@
package dto
import (
"time"
"mtusi2026lab3/internal/domain"
)
type CreateUserRequest struct {
Username string `json:"username"`
DisplayName string `json:"display_name"`
Password string `json:"password"`
}
type UserResponse struct {
ID string `json:"id"`
Username string `json:"username"`
DisplayName string `json:"display_name"`
CreatedAt time.Time `json:"created_at"`
}
func UserFromDomain(user domain.User) UserResponse {
return UserResponse{
ID: user.ID, Username: user.Username, DisplayName: user.DisplayName, CreatedAt: user.CreatedAt,
}
}