cleaned up the dto's and entities to make them more like what I am use to

This commit is contained in:
James Tombleson 2024-04-26 16:02:59 -07:00
parent 81699b6919
commit d1a4d10df0
2 changed files with 175 additions and 72 deletions

View File

@ -1 +1,86 @@
package domain
package domain
import "time"
type ArticleDto struct {
ID int64 `json:"id"`
SourceID int64 `json:"sourceId"`
Tags string `json:"tags"`
Title string `json:"title"`
Url string `json:"url"`
PubDate time.Time `json:"pubDate"`
Video string `json:"video"`
VideoHeight uint16 `json:"videoHeight"`
VideoWidth uint16 `json:"videoWidth"`
Thumbnail string `json:"thumbnail"`
Description string `json:"description"`
AuthorName string `json:"authorName"`
AuthorImage string `json:"authorImage"`
}
type DiscordQueueDto struct {
//CreatedAt time.Time `json:"createdAt"`
//UpdatedAt time.Time `json:"updatedAt"`
ID int64 `json:"id"`
ArticleId int64 `json:"articleId"`
SourceId int64 `json:"sourceId"`
}
type DiscordWebHookDto struct {
//CreatedAt time.Time `json:"CreatedAt"`
//UpdatedAt time.Time `json:"UpdatedAt"`
//DeletedAt time.Time `json:"DeletedAt"`
ID uint `json:"id"`
Name string `json:"name"`
Key string `json:"key"`
Url string `json:"url"`
Server string `json:"server"`
Channel string `json:"channel"`
Enabled bool `json:"enabled"`
}
type IconDto struct {
//CreatedAt time.Time `json:"CreatedAt"`
//UpdatedAt time.Time `json:"UpdatedAt"`
//DeletedAt time.Time `json:"DeletedAt"`
ID int64 `json:"id"`
FileName string `json:"fileName"`
Site string `json:"site"`
}
type SettingDto struct {
//CreatedAt time.Time `json:"CreatedAt"`
//UpdatedAt time.Time `json:"UpdatedAt"`
//DeletedAt time.Time `json:"DeletedAt"`
ID int64 `json:"id"`
Key string `json:"key"`
Value string `json:"value"`
Options string `json:"options"`
}
type SubscriptionDto struct {
//CreatedAt time.Time `json:"CreatedAt"`
//UpdatedAt time.Time `json:"UpdatedAt"`
//DeletedAt time.Time `json:"DeletedAt"`
ID int64 `json:"id"`
SourceID int64 `json:"sourceId"`
SourceType string `json:"sourceType"`
SourceName string `json:"sourceName"`
DiscordID int64 `json:"discordId"`
DiscordName string `json:"discordName"`
}
type SourceDto struct {
//CreatedAt time.Time `json:"CreatedAt"`
//UpdatedAt time.Time `json:"UpdatedAt"`
//DeletedAt time.Time `json:"DeletedAt"`
ID int64 `json:"id"`
Site string `json:"site"`
Name string `json:"name"`
Source string `json:"source"`
Type string `json:"type"`
Value string `json:"value"`
Enabled bool `json:"enabled"`
Url string `json:"url"`
Tags string `json:"tags"`
}

View File

@ -4,87 +4,105 @@ import (
"time"
)
// Articles represents the model for an Article
type Articles struct {
ID uint `json:"ID"`
SourceID uint `json:"sourceId"`
Tags string `json:"tags"`
Title string `json:"title"`
Url string `json:"url"`
PubDate time.Time `json:"pubdate"`
Video string `json:"video"`
VideoHeight uint16 `json:"videoHeight"`
VideoWidth uint16 `json:"videoWidth"`
Thumbnail string `json:"thumbnail"`
Description string `json:"description"`
AuthorName string `json:"authorName"`
AuthorImage string `json:"authorImage"`
type ArticleEntity struct {
ID int64
CreatedAt time.Time
LastUpdated time.Time
DeletedAt time.Time
SourceID int64
Tags string
Title string
Url string
PubDate time.Time
Thumbnail string
Description string
AuthorName string
AuthorImageUrl string
}
type DiscordQueue struct {
ID uint `json:"ID"`
CreatedAt time.Time `json:"CreatedAt"`
UpdatedAt time.Time `json:"UpdatedAt"`
DeletedAt time.Time `json:"DeletedAt"`
ArticleId string `json:"articleId"`
type DiscordQueueEntity struct {
ID int64
CreatedAt time.Time
LastUpdated time.Time
DeletedAt time.Time
ArticleId int64
SourceId int64
}
type DiscordWebHooks struct {
ID uint `json:"ID"`
CreatedAt time.Time `json:"CreatedAt"`
UpdatedAt time.Time `json:"UpdatedAt"`
DeletedAt time.Time `json:"DeletedAt"`
Name string `json:"name"`
Key string `json:"key"`
Url string `json:"url"`
Server string `json:"server"`
Channel string `json:"channel"`
Enabled bool `json:"enabled"`
type DiscordWebHookEntity struct {
ID int64
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt time.Time
Name string
Key string
Url string
Server string
Channel string
Enabled bool
}
type Icons struct {
ID uint `json:"ID"`
CreatedAt time.Time `json:"CreatedAt"`
UpdatedAt time.Time `json:"UpdatedAt"`
DeletedAt time.Time `json:"DeletedAt"`
FileName string `json:"fileName"`
Site string `json:"site"`
type IconEntity struct {
ID int64
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt time.Time
FileName string
Site string
}
type Settings struct {
ID uint `json:"ID"`
CreatedAt time.Time `json:"CreatedAt"`
UpdatedAt time.Time `json:"UpdatedAt"`
DeletedAt time.Time `json:"DeletedAt"`
Key string `json:"key"`
Value string `json:"value"`
Options string `json:"options"`
type SettingEntity struct {
ID int64
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt time.Time
Key string
Value string
Options string
}
type Sources struct {
ID uint `json:"ID"`
Site string `json:"site"`
Name string `json:"name"`
Source string `json:"source"`
Type string `json:"type"`
Value string `json:"value"`
Enabled bool `json:"enabled"`
Url string `json:"url"`
Tags string `json:"tags"`
type SourceEntity struct {
ID int64
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt time.Time
Site string
Name string
Source string
Type string
Value string
Enabled bool
Url string
Tags string
}
type SourceLinks struct {
ID uint `json:"ID"`
CreatedAt time.Time `json:"CreatedAt"`
UpdatedAt time.Time `json:"UpdatedAt"`
DeletedAt time.Time `json:"DeletedAt"`
SourceID uint `json:"sourceId"`
SourceType string `json:"sourceType"`
SourceName string `json:"sourceName"`
DiscordID uint `json:"discordId"`
DiscordName string `json:"discordName"`
type SubscriptionEntity struct {
ID int64
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt time.Time
SourceID int64
SourceType string
SourceName string
DiscordID int64
DiscordName string
}
type UserEntity struct {
ID int64
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt time.Time
Username string
Hash string
Scopes string
}
type RefreshTokenEntity struct {
ID int64
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt time.Time
Username string
Token string
}