Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

공지사항 게시판을 만들어 보자..

...

GET {{protocol}}://{{hostname}}:{{port}}/node/nodeType/noticeBoard

GET {{protocol}}://{{hostname}}:{{port}}/node/nodeType/read.json?id=noticeBoard

GET {{protocol}}://{{hostname}}:{{port}}/node/nodeType/list.json?id_matching=noticeBoard

GET {{protocol}}://{{hostname}}:{{port}}/node/propertyType/list.json?tid_matching=noticeBoard

...

  • primary key 가 없으면

    Status
    colourRed
    titlecreate
    , 없으면
    Status
    colourYellow
    titleupdate
    처리

...

Custom API

api Cartegory

Code Block
languagejson
[
  {
    "typeId": "apiCategory",
    "id": "notice",
    "categoryName": "Notice Board  API",
    "dateFormat": "yyyy-MM-dd HH:mm:ss",
    "fileUrlFormat": {
      "default": "{{:getEnvValue('core.cluster.api-url-prefix')}}"
    },
    "commonParameters": [
      {
        "parameter": "apiKey",
        "required": false
      }
    ],
    "commonResponse": [
      {
        "field": "time",
        "type": "field",
        "value": "{{:sysdate}}"
      }
    ]
  }
]

...

Status
colourGreen
titleadmin
공지사항 상태변경 서비스 작성 이벤트 실행

Info

POST {{protocol}}://{{hostname}}:{{port}}/adm/notice/updateStatus

Api Schema

Code Block
{
  "typeId": "api",
  "category": "notice",
  "apiId": "test",
  "apiName": "서비스 작성 이벤트 실행",
  "apiType": "admin",
  "method": "POST",
  "parameters": [
  ],
  "config": [
    {
      "configId": "root",
      "tid": "noticeBoard",
      "type": "event",
      "allowParams": false,
      "orderNo": 1,
      "event": "testEvent"
    }
  ]
}

NodeType Schema 에 Event 추가

Code Block
[
  {
    "typeId": "nodeType",
    "parentId": "root",
    "tid": "noticeBoard",
    "typeName": "게시판",
    "repositoryType": "node",
    "tableName": "",
    "propertyTypes": [
    ],
    "events": [
      {
        "event": "testEvent",
        "name": "테스트 이벤트",
        "noneExecute": true,
        "eventActions": [
          {
            "action": "testAction",
            "actionName": "테스트 이벤트 작성",
            "actionType": "service",
            "actionBody": "noticeBoardService.test",
            "order": 1
          }
        ]
      }
    ]
  }
]