
# 课程详情查询服务（API名称：openApiGetUserCourseByCourseId）
#### 功能介绍
课程详情查询服务支持openAPI
#### 相关接口
| **接口名称**                                                             | **调用说明**                                                     |
|:---|:---|
| [获取Token](https://support.huaweicloud.com/api-isdp/api_01_0019.html) | 调用该接口获取到Token，再调用其他接口时，需要在请求消息头中添加"Authorization"，其值即为Token。 |
   
#### URL
| **请求方式** | **HTTPS地址**                                                                | **服务架构** | **消息体类型**        |
|:---|:---|:---|:---|
| POST     | https://***isdp+域名***/openapi/v1/userCourse/openApiGetUserCourseByCourseId | OpenAPI  | application/json |
   
#### 请求头
| **KEY**       | VALUE                  | 是否必填 | **描述**                                                                                           |
|:---|:---|:---|:---|
| Content-Type  | application/json       | 是    | 无                                                                                                |
| Authorization | bearer ${access_token} | 是    | bearer +" "+[5.2.1](https://support.huaweicloud.com/api-isdp/api_01_0019.html)中获取的access_token的值 |
   
#### 请求参数
| **参数**   | **类型** | **是否必填** | **描述** |
|:---|:---|:---|:---|
| courseId | String | 是        | 课程id   |
   
#### 响应参数
| **参数**       | **类型**       | **描述**               |
|:---|:---|:---|
| errorMessage | errorMessage | 错误信息，接口错误时有值，正常调用时为空 |
| stateCode    | String       | 响应状态，"0"为成功，其他值失败    |
| Result       | Object       | 结果                   |
   
Object出参：
| **参数**             | **类型** | **描述**                       |
|:---|:---|:---|
| courseId           | Long   | 课程Id                         |
| courseName         | String | 课程名称                         |
| courseCode         | String | 课程编码                         |
| courseDuration     | String | 课程时长 单位:分钟                   |
| categoryName       | String | 课程类别名称                       |
| parentCategoryName | String | 课程类别父类名称                     |
| userCourseId       | Long   | 学员课程主键ID                     |
| userId             | Long   | 学员ID                         |
| learnStatus        | int    | 课程学习状态 1-进行中 默认 2-已完成        |
| learnType          | int    | 课程学习要求(推送) 1-必修 2-选修         |
| chapterId          | Long   | 课程大纲章节表主键ID                  |
| courseSource       | int    | 课程来源 1-学员学习课程记录 2-学员学习课程章节记录 |
| chapterList        | List   | 章节集合                         |
   
chapterList出参：
| **参数**          | **类型** | **描述**                |
|:---|:---|:---|
| chapterId       | Long   | 章节Id                  |
| courseId        | Long   | 课程Id                  |
| chapterName     | String | 章节名称                  |
| chapterDuration | String | 章节时长 单位:分钟            |
| chapterOrder    | int    | 章节的顺序 1-开始            |
| chapterRemark   | String | 章节描述                  |
| foolproofRemark | String | 防呆提示描述                |
| learnStatus     | int    | 课程学习状态 1-进行中 默认 2-已完成 |
| courseFileVo    | Map    | 文件实体                  |
   
courseFileVo出参：
| **参数**            | **类型** | **描述**    |
|:---|:---|:---|
| courseFileId      | Long   | 主键ID      |
| tablePrimaryId    | Long   | 关联的表的主键ID |
| fileId            | Long   | 文件ID      |
| fileName          | String | 文件名称      |
| coverFileId       | Long   | 封面文件ID    |
| fileType          | String | 文件类型后缀    |
| createName        | String | 创建人名称     |
| creationTimestamp | Long   | 创建时间戳     |
   
#### 请求示例
```
{
"courseId" : "5000024",
}
```
#### 响应示例
```
{
"stateCode" : "0",
         "errorMessage" : null,
         "result" : {
                   "courseId" : 5000024,
                   "courseName" : "自动测试课程3071",
                   "courseCode" : "20221114100",
                   "courseDuration" : 60,
                   "categoryName" : "语言类",
                   "parentCategoryName" : null,
                   "userCourseId" : 5000180,
                   "userId" : 1823,
                   "learnStatus" : 1,
                   "learnType" : 1,
                   "chapterId" : 0,
                   "courseSource" : 1,
                   "chapterList" : [{
                                     "chapterId" : 5000047,
                                     "courseId" : 5000024,
                                     "chapterName" : "第1章节",
                                     "chapterDuration" : 30,
                                     "chapterOrder" : 1,
                                     "chapterRemark" : "章节描述",
                                     "foolproofRemark" : "",
                                     "courseFileVo" : {
                                               "courseFileId" : 5000024,
                                               "tablePrimaryId" : 5000047,
                                               "fileId" : 1432449,
                                               "fileName" : "场景任务管理.pdf",
                                               "coverFileId" : 1432448,
                                               "fileType" : "application/pdf",
                                               "createName" : "superman",
                                               "creationTimestamp" : 1668417474902
                                     },
                                     "learnStatus" : 1
                            }
                   ]
         }
}                  "totalCount" : 1
         }
}
```
#### 状态码
状态码请参见[状态码](https://support.huaweicloud.com/api-isdp/api_01_0326.html)。
#### 错误码
错误码请参见[错误码](https://support.huaweicloud.com/api-isdp/api_01_0327.html)。
