updating article block model

This commit is contained in:
Roland Osborne 2022-01-28 14:37:35 -08:00
parent b4b2c2c651
commit 3af0122d64
3 changed files with 78 additions and 85 deletions

View File

@ -1551,6 +1551,19 @@ paths:
operationId: get-article-block-view
security:
- bearerAuth: []
parameters:
- name: viewRevision
in: query
description: only return updated if view matches
required: false
schema:
type: string
- name: contentRevision
in: query
description: only return updated if view matches
required: false
schema:
type: string
responses:
'200':
description: successful operation
@ -1559,13 +1572,7 @@ paths:
schema:
type: array
items:
type: object
properties:
id:
type: string
revision:
type: integer
format: int64
'401':
description: permission denied
'410':
@ -1629,13 +1636,7 @@ paths:
schema:
type: array
items:
type: object
properties:
id:
type: string
revision:
type: integer
format: int64
$ref: '#/components/schemas/ArticleView'
'401':
description: permission denied
'404':
@ -4067,36 +4068,6 @@ components:
data:
type: string
ArticleAccess:
type: object
required:
- labels
- groups
properties:
labels:
type: array
items:
type: string
groups:
type: array
items:
type: string
ArticleEntry:
type: object
required:
- blockId
- blockRevision
- article
properties:
blockId:
type: string
blockRevision:
type: integer
format: int64
article:
$ref: '#/components/schemas/Article'
Account:
type: object
required:
@ -4373,10 +4344,37 @@ components:
type: integer
format: int64
ArticleAccess:
type: object
required:
- labels
- groups
properties:
labels:
type: array
items:
type: string
groups:
type: array
items:
type: string
ArticleEntry:
type: object
required:
- articleBlockId
- article
properties:
articleBlockId:
type: string
article:
$ref: '#/components/schemas/Article'
Article:
type: object
required:
- articleId
- articleBlockId
- revision
- dataType
- data
@ -4384,12 +4382,14 @@ components:
- updated
- status
- labels
- tagRevision
- tagCount
- tagUpdated
- tagRevision
properties:
articleId:
type: string
articleBlockId:
type: string
revision:
type: integer
format: int64
@ -4424,6 +4424,22 @@ components:
type: integer
format: int64
ArticleView:
type: object
required:
- articleId
- revision
- tagRevision
properties:
articleId:
type: string
revision:
type: integer
format: int64
tagRevision:
type: integer
format: int64
Group:
type: object
required:

View File

@ -83,7 +83,6 @@ func AddArticle(w http.ResponseWriter, r *http.Request) {
articleEntry := &ArticleEntry{
BlockId: articleBlock.ArticleBlockId,
BlockRevision: articleBlock.Revision,
Article: getArticleModel(article, 0),
}

View File

@ -38,24 +38,19 @@ type AppData struct {
Image string `json:"image,omitempty"`
}
type ArticleAccess struct {
Labels []string `json:"labels"`
Groups []string `json:"groups"`
}
type ArticleEntry struct {
BlockId string `json:"blockId"`
BlockRevision int64 `json:"blockRevision"`
Article *Article `json:"article"`
}
type Subject struct {
DataType string `json:"dataType"`
Data string `json:"data"`
}
type ArticleEntry struct {
BlockId string `json:"blockId"`
Article *Article `json:"article"`
}
type Article struct {
ArticleId string `json:"articleId"`
ArticleBlockId string `json:"articleBlockId"`
Revision int64 `json:"revision"`
DataType string `json:"type"`
Data string `json:"data"`
@ -69,6 +64,17 @@ type Article struct {
TagRevision int64 `json:"tagRevision"`
}
type ArticleView struct {
ArticleId string `json:"articleId"`
Revision int64 `json:"revision"`
TagRevision int64 `json:"tagRevision"`
}
type ArticleAccess struct {
Labels []string `json:"labels"`
Groups []string `json:"groups"`
}
type ArticleIdAssetsBody struct {
FileName **os.File `json:"fileName,omitempty"`
}
@ -167,34 +173,6 @@ type GroupsGroupIdBody struct {
Data string `json:"data"`
}
type InlineResponse200 struct {
Token string `json:"token,omitempty"`
Status string `json:"status"`
}
type InlineResponse2001 struct {
Id string `json:"id,omitempty"`
Revision int64 `json:"revision,omitempty"`
}
type InlineResponse2002 struct {
BlockId string `json:"blockId,omitempty"`
BlockRevision int64 `json:"blockRevision,omitempty"`
Tag *Tag `json:"tag,omitempty"`
}
type InlineResponse201 struct {
BlockId string `json:"blockId,omitempty"`
BlockRevision int64 `json:"blockRevision,omitempty"`
Article *Article `json:"article,omitempty"`
}
type InlineResponse2011 struct {
BlockId string `json:"blockId,omitempty"`
BlockRevision int64 `json:"blockRevision,omitempty"`
Topic *Topic `json:"topic,omitempty"`
}
type Insight struct {
InsightId string `json:"insightId"`
InsightRevision int64 `json:"insightRevision"`