Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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

“ noticeBoard “

Field ID

Field Name

Value Type

Nullable

Default Value

id PK

아이디

long

N

title

제목

string

N

content

내용

clob

N

file

첨부파일

string

enable

사용여부

boolean

true

owner FK

등록자

string

created

등록일

date

modifier FK

수정자

string

changed

수정일

date

Schema 작성

NodeType

[
  {
    "typeId": "nodeType",
    "parentId": "root",
    "tid": "noticeBoard",
    "typeName": "게시판",
    "repositoryType": "node",
    "tableName": "",
    "propertyTypes": [
    
    
    ]
  }
]

PropertyType

  • Primary Key

    • “idable” : “true”

    • idType

      • id 자동 생성 유형

      • idType 이 없으면 id 직접 입력

      • autoIncrement, UUID, hash

[
  {
    "typeId": "nodeType",
    "parentId": "root",
    "tid": "noticeBoard",
    "typeName": "게시판",
    "repositoryType": "node",
    "tableName": "",
    "propertyTypes": [
      {
        "pid": "id",
        "name": "ID",
        "valueType": "LONG",
        "idable": true,
        "idType": "hash",
        "indexable": true,
        "orderNo": 10
      },
      {
        "pid": "title",
        "name": "제목",
        "valueType": "STRING",
        "required": true,
        "labelable": true,
        "indexable": true,
        "analyzer": "simple",
        "orderNo": 2
      },
      {
        "pid": "content",
        "name": "내용",
        "valueType": "TEXT",
        "required": true,
        "indexable": false,
        "orderNo": 3
      },
      {
        "pid": "file",
        "name": "File",
        "valueType": "FILE",
        "required": false,
        "indexable": false,
        "orderNo": 4
      },
      {
        "pid": "enable",
        "name": "사용여부",
        "valueType": "BOOLEAN",
        "required": false,
        "indexable": true,
        "defaultValue": "true",
        "orderNo": 5
      },
      {
        "pid": "owner",
        "name": "등록자",
        "valueType": "REFERENCE",
        "indexable": true,
        "analyzer": "code",
        "referenceType": "user",
        "orderNo": 6
      },
      {
        "pid": "created",
        "name": "등록일",
        "valueType": "DATE",
        "required": false,
        "indexable": true,
        "orderNo": 7
      },
      {
        "pid": "modifier",
        "name": "수정자",
        "valueType": "REFERENCE",
        "indexable": true,
        "analyzer": "code",
        "referenceType": "user",
        "orderNo": 8
      },
      {
        "pid": "changed",
        "name": "수정일",
        "valueType": "DATE",
        "required": false,
        "indexable": true,
        "analyzer": "simple",
        "orderNo": 9
      }
    ]
  }
]

loadSchema

작성한 schema 를 caching 한다.

GET {{protocol}}://{{hostname}}:{{port}}/helper/loadSchema

  • filePath : Absolute Path

  • helper/loadSchema :

  • helper/reloadSchema :

{{protocol}}://{{hostname}}:{{port}}/helper/loadSchema?filePath=/Users/jjong/IdeaProjects/backendcore/src/main/resources/schema/common/site

