Restructured project
- backend moved to backend directory - added and initialized frontend with vue - moved infrastructure files to infra directory
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
type Family struct {
|
||||
ID int64
|
||||
Name string
|
||||
OwnerID int64
|
||||
TelegramChatID int64
|
||||
TelegramChatName string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type FamilyRole string
|
||||
|
||||
const (
|
||||
FamilyRoleOwner FamilyRole = "owner"
|
||||
FamilyRoleAdmin FamilyRole = "admin"
|
||||
FamilyRoleMember FamilyRole = "member"
|
||||
FamilyRoleChild FamilyRole = "child"
|
||||
)
|
||||
|
||||
type FamilyMember struct {
|
||||
ID int64
|
||||
FamilyID int64
|
||||
UserID int64
|
||||
Role FamilyRole
|
||||
JoinedAt time.Time
|
||||
}
|
||||
|
||||
type FamilyThread struct {
|
||||
ID int64
|
||||
FamilyID int64
|
||||
Type string
|
||||
Title string
|
||||
TelegramTopicID int64
|
||||
IsSystem bool
|
||||
CreatedBy int64
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
type CreateFamilyRequest struct {
|
||||
Name string `json:"name"`
|
||||
OwnerID int64 `json:"owner_id"`
|
||||
TelegramChatID int64 `json:"telegram_chat_id"`
|
||||
TelegramChatName string `json:"telegram_chat_name"`
|
||||
}
|
||||
|
||||
type UpdateFamilyRequest struct {
|
||||
Name *string `json:"name"`
|
||||
TelegramChatName string `json:"telegram_chat_name"`
|
||||
}
|
||||
|
||||
type FamilyResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
OwnerID int64 `json:"owner_id"`
|
||||
TelegramChatID int64 `json:"telegram_chat_id"`
|
||||
TelegramChatName string `json:"telegram_chat_name"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
}
|
||||
|
||||
func (response *FamilyResponse) ModelToResponse(f *Family) FamilyResponse {
|
||||
return FamilyResponse{
|
||||
ID: f.ID,
|
||||
Name: f.Name,
|
||||
OwnerID: f.OwnerID,
|
||||
TelegramChatID: f.TelegramChatID,
|
||||
TelegramChatName: f.TelegramChatName,
|
||||
CreatedAt: f.CreatedAt.Format(time.RFC3339),
|
||||
UpdatedAt: f.UpdatedAt.Format(time.RFC3339),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user