项目

当前用户的项目列表

当前用户的项目列表,需要鉴权

  1. GET /api/user/projects?type=all&page={page}&pageSize={pageSize}

请求参数

字段描述
pageinteger页数 page
pageSizeinteger每页数量 pageSize
usernamestring用户 username

响应示例

  1. Status: 200 OK
  2. {
  3. "code": 0,
  4. "data": {
  5. "list": [
  6. {
  7. "created_at": 1553840847675,
  8. "backend_project_path": "/user/sunzhaoyao/project/dev-demo",
  9. "description": "开发者示例项目",
  10. "git_url": "git://git.coding.net/sunzhaoyao/dev-demo.git",
  11. "ssh_url": "git@git.coding.net:sunzhaoyao/dev-demo.git",
  12. "svn_url": "svn+ssh://svn@svn.coding.net/sunzhaoyao/dev-demo",
  13. "is_public": false,
  14. "https_url": "https://git.coding.net/sunzhaoyao/dev-demo.git",
  15. "vcs_type": "git",
  16. "subversion_url": "subversion.coding.net/sunzhaoyao/dev-demo",
  17. "id": 4260817,
  18. "name": "dev-demo",
  19. "display_name": "示例项目",
  20. "owner_id": 2169331,
  21. "owner_user_name": "sunzhaoyao",
  22. "owner_user_picture": "https://coding-net-production-static-ci.codehub.cn/WM-TEXT-AVATAR-AShcXtEmwkLlMcZJSQtz.jpg",
  23. "owner_user_home": "<a href=\"https://coding.net/u/sunzhaoyao\">sunzhaoyao</a>",
  24. "project_path": "/u/sunzhaoyao/p/dev-demo",
  25. "status": 1,
  26. "type": 2,
  27. "updated_at": 1553840847675,
  28. "fork_count": 0,
  29. "star_count": 0,
  30. "watch_count": 0,
  31. "download_count": 0,
  32. "pin": false,
  33. "depot_path": "/u/sunzhaoyao/p/dev-demo/git",
  34. "forked": false,
  35. "un_read_activities_count": 0,
  36. "icon": "https://dn-coding-net-production-pp.codehub.cn/79a8bcc4-d9cc-4061-940d-5b3bb31bf571.png",
  37. "current_user_role_id": 0,
  38. "stared": false,
  39. "watched": false,
  40. "recommended": 0,
  41. "shared": false,
  42. "is_member": false,
  43. "max_member": 20,
  44. "groupId": 0,
  45. "plan": 1,
  46. "isTeam": false,
  47. "isDemo": true
  48. }
  49. ],
  50. "page": 1,
  51. "pageSize": 10,
  52. "totalPage": 6,
  53. "totalRow": 54
  54. }
  55. }

获取用户的公开项目列表

获取用户的公开项目列表

  1. GET /api/user/{username}/projects/public?type=joined&amp;page={page}&amp;pageSize={pageSize}

请求参数

字段描述
pageinteger页数 page
pageSizeinteger每页数量 pageSize
usernamestring用户 username

响应示例

  1. Status: 200 OK
  2. {
  3. "code": 0,
  4. "data": {
  5. "list": [
  6. {
  7. "created_at": 1507771905000,
  8. "backend_project_path": "/user/coding/project/Comments",
  9. "description": "A comment system based on Coding.net",
  10. "git_url": "git://git.coding.net/coding/Comments.git",
  11. "ssh_url": "git@git.coding.net:coding/Comments.git",
  12. "svn_url": "svn+ssh://svn@svn.coding.net/coding/Comments",
  13. "is_public": true,
  14. "https_url": "https://git.coding.net/coding/Comments.git",
  15. "vcs_type": "git",
  16. "subversion_url": "subversion.coding.net/coding/Comments",
  17. "id": 1454826,
  18. "name": "Comments",
  19. "display_name": "Comments",
  20. "owner_id": 93,
  21. "owner_user_name": "coding",
  22. "owner_user_picture": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
  23. "owner_user_home": "<a href=\"https://coding.net/u/coding\">coding</a>",
  24. "project_path": "/u/coding/p/Comments",
  25. "status": 1,
  26. "type": 1,
  27. "updated_at": 1530611471000,
  28. "last_updated": 1530611471000,
  29. "fork_count": 4,
  30. "star_count": 17,
  31. "watch_count": 24,
  32. "download_count": 0,
  33. "pin": false,
  34. "depot_path": "/u/coding/p/Comments/git",
  35. "forked": false,
  36. "un_read_activities_count": 0,
  37. "icon": "/static/project_icon/scenery-4.png",
  38. "current_user_role_id": 0,
  39. "owner": {
  40. "tags_str": "云计算追随者, 技术风向标",
  41. "tags": "19,32",
  42. "job_str": "产品",
  43. "job": 2,
  44. "sex": 0,
  45. "location": "广东 深圳",
  46. "company": "Coding.net",
  47. "slogan": "",
  48. "website": "",
  49. "introduction": "",
  50. "avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
  51. "gravatar": "",
  52. "lavatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
  53. "created_at": 1403329814000,
  54. "last_logined_at": 1553703523000,
  55. "last_activity_at": 1553868240927,
  56. "global_key": "coding",
  57. "name": "coding",
  58. "name_pinyin": "",
  59. "updated_at": 1553703524000,
  60. "path": "/u/coding",
  61. "status": 1,
  62. "is_member": 0,
  63. "id": 93,
  64. "vip": 4,
  65. "vip_expired_at": 1562256000000,
  66. "follows_count": 0,
  67. "fans_count": 0,
  68. "tweets_count": 0,
  69. "followed": false,
  70. "follow": false,
  71. "is_tencent_user": false
  72. },
  73. "stared": false,
  74. "watched": false,
  75. "recommended": 0,
  76. "shared": false,
  77. "is_member": false,
  78. "max_member": 20,
  79. "groupId": 0,
  80. "plan": 1,
  81. "isTeam": false,
  82. "isDemo": false
  83. }
  84. ],
  85. "page": 1,
  86. "pageSize": 10,
  87. "totalPage": 1,
  88. "totalRow": 1
  89. }
  90. }