Caching 된 Schema (NodeType, PropertyType)를 조회해볼 수 있다. ( NodeController.java 참조 )

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

 Api Response
{
    "result": "200",
    "resultMessage": "SUCCESS",
    "item": {
        "id": "noticeBoard",
        "lable": "게시판",
        "parentId": {
            "value": "root",
            "label": "root",
            "refId": "root"
        },
        "tid": "noticeBoard",
        "repositoryType": {
            "value": "node",
            "label": "Node"
        },
        "typeName": "게시판",
        "microservice": null,
        "standaloneIndex": true,
        "targetGroup": null,
        "eviction": 10000,
        "i18n": null,
        "historyable": null,
        "datasource": null,
        "tableName": null,
        "uniqueFields": null,
        "authorityRule": null,
        "filter": null,
        "tempSave": null,
        "jsonStore": null,
        "statistic": null,
        "trace": null,
        "workflow": null,
        "owner": {
            "value": "anonymous",
            "label": "Anonymous User",
            "refId": "user::anonymous"
        },
        "created": "20200730144800",
        "modifier": {
            "value": "anonymous",
            "label": "Anonymous User",
            "refId": "user::anonymous"
        },
        "changed": "20200730144800",
        "propertyTypes": [
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "pid": "id",
                "name": "ID",
                "valueType": {
                    "value": "STRING",
                    "label": "String"
                },
                "required": true,
                "idable": true,
                "indexable": true,
                "analyzer": {
                    "value": "code",
                    "label": "Code Analyzer"
                },
                "orderNo": 1,
                "created": "20200730144800",
                "id": "noticeBoard>id",
                "label": "ID",
                "defaultValue": null,
                "description": null,
                "defaultComponent": null,
                "labelable": null,
                "i18n": null,
                "sortable": null,
                "facetable": null,
                "indexNull": null,
                "idType": null,
                "length": null,
                "encryption": null,
                "secure": null,
                "virtual": null,
                "authority": null,
                "presetOption": null,
                "option": null,
                "relatedPid": null,
                "enableCondition": null,
                "requiredCondition": null,
                "valueFunction": null,
                "columnId": null,
                "useRefId": null
            },
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "pid": "title",
                "name": "제목",
                "valueType": {
                    "value": "STRING",
                    "label": "String"
                },
                "required": true,
                "labelable": true,
                "indexable": true,
                "analyzer": {
                    "value": "simple",
                    "label": "Simple Analyzer"
                },
                "orderNo": 2,
                "created": "20200730144800",
                "id": "noticeBoard>title",
                "label": "제목",
                "defaultValue": null,
                "description": null,
                "defaultComponent": null,
                "idable": null,
                "i18n": null,
                "sortable": null,
                "facetable": null,
                "indexNull": null,
                "length": null,
                "encryption": null,
                "secure": null,
                "virtual": null,
                "authority": null,
                "presetOption": null,
                "option": null,
                "relatedPid": null,
                "enableCondition": null,
                "requiredCondition": null,
                "valueFunction": null,
                "columnId": null,
                "useRefId": null
            },
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "pid": "content",
                "name": "내용",
                "valueType": {
                    "value": "TEXT",
                    "label": "Text"
                },
                "required": true,
                "indexable": false,
                "orderNo": 3,
                "created": "20200730144800",
                "id": "noticeBoard>content",
                "label": "내용",
                "defaultValue": null,
                "description": null,
                "defaultComponent": null,
                "idable": null,
                "labelable": null,
                "i18n": null,
                "sortable": null,
                "facetable": null,
                "length": null,
                "encryption": null,
                "secure": null,
                "virtual": null,
                "authority": null,
                "presetOption": null,
                "option": null,
                "relatedPid": null,
                "enableCondition": null,
                "requiredCondition": null,
                "valueFunction": null,
                "columnId": null,
                "useRefId": null
            },
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "pid": "file",
                "name": "File",
                "valueType": {
                    "value": "FILE",
                    "label": "File"
                },
                "required": false,
                "indexable": false,
                "orderNo": 4,
                "created": "20200730144800",
                "fileHandler": "default",
                "id": "noticeBoard>file",
                "label": "File",
                "defaultValue": null,
                "description": null,
                "defaultComponent": null,
                "idable": null,
                "labelable": null,
                "i18n": null,
                "facetable": null,
                "length": null,
                "encryption": null,
                "secure": null,
                "virtual": null,
                "authority": null,
                "presetOption": null,
                "option": null,
                "relatedPid": null,
                "enableCondition": null,
                "valueFunction": null,
                "columnId": null,
                "useRefId": null
            },
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "pid": "enable",
                "name": "사용여부",
                "valueType": {
                    "value": "BOOLEAN",
                    "label": "Boolean"
                },
                "defaultValue": "true",
                "required": false,
                "indexable": true,
                "orderNo": 5,
                "created": "20200730144800",
                "id": "noticeBoard>enable",
                "label": "사용여부",
                "description": null,
                "defaultComponent": null,
                "idable": null,
                "labelable": null,
                "i18n": null,
                "facetable": null,
                "analyzer": null,
                "indexNull": null,
                "length": null,
                "encryption": null,
                "secure": null,
                "virtual": null,
                "authority": null,
                "presetOption": null,
                "option": null,
                "relatedPid": null,
                "enableCondition": null,
                "valueFunction": null,
                "columnId": null,
                "useRefId": null
            },
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "pid": "owner",
                "name": "등록자",
                "valueType": {
                    "value": "REFERENCE",
                    "label": "Reference"
                },
                "indexable": true,
                "analyzer": {
                    "value": "code",
                    "label": "Code Analyzer"
                },
                "referenceType": {
                    "value": "user",
                    "label": "사용자",
                    "refId": "user"
                },
                "orderNo": 6,
                "created": "20200730144800",
                "id": "noticeBoard>owner",
                "label": "등록자",
                "defaultValue": null,
                "description": null,
                "defaultComponent": null,
                "required": null,
                "idable": null,
                "labelable": null,
                "treeable": null,
                "i18n": null,
                "facetable": null,
                "indexNull": null,
                "filter": null,
                "length": null,
                "encryption": null,
                "secure": null,
                "virtual": null,
                "authority": null,
                "presetOption": null,
                "option": null,
                "relatedPid": null,
                "enableCondition": null,
                "valueFunction": null,
                "columnId": null,
                "useRefId": null
            },
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "pid": "created",
                "name": "등록일",
                "valueType": {
                    "value": "DATE",
                    "label": "Date"
                },
                "required": false,
                "indexable": true,
                "orderNo": 7,
                "created": "20200730144800",
                "id": "noticeBoard>created",
                "label": "등록일",
                "defaultValue": null,
                "description": null,
                "defaultComponent": null,
                "idable": null,
                "labelable": null,
                "i18n": null,
                "facetable": null,
                "analyzer": null,
                "indexNull": null,
                "length": null,
                "encryption": null,
                "secure": null,
                "virtual": null,
                "authority": null,
                "presetOption": null,
                "option": null,
                "relatedPid": null,
                "enableCondition": null,
                "valueFunction": null,
                "columnId": null,
                "useRefId": null
            },
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "pid": "modifier",
                "name": "수정자",
                "valueType": {
                    "value": "REFERENCE",
                    "label": "Reference"
                },
                "indexable": true,
                "analyzer": {
                    "value": "code",
                    "label": "Code Analyzer"
                },
                "referenceType": {
                    "value": "user",
                    "label": "사용자",
                    "refId": "user"
                },
                "orderNo": 8,
                "created": "20200730144800",
                "id": "noticeBoard>modifier",
                "label": "수정자",
                "defaultValue": null,
                "description": null,
                "defaultComponent": null,
                "required": null,
                "idable": null,
                "labelable": null,
                "treeable": null,
                "i18n": null,
                "facetable": null,
                "indexNull": null,
                "filter": null,
                "length": null,
                "encryption": null,
                "secure": null,
                "virtual": null,
                "authority": null,
                "presetOption": null,
                "option": null,
                "relatedPid": null,
                "enableCondition": null,
                "valueFunction": null,
                "columnId": null,
                "useRefId": null
            },
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "pid": "changed",
                "name": "수정일",
                "valueType": {
                    "value": "DATE",
                    "label": "Date"
                },
                "required": false,
                "indexable": true,
                "analyzer": {
                    "value": "simple",
                    "label": "Simple Analyzer"
                },
                "orderNo": 9,
                "created": "20200730144801",
                "id": "noticeBoard>changed",
                "label": "수정일",
                "defaultValue": null,
                "description": null,
                "defaultComponent": null,
                "idable": null,
                "labelable": null,
                "i18n": null,
                "facetable": null,
                "indexNull": null,
                "length": null,
                "encryption": null,
                "secure": null,
                "virtual": null,
                "authority": null,
                "presetOption": null,
                "option": null,
                "relatedPid": null,
                "enableCondition": null,
                "valueFunction": null,
                "columnId": null,
                "useRefId": null
            }
        ],
        "events": [
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "event": "create",
                "name": "create 게시판",
                "buttonLabel": {
                    "ko": "New"
                },
                "eventType": {
                    "value": "form",
                    "label": "Has Form"
                },
                "enablePageTypes": [
                    {
                        "value": "list",
                        "label": "List Page"
                    },
                    {
                        "value": "createForm",
                        "label": "Create Form"
                    }
                ],
                "noneExecute": false,
                "changed": "20200730144800",
                "linkType": {
                    "value": "modal",
                    "label": "Modal"
                },
                "callbackLinkType": {
                    "value": "page",
                    "label": "Page"
                },
                "id": "noticeBoard>create",
                "label": "create 게시판",
                "compensatingEvent": null,
                "trace": null,
                "linkUrl": null,
                "linkUrlParams": null,
                "callbackLinkUrl": null,
                "authority": null,
                "enableCondition": null,
                "option": null,
                "eventActions": [],
                "eventListeners": []
            },
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "event": "update",
                "name": "update 게시판",
                "buttonLabel": {
                    "ko": "Save"
                },
                "eventType": {
                    "value": "form",
                    "label": "Has Form"
                },
                "enablePageTypes": [
                    {
                        "value": "view",
                        "label": "View Page"
                    },
                    {
                        "value": "updateForm",
                        "label": "Update Form"
                    }
                ],
                "noneExecute": false,
                "changed": "20200730144800",
                "linkType": {
                    "value": "modal",
                    "label": "Modal"
                },
                "callbackLinkType": {
                    "value": "page",
                    "label": "Page"
                },
                "id": "noticeBoard>update",
                "label": "update 게시판",
                "compensatingEvent": null,
                "trace": null,
                "linkUrl": null,
                "linkUrlParams": null,
                "callbackLinkUrl": null,
                "authority": null,
                "enableCondition": null,
                "option": null,
                "eventActions": [],
                "eventListeners": []
            },
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "event": "delete",
                "name": "delete 게시판",
                "buttonLabel": {
                    "ko": "Delete"
                },
                "eventType": {
                    "value": "direct",
                    "label": "Direct Execute"
                },
                "enablePageTypes": [
                    {
                        "value": "view",
                        "label": "View Page"
                    },
                    {
                        "value": "updateForm",
                        "label": "Update Form"
                    }
                ],
                "noneExecute": false,
                "changed": "20200730144800",
                "linkType": {
                    "value": "modal",
                    "label": "Modal"
                },
                "callbackLinkType": {
                    "value": "page",
                    "label": "Page"
                },
                "id": "noticeBoard>delete",
                "label": "delete 게시판",
                "compensatingEvent": null,
                "trace": null,
                "linkUrl": null,
                "linkUrlParams": null,
                "callbackLinkUrl": null,
                "authority": null,
                "enableCondition": null,
                "option": null,
                "eventActions": [],
                "eventListeners": []
            },
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "event": "read",
                "name": "read 게시판",
                "eventType": {
                    "value": "link",
                    "label": "Link Page"
                },
                "enablePageTypes": [
                    {
                        "value": "list",
                        "label": "List Page"
                    }
                ],
                "noneExecute": true,
                "changed": "20200730144800",
                "linkType": {
                    "value": "modal",
                    "label": "Modal"
                },
                "callbackLinkType": {
                    "value": "page",
                    "label": "Page"
                },
                "buttonLabel": {
                    "ko": null
                },
                "id": "noticeBoard>read",
                "label": "read 게시판",
                "compensatingEvent": null,
                "trace": null,
                "linkUrl": null,
                "linkUrlParams": null,
                "callbackLinkUrl": null,
                "authority": null,
                "enableCondition": null,
                "option": null,
                "eventActions": [],
                "eventListeners": []
            },
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "event": "list",
                "name": "list 게시판",
                "buttonLabel": {
                    "ko": "List"
                },
                "eventType": {
                    "value": "link",
                    "label": "Link Page"
                },
                "enablePageTypes": [
                    {
                        "value": "view",
                        "label": "View Page"
                    },
                    {
                        "value": "createForm",
                        "label": "Create Form"
                    },
                    {
                        "value": "updateForm",
                        "label": "Update Form"
                    }
                ],
                "noneExecute": true,
                "changed": "20200730144800",
                "linkType": {
                    "value": "modal",
                    "label": "Modal"
                },
                "callbackLinkType": {
                    "value": "page",
                    "label": "Page"
                },
                "id": "noticeBoard>list",
                "label": "list 게시판",
                "compensatingEvent": null,
                "trace": null,
                "linkUrl": null,
                "linkUrlParams": null,
                "callbackLinkUrl": null,
                "authority": null,
                "enableCondition": null,
                "option": null,
                "eventActions": [],
                "eventListeners": []
            },
            {
                "tid": {
                    "value": "noticeBoard",
                    "label": "게시판",
                    "refId": "noticeBoard"
                },
                "event": "allEvent",
                "name": "allEvent 게시판",
                "noneExecute": true,
                "changed": "20200730144800",
                "linkType": {
                    "value": "modal",
                    "label": "Modal"
                },
                "callbackLinkType": {
                    "value": "page",
                    "label": "Page"
                },
                "buttonLabel": {
                    "ko": null
                },
                "id": "noticeBoard>allEvent",
                "label": "allEvent 게시판",
                "eventType": null,
                "compensatingEvent": null,
                "trace": null,
                "enablePageTypes": null,
                "linkUrl": null,
                "linkUrlParams": null,
                "callbackLinkUrl": null,
                "authority": null,
                "enableCondition": null,
                "option": null,
                "eventActions": [],
                "eventListeners": []
            }
        ],
        "eventListeners": null
    }
}

