Skip to content

Commit 6ffc09d

Browse files
committed
chore: remove unused httpmeta getter api
1 parent 125c9c9 commit 6ffc09d

File tree

4 files changed

+827
-877
lines changed

4 files changed

+827
-877
lines changed

api/v1/docs.go

Lines changed: 14 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1/http_getter.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,10 @@ import (
1111
)
1212

1313
func (*APIV1Service) registerGetterPublicRoutes(g *echo.Group) {
14-
// GET /get/httpmeta?url={url} - Get website meta.
15-
g.GET("/get/httpmeta", GetWebsiteMetadata)
16-
1714
// GET /get/image?url={url} - Get image.
1815
g.GET("/get/image", GetImage)
1916
}
2017

21-
// GetWebsiteMetadata godoc
22-
//
23-
// @Summary Get website metadata
24-
// @Tags get
25-
// @Produce json
26-
// @Param url query string true "Website URL"
27-
// @Success 200 {object} getter.HTMLMeta "Extracted metadata"
28-
// @Failure 400 {object} nil "Missing website url | Wrong url"
29-
// @Failure 406 {object} nil "Failed to get website meta with url: %s"
30-
// @Router /o/get/GetWebsiteMetadata [GET]
31-
func GetWebsiteMetadata(c echo.Context) error {
32-
urlStr := c.QueryParam("url")
33-
if urlStr == "" {
34-
return echo.NewHTTPError(http.StatusBadRequest, "Missing website url")
35-
}
36-
if _, err := url.Parse(urlStr); err != nil {
37-
return echo.NewHTTPError(http.StatusBadRequest, "Wrong url").SetInternal(err)
38-
}
39-
40-
htmlMeta, err := getter.GetHTMLMeta(urlStr)
41-
if err != nil {
42-
return echo.NewHTTPError(http.StatusNotAcceptable, fmt.Sprintf("Failed to get website meta with url: %s", urlStr)).SetInternal(err)
43-
}
44-
return c.JSON(http.StatusOK, htmlMeta)
45-
}
46-
4718
// GetImage godoc
4819
//
4920
// @Summary Get GetImage from URL

api/v1/swagger.yaml

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
basePath: /
22
definitions:
3-
getter.HTMLMeta:
4-
properties:
5-
description:
6-
type: string
7-
image:
8-
type: string
9-
title:
10-
type: string
11-
type: object
123
github_com_usememos_memos_store.UserSetting:
134
properties:
145
key:
@@ -20,6 +11,14 @@ definitions:
2011
type: object
2112
profile.Profile:
2213
properties:
14+
driver:
15+
description: |-
16+
Driver is the database driver
17+
sqlite, mysql
18+
type: string
19+
dsn:
20+
description: DSN points to where Memos stores its own data
21+
type: string
2322
mode:
2423
description: Mode can be "prod" or "dev" or "demo"
2524
type: string
@@ -90,8 +89,13 @@ definitions:
9089
type: integer
9190
id:
9291
type: integer
92+
parentID:
93+
description: |-
94+
Composed fields
95+
For those comment memos, the parent ID is the memo ID of the memo being commented.
96+
If the parent ID is nil, then this memo is not a comment.
97+
type: integer
9398
pinned:
94-
description: Composed fields
9599
type: boolean
96100
relationList:
97101
items:
@@ -122,11 +126,11 @@ definitions:
122126
store.MemoRelationType:
123127
enum:
124128
- REFERENCE
125-
- ADDITIONAL
129+
- COMMENT
126130
type: string
127131
x-enum-varnames:
128132
- MemoRelationReference
129-
- MemoRelationAdditional
133+
- MemoRelationComment
130134
store.Resource:
131135
properties:
132136
blob:
@@ -267,8 +271,6 @@ definitions:
267271
type: string
268272
filename:
269273
type: string
270-
internalPath:
271-
type: string
272274
type:
273275
type: string
274276
type: object
@@ -1976,28 +1978,6 @@ paths:
19761978
summary: Get GetImage from URL
19771979
tags:
19781980
- get
1979-
/o/get/GetWebsiteMetadata:
1980-
get:
1981-
parameters:
1982-
- description: Website URL
1983-
in: query
1984-
name: url
1985-
required: true
1986-
type: string
1987-
produces:
1988-
- application/json
1989-
responses:
1990-
"200":
1991-
description: Extracted metadata
1992-
schema:
1993-
$ref: '#/definitions/getter.HTMLMeta'
1994-
"400":
1995-
description: Missing website url | Wrong url
1996-
"406":
1997-
description: 'Failed to get website meta with url: %s'
1998-
summary: Get website metadata
1999-
tags:
2000-
- get
20011981
/o/r/{resourceId}:
20021982
get:
20031983
description: '*Swagger UI may have problems displaying other file types than

0 commit comments

Comments
 (0)