cleaning up the dto's and making new response types
This commit is contained in:
parent
dfd44714c0
commit
3d2420343c
@ -3,33 +3,26 @@ package domain
|
|||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
type ArticleDto struct {
|
type ArticleDto struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
SourceID int64 `json:"sourceId"`
|
SourceID int64 `json:"sourceId"`
|
||||||
Tags string `json:"tags"`
|
Tags string `json:"tags"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Url string `json:"url"`
|
Url string `json:"url"`
|
||||||
PubDate time.Time `json:"pubDate"`
|
PubDate time.Time `json:"pubDate"`
|
||||||
Video string `json:"video"`
|
IsVideo bool `json:"isVideo"`
|
||||||
VideoHeight uint16 `json:"videoHeight"`
|
Thumbnail string `json:"thumbnail"`
|
||||||
VideoWidth uint16 `json:"videoWidth"`
|
Description string `json:"description"`
|
||||||
Thumbnail string `json:"thumbnail"`
|
AuthorName string `json:"authorName"`
|
||||||
Description string `json:"description"`
|
AuthorImageUrl string `json:"authorImage"`
|
||||||
AuthorName string `json:"authorName"`
|
|
||||||
AuthorImage string `json:"authorImage"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type DiscordQueueDto struct {
|
type DiscordQueueDto struct {
|
||||||
//CreatedAt time.Time `json:"createdAt"`
|
|
||||||
//UpdatedAt time.Time `json:"updatedAt"`
|
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
ArticleId int64 `json:"articleId"`
|
ArticleId int64 `json:"articleId"`
|
||||||
SourceId int64 `json:"sourceId"`
|
SourceId int64 `json:"sourceId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DiscordWebHookDto struct {
|
type DiscordWebHookDto struct {
|
||||||
//CreatedAt time.Time `json:"CreatedAt"`
|
|
||||||
//UpdatedAt time.Time `json:"UpdatedAt"`
|
|
||||||
//DeletedAt time.Time `json:"DeletedAt"`
|
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Key string `json:"key"`
|
Key string `json:"key"`
|
||||||
@ -40,18 +33,12 @@ type DiscordWebHookDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type IconDto struct {
|
type IconDto struct {
|
||||||
//CreatedAt time.Time `json:"CreatedAt"`
|
|
||||||
//UpdatedAt time.Time `json:"UpdatedAt"`
|
|
||||||
//DeletedAt time.Time `json:"DeletedAt"`
|
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
FileName string `json:"fileName"`
|
FileName string `json:"fileName"`
|
||||||
Site string `json:"site"`
|
Site string `json:"site"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SettingDto struct {
|
type SettingDto struct {
|
||||||
//CreatedAt time.Time `json:"CreatedAt"`
|
|
||||||
//UpdatedAt time.Time `json:"UpdatedAt"`
|
|
||||||
//DeletedAt time.Time `json:"DeletedAt"`
|
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
Key string `json:"key"`
|
Key string `json:"key"`
|
||||||
Value string `json:"value"`
|
Value string `json:"value"`
|
||||||
@ -59,9 +46,6 @@ type SettingDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SubscriptionDto struct {
|
type SubscriptionDto struct {
|
||||||
//CreatedAt time.Time `json:"CreatedAt"`
|
|
||||||
//UpdatedAt time.Time `json:"UpdatedAt"`
|
|
||||||
//DeletedAt time.Time `json:"DeletedAt"`
|
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
SourceID int64 `json:"sourceId"`
|
SourceID int64 `json:"sourceId"`
|
||||||
SourceType string `json:"sourceType"`
|
SourceType string `json:"sourceType"`
|
||||||
@ -71,16 +55,10 @@ type SubscriptionDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SourceDto struct {
|
type SourceDto struct {
|
||||||
//CreatedAt time.Time `json:"CreatedAt"`
|
ID int64 `json:"id"`
|
||||||
//UpdatedAt time.Time `json:"UpdatedAt"`
|
Source string `json:"source"`
|
||||||
//DeletedAt time.Time `json:"DeletedAt"`
|
DisplayName string `json:"name"`
|
||||||
ID int64 `json:"id"`
|
Url string `json:"url"`
|
||||||
Site string `json:"site"`
|
Tags string `json:"tags"`
|
||||||
Name string `json:"name"`
|
Enabled bool `json:"enabled"`
|
||||||
Source string `json:"source"`
|
|
||||||
Type string `json:"type"`
|
|
||||||
Value string `json:"value"`
|
|
||||||
Enabled bool `json:"enabled"`
|
|
||||||
Url string `json:"url"`
|
|
||||||
Tags string `json:"tags"`
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,26 @@
|
|||||||
package domain
|
package domain
|
||||||
|
|
||||||
type ErrorResponse struct {
|
|
||||||
|
type BaseResponse struct {
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArticleResponse struct {
|
||||||
|
BaseResponse
|
||||||
|
Payload []ArticleDto `json:"payload"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArticleAndSourceModel struct {
|
||||||
|
Article ArticleDto `json:"article"`
|
||||||
|
Source SourceDto `json:"source"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArticleDetailResponse struct {
|
||||||
|
BaseResponse
|
||||||
|
Payload ArticleAndSourceModel `json:"payload"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DiscordWebhookResponse struct {
|
||||||
|
BaseResponse
|
||||||
|
Payload []DiscordWebHookDto `json:"payload"`
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user