Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
antai-sport-http-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
antai-sport
antai-sport-http-server
Commits
bedfce85
Commit
bedfce85
authored
Aug 21, 2022
by
liming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
课程章节查询接口
parent
cd35cc5b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
243 additions
and
162 deletions
+243
-162
antai-sport.ndm2
doc/antai-sport.ndm2
+188
-162
CourseItem.java
...port/http/server/repository/course/entity/CourseItem.java
+5
-0
CourseController.java
...rver/api/business/course/controller/CourseController.java
+8
-0
CourseBusinessMapper.java
...rver/api/business/course/mapper/CourseBusinessMapper.java
+4
-0
CourseService.java
...ver/server/api/business/course/service/CourseService.java
+5
-0
CourseItemVO.java
...tp/server/server/api/business/course/vo/CourseItemVO.java
+29
-0
CourseBusinessMapper.xml
...src/main/resources/mapper/course/CourseBusinessMapper.xml
+4
-0
No files found.
doc/antai-sport.ndm2
View file @
bedfce85
...
...
@@ -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": "
targe
t_type"
"oldName": "
clien
t_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": "d
escription
",
"name": "d
ownload_page_url
",
"type": "varchar",
"length":
10
00,
"length":
5
00,
"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": "
tinyin
t",
"name": "
force_update
",
"type": "
bi
t",
"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": "c
lient_type
",
"type": "int",
"name": "c
ourse_id
",
"type": "
big
int",
"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": "c
lient_type
"
"oldName": "c
ourse_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":
5
00,
"length":
10
00,
"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": "d
ownload_page_url
"
"oldName": "d
escription
"
},
{
"objectType": "TableField_MYSQL",
"name": "
force_update
",
"type": "
bi
t",
"name": "
show_order
",
"type": "
in
t",
"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",
...
...
repository/src/main/java/com/antai/sport/http/server/repository/course/entity/CourseItem.java
View file @
bedfce85
...
...
@@ -28,6 +28,11 @@ public class CourseItem implements Serializable {
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 课程id
*/
private
Long
courseId
;
/**
* 章节名称
*/
...
...
server-api/src/main/java/com/antai/sport/http/server/server/api/business/course/controller/CourseController.java
View file @
bedfce85
...
...
@@ -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
));
}
}
server-api/src/main/java/com/antai/sport/http/server/server/api/business/course/mapper/CourseBusinessMapper.java
View file @
bedfce85
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
);
}
server-api/src/main/java/com/antai/sport/http/server/server/api/business/course/service/CourseService.java
View file @
bedfce85
...
...
@@ -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
);
}
}
server-api/src/main/java/com/antai/sport/http/server/server/api/business/course/vo/CourseItemVO.java
0 → 100644
View file @
bedfce85
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
;
}
server-api/src/main/resources/mapper/course/CourseBusinessMapper.xml
View file @
bedfce85
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment