Fixed formatting for api inline docs, see #12

This commit is contained in:
Michael Mayer 2018-11-06 10:43:59 +01:00
parent e66e9e4f69
commit 4a33d430e9
2 changed files with 20 additions and 20 deletions

View file

@ -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
@ -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())
@ -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())

View file

@ -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")