---
title: "获取分类列表，构造成树形结构返回"
method: GET
path: "/category/tree"
tags: ["前台-分类"]
---

# 获取分类列表，构造成树形结构返回

`GET /category/tree`

## Query parameters

- `contentType` string, required

## Response `200`

分类列表

- ModelCategoryTreeItem[]
  - `brief` string — 简述
  - `content` string — 详细介绍
  - `id` integer — 分类ID，自增主键
  - `indent` string — 缩进字符串，包含：&nbsp;, " │", " ├", " └"
  - `items` ModelCategoryTreeItem[] — 子级数据项
  - `name` string — 分类名称
  - `parent_id` integer — 父级分类ID，用于层级管理
  - `thumb` string — 封面图

## Changes

> 13 revisions in range; 1 could not be searched.

- **2020-11-23** `5360f0b5286c` — 2 info
  - api tag `前台-分类` added
  - api tag `分类` removed
- **2020-11-10** `2f2843724d00` — 1 info
  - endpoint added
- **2020-10-30** `71161e2ef517` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/gogf/apis/goframe-api/changes/category/tree/get.md)

---

[API](https://skmtc.dev/gogf/apis/goframe-api.md) · [All operations](https://skmtc.dev/gogf/apis/goframe-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gogf/goframe-api/revisions/d05fe905b682/schema)
