Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
02259a59
Commit
02259a59
authored
Jun 23, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产品、短视频、直播详情Tab
parent
882eec9e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1907 additions
and
7 deletions
+1907
-7
ThemeDTO.java
...src/main/java/com/tanpu/community/api/beans/ThemeDTO.java
+1
-0
CodeAutoGenerator.java
.../main/java/com/tanpu/community/dao/CodeAutoGenerator.java
+5
-5
CurriculumResEntity.java
.../tanpu/community/dao/entity/user/CurriculumResEntity.java
+305
-0
FinProResEntity.java
.../com/tanpu/community/dao/entity/user/FinProResEntity.java
+463
-0
ZhiboThemeEntity.java
...om/tanpu/community/dao/entity/zhibo/ZhiboThemeEntity.java
+986
-0
CurriculumResMapper.java
.../tanpu/community/dao/mapper/user/CurriculumResMapper.java
+16
-0
FinProResMapper.java
.../com/tanpu/community/dao/mapper/user/FinProResMapper.java
+16
-0
ZhiboThemeMapper.java
...om/tanpu/community/dao/mapper/zhibo/ZhiboThemeMapper.java
+16
-0
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+36
-2
CurriculumResService.java
...ava/com/tanpu/community/service/CurriculumResService.java
+21
-0
FinProResService.java
...in/java/com/tanpu/community/service/FinProResService.java
+21
-0
ZhiboService.java
...c/main/java/com/tanpu/community/service/ZhiboService.java
+21
-0
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/ThemeDTO.java
View file @
02259a59
...
@@ -68,4 +68,5 @@ public class ThemeDTO {
...
@@ -68,4 +68,5 @@ public class ThemeDTO {
private
Integer
deleteTag
;
private
Integer
deleteTag
;
private
Object
attachmentInfo
;
}
}
community-service/src/main/java/com/tanpu/community/dao/CodeAutoGenerator.java
View file @
02259a59
...
@@ -21,13 +21,13 @@ public class CodeAutoGenerator {
...
@@ -21,13 +21,13 @@ public class CodeAutoGenerator {
String
author
=
"xudong"
;
String
author
=
"xudong"
;
String
mysqlUserName
=
"tamp_admin"
;
String
mysqlUserName
=
"tamp_admin"
;
String
mysqlPassword
=
"@imeng123"
;
String
mysqlPassword
=
"@imeng123"
;
String
jdbcUrl
=
"jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_
community
"
;
String
jdbcUrl
=
"jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_
user
"
;
String
[]
tables
=
new
String
[]{
"
topic
"
};
String
[]
tables
=
new
String
[]{
"
curriculum_res
"
};
// String[] tables = new String[]{"visit_summary", "black_list","collection","comment","fans_rel","file_record","home_page","theme","topic"};
// String[] tables = new String[]{"visit_summary", "black_list","collection","comment","fans_rel","file_record","home_page","theme","topic"};
String
basePackage
=
"com.tanpu.community"
;
String
basePackage
=
"com.tanpu.community"
;
String
mapperPackage
=
"dao.mapper.
community
"
;
String
mapperPackage
=
"dao.mapper.
user
"
;
String
entityPackage
=
"dao.entity.
community
"
;
String
entityPackage
=
"dao.entity.
user
"
;
String
xmlPath
=
"D:\\code\\backend\\tanpu-community\\community-service\\src\\main\\resources\\mapper\\
community
"
;
String
xmlPath
=
"D:\\code\\backend\\tanpu-community\\community-service\\src\\main\\resources\\mapper\\
user
"
;
AutoGenerator
autoGenerator
=
new
AutoGenerator
();
AutoGenerator
autoGenerator
=
new
AutoGenerator
();
//全局配置
//全局配置
GlobalConfig
gc
=
new
GlobalConfig
();
GlobalConfig
gc
=
new
GlobalConfig
();
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/user/CurriculumResEntity.java
0 → 100644
View file @
02259a59
package
com
.
tanpu
.
community
.
dao
.
entity
.
user
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* <p>
* 课程资源
* </p>
*
* @author xudong
* @since 2021-06-23
*/
@TableName
(
"curriculum_res"
)
@ApiModel
(
value
=
"CurriculumResEntity对象"
,
description
=
"课程资源"
)
public
class
CurriculumResEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键id"
)
private
String
id
;
@ApiModelProperty
(
value
=
"课程名称"
)
private
String
title
;
@ApiModelProperty
(
value
=
"课程音视频"
)
private
String
audio
;
@ApiModelProperty
(
value
=
"音/视频类型 1:音频 2:视频 3:小视频"
)
private
Integer
audioType
;
@ApiModelProperty
(
value
=
"讲师id"
)
private
String
teacherId
;
@ApiModelProperty
(
value
=
"讲师姓名"
)
private
String
teacherName
;
@ApiModelProperty
(
value
=
"文稿内容"
)
private
String
content
;
@ApiModelProperty
(
value
=
"时长"
)
private
Integer
duration
;
@ApiModelProperty
(
value
=
"文件大小KB"
)
private
Integer
fileSize
;
@ApiModelProperty
(
value
=
"组织id"
)
private
String
orgId
;
@ApiModelProperty
(
value
=
"房间密码"
)
private
String
roomPwd
;
@ApiModelProperty
(
value
=
"白名单 1:白名单 2:黑名单"
)
private
Integer
whiteList
;
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createBy
;
@ApiModelProperty
(
value
=
"阅读数"
)
private
Integer
readNum
;
@ApiModelProperty
(
value
=
"阅读基础数"
)
private
Integer
readBaseNum
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updateBy
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
value
=
"删除标识"
)
private
Integer
deleteTag
;
@ApiModelProperty
(
value
=
"状态"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"简介"
)
private
String
info
;
@ApiModelProperty
(
value
=
"封面"
)
private
String
cover
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getAudio
()
{
return
audio
;
}
public
void
setAudio
(
String
audio
)
{
this
.
audio
=
audio
;
}
public
Integer
getAudioType
()
{
return
audioType
;
}
public
void
setAudioType
(
Integer
audioType
)
{
this
.
audioType
=
audioType
;
}
public
String
getTeacherId
()
{
return
teacherId
;
}
public
void
setTeacherId
(
String
teacherId
)
{
this
.
teacherId
=
teacherId
;
}
public
String
getTeacherName
()
{
return
teacherName
;
}
public
void
setTeacherName
(
String
teacherName
)
{
this
.
teacherName
=
teacherName
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
public
Integer
getDuration
()
{
return
duration
;
}
public
void
setDuration
(
Integer
duration
)
{
this
.
duration
=
duration
;
}
public
Integer
getFileSize
()
{
return
fileSize
;
}
public
void
setFileSize
(
Integer
fileSize
)
{
this
.
fileSize
=
fileSize
;
}
public
String
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
String
orgId
)
{
this
.
orgId
=
orgId
;
}
public
String
getRoomPwd
()
{
return
roomPwd
;
}
public
void
setRoomPwd
(
String
roomPwd
)
{
this
.
roomPwd
=
roomPwd
;
}
public
Integer
getWhiteList
()
{
return
whiteList
;
}
public
void
setWhiteList
(
Integer
whiteList
)
{
this
.
whiteList
=
whiteList
;
}
public
String
getCreateBy
()
{
return
createBy
;
}
public
void
setCreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
public
Integer
getReadNum
()
{
return
readNum
;
}
public
void
setReadNum
(
Integer
readNum
)
{
this
.
readNum
=
readNum
;
}
public
Integer
getReadBaseNum
()
{
return
readBaseNum
;
}
public
void
setReadBaseNum
(
Integer
readBaseNum
)
{
this
.
readBaseNum
=
readBaseNum
;
}
public
LocalDateTime
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
LocalDateTime
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getUpdateBy
()
{
return
updateBy
;
}
public
void
setUpdateBy
(
String
updateBy
)
{
this
.
updateBy
=
updateBy
;
}
public
LocalDateTime
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
LocalDateTime
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Integer
getDeleteTag
()
{
return
deleteTag
;
}
public
void
setDeleteTag
(
Integer
deleteTag
)
{
this
.
deleteTag
=
deleteTag
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Integer
getSort
()
{
return
sort
;
}
public
void
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
}
public
String
getInfo
()
{
return
info
;
}
public
void
setInfo
(
String
info
)
{
this
.
info
=
info
;
}
public
String
getCover
()
{
return
cover
;
}
public
void
setCover
(
String
cover
)
{
this
.
cover
=
cover
;
}
@Override
public
String
toString
()
{
return
"CurriculumResEntity{"
+
"id="
+
id
+
", title="
+
title
+
", audio="
+
audio
+
", audioType="
+
audioType
+
", teacherId="
+
teacherId
+
", teacherName="
+
teacherName
+
", content="
+
content
+
", duration="
+
duration
+
", fileSize="
+
fileSize
+
", orgId="
+
orgId
+
", roomPwd="
+
roomPwd
+
", whiteList="
+
whiteList
+
", createBy="
+
createBy
+
", readNum="
+
readNum
+
", readBaseNum="
+
readBaseNum
+
", createTime="
+
createTime
+
", updateBy="
+
updateBy
+
", updateTime="
+
updateTime
+
", deleteTag="
+
deleteTag
+
", status="
+
status
+
", sort="
+
sort
+
", info="
+
info
+
", cover="
+
cover
+
"}"
;
}
}
community-service/src/main/java/com/tanpu/community/dao/entity/user/FinProResEntity.java
0 → 100644
View file @
02259a59
This diff is collapsed.
Click to expand it.
community-service/src/main/java/com/tanpu/community/dao/entity/zhibo/ZhiboThemeEntity.java
0 → 100644
View file @
02259a59
This diff is collapsed.
Click to expand it.
community-service/src/main/java/com/tanpu/community/dao/mapper/user/CurriculumResMapper.java
0 → 100644
View file @
02259a59
package
com
.
tanpu
.
community
.
dao
.
mapper
.
user
;
import
com.tanpu.community.dao.entity.user.CurriculumResEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* 课程资源 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-23
*/
public
interface
CurriculumResMapper
extends
BaseMapper
<
CurriculumResEntity
>
{
}
community-service/src/main/java/com/tanpu/community/dao/mapper/user/FinProResMapper.java
0 → 100644
View file @
02259a59
package
com
.
tanpu
.
community
.
dao
.
mapper
.
user
;
import
com.tanpu.community.dao.entity.user.FinProResEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-23
*/
public
interface
FinProResMapper
extends
BaseMapper
<
FinProResEntity
>
{
}
community-service/src/main/java/com/tanpu/community/dao/mapper/zhibo/ZhiboThemeMapper.java
0 → 100644
View file @
02259a59
package
com
.
tanpu
.
community
.
dao
.
mapper
.
zhibo
;
import
com.tanpu.community.dao.entity.zhibo.ZhiboThemeEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* 直播间信息表 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-23
*/
public
interface
ZhiboThemeMapper
extends
BaseMapper
<
ZhiboThemeEntity
>
{
}
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
02259a59
...
@@ -4,12 +4,15 @@ import com.tanpu.community.api.beans.ThemeDTO;
...
@@ -4,12 +4,15 @@ import com.tanpu.community.api.beans.ThemeDTO;
import
com.tanpu.community.api.constants.BlockTypeEnum
;
import
com.tanpu.community.api.constants.BlockTypeEnum
;
import
com.tanpu.community.api.constants.CollectionTypeEnum
;
import
com.tanpu.community.api.constants.CollectionTypeEnum
;
import
com.tanpu.community.api.constants.CommentTypeEnum
;
import
com.tanpu.community.api.constants.CommentTypeEnum
;
import
com.tanpu.community.util.ConvertUtil
;
import
com.tanpu.community.dao.entity.community.BlackListEntity
;
import
com.tanpu.community.dao.entity.community.BlackListEntity
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
import
com.tanpu.community.dao.entity.community.FansRelEntity
;
import
com.tanpu.community.dao.entity.community.FansRelEntity
;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.dao.entity.user.CurriculumResEntity
;
import
com.tanpu.community.dao.entity.user.FinProResEntity
;
import
com.tanpu.community.dao.entity.zhibo.ZhiboThemeEntity
;
import
com.tanpu.community.service.*
;
import
com.tanpu.community.service.*
;
import
com.tanpu.community.util.ConvertUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -37,16 +40,47 @@ public class ThemeManager {
...
@@ -37,16 +40,47 @@ public class ThemeManager {
@Autowired
@Autowired
private
BlackListService
blackListService
;
private
BlackListService
blackListService
;
@Autowired
private
FinProResService
finProResService
;
@Autowired
@Autowired
private
RedisService
redisService
;
private
RedisService
redisService
;
@Autowired
private
ZhiboService
zhiboService
;
@Autowired
private
CurriculumResService
curriculumResService
;
// 返回推荐主题文章
// 返回推荐主题文章
public
List
<
ThemeDTO
>
selectHotThemes
()
{
public
List
<
ThemeDTO
>
selectHotThemes
()
{
// TODO:根据算法计算推荐主题
// TODO:根据算法计算推荐主题
List
<
ThemeEntity
>
themeEntities
=
themeService
.
selectAll
();
List
<
ThemeEntity
>
themeEntities
=
themeService
.
selectAll
();
List
<
ThemeDTO
>
themeDTOS
=
ConvertUtil
.
themeEntitiesToDTOs
(
themeEntities
);
List
<
ThemeDTO
>
themeDTOS
=
ConvertUtil
.
themeEntitiesToDTOs
(
themeEntities
);
for
(
ThemeDTO
themeDTO
:
themeDTOS
)
{
for
(
ThemeDTO
themeDTO
:
themeDTOS
)
{
switch
(
themeDTO
.
getAttachType
())
{
//附件类型 1:产品 2:直播 3:短视频 4:课程
//TODO ENTITY 转 DTO
case
1
:
FinProResEntity
finProResEntity
=
finProResService
.
selectById
(
themeDTO
.
getAttachment
());
themeDTO
.
setAttachmentInfo
(
finProResEntity
);
break
;
case
2
:
ZhiboThemeEntity
zhiboThemeEntity
=
zhiboService
.
selectByid
(
themeDTO
.
getAttachment
());
themeDTO
.
setAttachmentInfo
(
zhiboThemeEntity
);
break
;
case
3
:
CurriculumResEntity
curriculumResEntity
=
curriculumResService
.
selectById
(
themeDTO
.
getAttachment
());
themeDTO
.
setAttachmentInfo
(
curriculumResEntity
);
break
;
case
4
:
//todo 课程详情
break
;
default
:
break
;
}
themeDTO
.
setUpToNowTime
(
calUpToNowTime
(
themeDTO
.
getCreateTime
()));
themeDTO
.
setUpToNowTime
(
calUpToNowTime
(
themeDTO
.
getCreateTime
()));
//TODO 添加用户名、头像、认证
//TODO 添加用户名、头像、认证
}
}
...
...
community-service/src/main/java/com/tanpu/community/service/CurriculumResService.java
0 → 100644
View file @
02259a59
package
com
.
tanpu
.
community
.
service
;
import
com.tanpu.community.dao.entity.user.CurriculumResEntity
;
import
com.tanpu.community.dao.mapper.user.CurriculumResMapper
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
/**
* 短视频详情
*/
@Service
public
class
CurriculumResService
{
@Resource
private
CurriculumResMapper
curriculumResMapper
;
public
CurriculumResEntity
selectById
(
String
id
)
{
return
curriculumResMapper
.
selectById
(
id
);
}
}
community-service/src/main/java/com/tanpu/community/service/FinProResService.java
0 → 100644
View file @
02259a59
package
com
.
tanpu
.
community
.
service
;
import
com.tanpu.community.dao.entity.user.FinProResEntity
;
import
com.tanpu.community.dao.mapper.user.FinProResMapper
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
/**
* 产品详情
*/
@Service
public
class
FinProResService
{
@Resource
private
FinProResMapper
finProResMapper
;
public
FinProResEntity
selectById
(
String
id
){
return
finProResMapper
.
selectById
(
id
);
}
}
community-service/src/main/java/com/tanpu/community/service/ZhiboService.java
0 → 100644
View file @
02259a59
package
com
.
tanpu
.
community
.
service
;
import
com.tanpu.community.dao.entity.zhibo.ZhiboThemeEntity
;
import
com.tanpu.community.dao.mapper.zhibo.ZhiboThemeMapper
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
/**
* 直播详情
*/
@Service
public
class
ZhiboService
{
@Resource
private
ZhiboThemeMapper
zhiboThemeMapper
;
public
ZhiboThemeEntity
selectByid
(
String
id
)
{
return
zhiboThemeMapper
.
selectById
(
id
);
}
}
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