Versions Compared

Key

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

API 카테고리는 API를 그룹화 하여 관리하기 위해서 사용하며, 하위 API에 대한 공통 설정을 정의할 수 있다.

...

Info

{{protocol}}://{{hostname}}:{{port}}/{{apiType}}/{{apiCategory}}/{{api}}

API Category는 다음과 같은 속성을 정의한다.

...

  • Profile에 따라 환경 변수를 치환하여 결과를 반환한다.

Expand
titleapplication-default-loc.yml
Code Block
languageyaml
core:
  project: default
  internal-port: 8080
  session-timeout: 30m
  cluster:
    api-url-prefix: http://local.i-on.net:8080/
    front-url-prefix: http://local.i-on.net:3000/
    mode: all
    default-service-group: all
    members: 127.0.0.1

API Response :

Code Block
languagejson
"images": [
            {
                "id": "409",
                "imageType": {
                    "value": "representative",
                    "label": "대표이미지"
                },
                "file": "http://local.i-on.net:8080/productImage/file/202010/12/198395a0-5cbf-42b8-adc8-3c392e2db0a9.jpg",
                "label": "",
                "name": null,
                "fileSize": null,
                "width": null,
                "height": null
            }
        ]

Expand
titleapplication-default-dev.yml
Code Block
languageyaml
core:
  project: default
  internal-port: 8080
  session-timeout: 30m
  cluster:
    api-url-prefix: http://dev-core.justten.io/
    front-url-prefix: http://dev-builder.justten.io/
    mode: all
    default-service-group: all
    members: 127.0.0.1

API Response :

Code Block
languagejson
"images": [
            {
                "id": "409",
                "imageType": {
                    "value": "representative",
                    "label": "대표이미지"
                },
                "file": "http://dev-core.justten.io/productImage/file/202010/14/062c86ae-fe0a-479a-bc7b-8d70fa41c135.jpg",
                "label": "",
                "name": null,
                "fileSize": null,
                "width": null,
                "height": null
            }
        ]

커스텀 가능

Expand

apiCategory

  • "video" 추가

Code Block
languagejson
"fileUrlFormat": {
      "default": "{{:getEnvValue(core.cluster.api-url-prefix, url)}}",
      "video": "{{:getEnvValue(core.cluster.wowza-url-prefix, url)}}"
}

application.yml

  • core.cluster.wowza-url-prefix 설정

Code Block
languageyaml
core:
  project: sbdc
  internal-port: 8080
  session-timeout: 30m
  single-http-connector: true
  cluster:
    api-url-prefix: http://dev-core.justten.io/
    front-url-prefix: http://dev-builder.justten.io/
    wowza-url-prefix: https://vod.justten.io/vod_stg/_definst_/%s/playlist.m3u8
    mode: all
    default-service-group: all
    members: 192.1.1.110

propertyType.json

  • "fileHandler": "video", 설정

Code Block
languagejson
{
  "pid": "fileValue",
  "name": "파일",
  "valueType": "FILE",
  "required": true,
  "idable": false,
  "labelable": true,
  "treeable": false,
  "indexable": true,
  "analyzer": "simple",
  "fileHandler": "video",
  "referenceType": "",
  "referenceValue": "",
  "orderNo": 30
}

VideoFileRepository.java

  • FileRepository 추가. implements FileRepository

  • 명명규칙

    • {{fileHandler}}FileRepository.java

API Response :

mainImageFile 는 default fileHandler

fileValue 는 video fileHandler

Code Block
languagejson
{
	"mainImageFile": "http://dev-core.justten.io/imageResource/fileValue/202007/17/48195194-c6e5-4a86-a7e4-a3e61b777032.png",
	"fileValue": "https://vod.justten.io/vod/_definst_/videoResource/fileValue/202003/25/21c90041-95eb-406f-8a2b-5e15ef4bc6dd.mp4/playlist.m3u8"
}

...