31 lines
715 B
Go
31 lines
715 B
Go
|
|
package model
|
||
|
|
|
||
|
|
// ── Common API response envelope ─────────────────────────
|
||
|
|
|
||
|
|
// ApiResponse wraps all API responses.
|
||
|
|
type ApiResponse struct {
|
||
|
|
Code int `json:"code"`
|
||
|
|
Data any `json:"data,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// ApiError wraps error responses.
|
||
|
|
type ApiError struct {
|
||
|
|
Code int `json:"code"`
|
||
|
|
Error string `json:"error"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// ── Simple response types ─────────────────────────────────
|
||
|
|
|
||
|
|
type OKResponse struct {
|
||
|
|
OK string `json:"ok"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type JobResponse struct {
|
||
|
|
JobID string `json:"job_id"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type UploadResponse struct {
|
||
|
|
URL string `json:"url"`
|
||
|
|
Filename string `json:"filename"`
|
||
|
|
}
|