2020-1-28-coding获取项目列表

发布时间 2023-09-17 19:22:38作者: Yecgaa1
layout: post
title: coding获取项目信息
categories: coding-post
tag: coding api

coding获取项目信息

接口URL

https://<team-name>.coding.net/api/projects

请求方式

GET

请求header参数:

cookie:eid

请求Query参数

参数 示例值 必填 参数描述
page 1 页数
pageSize 1000 每页容量
type 1
teamType 1

成功返回参数

参数 示例值 参数描述
code 0 状态码
data.list ··· 项目信息列表
data.list.description ··· 项目描述
data.list.ssh_url xxxx.git git地址
data.list.owner_user_name xutongxin 项目所有人
data.list.id 123321 项目id
data.list.current_user_role admin 该用户在此项目权限
data.page 1 当前页码
data.totalPage 1 总页码
data.totalRow 3 总项目数=总行数

成功示例数据

{
	"code": 0,
	"data": {
		"list": [
			{
				"created_at": 1563349074000,
				"backend_project_path": "/team/xutongxin/project/test",
				"description": "123",
				"git_url": "git@e.coding.net:xutongxin/test.git",
				"ssh_url": "git@e.coding.net:xutongxin/test.git",
				"svn_url": "svn+ssh://svn@svn.e.coding.net/xutongxin/test",
				"is_public": false,
				"https_url": "https://e.coding.net/xutongxin/test.git",
				"vcs_type": "git",
				"subversion_url": "svn.e.coding.net/xutongxin/test",
				"id": 163693,
				"name": "test",
				"name_pinyin": "test",
				"display_name": "test",
				"owner_id": 0,
				"owner_user_name": "xutongxin",
				"owner_user_picture": "https://coding-net-production-static-ci.codehub.cn/WM-REXT-AVATAR-hhRyeVzAOcdIIllXCioP.jpg",
				"owner_user_home": "<a href=\"https://xutongxin.coding.net/u/ysscsaBHedA\">yssdcpBHedA</a>",
				"project_path": "/p/test",
				"status": 1,
				"type": 2,
				"updated_at": 1567398064000,
				"fork_count": 0,
				"star_count": 0,
				"watch_count": 0,
				"pin": false,
				"depot_path": "/p/test/d/test/git",
				"forked": false,
				"un_read_activities_count": 0,
				"icon": "/static/project_icon/scenery-11.png",
				"current_user_role_id": 90,
				"current_user_role": "admin",
				"stared": false,
				"watched": false,
				"recommended": 0,
				"shared": false,
				"is_member": false,
				"max_member": 0,
				"groupId": 0,
				"plan": 1,
				"isTeam": true,
				"archived": false,
				"isDemo": false,
				"taskHide": true,
				"default_depot_name": "test",
				"agile_feature_initialized": false
			}
		],
		"page": 1,
		"pageSize": 10,
		"totalPage": 1,
		"totalRow": 1
	}
}

失败返回参数

参数 示例值 参数描述
code 1000 状态码
msg ··· 错误原因描述

失败示例数据

{
	"code": 1000,
	"msg": {
		"user_not_login": "用户未登录"
	},
	"data": {
		"account_type": 0
	}
}