Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public API of the project #28

Open
6 tasks
HideBa opened this issue Mar 24, 2022 · 0 comments
Open
6 tasks

Public API of the project #28

HideBa opened this issue Mar 24, 2022 · 0 comments
Assignees
Labels

Comments

@HideBa
Copy link
Member

HideBa commented Mar 24, 2022

Leader

@gop50k

User story

Users want to access their own data through public APIs. This will allow them to edit their data in the CMS and use it via the API for use in blogs, Re:Earth itself, and other applications. Also, by specifying the data format using the extension at the end of the endpoint, the data can be returned in a format that is supported by Re:Earth by default and can be used by other applications such as blogs, Re:Earth itself, and other applications.

Requirements

  • Items of the project whose publication settings allows to them be public can be retrieved via public API
  • Re:Earth should support this data format as default
    • tables/tableId/records.json -> JSON
    • tables/tableId/records.csv -> CSV

Design file

Testing list

  • When OO is
    • If you input "XXX", it should show "YYY"

public api memo

// Domain model

// already we have
type Schema struct {
	id string
}

type Project struct {
	id          ID
	workspaceID WorkspaceID
	name        string
	description string
	alias       string
	imageURL    *url.URL
	updatedAt   time.Time
}

type Workspace strcut {
}

// we will have
type ProjectPublicSetting struct {
	projectId id
	publicScope string //"APIKEY" | "ANYONE"
	publicModelIds id[]
	assetPublic bool
}
mutation(input: UpdatePublicModelInput!): PublicModelPayload
  1. 公開APIの設定をUpdate, Readができるようにする

    1. GraphQLのスキーマを決定
    2. ドメインモデルの実装
    3. ユースケース
    4. DB
    5. Graphql, Adapter
  2. 公開API自体の実装

    baseURL: https://api.cms.reearth.io/{workspaceId}

    1. スキーマ

      GET: /{projectId}/{schemaId}

      paramsName place type
      direction path enum of asc, desc
      limit path number
      {
      	schemaList: [
      		{
      			"id": "author",
      			"name": "Author",
      			...
      		}
      	],
      	totalNum: 10
      }
    2. アイテム

      GET: /{projectId}/{schemaId}/items

      {
      	itemList: [
      		{
      			"id": "author",
      			"name": "Author",
      			...
      		}
      	],
      	totalNum: 10
      }
    3. アセット

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants