Skip to content

Commit

Permalink
Fixed formatting for api inline docs, see #12
Browse files Browse the repository at this point in the history
  • Loading branch information
lastzero committed Nov 6, 2018
1 parent e66e9e4 commit 4a33d43
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
32 changes: 16 additions & 16 deletions internal/api/photos.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ import (
"github.com/photoprism/photoprism/internal/photoprism"
)

// `GET /api/v1/photos`
// GET /api/v1/photos
//
// Query:
// - `q`: string Query string `form:""`
// - `tags`: string Tags string `form:"tags"`
// - `cat`: string Category
// - `country`: string Country code
// - `camera`: int Camera ID
// - `order`: string Sort order
// - `count`: int Max result count (required)
// - `offset`: int Result offset
// - `before`: date Find photos taken before (format: "2006-01-02")
// - `after`: date Find photos taken after (format: "2006-01-02")
// - `favorites`: bool Find favorites only
// q: string Query string
// tags: string Tags
// cat: string Category
// country: string Country code
// camera: int Camera ID
// order: string Sort order
// count: int Max result count (required)
// offset: int Result offset
// before: date Find photos taken before (format: "2006-01-02")
// after: date Find photos taken after (format: "2006-01-02")
// favorites: bool Find favorites only
func GetPhotos(router *gin.RouterGroup, conf *photoprism.Config) {
router.GET("/photos", func(c *gin.Context) {
var form forms.PhotoSearchForm
Expand All @@ -46,10 +46,10 @@ func GetPhotos(router *gin.RouterGroup, conf *photoprism.Config) {
})
}

// `POST /api/v1/photos/:photoId/like`
// POST /api/v1/photos/:photoId/like
//
// Parameters:
// - `photoId`: Photo ID as returned by the API
// photoId: int Photo ID as returned by the API
func LikePhoto(router *gin.RouterGroup, conf *photoprism.Config) {
router.POST("/photos/:photoId/like", func(c *gin.Context) {
search := photoprism.NewSearch(conf.OriginalsPath, conf.GetDb())
Expand All @@ -68,10 +68,10 @@ func LikePhoto(router *gin.RouterGroup, conf *photoprism.Config) {
})
}

// `DELETE /api/v1/photos/:photoId/like`
// DELETE /api/v1/photos/:photoId/like
//
// Parameters:
// - `photoId`: Photo ID as returned by the API
// photoId: int Photo ID as returned by the API
func DislikePhoto(router *gin.RouterGroup, conf *photoprism.Config) {
router.DELETE("/photos/:photoId/like", func(c *gin.Context) {
search := photoprism.NewSearch(conf.OriginalsPath, conf.GetDb())
Expand Down
8 changes: 4 additions & 4 deletions internal/api/thumbnails.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ var photoIconSvg = []byte(`
<path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/>
</svg>`)

// `GET /api/v1/thumbnails/:type/:size/:hash`
// GET /api/v1/thumbnails/:type/:size/:hash
//
// Parameters:
// - `type`: string Format, either "fit" or "square"
// - `size`: int Size in pixels
// - `hash`: string The file hash as returned by the search API
// type: string Format, either "fit" or "square"
// size: int Size in pixels
// hash: string The file hash as returned by the search API
func GetThumbnail(router *gin.RouterGroup, conf *photoprism.Config) {
router.GET("/thumbnails/:type/:size/:hash", func(c *gin.Context) {
fileHash := c.Param("hash")
Expand Down

0 comments on commit 4a33d43

Please sign in to comment.