Skip to content

Commit

Permalink
added new models
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan-Nava authored Nov 13, 2023
1 parent ef96730 commit 7c5c69a
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 13 deletions.
1 change: 0 additions & 1 deletion compress/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package compress

const (
TNGRM_BASE_URL = "https://api.tngrm.io/api/v3.0"
AUTH_LOGIN = "/external/auth/login"
CATEGORIES = "/external/upload/categories"
RESTREAMERS = "/external/restreamers"
UPLOADS = "/external/upload"
Expand Down
17 changes: 17 additions & 0 deletions compress/model_category.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package compress

import (
"time"
)

type categoriesRequest struct {
BaseModel
}

type Category struct {
ID int `json:"id" `
Name string `json:"name" `
Created time.Time `json:"created" gorm:"type:timestamp;" `
VideoAmount int `json:"video_amount" `
ClientID string `json:"client_id" `
}
48 changes: 48 additions & 0 deletions compress/model_upload.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package compress

import "time"

type UploadsPaginated struct {
BaseModel
StartFrom int `json:"start_from"`
Amount int `json:"amount"`
TitleFilter *string `json:"q"`
Category *string `json:"category"`
Tags *string `json:"tags"`
FromDate *string `json:"from_date", omitempty `
ToDate *string `json:"to_date", omitempty `
}


// VideoUploadInfo single video upload representation for response, made with Upload, AuthUser and Category tables
type VideoUploadInfo struct {
Id int `json:"id" `
Title string `json:"title" `
Location string `json:"location"`
ReporterFirstName string `json:"reporter_first_name" `
ReporterLastName string `json:"reporter_last_name" `
Created string `json:"created" `
CategoryName string `json:"category_name" `
Token string `json:"token" `
JobId int `json:"job_id" ` // changed with job_id
DownloadUrl string `json:"download_url" `
RemoteUrl string `json:"remote_url" `
Thumbnail string `json:"thumbnail" `
Thumbnails string `json:"thumbnails" `
ThumbnailsV2 string `json:"thumbnailsV2" gorm:"column:thumbnailsV2"` //TODO to deprecate with new models --> preview_urls
WatermarkUrl string `json:"watermark_url" `
Tags string `json:"tags" `
ExtendedData string `json:"extended_data" `
OriginalUrl string `json:"original_url" `
Duration int `json:"duration" `
DurationMillisecond int `json:"duration_msec" gorm:"column:duration_msec"`
Size int64 `json:"size" `
Published int `json:"published" `
Width int `json:"width"`
Height int `json:"height"`
DisplayAspectRatio string `json:"display_aspect_ratio"`
Is360 int `json:"360degree" gorm:"column:360degree"`
ClientId string `json:"client_id" `
DeletedAt *time.Time `json:"deleted_at,omitempty" gorm:"type:timestamp;"`
MiniClips interface{} `json:"mini_clips" gorm:"-"`
}
12 changes: 0 additions & 12 deletions compress/request_upload.go

This file was deleted.

0 comments on commit 7c5c69a

Please sign in to comment.