FEAT: Added MOre Video Statuses
Build, Push and Deploy CMS / build-push-deploy (push) Failing after 2m2s
Build, Push and Deploy CMS / build-push-deploy (push) Failing after 2m2s
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// Package api holds the request and response bodies of the HTTP API — the
|
||||
// wire contract, kept apart from the handlers that serve it. The swaggo
|
||||
// annotations on the handlers reference these types by name (api.VideoResponse
|
||||
// and so on), so renaming one changes the generated spec.
|
||||
package api
|
||||
|
||||
// HealthResponse is the body of GET /health.
|
||||
type HealthResponse struct {
|
||||
Status string `json:"status" example:"ok"`
|
||||
}
|
||||
|
||||
// ProblemDetails is an error body in the RFC 9457 "Problem Details for HTTP
|
||||
// APIs" format. Type stays "about:blank" — the value RFC 9457 defines for
|
||||
// problems with no dedicated documentation URI. Title is a short summary that
|
||||
// stays identical for every occurrence of the same problem, so clients can
|
||||
// branch on it; Detail explains this particular occurrence and is the only
|
||||
// member that varies with request data.
|
||||
type ProblemDetails struct {
|
||||
Type string `json:"type" example:"about:blank"`
|
||||
Title string `json:"title" example:"Title is required."`
|
||||
Status int `json:"status" example:"422"`
|
||||
Detail string `json:"detail,omitempty" example:"The 'title' field was absent or contained only whitespace. Every video needs a non-empty title."`
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package api
|
||||
|
||||
import "time"
|
||||
|
||||
// CategoriesResponse is the body of GET /api/categories.
|
||||
type CategoriesResponse struct {
|
||||
Categories []string `json:"categories" example:"documentary,news"`
|
||||
}
|
||||
|
||||
// PresignRequest is the body of POST /api/videos/presign.
|
||||
type PresignRequest struct {
|
||||
FileName string `json:"fileName" example:"interview-cut.mov"`
|
||||
ContentType string `json:"contentType" enums:"video/mp4,video/quicktime" example:"video/quicktime"`
|
||||
}
|
||||
|
||||
// PresignResponse is the body returned by POST /api/videos/presign.
|
||||
type PresignResponse struct {
|
||||
UploadURL string `json:"uploadUrl" example:"https://raw-uploads-bucket.s3.amazonaws.com/videos/a1b2....mov?X-Amz-Signature=..."`
|
||||
Key string `json:"key" example:"videos/a1b2c3d4e5f6.mov"`
|
||||
}
|
||||
|
||||
// CompleteRequest is the body of POST /api/videos.
|
||||
type CompleteRequest struct {
|
||||
Title string `json:"title" example:"Inside the Newsroom"`
|
||||
Description string `json:"description" example:"A behind-the-scenes look at the evening bulletin."`
|
||||
Categories []string `json:"categories" example:"documentary,news"`
|
||||
Tags string `json:"tags" example:"media, press, riyadh"`
|
||||
FileName string `json:"fileName" example:"interview-cut.mov"`
|
||||
Key string `json:"key" example:"videos/a1b2c3d4e5f6.mov"`
|
||||
}
|
||||
|
||||
// VideoResponse is a persisted video record as returned by POST /api/videos.
|
||||
// Status carries the values of services.VideoStatus; the enums tag has to be
|
||||
// widened by hand whenever that type gains a state.
|
||||
type VideoResponse struct {
|
||||
ID string `json:"id" example:"0199f3a1-7c2e-7b21-9f0d-1a2b3c4d5e6f"`
|
||||
Title string `json:"title" example:"Inside the Newsroom"`
|
||||
Description string `json:"description" example:"A behind-the-scenes look at the evening bulletin."`
|
||||
Categories []string `json:"categories" example:"documentary,news"`
|
||||
Tags string `json:"tags" example:"media, press, riyadh"`
|
||||
FileName string `json:"fileName" example:"interview-cut.mov"`
|
||||
StorageKey string `json:"storageKey" example:"videos/a1b2c3d4e5f6.mov"`
|
||||
MediaConvertJobID string `json:"mediaConvertJobId" example:"1755300000000-abcdef"`
|
||||
Status string `json:"status" enums:"processing,ready,failed" example:"processing"`
|
||||
SizeBytes int64 `json:"sizeBytes" example:"60"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
Reference in New Issue
Block a user