获取项目信息

通过 username 和 project_name 获取项目信息,公开项目不需要鉴权,私有项目需要鉴权

  1. GET /api/user/{username}/project/{project_name}

请求参数

字段描述
usernamestring用户名 username
project_namestring项目名 project_name

响应示例

  1. Status: 200 OK
  2. {
  3. "code": 0,
  4. "data": {
  5. "created_at": 1418376096000,
  6. "backend_project_path": "/user/coding/project/Coding-iOS",
  7. "description": "本项目旨在分享 Coding.net iOS 客户端源代码。",
  8. "git_url": "git://git.coding.net/coding/Coding-iOS.git",
  9. "ssh_url": "git@git.coding.net:coding/Coding-iOS.git",
  10. "svn_url": "svn+ssh://svn@svn.coding.net/coding/Coding-iOS",
  11. "is_public": false,
  12. "https_url": "https://git.coding.net/coding/Coding-iOS.git",
  13. "vcs_type": "git",
  14. "subversion_url": "subversion.coding.net/coding/Coding-iOS",
  15. "id": 38894,
  16. "name": "Coding-iOS",
  17. "display_name": "Coding-iOS",
  18. "owner_id": 93,
  19. "owner_user_name": "coding",
  20. "owner_user_picture": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
  21. "owner_user_home": "<a href=\"https://coding.net/u/coding\">coding</a>",
  22. "project_path": "/u/coding/p/Coding-iOS",
  23. "status": 1,
  24. "type": 2,
  25. "updated_at": 1534908304000,
  26. "last_updated": 1534908304000,
  27. "fork_count": 978,
  28. "star_count": 1042,
  29. "watch_count": 943,
  30. "download_count": 355,
  31. "pin": false,
  32. "depot_path": "/u/coding/p/Coding-iOS/git",
  33. "forked": false,
  34. "un_read_activities_count": 15,
  35. "icon": "https://dn-coding-net-production-static.codehub.cn/198b9af0-5396-4cd6-b160-8f5dd078145d.png",
  36. "current_user_role_id": 100,
  37. "current_user_role": "owner",
  38. "owner": {
  39. "tags_str": "云计算追随者, 技术风向标",
  40. "tags": "19,32",
  41. "job_str": "产品",
  42. "job": 2,
  43. "sex": 0,
  44. "location": "广东 深圳",
  45. "company": "Coding.net",
  46. "slogan": "",
  47. "website": "",
  48. "introduction": "",
  49. "avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
  50. "gravatar": "",
  51. "lavatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
  52. "created_at": 1403329814000,
  53. "last_logined_at": 1553703523000,
  54. "last_activity_at": 1553866775280,
  55. "global_key": "coding",
  56. "name": "coding",
  57. "name_pinyin": "",
  58. "updated_at": 1553703524000,
  59. "path": "/u/coding",
  60. "status": 1,
  61. "is_member": 0,
  62. "id": 93,
  63. "vip": 4,
  64. "vip_expired_at": 1562256000000,
  65. "follows_count": 0,
  66. "fans_count": 0,
  67. "tweets_count": 0,
  68. "followed": false,
  69. "follow": false,
  70. "is_tencent_user": false
  71. },
  72. "stared": false,
  73. "watched": false,
  74. "recommended": 0,
  75. "shared": true,
  76. "is_member": true,
  77. "max_member": 20,
  78. "groupId": 0,
  79. "plan": 1,
  80. "isTeam": false,
  81. "isDemo": false,
  82. "test": [
  83. "code-search"
  84. ]
  85. }
  86. }