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 operationId: get-article-block-view
security: security:
- bearerAuth: [] - 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: responses:
'200': '200':
description: successful operation description: successful operation
@ -1559,13 +1572,7 @@ paths:
schema: schema:
type: array type: array
items: items:
type: object
properties:
id:
type: string type: string
revision:
type: integer
format: int64
'401': '401':
description: permission denied description: permission denied
'410': '410':
@ -1629,13 +1636,7 @@ paths:
schema: schema:
type: array type: array
items: items:
type: object $ref: '#/components/schemas/ArticleView'
properties:
id:
type: string
revision:
type: integer
format: int64
'401': '401':
description: permission denied description: permission denied
'404': '404':
@ -4067,36 +4068,6 @@ components:
data: data:
type: string 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: Account:
type: object type: object
required: required:
@ -4373,10 +4344,37 @@ components:
type: integer type: integer
format: int64 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: Article:
type: object type: object
required: required:
- articleId - articleId
- articleBlockId
- revision - revision
- dataType - dataType
- data - data
@ -4384,12 +4382,14 @@ components:
- updated - updated
- status - status
- labels - labels
- tagRevision
- tagCount - tagCount
- tagUpdated - tagUpdated
- tagRevision
properties: properties:
articleId: articleId:
type: string type: string
articleBlockId:
type: string
revision: revision:
type: integer type: integer
format: int64 format: int64
@ -4424,6 +4424,22 @@ components:
type: integer type: integer
format: int64 format: int64
ArticleView:
type: object
required:
- articleId
- revision
- tagRevision
properties:
articleId:
type: string
revision:
type: integer
format: int64
tagRevision:
type: integer
format: int64
Group: Group:
type: object type: object
required: required:

View File

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

View File

@ -38,24 +38,19 @@ type AppData struct {
Image string `json:"image,omitempty"` 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 { type Subject struct {
DataType string `json:"dataType"` DataType string `json:"dataType"`
Data string `json:"data"` Data string `json:"data"`
} }
type ArticleEntry struct {
BlockId string `json:"blockId"`
Article *Article `json:"article"`
}
type Article struct { type Article struct {
ArticleId string `json:"articleId"` ArticleId string `json:"articleId"`
ArticleBlockId string `json:"articleBlockId"`
Revision int64 `json:"revision"` Revision int64 `json:"revision"`
DataType string `json:"type"` DataType string `json:"type"`
Data string `json:"data"` Data string `json:"data"`
@ -69,6 +64,17 @@ type Article struct {
TagRevision int64 `json:"tagRevision"` 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 { type ArticleIdAssetsBody struct {
FileName **os.File `json:"fileName,omitempty"` FileName **os.File `json:"fileName,omitempty"`
} }
@ -167,34 +173,6 @@ type GroupsGroupIdBody struct {
Data string `json:"data"` 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 { type Insight struct {
InsightId string `json:"insightId"` InsightId string `json:"insightId"`
InsightRevision int64 `json:"insightRevision"` InsightRevision int64 `json:"insightRevision"`