diff options
author | 6543 <6543@obermui.de> | 2021-06-23 21:58:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-23 15:58:44 -0400 |
commit | 58501a26821160c3258c1ad3501f4c1d8db0a597 (patch) | |
tree | d8a75bc1e8145e83b02c220006b9bc24d8ba2f9b /templates | |
parent | 8640717f5fb045ee88eda14c7dbe3731b8c068b2 (diff) | |
download | gitea-58501a26821160c3258c1ad3501f4c1d8db0a597.tar.gz gitea-58501a26821160c3258c1ad3501f4c1d8db0a597.zip |
[API] GET / SET User Settings (#16169)
* API: GET/SET User Settings
* linter
* Apply suggestions from code review
* Update modules/structs/user.go
* lint
* fix swagger
* move User2UserSettings to convert
* as per @zeripath "preferences" -> "settings"
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/swagger/v1_json.tmpl | 140 |
1 files changed, 139 insertions, 1 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 017dc824d7..7425150a98 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -10911,6 +10911,47 @@ } } }, + "/user/settings": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get user settings", + "operationId": "getUserSettings", + "responses": { + "200": { + "$ref": "#/responses/UserSettings" + } + } + }, + "patch": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Update user settings", + "operationId": "updateUserSettings", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/UserSettingsOptions" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/UserSettings" + } + } + } + }, "/user/starred": { "get": { "produces": [ @@ -16578,6 +16619,94 @@ }, "x-go-package": "code.gitea.io/gitea/models" }, + "UserSettings": { + "description": "UserSettings represents user settings", + "type": "object", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "diff_view_style": { + "type": "string", + "x-go-name": "DiffViewStyle" + }, + "full_name": { + "type": "string", + "x-go-name": "FullName" + }, + "hide_activity": { + "type": "boolean", + "x-go-name": "HideActivity" + }, + "hide_email": { + "description": "Privacy", + "type": "boolean", + "x-go-name": "HideEmail" + }, + "language": { + "type": "string", + "x-go-name": "Language" + }, + "location": { + "type": "string", + "x-go-name": "Location" + }, + "theme": { + "type": "string", + "x-go-name": "Theme" + }, + "website": { + "type": "string", + "x-go-name": "Website" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "UserSettingsOptions": { + "description": "UserSettingsOptions represents options to change user settings", + "type": "object", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "diff_view_style": { + "type": "string", + "x-go-name": "DiffViewStyle" + }, + "full_name": { + "type": "string", + "x-go-name": "FullName" + }, + "hide_activity": { + "type": "boolean", + "x-go-name": "HideActivity" + }, + "hide_email": { + "description": "Privacy", + "type": "boolean", + "x-go-name": "HideEmail" + }, + "language": { + "type": "string", + "x-go-name": "Language" + }, + "location": { + "type": "string", + "x-go-name": "Location" + }, + "theme": { + "type": "string", + "x-go-name": "Theme" + }, + "website": { + "type": "string", + "x-go-name": "Website" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "WatchInfo": { "description": "WatchInfo represents an API watch status of one repository", "type": "object", @@ -17281,6 +17410,15 @@ } } }, + "UserSettings": { + "description": "UserSettings", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/UserSettings" + } + } + }, "WatchInfo": { "description": "WatchInfo", "schema": { @@ -17335,7 +17473,7 @@ "parameterBodies": { "description": "parameterBodies", "schema": { - "$ref": "#/definitions/CreateTagOption" + "$ref": "#/definitions/UserSettingsOptions" } }, "redirect": { |