기본 CRUD API

작성한 schema nodeType에서 기본 제공하는 crud API

GET {{protocol}}://{{hostname}}:{{port}}/node/noticeBoard/list.json

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

POST {{protocol}}://{{hostname}}:{{port}}/node/noticeBoard/create.json

POST {{protocol}}://{{hostname}}:{{port}}/node/noticeBoard/update.json

  • primary key 필수

POST {{protocol}}://{{hostname}}:{{port}}/node/noticeBoard/delete.json

  • primary key 필수

POST {{protocol}}://{{hostname}}:{{port}}/node/noticeBoard/save.json

  • primary key 가 없으면 CREATE , 없으면 UPDATE 처리

API

api Cartegory

[
  {
    "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}}"
      }
    ]
  }
]

api

FRONT 공지사항 리스트

{{protocol}}://{{hostname}}:{{port}}/svc/notice/list

Params

  • sorting

  • page

  • pageSize

Config

  • type : query

  • cacheable : true / cacheType : 60 → API 결과를 60초간 캐싱

Response

  • 아래와 같이 api 응답결과의 필드를 지정할수도 있고, 모든 필드를 반환할 수도 있다.

"response": [
  {
    "field": "id",
    "type": "field",
    "value": ""
  },
  {
    "field": "title",
    "type": "field",
    "value": ""
  }
]
"response": [
  {
    "field": "_all_",
    "type": "all"
  }
]

{
    "typeId": "api",
    "category": "notice",
    "apiId": "list",
    "apiName": "공지사항 리스트",
    "apiType": "service",
    "method": "GET",
    "parameters": [
    ],
    "config": [
      {
        "configId": "root",
        "tid": "noticeBoard",
        "type": "query",
        "allowParams": false,
        "orderNo": 1,
        "cacheable": true,
        "cacheTime": 60,
        "query": [
          {
            "method": "matching",
            "field": "enable",
            "value": "true"
          },
          {
            "method": "sorting",
            "value": "{{:sorting}},id desc"
          },
          {
            "method": "page",
            "value": "{{:page}}"
          },
          {
            "method": "pageSize",
            "value": "{{:pageSize}}"
          }
        ],
        "response": [
          {
            "field": "id",
            "type": "field",
            "value": ""
          },
          {
            "field": "title",
            "type": "field",
            "value": ""
          },
          {
            "field": "owner",
            "type": "field",
            "value": ""
          },
          {
            "field": "created",
            "type": "field",
            "value": ""
          }
        ]
      }
    ]
  }

FRONT 공지사항 조회

 

FRONT 공지사항 리스트

 

FRONT 공지사항 조회

 

  • No labels