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
83fc55bd
Commit
83fc55bd
authored
Jul 08, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口调整
parent
494f79af
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
19 deletions
+124
-19
ThemeContentReq.java
.../tanpu/community/api/beans/req/theme/ThemeContentReq.java
+6
-3
RelTypeEnum.java
.../main/java/com/tanpu/community/api/enums/RelTypeEnum.java
+104
-0
ConvertUtil.java
...e/src/main/java/com/tanpu/community/util/ConvertUtil.java
+14
-16
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/req/theme/ThemeContentReq.java
View file @
83fc55bd
package
com
.
tanpu
.
community
.
api
.
beans
.
req
.
theme
;
package
com
.
tanpu
.
community
.
api
.
beans
.
req
.
theme
;
import
com.tanpu.community.api.beans.ImagesDTO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.List
;
@Data
@Data
@ApiModel
(
value
=
"主题内容"
)
@ApiModel
(
value
=
"主题内容"
)
public
class
ThemeContentReq
{
public
class
ThemeContentReq
{
...
@@ -17,4 +14,10 @@ public class ThemeContentReq {
...
@@ -17,4 +14,10 @@ public class ThemeContentReq {
@ApiModelProperty
(
value
=
"文本的值是内容,附件的值为id"
)
@ApiModelProperty
(
value
=
"文本的值是内容,附件的值为id"
)
private
String
value
;
private
String
value
;
@ApiModelProperty
(
value
=
"产品类型"
)
private
Integer
productType
;
@ApiModelProperty
(
value
=
"产品推荐语"
)
private
String
remark
;
}
}
community-api/src/main/java/com/tanpu/community/api/enums/RelTypeEnum.java
0 → 100644
View file @
83fc55bd
package
com
.
tanpu
.
community
.
api
.
enums
;
/**
* 资源类型
*/
public
enum
RelTypeEnum
{
/**
* 专栏
*/
COLUMN
(
1
,
"栏目"
),
/**
* 课程包
*/
PACKAGE
(
2
,
"课程包"
),
/**
* 直播
*/
LIVE
(
3
,
"直播"
),
/**
* 视频
*/
VIDEO
(
4
,
"视频"
),
/**
* 音频
*/
AUDIO
(
5
,
"音频"
),
/**
* 短视频
*/
SHORT_VIDEO
(
6
,
"小视频"
),
/**
* 课件
*/
COURSE_WARE
(
7
,
"直播课件"
),
/**
* 文本类型
*/
TEXT
(
8
,
"文本"
),
FUND
(
88
,
"产品"
),
PINGLUN
(
99
,
"评论"
),
TAMP_CAMP
(
101
,
"训练营"
),
SPECIAL_IMG
(
122
,
"专栏-图片"
),
RES_FILE
(
121
,
"资源文件"
),
ARTICLE
(
202
,
"文章"
),
DAYREPORT
(
204
,
"早报"
),
/**
* 新版课程包
*/
NEW_COURSE_WARE
(
300
,
"新版课程 - 课程包"
),
/**
* 新版课程
*/
NEW_COURSE_CHAPTER
(
301
,
"新版课程 - 章节"
),
/**
* 新版课程
*/
NEW_COURSE_SECTION_AUDIO
(
303
,
"新版课程 - 小节 - 音频"
),
/**
* 新版课程
*/
NEW_COURSE_SECTION_VIDEO
(
304
,
"新版课程 - 小节 - 视频"
),
/**
* 新版课件
*/
NEW_COURSE_SECTION_KEJIAN
(
305
,
"新版课件 - 课件 - 课件"
);
/**
* 前端用的类型
*/
public
String
type
;
/**
* 名称
*/
public
String
name
;
RelTypeEnum
(
Integer
type
,
String
name
)
{
this
.
type
=
type
.
toString
();
this
.
name
=
name
;
}
}
community-service/src/main/java/com/tanpu/community/util/ConvertUtil.java
View file @
83fc55bd
package
com
.
tanpu
.
community
.
util
;
package
com
.
tanpu
.
community
.
util
;
import
com.tanpu.community.api.beans.qo.TopicTitileQo
;
import
com.tanpu.community.api.beans.TopicDO
;
import
com.tanpu.community.api.beans.TopicDO
;
import
com.tanpu.community.api.beans.qo.CommentLv2Qo
;
import
com.tanpu.community.api.beans.qo.*
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.qo.FollowQo
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.req.theme.CreateThemeReq
;
import
com.tanpu.community.api.beans.req.theme.CreateThemeReq
;
import
com.tanpu.community.api.beans.req.theme.ThemeContentReq
;
import
com.tanpu.community.api.enums.DeleteTagEnum
;
import
com.tanpu.community.api.enums.DeleteTagEnum
;
import
com.tanpu.community.api.enums.RelTypeEnum
;
import
com.tanpu.community.dao.entity.community.*
;
import
com.tanpu.community.dao.entity.community.*
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -100,17 +97,18 @@ public class ConvertUtil {
...
@@ -100,17 +97,18 @@ public class ConvertUtil {
}
}
public
static
List
<
ThemeAttachmentEntity
>
themeReqToAttachmentList
(
CreateThemeReq
req
,
String
themeId
)
{
public
static
List
<
ThemeAttachmentEntity
>
themeReqToAttachmentList
(
CreateThemeReq
req
,
String
themeId
)
{
if
(
req
==
null
||
req
.
getAttachment
()
==
null
||
req
.
getAttachment
().
size
()
==
0
)
{
List
<
ThemeContentReq
>
contents
=
req
.
getContent
();
return
Collections
.
emptyList
();
}
List
<
ThemeAttachmentEntity
>
list
=
new
ArrayList
<>();
List
<
ThemeAttachmentEntity
>
list
=
new
ArrayList
<>();
req
.
getAttachment
().
forEach
((
k
,
v
)
->
{
for
(
ThemeContentReq
content
:
contents
)
{
if
(!
RelTypeEnum
.
TEXT
.
type
.
equals
(
content
.
getType
())){
list
.
add
(
ThemeAttachmentEntity
.
builder
()
list
.
add
(
ThemeAttachmentEntity
.
builder
()
.
attachType
(
Integer
.
valueOf
(
k
))
.
attachType
(
Integer
.
valueOf
(
content
.
getType
()
))
.
attachId
(
v
)
.
attachId
(
content
.
getValue
()
)
.
themeId
(
themeId
)
.
themeId
(
themeId
)
.
build
());
.
build
());
});
}
}
return
list
;
return
list
;
}
}
...
...
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