mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 20:49:16 +00:00
added article expiration
This commit is contained in:
parent
1dc2ddcf39
commit
e51197a3e5
39
doc/api.oa3
39
doc/api.oa3
@ -1783,6 +1783,44 @@ paths:
|
|||||||
data:
|
data:
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
/content/articles/{articleId}/expiration:
|
||||||
|
put:
|
||||||
|
tags:
|
||||||
|
- content
|
||||||
|
description: Set expiration for article. Access granted to app token of account holder.
|
||||||
|
operationId: set-article-expiration
|
||||||
|
security:
|
||||||
|
- bearerAuth: []
|
||||||
|
parameters:
|
||||||
|
- name: articleId
|
||||||
|
in: path
|
||||||
|
description: specified article id
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: success
|
||||||
|
'401':
|
||||||
|
description: permission denied
|
||||||
|
'404':
|
||||||
|
description: article not found
|
||||||
|
'410':
|
||||||
|
description: account disabled
|
||||||
|
'500':
|
||||||
|
description: internal server error
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- expires
|
||||||
|
properties:
|
||||||
|
expires:
|
||||||
|
type: number
|
||||||
|
format: int32
|
||||||
|
|
||||||
/content/articles/{articleId}/groups/{groupId}:
|
/content/articles/{articleId}/groups/{groupId}:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
@ -4553,3 +4591,4 @@ components:
|
|||||||
type: http
|
type: http
|
||||||
scheme: bearer
|
scheme: bearer
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,6 +133,11 @@ func SetArticleConfirmed(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SetArticleExpiration(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
|
}
|
||||||
|
|
||||||
func SetArticleGroup(w http.ResponseWriter, r *http.Request) {
|
func SetArticleGroup(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
|
@ -579,6 +579,13 @@ var routes = Routes{
|
|||||||
SetArticleConfirmed,
|
SetArticleConfirmed,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Route{
|
||||||
|
"SetArticleExpiration",
|
||||||
|
strings.ToUpper("Put"),
|
||||||
|
"/content/articles/{articleId}/expiration",
|
||||||
|
SetArticleExpiration,
|
||||||
|
},
|
||||||
|
|
||||||
Route{
|
Route{
|
||||||
"SetArticleGroup",
|
"SetArticleGroup",
|
||||||
strings.ToUpper("Post"),
|
strings.ToUpper("Post"),
|
||||||
@ -908,4 +915,3 @@ var routes = Routes{
|
|||||||
Status,
|
Status,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user