2019-02-09 12:30:49 +00:00
|
|
|
package urlbuilders
|
|
|
|
|
|
|
|
import "strconv"
|
|
|
|
|
2019-02-14 22:53:32 +00:00
|
|
|
type GalleryURLBuilder struct {
|
|
|
|
BaseURL string
|
2019-02-09 12:30:49 +00:00
|
|
|
GalleryID string
|
|
|
|
}
|
|
|
|
|
2019-02-14 22:53:32 +00:00
|
|
|
func NewGalleryURLBuilder(baseURL string, galleryID int) GalleryURLBuilder {
|
|
|
|
return GalleryURLBuilder{
|
|
|
|
BaseURL: baseURL,
|
2019-02-09 12:30:49 +00:00
|
|
|
GalleryID: strconv.Itoa(galleryID),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-14 22:53:32 +00:00
|
|
|
func (b GalleryURLBuilder) GetGalleryImageURL(fileIndex int) string {
|
2019-02-09 12:30:49 +00:00
|
|
|
return b.BaseURL + "/gallery/" + b.GalleryID + "/" + strconv.Itoa(fileIndex)
|
|
|
|
}
|