위젯 만들기

위젯을 구현하기 위해 필요한 요청 데이터 식별자와 응답 결과 구조를 안내합니다.
콘솔에서 생성된 위젯은 데이터식별자에 widget 속성(property)으로 추가합니다.

데이타 식별자

{
  "dataID": "Some dataID",
  "property key": "Some Data Identifier property value",
  "widget":["widget_code_1","widget_code_2"]
}
KeyDescription
widget콘솔에서 생성된 웨젯코드를 요소로 하는 배열

Response Result

{
  "content_category": "200",
  "content_limit": "5",
  "content_sort": "asc",
  "create_date": "2025-01-01 12:00:13",
  "description": "인기 게시물",
  "widget_code": "top_post",
  "widget_key": "b9897jdfuidyuh23",
  "widget_type": "bbs_daily_rate",
  "content_list": [
    {"subject": "Subject 1","seq": 101,"create_date":"2025-01-01 12:00:13"},
    {"subject": "Subject 2","seq": 209,"create_date":"2025-01-04 12:00:13"}
  ]
}
KeyDescription
content_category위젯 콘텐츠 카테고리(게시판 시퀀스 등)
content_limit콘텐츠 노출 수
content_sort콘텐츠 정렬(asc or desc)
create_date위젯 생성일
description웨젯 설명
widget_code위젯 코드
widget_key위젯 키
widget_type위젯 형식(bbs_daily_rate:조회율 순,bbs_create_date:등록일 순,custom:사용자 지정 게시물)
content_list위젯 콘텐츠 - 게시물 목록과 동일한 Response
<div class="bg-white p-3 rounded-3">
<div>
  <h6 class="mb-3">많이본 게시물</h6>
  <ul class="list-group list-group-flush">
    <li class="list-group-item bg-transparent px-1" v-for="post in output.widget.most_read_post.content_list">
      <div class="d-flex justify-content-between align-items-center">
        <a :href="'/community/detail?post_key='+post.post_key" class="text-black">
          <small class="crop-text-1">{{ post.subject }}</small>
        </a>
        <small>{{ post.create_date }}</small>
      </div>
    </li>
  </ul>
</div>
</div>
<div class="bg-white p-3 rounded-3">
    <div>
        <h6 class="mb-3">많이본 게시물</h6>
        <ul class="list-group list-group-flush">
            <? foreach($output['widget']['most_read_post']['content_list'] as $intKey=>$arrPost){ ?>
                <li class="list-group-item bg-transparent px-1">
                    <div class="d-flex justify-content-between align-items-center">
                        <a href="/community/detail?post_key=<?=$arrPost['post_key'];?>" class="text-black">
                            <small class="crop-text-1"><?=$arrPost['subject'];?></small>
                        </a>
                        <small><?=$arrPost['create_date'];?></small>
                    </div>
                </li>
            <? } ?>
        </ul>
    </div>
</div>