Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
P portal
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Create a new issue
  • Jobs
  • Issue Boards
Collapse sidebar
  • 科探开源
  • portal
  • Wiki
    • 门户v2 api 文档
  • 05.PageLayout API v2

05.PageLayout API v2 · Changes

Page history
Update 门户V2 API 文档/05.PageLayout API v2 authored Dec 21, 2020 by 杜安山's avatar 杜安山
Hide whitespace changes
Inline Side-by-side
Showing with 128 additions and 0 deletions
+128 -0
  • 门户V2-API-文档/05.PageLayout-API-v2.md 门户V2-API-文档/05.PageLayout-API-v2.md +128 -0
  • No files found.
门户V2-API-文档/05.PageLayout-API-v2.md 0 → 100644
View page @ 714385ed
## 1.1 PageLayout API 概述
- PageLayout API 提供每个页面数据结构,输出数据根据角色或者path结构授权
- PageLayout API 提供的页面数据结构查询接口如下:
- 已登录用户可以访问的页面数据结构的接口
- 匿名用户可访问的页面数据结构的接口
- 查询已登录用户可访问的页面数据结构接口 [/portal/api/v2/page/layout?_format=json](https://note.youdao.com) GET
- 匿名用户可访问的页面数据结构的接口 [/portal/api/v2/page/layout/anonymous?_format=json](https://note.youdao.com/) GET
- 如需要额外接口满足项目需求,可以通过后台使用**Portal Views**配置
## 1.2.PageLayout API 已登录用户授权访问的页面数据接口
```
GET /portal/api/v2/page/layout?_format=json HTTP/1.1
Host: portal.xx.edu.com.cn
Authorization: Bearer 39aec9c68b679d43de6803e0f14c223j
path={value}
```
## 1.3.PageLayout API 匿名用户授权访问的页面数据接口
```
GET /portal/api/v2/page/layout/anonymous?_format=json HTTP/1.1
Host: portal.xx.edu.com.cn
Authorization: Bearer 39aec9c68b679d43de6803e0f14c223j
path={value}
```
## 1.2.1.PageLayout API 新增单个数据的请求参数
具体的字段如下:
参数名 | 类型 | 是否必需 | 描述
---|---|--|----|---
path | string | 是 | 例:/node (首页) 具体值根据定义的路由确定
## 1.3 响应数据结构
```
{
"content_all": {
"portalblockxinwenzhongxin": {
"label": "Portal block: 新闻中心",
"label_display": "visible",
"block_component": "tab_block",
"block_content": [
{
"icon": "/",
"link": "http://etl.dd:8083/zh-hans/admin/portal/content/page_block_content/add/block_content",
"title": "校内新闻",
"block_content_component": "news_list",
"source_type": "json_url",
"content": {
"urls": [
"http://etl.dd:8083/admin/portal/content/subscription"
]
}
},
{
"icon": "/",
"link": "http://etl.dd:8083/admin/portal/content/subscription",
"title": "通知公告",
"block_content_component": "hot_list",
"source_type": "json_url",
"content": {
"urls": [
"http://etl.dd:8083/admin/portal/content/subscription"
]
}
}
]
}
},
"content_second": {
"portalblockrichengzhongxin": {
"label": "Portal block: 日程中心",
"label_display": "visible",
"block_component": "normal_block",
"block_content": [
{
"icon": "/",
"link": "http://etl.dd:8083/admin/portal/content/subscription",
"title": "校内会议",
"block_content_component": "news_list",
"source_type": "json_url",
"content": {
"urls": [
"http://etl.dd:8083/admin/portal/content/subscription"
]
}
},
{
"icon": "/",
"link": "http://etl.dd:8083/admin/portal/content/subscription",
"title": "课表安排",
"block_content_component": "hot_list",
"source_type": "json_url",
"content": {
"urls": [
"http://etl.dd:8083/admin/portal/content/subscription"
]
}
}
]
}
}
}
```
## 1.3.1.PageLayout API 更新单个数据的请求参数
具体的字段如下:
参数名 | 类型 | 是否必需 | 描述
---|---|--|----|---
_links | string | 是 | 参数bundle为具体内容类型的key。系统已有bundle的key为news
type | string | 否 | bundle可设置为系统默认的类型news,也可以在系统后台定义其他的类型,比如note等
title | string | 否 | 信息标题
field_access_roles | string | 否 | 可以访问资源的用户角色的,后台可配置其他角色,默认key有:anonymous、authenticated
field_department | int | 否 | 根据用户所在的部门访问次资源。具体的key,根据后台配置得到。
field_category | int | 否 | 属于具体的类别,后台可配置
url_redirection | string | 否 | 跳转地址,
published_date | timestamp | 否 | 信息的发布时间
body | string | 否 | 描述简介
status | int | 否 | 此资源是否发布,1)如果为0,则不发,2)如果为1,则发布。
Clone repository
  • Home
  • 数据管理手册
    • 094.Views twig 配置
    • ETL01.数据管理使用手册 V2.0
    • ETL02.Source 数据请求 data_fetcher_plugin
    • ETL03.Source 解析 data_parser_plugin
    • ETL04.Source 认证插件 authentication
    • ETL05.Porcess plugins 明细
    • ETL06.URL endpoint 数据管理E
    • ETL07.Mysql 数据管理
    • ETL08.MSSQL 数据管理
    • ETL09.Oracle 数据管理
    • ETL10.Token 列表
  • 门户V2 API 文档
    • 01.Portal Rest API v2
    • 01.Resource API
    • 02.App API
View All Pages