Fixed lint errors after refactor (#806)
Автор
Felipe Martin

Коммитер
GitHub
год назад 
Файлов изменено: 6
+13–28
cf7301c
docs/swagger/docs.go
+4–2
@@ -150,7 +150,7 @@ | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"$ref": "#/definitions/model.Bookmark" | ||
"$ref": "#/definitions/model.BookmarkDTO" | ||
} | ||
}, | ||
"403": { | ||
@@ -294,16 +294,18 @@ | ||
} | ||
} | ||
}, | ||
"model.Bookmark": { | ||
"model.BookmarkDTO": { | ||
"type": "object", | ||
"properties": { | ||
"author": { | ||
"type": "string" | ||
}, | ||
"create_archive": { | ||
"description": "TODO: migrate outside the DTO", | ||
"type": "boolean" | ||
}, | ||
"create_ebook": { | ||
"description": "TODO: migrate outside the DTO", | ||
"type": "boolean" | ||
}, | ||
"excerpt": { |
docs/swagger/swagger.json
+4–2
@@ -139,7 +139,7 @@ | ||
"200":{ | ||
"description":"OK", | ||
"schema":{ | ||
"$ref":"#/definitions/model.Bookmark" | ||
"$ref":"#/definitions/model.BookmarkDTO" | ||
} | ||
}, | ||
"403":{ | ||
@@ -283,16 +283,18 @@ | ||
} | ||
} | ||
}, | ||
"model.Bookmark":{ | ||
"model.BookmarkDTO":{ | ||
"type":"object", | ||
"properties":{ | ||
"author":{ | ||
"type":"string" | ||
}, | ||
"create_archive":{ | ||
"description":"TODO: migrate outside the DTO", | ||
"type":"boolean" | ||
}, | ||
"create_ebook":{ | ||
"description":"TODO: migrate outside the DTO", | ||
"type":"boolean" | ||
}, | ||
"excerpt":{ |
docs/swagger/swagger.yaml
+4–2
@@ -57,13 +57,15 @@ | ||
username: | ||
type: string | ||
type: object | ||
model.Bookmark: | ||
model.BookmarkDTO: | ||
properties: | ||
author: | ||
type: string | ||
create_archive: | ||
description: 'TODO: migrate outside the DTO' | ||
type: boolean | ||
create_ebook: | ||
description: 'TODO: migrate outside the DTO' | ||
type: boolean | ||
excerpt: | ||
type: string | ||
@@ -210,7 +212,7 @@ | ||
"200": | ||
description: OK | ||
schema: | ||
$ref: '#/definitions/model.Bookmark' | ||
$ref: '#/definitions/model.BookmarkDTO' | ||
"403": | ||
description: Token not provided/invalid | ||
summary: Update Cache and Ebook on server. |
internal/http/.../bookmarks.go
+1–1
@@ -202,7 +202,7 @@ | ||
// @securityDefinitions.apikey ApiKeyAuth | ||
// @Param payload body updateCachePayload true "Update Cache Payload"` | ||
// @Produce json | ||
// @Success 200 {object} model.Bookmark | ||
// @Success 200 {object} model.BookmarkDTO | ||
// @Failure 403 {object} nil "Token not provided/invalid" | ||
// @Router /api/v1/bookmarks/cache [put] | ||
func (r *BookmarksAPIRoutes) updateCache(c *gin.Context) { |
internal/webserver/utils.go
+0–18
@@ -4,28 +4,10 @@ | ||
"html/template" | ||
"io" | ||
"net" | ||
"net/http" | ||
nurl "net/url" | ||
"os" | ||
"syscall" | ||
) | ||
func createRedirectURL(newPath, previousPath string) string { | ||
urlQueries := nurl.Values{} | ||
urlQueries.Set("dst", previousPath) | ||
redirectURL, _ := nurl.Parse(newPath) | ||
redirectURL.RawQuery = urlQueries.Encode() | ||
return redirectURL.String() | ||
} | ||
func redirectPage(w http.ResponseWriter, r *http.Request, url string) { | ||
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") | ||
w.Header().Set("Pragma", "no-cache") | ||
w.Header().Set("Expires", "0") | ||
http.Redirect(w, r, url, http.StatusMovedPermanently) | ||
} | ||
func FileExists(filePath string) bool { | ||
info, err := os.Stat(filePath) | ||
return err == nil && !info.IsDir() |
scripts/swagger_check.sh
+0–3
@@ -12,7 +12,6 @@ | ||
# Check if the git tree for CWD is clean | ||
if [ -n "$(git status docs/swagger --porcelain)" ]; then | ||
echo "❌ git tree is not clean. Please commit all changes before running this script." | ||
git diff | ||
exit 1 | ||
fi | ||
@@ -20,7 +19,6 @@ | ||
make swag-fmt | ||
if [ -n "$(git status docs/swagger --porcelain)" ]; then | ||
echo "❌ swag comments are not formatted. Please run 'make swag-fmt' and commit the changes." | ||
git diff | ||
git checkout -- docs/swagger | ||
exit 1 | ||
fi | ||
@@ -29,7 +27,6 @@ | ||
make swagger | ||
if [ -n "$(git status docs/swagger --porcelain)" ]; then | ||
echo "❌ swagger documentation not updated, please run 'make swagger' and commit the changes." | ||
git diff | ||
git checkout -- docs/swagger | ||
exit 1 | ||
fi |
GPG верификация
Статус: Неверифицирован
Причина: Не найден публичный ключ
ID ключа: 4aee18f83afdeb23
Cherry-pick
Команда cherry-pick позволяет выбрать отдельные коммиты из одной ветки и применить их к другой.