Commit bedfce85 authored by liming's avatar liming

课程章节查询接口

parent cd35cc5b
......@@ -24425,8 +24425,8 @@
},
{
"objectType": "Table_MYSQL",
"name": "course_item",
"comment": "课程章节",
"name": "app_version",
"comment": "app版本升级",
"engine": "InnoDB",
"characterSet": "utf8mb4",
"collation": "utf8mb4_0900_ai_ci",
......@@ -24501,33 +24501,7 @@
},
{
"objectType": "TableField_MYSQL",
"name": "name",
"type": "varchar",
"length": 100,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "utf8mb4",
"collation": "utf8mb4_0900_ai_ci",
"isNullable": true,
"defaultType": "Null",
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "章节名称",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "name"
},
{
"objectType": "TableField_MYSQL",
"name": "target_type",
"name": "client_type",
"type": "int",
"length": -2147483648,
"decimals": -2147483648,
......@@ -24542,20 +24516,20 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "指标类型 1:ftp 2:踏频 3:速度",
"comment": "1:android 2:ios",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "target_type"
"oldName": "client_type"
},
{
"objectType": "TableField_MYSQL",
"name": "target_value_type",
"type": "int",
"length": -2147483648,
"name": "version",
"type": "varchar",
"length": 50,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -24568,20 +24542,20 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "目标值类型",
"comment": "版本号x.y.z",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "target_value_type"
"oldName": "version"
},
{
"objectType": "TableField_MYSQL",
"name": "target_value",
"type": "int",
"length": -2147483648,
"name": "content",
"type": "varchar",
"length": 1000,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -24594,46 +24568,20 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "目标值",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "target_value"
},
{
"objectType": "TableField_MYSQL",
"name": "allowable_deviation",
"type": "decimal",
"length": 18,
"decimals": 2,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "",
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "允许偏差",
"comment": "更新内容",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "allowable_deviation"
"oldName": "content"
},
{
"objectType": "TableField_MYSQL",
"name": "duration",
"type": "int",
"length": -2147483648,
"name": "url",
"type": "varchar",
"length": 500,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -24646,20 +24594,20 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "持续时长s",
"comment": "下载地址",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "duration"
"oldName": "url"
},
{
"objectType": "TableField_MYSQL",
"name": "description",
"name": "download_page_url",
"type": "varchar",
"length": 1000,
"length": 500,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -24672,71 +24620,19 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "描述",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "description"
},
{
"objectType": "TableField_MYSQL",
"name": "show_order",
"type": "int",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "",
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "0",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "显示顺序",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "show_order"
},
{
"objectType": "TableField_MYSQL",
"name": "version",
"type": "bigint",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "",
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "0",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "版本号",
"comment": "下载更新页面地址",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "version"
"oldName": "download_page_url"
},
{
"objectType": "TableField_MYSQL",
"name": "deleted",
"type": "tinyint",
"name": "force_update",
"type": "bit",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
......@@ -24747,17 +24643,17 @@
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "0",
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "删除标记",
"comment": "是否强制更新",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "deleted"
"oldName": "force_update"
},
{
"objectType": "TableField_MYSQL",
......@@ -24999,8 +24895,8 @@
},
{
"objectType": "Table_MYSQL",
"name": "app_version",
"comment": "app版本升级",
"name": "course_item",
"comment": "课程章节",
"engine": "InnoDB",
"characterSet": "utf8mb4",
"collation": "utf8mb4_0900_ai_ci",
......@@ -25075,8 +24971,8 @@
},
{
"objectType": "TableField_MYSQL",
"name": "client_type",
"type": "int",
"name": "course_id",
"type": "bigint",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
......@@ -25090,20 +24986,46 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "1:android 2:ios",
"comment": "课程id",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "client_type"
"oldName": "course_id"
},
{
"objectType": "TableField_MYSQL",
"name": "version",
"name": "name",
"type": "varchar",
"length": 50,
"length": 100,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "utf8mb4",
"collation": "utf8mb4_0900_ai_ci",
"isNullable": true,
"defaultType": "Null",
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "章节名称",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "name"
},
{
"objectType": "TableField_MYSQL",
"name": "target_type",
"type": "int",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -25116,20 +25038,20 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "版本号x.y.z",
"comment": "指标类型 1:ftp 2:踏频 3:速度",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "version"
"oldName": "target_type"
},
{
"objectType": "TableField_MYSQL",
"name": "content",
"type": "varchar",
"length": 1000,
"name": "target_value_type",
"type": "int",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -25142,20 +25064,20 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "更新内容",
"comment": "目标值类型",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "content"
"oldName": "target_value_type"
},
{
"objectType": "TableField_MYSQL",
"name": "url",
"type": "varchar",
"length": 500,
"name": "target_value",
"type": "int",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -25168,20 +25090,72 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "下载地址",
"comment": "目标值",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "url"
"oldName": "target_value"
},
{
"objectType": "TableField_MYSQL",
"name": "download_page_url",
"name": "allowable_deviation",
"type": "decimal",
"length": 18,
"decimals": 2,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "",
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "允许偏差",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "allowable_deviation"
},
{
"objectType": "TableField_MYSQL",
"name": "duration",
"type": "int",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "",
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "持续时长s",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "duration"
},
{
"objectType": "TableField_MYSQL",
"name": "description",
"type": "varchar",
"length": 500,
"length": 1000,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -25194,19 +25168,19 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "下载更新页面地址",
"comment": "描述",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "download_page_url"
"oldName": "description"
},
{
"objectType": "TableField_MYSQL",
"name": "force_update",
"type": "bit",
"name": "show_order",
"type": "int",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
......@@ -25217,17 +25191,69 @@
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "",
"defaultValue": "0",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "是否强制更新",
"comment": "显示顺序",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "force_update"
"oldName": "show_order"
},
{
"objectType": "TableField_MYSQL",
"name": "version",
"type": "bigint",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "",
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "0",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "版本号",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "version"
},
{
"objectType": "TableField_MYSQL",
"name": "deleted",
"type": "tinyint",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "",
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "0",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "删除标记",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "deleted"
},
{
"objectType": "TableField_MYSQL",
......
......@@ -28,6 +28,11 @@ public class CourseItem implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 课程id
*/
private Long courseId;
/**
* 章节名称
*/
......
......@@ -2,11 +2,13 @@ package com.antai.sport.http.server.server.api.business.course.controller;
import com.antai.sport.http.server.common.base.Result;
import com.antai.sport.http.server.server.api.business.course.service.CourseService;
import com.antai.sport.http.server.server.api.business.course.vo.CourseItemVO;
import com.antai.sport.http.server.server.api.business.course.vo.CourseTypeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -28,4 +30,10 @@ public class CourseController {
public ResponseEntity<Result<List<CourseTypeVO>>> getCourseTree() {
return success(courseService.getCourseTree());
}
@GetMapping("/{courseId}")
@ApiOperation(value = "获取课程章节")
public ResponseEntity<Result<List<CourseItemVO>>> getCourseItemList(@PathVariable("courseId") Long courseId) {
return success(courseService.getCourseItemList(courseId));
}
}
package com.antai.sport.http.server.server.api.business.course.mapper;
import com.antai.sport.http.server.server.api.business.course.vo.CourseItemVO;
import com.antai.sport.http.server.server.api.business.course.vo.CourseVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface CourseBusinessMapper {
List<CourseVO> getCourseList();
List<CourseItemVO> getCourseItemList(@Param("courseId") Long courseId);
}
......@@ -4,6 +4,7 @@ import com.antai.sport.http.server.common.service.CommonCodeService;
import com.antai.sport.http.server.common.vo.SysCodeDetailVO;
import com.antai.sport.http.server.constants.CourseType;
import com.antai.sport.http.server.server.api.business.course.mapper.CourseBusinessMapper;
import com.antai.sport.http.server.server.api.business.course.vo.CourseItemVO;
import com.antai.sport.http.server.server.api.business.course.vo.CourseTypeVO;
import com.antai.sport.http.server.server.api.business.course.vo.CourseVO;
import org.springframework.stereotype.Service;
......@@ -43,4 +44,8 @@ public class CourseService {
}
return resultList;
}
public List<CourseItemVO> getCourseItemList(Long courseId) {
return courseBusinessMapper.getCourseItemList(courseId);
}
}
package com.antai.sport.http.server.server.api.business.course.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
@ApiModel("课程章节查询对象")
public class CourseItemVO {
@ApiModelProperty("")
private Long id;
@ApiModelProperty("课程名称")
private String name;
@ApiModelProperty("指标类型 1:ftp 2:踏频 3:速度")
private Integer targetType;
@ApiModelProperty("指标值类型")
private Integer targetValueType;
@ApiModelProperty("目标值")
private Integer targetValue;
@ApiModelProperty("允许偏差")
private BigDecimal allowableDeviation;
@ApiModelProperty("持续时长s")
private Integer duration;
@ApiModelProperty("章节描述")
private String description;
}
......@@ -4,4 +4,8 @@
<select id="getCourseList" resultType="com.antai.sport.http.server.server.api.business.course.vo.CourseVO">
select * from course where deleted = 0 and status = 20 order by show_order,id desc
</select>
<select id="getCourseItemList" resultType="com.antai.sport.http.server.server.api.business.course.vo.CourseItemVO">
select * from course_item where deleted = 0 and course_id = #{courseId} order by show_order,id
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment