add service
This commit is contained in:
14
internal/model/invite.go
Normal file
14
internal/model/invite.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type InviteCode struct {
|
||||
ID int
|
||||
UserID int
|
||||
Code int64
|
||||
CanBeUsedCount int
|
||||
UsedCount int
|
||||
IsActive bool
|
||||
CreatedAt time.Time
|
||||
ExpiresAt time.Time
|
||||
}
|
||||
40
internal/model/request.go
Normal file
40
internal/model/request.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Request struct {
|
||||
ID uuid.UUID
|
||||
UserID int
|
||||
RequestTxt string
|
||||
GeneratedTZ bool
|
||||
FinalTZ string
|
||||
GeneratedFinalTZ bool
|
||||
FinalUpdateTZ string
|
||||
MailingStatusID int
|
||||
MailingStatus string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
type MailingStatus struct {
|
||||
ID int
|
||||
StatusName string
|
||||
}
|
||||
|
||||
type RequestDetail struct {
|
||||
RequestID uuid.UUID
|
||||
Title string
|
||||
MailText string
|
||||
Suppliers []SupplierInfo
|
||||
}
|
||||
|
||||
type SupplierInfo struct {
|
||||
CompanyID int `json:"company_id"`
|
||||
Email string `json:"email"`
|
||||
Phone string `json:"phone"`
|
||||
CompanyName string `json:"company_name"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
15
internal/model/session.go
Normal file
15
internal/model/session.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Session struct {
|
||||
ID int
|
||||
UserID int
|
||||
AccessToken string
|
||||
RefreshToken string
|
||||
IP string
|
||||
UserAgent string
|
||||
CreatedAt time.Time
|
||||
ExpiresAt time.Time
|
||||
RevokedAt *time.Time
|
||||
}
|
||||
28
internal/model/supplier.go
Normal file
28
internal/model/supplier.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Supplier struct {
|
||||
ID int
|
||||
RequestID uuid.UUID
|
||||
Name string
|
||||
Email string
|
||||
Phone string
|
||||
Address string
|
||||
URL string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
type TokenUsage struct {
|
||||
ID int
|
||||
RequestID uuid.UUID
|
||||
RequestTokenCount int
|
||||
ResponseTokenCount int
|
||||
TokenCost float64
|
||||
Type string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
18
internal/model/user.go
Normal file
18
internal/model/user.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type User struct {
|
||||
ID int
|
||||
Email string
|
||||
EmailHash string
|
||||
PasswordHash string
|
||||
Phone string
|
||||
UserName string
|
||||
CompanyName string
|
||||
Balance float64
|
||||
PaymentStatus string
|
||||
InvitesIssued int
|
||||
InvitesLimit int
|
||||
CreatedAt time.Time
|
||||
}
|
||||
Reference in New Issue
Block a user