Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
roncoo
roncoo-education
提交
6819755c
R
roncoo-education
项目概览
roncoo
/
roncoo-education
12 个月 前同步成功
通知
146
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roncoo-education
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6819755c
编写于
8月 27, 2022
作者:
F
fengyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户工程调整
上级
9fa5373b
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
400 addition
and
120 deletion
+400
-120
roncoo-education-common/roncoo-education-common-service/src/main/java/com/roncoo/education/common/es/EsCourse.java
...rc/main/java/com/roncoo/education/common/es/EsCourse.java
+11
-25
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/dao/CourseChapterDao.java
...ava/com/roncoo/education/course/dao/CourseChapterDao.java
+6
-2
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/dao/CourseChapterPeriodDao.java
...m/roncoo/education/course/dao/CourseChapterPeriodDao.java
+4
-2
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/dao/impl/CourseChapterDaoImpl.java
...oncoo/education/course/dao/impl/CourseChapterDaoImpl.java
+17
-1
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/dao/impl/CourseChapterPeriodDaoImpl.java
...education/course/dao/impl/CourseChapterPeriodDaoImpl.java
+13
-1
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/ApiCourseController.java
...coo/education/course/service/api/ApiCourseController.java
+28
-0
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/biz/ApiCourseBiz.java
...roncoo/education/course/service/api/biz/ApiCourseBiz.java
+109
-0
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/req/ApiCoursePageReq.java
...oo/education/course/service/api/req/ApiCoursePageReq.java
+49
-0
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/req/ApiCourseReq.java
...roncoo/education/course/service/api/req/ApiCourseReq.java
+4
-55
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/resp/ApiCourseChapterPeriodResp.java
...n/course/service/api/resp/ApiCourseChapterPeriodResp.java
+3
-8
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/resp/ApiCourseChapterResp.java
...ucation/course/service/api/resp/ApiCourseChapterResp.java
+7
-8
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/resp/ApiCourseLecturerResp.java
...cation/course/service/api/resp/ApiCourseLecturerResp.java
+41
-0
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/resp/ApiCoursePageResp.java
.../education/course/service/api/resp/ApiCoursePageResp.java
+71
-0
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/resp/ApiCourseResp.java
...ncoo/education/course/service/api/resp/ApiCourseResp.java
+13
-18
roncoo-education-course/roncoo-education-course-service/src/test/java/com/roncoo/education/course/test/CourseTest.java
...est/java/com/roncoo/education/course/test/CourseTest.java
+24
-0
未找到文件。
roncoo-education-common/roncoo-education-common-service/src/main/java/com/roncoo/education/common/es/EsCourse.java
浏览文件 @
6819755c
...
...
@@ -18,8 +18,8 @@ import java.util.Date;
@Data
@Accessors
(
chain
=
true
)
public
class
EsCourse
implements
Serializable
{
public
static
final
String
COURSE
=
"edu_course"
;
private
static
final
long
serialVersionUID
=
1L
;
public
static
final
String
COURSE
=
"rc_course"
;
/**
* 主键
...
...
@@ -35,46 +35,32 @@ public class EsCourse implements Serializable {
*/
private
Date
gmtModified
;
/**
* 排序
*/
private
Integer
sort
;
/**
* 讲师名称
*/
private
String
lecturerName
;
/**
* 课程编号
* 课程名称
*/
private
Long
courseNo
;
private
String
courseName
;
/**
* 课程封面
*/
private
String
courseLogo
;
/**
*
课程名称
*
分类
*/
private
String
courseName
;
private
Long
categoryId
;
/**
*
课程排序
*
是否免费(1:免费,0:收费)
*/
private
Integer
courseSort
;
private
Integer
isFree
;
/**
* 原价
*/
private
BigDecimal
courseOriginal
;
private
BigDecimal
rulingPrice
;
/**
* 优惠价
*/
private
BigDecimal
course
Discount
;
private
BigDecimal
course
Price
;
/**
*
是否免费(1:免费,0:收费)
*
课程排序
*/
private
Integer
isFree
;
@Override
public
String
toString
()
{
return
"EsCourse [id="
+
id
+
", gmtCreate="
+
gmtCreate
+
", gmtModified="
+
gmtModified
+
", sort="
+
sort
+
", lecturerName="
+
lecturerName
+
", courseNo="
+
courseNo
+
", courseLogo="
+
courseLogo
+
", courseName="
+
courseName
+
", courseSort="
+
courseSort
+
", courseOriginal="
+
courseOriginal
+
", courseDiscount="
+
courseDiscount
+
", isFree="
+
isFree
+
"]"
;
}
private
Integer
courseSort
;
}
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/dao/CourseChapterDao.java
浏览文件 @
6819755c
...
...
@@ -59,7 +59,7 @@ public interface CourseChapterDao {
/**
* 章节信息--条件列出
*
* @param example
查询条件
* @param example 查询条件
* @return 章节信息列表
*/
List
<
CourseChapter
>
listByExample
(
CourseChapterExample
example
);
...
...
@@ -67,8 +67,12 @@ public interface CourseChapterDao {
/**
* 章节信息--条件统计
*
* @param example
统计条件
* @param example 统计条件
* @return 章节信息数量
*/
int
countByExample
(
CourseChapterExample
example
);
List
<
CourseChapter
>
listByCourseId
(
Long
courseId
);
List
<
CourseChapter
>
listByCourseIdAndStatusId
(
Long
id
,
Integer
statusId
);
}
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/dao/CourseChapterPeriodDao.java
浏览文件 @
6819755c
...
...
@@ -59,7 +59,7 @@ public interface CourseChapterPeriodDao {
/**
* 课时信息--条件列出
*
* @param example
查询条件
* @param example 查询条件
* @return 课时信息列表
*/
List
<
CourseChapterPeriod
>
listByExample
(
CourseChapterPeriodExample
example
);
...
...
@@ -67,8 +67,10 @@ public interface CourseChapterPeriodDao {
/**
* 课时信息--条件统计
*
* @param example
统计条件
* @param example 统计条件
* @return 课时信息数量
*/
int
countByExample
(
CourseChapterPeriodExample
example
);
List
<
CourseChapterPeriod
>
listByCourseIdAndStatusId
(
Long
courseId
,
Integer
statusId
);
}
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/dao/impl/CourseChapterDaoImpl.java
浏览文件 @
6819755c
...
...
@@ -68,7 +68,23 @@ public class CourseChapterDaoImpl implements CourseChapterDao {
}
@Override
public
int
countByExample
(
CourseChapterExample
example
){
public
int
countByExample
(
CourseChapterExample
example
)
{
return
this
.
mapper
.
countByExample
(
example
);
}
@Override
public
List
<
CourseChapter
>
listByCourseId
(
Long
courseId
)
{
CourseChapterExample
example
=
new
CourseChapterExample
();
example
.
createCriteria
().
andCourseIdEqualTo
(
courseId
);
example
.
setOrderByClause
(
" sort asc, id desc "
);
return
this
.
mapper
.
selectByExample
(
example
);
}
@Override
public
List
<
CourseChapter
>
listByCourseIdAndStatusId
(
Long
courseId
,
Integer
statusId
)
{
CourseChapterExample
example
=
new
CourseChapterExample
();
example
.
createCriteria
().
andCourseIdEqualTo
(
courseId
).
andStatusIdEqualTo
(
statusId
);
example
.
setOrderByClause
(
" sort asc, id desc "
);
return
this
.
mapper
.
selectByExample
(
example
);
}
}
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/dao/impl/CourseChapterPeriodDaoImpl.java
浏览文件 @
6819755c
...
...
@@ -68,7 +68,19 @@ public class CourseChapterPeriodDaoImpl implements CourseChapterPeriodDao {
}
@Override
public
int
countByExample
(
CourseChapterPeriodExample
example
){
public
int
countByExample
(
CourseChapterPeriodExample
example
)
{
return
this
.
mapper
.
countByExample
(
example
);
}
@Override
public
List
<
CourseChapterPeriod
>
listByCourseIdAndStatusId
(
Long
courseId
,
Integer
statusId
)
{
CourseChapterPeriodExample
example
=
new
CourseChapterPeriodExample
();
CourseChapterPeriodExample
.
Criteria
c
=
example
.
createCriteria
();
c
.
andCourseIdEqualTo
(
courseId
);
if
(
null
!=
statusId
)
{
c
.
andStatusIdEqualTo
(
statusId
);
}
example
.
setOrderByClause
(
"sort asc, id desc"
);
return
this
.
mapper
.
selectByExample
(
example
);
}
}
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/ApiCourseController.java
浏览文件 @
6819755c
package
com.roncoo.education.course.service.api
;
import
com.roncoo.education.common.core.base.Page
;
import
com.roncoo.education.common.core.base.Result
;
import
com.roncoo.education.course.service.api.biz.ApiCourseBiz
;
import
com.roncoo.education.course.service.api.req.ApiCoursePageReq
;
import
com.roncoo.education.course.service.api.req.ApiCourseReq
;
import
com.roncoo.education.course.service.api.resp.ApiCoursePageResp
;
import
com.roncoo.education.course.service.api.resp.ApiCourseResp
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.validation.constraints.NotNull
;
...
...
@@ -23,4 +32,23 @@ public class ApiCourseController {
@NotNull
private
final
ApiCourseBiz
biz
;
/**
* 课程信息列表接口
*
* @author fengyw
*/
@ApiOperation
(
value
=
"列表和搜索接口"
,
notes
=
"根据条件进行课程列出"
)
@RequestMapping
(
value
=
"/search"
,
method
=
RequestMethod
.
POST
)
public
Result
<
Page
<
ApiCoursePageResp
>>
searchForPage
(
@RequestBody
ApiCoursePageReq
req
)
{
return
biz
.
searchForPage
(
req
);
}
/**
* 课程详情接口
*/
@ApiOperation
(
value
=
"课程详情接口"
,
notes
=
"根据课程ID获取课程信息"
)
@RequestMapping
(
value
=
"/view"
,
method
=
RequestMethod
.
POST
)
public
Result
<
ApiCourseResp
>
view
(
@RequestBody
ApiCourseReq
req
)
{
return
biz
.
view
(
req
);
}
}
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/biz/ApiCourseBiz.java
浏览文件 @
6819755c
package
com.roncoo.education.course.service.api.biz
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.roncoo.education.common.core.base.Page
;
import
com.roncoo.education.common.core.base.Result
;
import
com.roncoo.education.common.core.enums.PutawayEnum
;
import
com.roncoo.education.common.core.enums.StatusIdEnum
;
import
com.roncoo.education.common.core.tools.BeanUtil
;
import
com.roncoo.education.common.es.EsCourse
;
import
com.roncoo.education.common.es.EsPageUtil
;
import
com.roncoo.education.common.service.BaseBiz
;
import
com.roncoo.education.course.dao.CourseChapterDao
;
import
com.roncoo.education.course.dao.CourseChapterPeriodDao
;
import
com.roncoo.education.course.dao.CourseDao
;
import
com.roncoo.education.course.dao.impl.mapper.entity.Course
;
import
com.roncoo.education.course.dao.impl.mapper.entity.CourseChapter
;
import
com.roncoo.education.course.dao.impl.mapper.entity.CourseChapterPeriod
;
import
com.roncoo.education.course.service.api.req.ApiCoursePageReq
;
import
com.roncoo.education.course.service.api.req.ApiCourseReq
;
import
com.roncoo.education.course.service.api.resp.*
;
import
com.roncoo.education.user.feign.interfaces.IFeignLecturer
;
import
com.roncoo.education.user.feign.interfaces.vo.LecturerViewVO
;
import
lombok.RequiredArgsConstructor
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.MultiMatchQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder
;
import
org.elasticsearch.search.sort.FieldSortBuilder
;
import
org.elasticsearch.search.sort.SortOrder
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate
;
import
org.springframework.data.elasticsearch.core.SearchHits
;
import
org.springframework.data.elasticsearch.core.mapping.IndexCoordinates
;
import
org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* API-课程信息
...
...
@@ -13,10 +49,83 @@ import javax.validation.constraints.NotNull;
* @author wujing
*/
@Component
@CacheConfig
(
cacheNames
=
{
"course"
})
@RequiredArgsConstructor
public
class
ApiCourseBiz
extends
BaseBiz
{
@NotNull
private
final
CourseDao
dao
;
@NotNull
private
final
CourseChapterDao
chapterDao
;
@NotNull
private
final
CourseChapterPeriodDao
periodDao
;
@NotNull
private
final
IFeignLecturer
feignLecturer
;
@NotNull
private
final
ElasticsearchRestTemplate
elasticsearchRestTemplate
;
public
Result
<
Page
<
ApiCoursePageResp
>>
searchForPage
(
ApiCoursePageReq
req
)
{
NativeSearchQueryBuilder
nsb
=
new
NativeSearchQueryBuilder
();
// 高亮字段
nsb
.
withHighlightFields
(
new
HighlightBuilder
.
Field
(
"courseName"
).
preTags
(
"<mark>"
).
postTags
(
"</mark>"
));
// 课程排序(courseSort)
nsb
.
withSort
(
new
FieldSortBuilder
(
"courseSort"
).
order
(
SortOrder
.
DESC
));
// 分页
nsb
.
withPageable
(
PageRequest
.
of
(
req
.
getPageCurrent
()
-
1
,
req
.
getPageSize
()));
BoolQueryBuilder
qb
=
QueryBuilders
.
boolQuery
();
if
(
ObjectUtil
.
isNotEmpty
(
req
.
getCategoryId
()))
{
qb
.
must
(
QueryBuilders
.
termQuery
(
req
.
getCategoryId
().
toString
(),
"categoryId"
));
}
if
(
ObjectUtil
.
isNotEmpty
(
req
.
getIsFree
()))
{
qb
.
must
(
QueryBuilders
.
termQuery
(
req
.
getIsFree
().
toString
(),
"isFree"
));
}
if
(
StringUtils
.
hasText
(
req
.
getCourseName
()))
{
// 模糊查询multiMatchQuery,最佳字段best_fields
qb
.
must
(
QueryBuilders
.
multiMatchQuery
(
req
.
getCourseName
(),
"courseName"
).
type
(
MultiMatchQueryBuilder
.
Type
.
BEST_FIELDS
));
}
nsb
.
withQuery
(
qb
);
SearchHits
<
EsCourse
>
searchHits
=
elasticsearchRestTemplate
.
search
(
nsb
.
build
(),
EsCourse
.
class
,
IndexCoordinates
.
of
(
EsCourse
.
COURSE
));
return
Result
.
success
(
EsPageUtil
.
transform
(
searchHits
,
req
.
getPageCurrent
(),
req
.
getPageSize
(),
ApiCoursePageResp
.
class
));
}
@Cacheable
public
Result
<
ApiCourseResp
>
view
(
ApiCourseReq
req
)
{
Course
course
=
dao
.
getById
(
req
.
getCourseId
());
if
(
course
==
null
)
{
return
Result
.
error
(
"找不到该课程信息"
);
}
if
(!
course
.
getStatusId
().
equals
(
StatusIdEnum
.
YES
.
getCode
()))
{
return
Result
.
error
(
"该课程已被禁用"
);
}
if
(
course
.
getIsPutaway
().
equals
(
PutawayEnum
.
DOWN
.
getCode
()))
{
return
Result
.
error
(
"该课程已下架"
);
}
ApiCourseResp
courseResp
=
BeanUtil
.
copyProperties
(
course
,
ApiCourseResp
.
class
);
// 获取讲师信息
LecturerViewVO
lecturerViewVO
=
feignLecturer
.
getById
(
course
.
getLecturerId
());
if
(
ObjectUtil
.
isNotEmpty
(
lecturerViewVO
))
{
courseResp
.
setLecturerResp
(
BeanUtil
.
copyProperties
(
lecturerViewVO
,
ApiCourseLecturerResp
.
class
));
}
// 章节信息
List
<
CourseChapter
>
chapterList
=
chapterDao
.
listByCourseIdAndStatusId
(
course
.
getId
(),
StatusIdEnum
.
YES
.
getCode
());
if
(
CollUtil
.
isNotEmpty
(
chapterList
))
{
courseResp
.
setChapterRespList
(
BeanUtil
.
copyProperties
(
chapterList
,
ApiCourseChapterResp
.
class
));
// 课时信息
List
<
CourseChapterPeriod
>
periodList
=
periodDao
.
listByCourseIdAndStatusId
(
course
.
getId
(),
StatusIdEnum
.
YES
.
getCode
());
if
(
CollUtil
.
isNotEmpty
(
periodList
))
{
Map
<
Long
,
List
<
CourseChapterPeriod
>>
map
=
periodList
.
stream
().
collect
(
Collectors
.
groupingBy
(
CourseChapterPeriod:
:
getChapterId
,
Collectors
.
toList
()));
for
(
ApiCourseChapterResp
chapterResp
:
courseResp
.
getChapterRespList
())
{
chapterResp
.
setPeriodRespList
(
BeanUtil
.
copyProperties
(
map
.
get
(
chapterResp
.
getId
()),
ApiCourseChapterPeriodResp
.
class
));
}
}
}
return
Result
.
success
(
courseResp
);
}
}
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/req/ApiCoursePageReq.java
0 → 100644
浏览文件 @
6819755c
package
com.roncoo.education.course.service.api.req
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
/**
* <p>
* API-课程信息
* </p>
*
* @author wujing
* @date 2022-08-25
*/
@Data
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"ApiCourseReq"
,
description
=
"API-课程信息"
)
public
class
ApiCoursePageReq
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"分类ID"
)
private
Long
categoryId
;
@ApiModelProperty
(
value
=
"课程名称"
)
private
String
courseName
;
@ApiModelProperty
(
value
=
"是否免费(1:免费,0:收费)"
)
private
Integer
isFree
;
@ApiModelProperty
(
value
=
"购买人数"
)
private
Integer
countBuy
;
@ApiModelProperty
(
value
=
"学习人数"
)
private
Integer
countStudy
;
/**
* 当前页
*/
@ApiModelProperty
(
value
=
"当前页"
)
private
Integer
pageCurrent
=
1
;
/**
* 每页条数
*/
@ApiModelProperty
(
value
=
"每页条数"
)
private
Integer
pageSize
=
20
;
}
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/req/ApiCourseReq.java
浏览文件 @
6819755c
package
com.roncoo.education.course.service.api.req
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
/**
* <p>
* API-课程信息
...
...
@@ -24,56 +22,7 @@ public class ApiCourseReq implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
gmtCreate
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"修改时间"
)
private
LocalDateTime
gmtModified
;
@ApiModelProperty
(
value
=
"状态(1:正常,0:禁用)"
)
private
Integer
statusId
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"讲师ID"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"分类ID"
)
private
Long
categoryId
;
@ApiModelProperty
(
value
=
"课程名称"
)
private
String
courseName
;
@ApiModelProperty
(
value
=
"课程封面"
)
private
String
courseLogo
;
@ApiModelProperty
(
value
=
"课程简介"
)
private
String
introduce
;
@ApiModelProperty
(
value
=
"是否免费(1:免费,0:收费)"
)
private
Integer
isFree
;
@ApiModelProperty
(
value
=
"原价"
)
private
BigDecimal
courseOriginal
;
@ApiModelProperty
(
value
=
"优惠价"
)
private
BigDecimal
courseDiscount
;
@ApiModelProperty
(
value
=
"是否上架(1:上架,0:下架)"
)
private
Integer
isPutaway
;
@ApiModelProperty
(
value
=
"课程排序(前端显示使用)"
)
private
Integer
courseSort
;
@ApiModelProperty
(
value
=
"购买人数"
)
private
Integer
countBuy
;
@ApiModelProperty
(
value
=
"课程ID"
)
private
Long
courseId
;
@ApiModelProperty
(
value
=
"学习人数"
)
private
Integer
countStudy
;
}
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/resp/ApiCourseChapterPeriodResp.java
浏览文件 @
6819755c
package
com.roncoo.education.course.service.api.resp
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* <p>
* API-课时信息
...
...
@@ -34,12 +35,6 @@ public class ApiCourseChapterPeriodResp implements Serializable {
@ApiModelProperty
(
value
=
"修改时间"
)
private
LocalDateTime
gmtModified
;
@ApiModelProperty
(
value
=
"状态(1:正常,0:禁用)"
)
private
Integer
statusId
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"课程ID"
)
private
Long
courseId
;
...
...
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/resp/ApiCourseChapterResp.java
浏览文件 @
6819755c
package
com.roncoo.education.course.service.api.resp
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
* <p>
* API-章节信息
...
...
@@ -34,12 +36,6 @@ public class ApiCourseChapterResp implements Serializable {
@ApiModelProperty
(
value
=
"修改时间"
)
private
LocalDateTime
gmtModified
;
@ApiModelProperty
(
value
=
"状态(1:正常,0:禁用)"
)
private
Integer
statusId
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"课程ID"
)
private
Long
courseId
;
...
...
@@ -51,4 +47,7 @@ public class ApiCourseChapterResp implements Serializable {
@ApiModelProperty
(
value
=
"是否免费(1免费,0收费)"
)
private
Integer
isFree
;
@ApiModelProperty
(
value
=
"课时信息"
)
private
List
<
ApiCourseChapterPeriodResp
>
periodRespList
;
}
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/resp/ApiCourseLecturerResp.java
0 → 100644
浏览文件 @
6819755c
package
com.roncoo.education.course.service.api.resp
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
/**
* <p>
* ADMIN-讲师信息
* </p>
*
* @author wujing
*/
@Data
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"ApiLecturerResp"
,
description
=
"ADMIN-讲师信息查看"
)
public
class
ApiCourseLecturerResp
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"讲师名称"
)
private
String
lecturerName
;
@ApiModelProperty
(
value
=
"讲师手机"
)
private
String
lecturerMobile
;
@ApiModelProperty
(
value
=
"讲师职位"
)
private
String
lecturerPosition
;
@ApiModelProperty
(
value
=
"讲师头像"
)
private
String
lecturerHead
;
@ApiModelProperty
(
value
=
"简介"
)
private
String
introduce
;
}
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/resp/ApiCoursePageResp.java
0 → 100644
浏览文件 @
6819755c
package
com.roncoo.education.course.service.api.resp
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
/**
* <p>
* API-课程信息
* </p>
*
* @author wujing
* @date 2022-08-25
*/
@Data
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"ApiCourseResp"
,
description
=
"API-课程信息"
)
public
class
ApiCoursePageResp
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
gmtCreate
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"修改时间"
)
private
LocalDateTime
gmtModified
;
@ApiModelProperty
(
value
=
"讲师ID"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"分类ID"
)
private
Long
categoryId
;
@ApiModelProperty
(
value
=
"课程名称"
)
private
String
courseName
;
@ApiModelProperty
(
value
=
"课程封面"
)
private
String
courseLogo
;
@ApiModelProperty
(
value
=
"课程简介"
)
private
String
introduce
;
@ApiModelProperty
(
value
=
"是否免费(1:免费,0:收费)"
)
private
Integer
isFree
;
@ApiModelProperty
(
value
=
"原价"
)
private
BigDecimal
rulingPrice
;
@ApiModelProperty
(
value
=
"优惠价"
)
private
BigDecimal
coursePrice
;
@ApiModelProperty
(
value
=
"课程排序(前端显示使用)"
)
private
Integer
courseSort
;
// @ApiModelProperty(value = "购买人数")
// private Integer countBuy;
//
// @ApiModelProperty(value = "学习人数")
// private Integer countStudy;
}
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/api/resp/ApiCourseResp.java
浏览文件 @
6819755c
...
...
@@ -9,6 +9,7 @@ import lombok.experimental.Accessors;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
* <p>
...
...
@@ -36,18 +37,6 @@ public class ApiCourseResp implements Serializable {
@ApiModelProperty
(
value
=
"修改时间"
)
private
LocalDateTime
gmtModified
;
@ApiModelProperty
(
value
=
"状态(1:正常,0:禁用)"
)
private
Integer
statusId
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"讲师ID"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"分类ID"
)
private
Long
categoryId
;
@ApiModelProperty
(
value
=
"课程名称"
)
private
String
courseName
;
...
...
@@ -66,15 +55,21 @@ public class ApiCourseResp implements Serializable {
@ApiModelProperty
(
value
=
"优惠价"
)
private
BigDecimal
courseDiscount
;
@ApiModelProperty
(
value
=
"是否上架(1:上架,0:下架)"
)
private
Integer
isPutaway
;
@ApiModelProperty
(
value
=
"课程排序(前端显示使用)"
)
private
Integer
courseSort
;
@ApiModelProperty
(
value
=
"购买人数"
)
private
Integer
countBuy
;
@ApiModelProperty
(
value
=
"学习人数"
)
private
Integer
countStudy
;
@ApiModelProperty
(
value
=
"分类ID"
)
private
Long
categoryId
;
@ApiModelProperty
(
value
=
"讲师ID"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"讲师信息"
)
private
ApiCourseLecturerResp
lecturerResp
;
@ApiModelProperty
(
value
=
"章节信息"
)
private
List
<
ApiCourseChapterResp
>
chapterRespList
;
}
roncoo-education-course/roncoo-education-course-service/src/test/java/com/roncoo/education/course/test/CourseTest.java
0 → 100644
浏览文件 @
6819755c
package
com.roncoo.education.course.test
;
import
com.roncoo.education.common.core.base.Result
;
import
com.roncoo.education.course.service.api.biz.ApiCourseBiz
;
import
com.roncoo.education.course.service.api.req.ApiCourseReq
;
import
com.roncoo.education.course.service.api.resp.ApiCourseResp
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
@Slf4j
public
class
CourseTest
extends
BaseTest
{
@Autowired
private
ApiCourseBiz
courseBiz
;
@Test
public
void
view
()
{
ApiCourseReq
req
=
new
ApiCourseReq
();
req
.
setCourseId
(
1080759557655564289L
);
Result
<
ApiCourseResp
>
result
=
courseBiz
.
view
(
req
);
log
.
info
(
"course={}"
,
result
.
getData
());
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录