mirror of
https://github.com/photoprism/photoprism.git
synced 2025-10-02 07:32:48 +08:00

This is a proof of concept and still under development. The other Vision API endpoints are stubs for testing and not yet functional. Signed-off-by: Michael Mayer <michael@photoprism.app>
23 lines
640 B
Go
23 lines
640 B
Go
package vision
|
|
|
|
import (
|
|
"github.com/photoprism/photoprism/pkg/rnd"
|
|
)
|
|
|
|
// ApiRequest represents a Vision API service request.
|
|
type ApiRequest struct {
|
|
Id string `form:"id" yaml:"Id,omitempty" json:"id,omitempty"`
|
|
Model string `form:"model" yaml:"Model,omitempty" json:"model,omitempty"`
|
|
Images []string `form:"images" yaml:"Images,omitempty" json:"images,omitempty"`
|
|
Videos []string `form:"videos" yaml:"Videos,omitempty" json:"videos,omitempty"`
|
|
}
|
|
|
|
// GetId returns the request ID string and generates a random ID if none was set.
|
|
func (r *ApiRequest) GetId() string {
|
|
if r.Id == "" {
|
|
r.Id = rnd.UUID()
|
|
}
|
|
|
|
return r.Id
|
|
}
|