mirror of https://github.com/stashapp/stash.git
26 lines
480 B
Go
26 lines
480 B
Go
|
package urlbuilders
|
||
|
|
||
|
import (
|
||
|
"strconv"
|
||
|
)
|
||
|
|
||
|
type ImageURLBuilder struct {
|
||
|
BaseURL string
|
||
|
ImageID string
|
||
|
}
|
||
|
|
||
|
func NewImageURLBuilder(baseURL string, imageID int) ImageURLBuilder {
|
||
|
return ImageURLBuilder{
|
||
|
BaseURL: baseURL,
|
||
|
ImageID: strconv.Itoa(imageID),
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (b ImageURLBuilder) GetImageURL() string {
|
||
|
return b.BaseURL + "/image/" + b.ImageID + "/image"
|
||
|
}
|
||
|
|
||
|
func (b ImageURLBuilder) GetThumbnailURL() string {
|
||
|
return b.BaseURL + "/image/" + b.ImageID + "/thumbnail"
|
||
|
}
|