diff --git a/doc/api.oa3 b/doc/api.oa3 index f967ab26..ad38a57e 100644 --- a/doc/api.oa3 +++ b/doc/api.oa3 @@ -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 + type: string '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: @@ -4372,11 +4343,38 @@ components: tagRevision: 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: diff --git a/net/server/internal/api_addArticle.go b/net/server/internal/api_addArticle.go index 2e837d6d..7ecf7831 100644 --- a/net/server/internal/api_addArticle.go +++ b/net/server/internal/api_addArticle.go @@ -83,7 +83,6 @@ func AddArticle(w http.ResponseWriter, r *http.Request) { articleEntry := &ArticleEntry{ BlockId: articleBlock.ArticleBlockId, - BlockRevision: articleBlock.Revision, Article: getArticleModel(article, 0), } diff --git a/net/server/internal/models.go b/net/server/internal/models.go index fb60cb9c..8ca35908 100644 --- a/net/server/internal/models.go +++ b/net/server/internal/models.go @@ -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"`