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
42942fcb
Commit
42942fcb
authored
Jun 28, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产品、短视频、直播详情
parent
02259a59
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
878 additions
and
38 deletions
+878
-38
ForwardThemeDTO.java
...n/java/com/tanpu/community/api/beans/ForwardThemeDTO.java
+11
-0
CurriculumEnum.java
...ava/com/tanpu/community/api/constants/CurriculumEnum.java
+70
-0
ThemeController.java
.../java/com/tanpu/community/controller/ThemeController.java
+3
-2
CodeAutoGenerator.java
.../main/java/com/tanpu/community/dao/CodeAutoGenerator.java
+1
-1
ThemeEntity.java
...com/tanpu/community/dao/entity/community/ThemeEntity.java
+6
-0
CurriculumPriceEntity.java
...anpu/community/dao/entity/user/CurriculumPriceEntity.java
+244
-0
OrderFlowEntity.java
.../com/tanpu/community/dao/entity/user/OrderFlowEntity.java
+377
-0
CurriculumPriceMapper.java
...anpu/community/dao/mapper/user/CurriculumPriceMapper.java
+16
-0
OrderFlowMapper.java
.../com/tanpu/community/dao/mapper/user/OrderFlowMapper.java
+16
-0
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+56
-34
CurriculumPriceService.java
...a/com/tanpu/community/service/CurriculumPriceService.java
+29
-0
CurriculumResService.java
...ava/com/tanpu/community/service/CurriculumResService.java
+10
-0
OrderFlowService.java
...in/java/com/tanpu/community/service/OrderFlowService.java
+38
-0
ThemeService.java
...c/main/java/com/tanpu/community/service/ThemeService.java
+1
-1
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/ForwardThemeDTO.java
0 → 100644
View file @
42942fcb
package
com
.
tanpu
.
community
.
api
.
beans
;
import
lombok.Data
;
@Data
public
class
ForwardThemeDTO
{
private
String
formerThemeId
;
private
String
content
;
private
String
topicId
;
}
community-api/src/main/java/com/tanpu/community/api/constants/CurriculumEnum.java
0 → 100644
View file @
42942fcb
package
com
.
tanpu
.
community
.
api
.
constants
;
import
com.caixiaoquan.faTools.dao.model.vo.SysConstantListVo
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.List
;
public
class
CurriculumEnum
{
//课程类型
public
class
TypeEnum
{
public
static
final
String
MODULE_BAR
=
"0"
;
//实战课堂
public
static
final
String
MODULE_DV
=
"1"
;
//大V讲坛
public
static
final
String
MODULE_TANPU
=
"2"
;
//探普课程
}
//课程是否推荐
public
class
RecommendEnum
{
public
static
final
String
RECOMMEND_NO
=
"0"
;
//否
public
static
final
String
RECOMMEND_YES
=
"1"
;
//1
}
//课程类型
public
class
ChapterType
{
public
static
final
String
single
=
"0"
;
//单篇
public
static
final
String
mutiple
=
"1"
;
//多篇
}
//课程状态
public
class
CcStatus
{
public
static
final
String
doing
=
"0"
;
//制作中
public
static
final
String
up
=
"1"
;
//上架
public
static
final
String
down
=
"2"
;
//下架
}
//课程章节上架状态
public
class
ChapterStatus
{
public
static
final
String
NO
=
"0"
;
//未上架
public
static
final
String
YES
=
"1"
;
//上架
}
//课程章节类型
public
class
ChapterCatalogType
{
public
static
final
String
ONE_CATALOG
=
"0"
;
//只有一级目录
public
static
final
String
TWO_CATALOG
=
"1"
;
//有两级目录
}
//是否置顶
public
class
Istop
{
public
static
final
String
NO
=
"0"
;
//否
public
static
final
String
YES
=
"1"
;
//是
}
//课程类型
public
class
LabelEnum
{
public
static
final
String
LABEL_ZB
=
"11"
;
//直播课
}
//课程类型
public
static
String
getTypeName
(
String
code
,
List
<
SysConstantListVo
>
listVoList
)
{
String
name
=
""
;
for
(
SysConstantListVo
sysConstantListVo
:
listVoList
)
{
if
(
StringUtils
.
equals
(
sysConstantListVo
.
getId
(),
code
))
{
name
=
sysConstantListVo
.
getConstantName
();
break
;
}
}
return
name
;
}
}
community-service/src/main/java/com/tanpu/community/controller/ThemeController.java
View file @
42942fcb
package
com
.
tanpu
.
community
.
controller
;
import
com.tanpu.community.api.beans.ForwardThemeDTO
;
import
com.tanpu.community.api.beans.ThemeDTO
;
import
com.tanpu.community.manager.ThemeManager
;
import
com.tanpu.community.service.FansRelService
;
...
...
@@ -59,9 +60,9 @@ public class ThemeController {
@ApiOperation
(
"转发主题"
)
@RequestMapping
(
value
=
"/forward"
)
@ResponseBody
public
String
forwardTheme
(
String
themeId
){
public
String
forwardTheme
(
ForwardThemeDTO
forwardThemeDTO
){
String
userId
=
"liujm"
;
themeManager
.
forward
(
themeId
,
userId
);
themeManager
.
forward
(
forwardThemeDTO
,
userId
);
return
"success"
;
}
...
...
community-service/src/main/java/com/tanpu/community/dao/CodeAutoGenerator.java
View file @
42942fcb
...
...
@@ -22,7 +22,7 @@ public class CodeAutoGenerator {
String
mysqlUserName
=
"tamp_admin"
;
String
mysqlPassword
=
"@imeng123"
;
String
jdbcUrl
=
"jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_user"
;
String
[]
tables
=
new
String
[]{
"
curriculum_res
"
};
String
[]
tables
=
new
String
[]{
"
order_flow"
,
"curriculum_price
"
};
// String[] tables = new String[]{"visit_summary", "black_list","collection","comment","fans_rel","file_record","home_page","theme","topic"};
String
basePackage
=
"com.tanpu.community"
;
String
mapperPackage
=
"dao.mapper.user"
;
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/ThemeEntity.java
View file @
42942fcb
...
...
@@ -5,6 +5,9 @@ import java.time.LocalDateTime;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.NoArgsConstructor
;
/**
* <p>
...
...
@@ -14,6 +17,9 @@ import io.swagger.annotations.ApiModelProperty;
* @author xudong
* @since 2021-06-10
*/
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName
(
"theme"
)
@ApiModel
(
value
=
"ThemeEntity对象"
,
description
=
"主题内容"
)
public
class
ThemeEntity
implements
Serializable
{
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/user/CurriculumPriceEntity.java
0 → 100644
View file @
42942fcb
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-24
*/
@TableName
(
"curriculum_price"
)
@ApiModel
(
value
=
"CurriculumPriceEntity对象"
,
description
=
"定价表"
)
public
class
CurriculumPriceEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
id
;
@ApiModelProperty
(
value
=
"关联id"
)
private
String
relId
;
@ApiModelProperty
(
value
=
"付费模式 1:免费 2:积分 3:现金"
)
private
Integer
chargeMode
;
@ApiModelProperty
(
value
=
"价格"
)
private
Long
price
;
@ApiModelProperty
(
value
=
"划线价"
)
private
Long
crossedPrice
;
@ApiModelProperty
(
value
=
"是否促销 0:否 1 :是 "
)
private
Integer
promo
;
@ApiModelProperty
(
value
=
"促销价格"
)
private
Long
promoPrice
;
@ApiModelProperty
(
value
=
"促销开始日期"
)
private
LocalDateTime
promoStartTime
;
@ApiModelProperty
(
value
=
"促销结束日期"
)
private
LocalDateTime
promoEndTime
;
@ApiModelProperty
(
value
=
"使用积分 0:不使用 1:使用 (保留字段)"
)
private
Integer
useScore
;
@ApiModelProperty
(
value
=
"积分"
)
private
Integer
score
;
@ApiModelProperty
(
value
=
"是否有角色价 0:没有 1:有"
)
private
Integer
isRolePrice
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createBy
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
value
=
"删除"
)
private
Integer
deleteTag
;
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updateBy
;
@ApiModelProperty
(
value
=
"机构id"
)
private
String
orgId
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getRelId
()
{
return
relId
;
}
public
void
setRelId
(
String
relId
)
{
this
.
relId
=
relId
;
}
public
Integer
getChargeMode
()
{
return
chargeMode
;
}
public
void
setChargeMode
(
Integer
chargeMode
)
{
this
.
chargeMode
=
chargeMode
;
}
public
Long
getPrice
()
{
return
price
;
}
public
void
setPrice
(
Long
price
)
{
this
.
price
=
price
;
}
public
Long
getCrossedPrice
()
{
return
crossedPrice
;
}
public
void
setCrossedPrice
(
Long
crossedPrice
)
{
this
.
crossedPrice
=
crossedPrice
;
}
public
Integer
getPromo
()
{
return
promo
;
}
public
void
setPromo
(
Integer
promo
)
{
this
.
promo
=
promo
;
}
public
Long
getPromoPrice
()
{
return
promoPrice
;
}
public
void
setPromoPrice
(
Long
promoPrice
)
{
this
.
promoPrice
=
promoPrice
;
}
public
LocalDateTime
getPromoStartTime
()
{
return
promoStartTime
;
}
public
void
setPromoStartTime
(
LocalDateTime
promoStartTime
)
{
this
.
promoStartTime
=
promoStartTime
;
}
public
LocalDateTime
getPromoEndTime
()
{
return
promoEndTime
;
}
public
void
setPromoEndTime
(
LocalDateTime
promoEndTime
)
{
this
.
promoEndTime
=
promoEndTime
;
}
public
Integer
getUseScore
()
{
return
useScore
;
}
public
void
setUseScore
(
Integer
useScore
)
{
this
.
useScore
=
useScore
;
}
public
Integer
getScore
()
{
return
score
;
}
public
void
setScore
(
Integer
score
)
{
this
.
score
=
score
;
}
public
Integer
getIsRolePrice
()
{
return
isRolePrice
;
}
public
void
setIsRolePrice
(
Integer
isRolePrice
)
{
this
.
isRolePrice
=
isRolePrice
;
}
public
LocalDateTime
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
LocalDateTime
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getCreateBy
()
{
return
createBy
;
}
public
void
setCreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
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
String
getUpdateBy
()
{
return
updateBy
;
}
public
void
setUpdateBy
(
String
updateBy
)
{
this
.
updateBy
=
updateBy
;
}
public
String
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
String
orgId
)
{
this
.
orgId
=
orgId
;
}
@Override
public
String
toString
()
{
return
"CurriculumPriceEntity{"
+
"id="
+
id
+
", relId="
+
relId
+
", chargeMode="
+
chargeMode
+
", price="
+
price
+
", crossedPrice="
+
crossedPrice
+
", promo="
+
promo
+
", promoPrice="
+
promoPrice
+
", promoStartTime="
+
promoStartTime
+
", promoEndTime="
+
promoEndTime
+
", useScore="
+
useScore
+
", score="
+
score
+
", isRolePrice="
+
isRolePrice
+
", createTime="
+
createTime
+
", createBy="
+
createBy
+
", updateTime="
+
updateTime
+
", deleteTag="
+
deleteTag
+
", updateBy="
+
updateBy
+
", orgId="
+
orgId
+
"}"
;
}
}
community-service/src/main/java/com/tanpu/community/dao/entity/user/OrderFlowEntity.java
0 → 100644
View file @
42942fcb
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-24
*/
@TableName
(
"order_flow"
)
@ApiModel
(
value
=
"OrderFlowEntity对象"
,
description
=
""
)
public
class
OrderFlowEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"唯一主键"
)
private
String
id
;
@ApiModelProperty
(
value
=
"订单号"
)
private
String
abOrdernum
;
@ApiModelProperty
(
value
=
"产品价格"
)
private
Long
abPrice
;
@ApiModelProperty
(
value
=
"积分"
)
private
Long
abScore
;
@ApiModelProperty
(
value
=
"积分抵扣"
)
private
Long
abScoreDeduct
;
@ApiModelProperty
(
value
=
"账户余额抵扣"
)
private
Long
abAccountDeduct
;
@ApiModelProperty
(
value
=
"支付通道付款金额"
)
private
Long
abPayment
;
@ApiModelProperty
(
value
=
"支付方式 1:免费 2:积分 3现金"
)
private
String
abPayMode
;
@ApiModelProperty
(
value
=
"订单总额"
)
private
Long
abTotalMoney
;
@ApiModelProperty
(
value
=
"产品类型"
)
private
String
abType
;
@ApiModelProperty
(
value
=
"产品ID"
)
private
String
abProid
;
@ApiModelProperty
(
value
=
"产品规格ID"
)
private
String
abProSiid
;
@ApiModelProperty
(
value
=
"产品规格类型"
)
private
String
abSiType
;
@ApiModelProperty
(
value
=
"产品规格规格名称"
)
private
String
abSiName
;
@ApiModelProperty
(
value
=
"产品规格规格编码"
)
private
String
abSiCode
;
@ApiModelProperty
(
value
=
"产品规格定价模式"
)
private
String
abSiPattern
;
@ApiModelProperty
(
value
=
"状态 WAIT:待支付 SUCCESS:支付成功 FAIL:支付失败 CANCEL:取消交易"
)
private
String
abStatus
;
@ApiModelProperty
(
value
=
"权益分配状态"
)
private
String
abRightsStatus
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createtime
;
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createby
;
@ApiModelProperty
(
value
=
"修改时间"
)
private
LocalDateTime
updatetime
;
@ApiModelProperty
(
value
=
"修改人"
)
private
String
updateby
;
@ApiModelProperty
(
value
=
"删除标识"
)
private
String
deletetag
;
@ApiModelProperty
(
value
=
"微信unionid"
)
private
String
unionid
;
@ApiModelProperty
(
value
=
"交易流水号"
)
private
String
transactionSerialNo
;
@ApiModelProperty
(
value
=
"付款时间"
)
private
LocalDateTime
payTime
;
@ApiModelProperty
(
value
=
"完成时间"
)
private
LocalDateTime
completeTime
;
@ApiModelProperty
(
value
=
"机构id"
)
private
String
orgId
;
@ApiModelProperty
(
value
=
"注册手机号"
)
private
String
registerPhone
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getAbOrdernum
()
{
return
abOrdernum
;
}
public
void
setAbOrdernum
(
String
abOrdernum
)
{
this
.
abOrdernum
=
abOrdernum
;
}
public
Long
getAbPrice
()
{
return
abPrice
;
}
public
void
setAbPrice
(
Long
abPrice
)
{
this
.
abPrice
=
abPrice
;
}
public
Long
getAbScore
()
{
return
abScore
;
}
public
void
setAbScore
(
Long
abScore
)
{
this
.
abScore
=
abScore
;
}
public
Long
getAbScoreDeduct
()
{
return
abScoreDeduct
;
}
public
void
setAbScoreDeduct
(
Long
abScoreDeduct
)
{
this
.
abScoreDeduct
=
abScoreDeduct
;
}
public
Long
getAbAccountDeduct
()
{
return
abAccountDeduct
;
}
public
void
setAbAccountDeduct
(
Long
abAccountDeduct
)
{
this
.
abAccountDeduct
=
abAccountDeduct
;
}
public
Long
getAbPayment
()
{
return
abPayment
;
}
public
void
setAbPayment
(
Long
abPayment
)
{
this
.
abPayment
=
abPayment
;
}
public
String
getAbPayMode
()
{
return
abPayMode
;
}
public
void
setAbPayMode
(
String
abPayMode
)
{
this
.
abPayMode
=
abPayMode
;
}
public
Long
getAbTotalMoney
()
{
return
abTotalMoney
;
}
public
void
setAbTotalMoney
(
Long
abTotalMoney
)
{
this
.
abTotalMoney
=
abTotalMoney
;
}
public
String
getAbType
()
{
return
abType
;
}
public
void
setAbType
(
String
abType
)
{
this
.
abType
=
abType
;
}
public
String
getAbProid
()
{
return
abProid
;
}
public
void
setAbProid
(
String
abProid
)
{
this
.
abProid
=
abProid
;
}
public
String
getAbProSiid
()
{
return
abProSiid
;
}
public
void
setAbProSiid
(
String
abProSiid
)
{
this
.
abProSiid
=
abProSiid
;
}
public
String
getAbSiType
()
{
return
abSiType
;
}
public
void
setAbSiType
(
String
abSiType
)
{
this
.
abSiType
=
abSiType
;
}
public
String
getAbSiName
()
{
return
abSiName
;
}
public
void
setAbSiName
(
String
abSiName
)
{
this
.
abSiName
=
abSiName
;
}
public
String
getAbSiCode
()
{
return
abSiCode
;
}
public
void
setAbSiCode
(
String
abSiCode
)
{
this
.
abSiCode
=
abSiCode
;
}
public
String
getAbSiPattern
()
{
return
abSiPattern
;
}
public
void
setAbSiPattern
(
String
abSiPattern
)
{
this
.
abSiPattern
=
abSiPattern
;
}
public
String
getAbStatus
()
{
return
abStatus
;
}
public
void
setAbStatus
(
String
abStatus
)
{
this
.
abStatus
=
abStatus
;
}
public
String
getAbRightsStatus
()
{
return
abRightsStatus
;
}
public
void
setAbRightsStatus
(
String
abRightsStatus
)
{
this
.
abRightsStatus
=
abRightsStatus
;
}
public
LocalDateTime
getCreatetime
()
{
return
createtime
;
}
public
void
setCreatetime
(
LocalDateTime
createtime
)
{
this
.
createtime
=
createtime
;
}
public
String
getCreateby
()
{
return
createby
;
}
public
void
setCreateby
(
String
createby
)
{
this
.
createby
=
createby
;
}
public
LocalDateTime
getUpdatetime
()
{
return
updatetime
;
}
public
void
setUpdatetime
(
LocalDateTime
updatetime
)
{
this
.
updatetime
=
updatetime
;
}
public
String
getUpdateby
()
{
return
updateby
;
}
public
void
setUpdateby
(
String
updateby
)
{
this
.
updateby
=
updateby
;
}
public
String
getDeletetag
()
{
return
deletetag
;
}
public
void
setDeletetag
(
String
deletetag
)
{
this
.
deletetag
=
deletetag
;
}
public
String
getUnionid
()
{
return
unionid
;
}
public
void
setUnionid
(
String
unionid
)
{
this
.
unionid
=
unionid
;
}
public
String
getTransactionSerialNo
()
{
return
transactionSerialNo
;
}
public
void
setTransactionSerialNo
(
String
transactionSerialNo
)
{
this
.
transactionSerialNo
=
transactionSerialNo
;
}
public
LocalDateTime
getPayTime
()
{
return
payTime
;
}
public
void
setPayTime
(
LocalDateTime
payTime
)
{
this
.
payTime
=
payTime
;
}
public
LocalDateTime
getCompleteTime
()
{
return
completeTime
;
}
public
void
setCompleteTime
(
LocalDateTime
completeTime
)
{
this
.
completeTime
=
completeTime
;
}
public
String
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
String
orgId
)
{
this
.
orgId
=
orgId
;
}
public
String
getRegisterPhone
()
{
return
registerPhone
;
}
public
void
setRegisterPhone
(
String
registerPhone
)
{
this
.
registerPhone
=
registerPhone
;
}
@Override
public
String
toString
()
{
return
"OrderFlowEntity{"
+
"id="
+
id
+
", abOrdernum="
+
abOrdernum
+
", abPrice="
+
abPrice
+
", abScore="
+
abScore
+
", abScoreDeduct="
+
abScoreDeduct
+
", abAccountDeduct="
+
abAccountDeduct
+
", abPayment="
+
abPayment
+
", abPayMode="
+
abPayMode
+
", abTotalMoney="
+
abTotalMoney
+
", abType="
+
abType
+
", abProid="
+
abProid
+
", abProSiid="
+
abProSiid
+
", abSiType="
+
abSiType
+
", abSiName="
+
abSiName
+
", abSiCode="
+
abSiCode
+
", abSiPattern="
+
abSiPattern
+
", abStatus="
+
abStatus
+
", abRightsStatus="
+
abRightsStatus
+
", createtime="
+
createtime
+
", createby="
+
createby
+
", updatetime="
+
updatetime
+
", updateby="
+
updateby
+
", deletetag="
+
deletetag
+
", unionid="
+
unionid
+
", transactionSerialNo="
+
transactionSerialNo
+
", payTime="
+
payTime
+
", completeTime="
+
completeTime
+
", orgId="
+
orgId
+
", registerPhone="
+
registerPhone
+
"}"
;
}
}
community-service/src/main/java/com/tanpu/community/dao/mapper/user/CurriculumPriceMapper.java
0 → 100644
View file @
42942fcb
package
com
.
tanpu
.
community
.
dao
.
mapper
.
user
;
import
com.tanpu.community.dao.entity.user.CurriculumPriceEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* 定价表 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-24
*/
public
interface
CurriculumPriceMapper
extends
BaseMapper
<
CurriculumPriceEntity
>
{
}
community-service/src/main/java/com/tanpu/community/dao/mapper/user/OrderFlowMapper.java
0 → 100644
View file @
42942fcb
package
com
.
tanpu
.
community
.
dao
.
mapper
.
user
;
import
com.tanpu.community.dao.entity.user.OrderFlowEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-24
*/
public
interface
OrderFlowMapper
extends
BaseMapper
<
OrderFlowEntity
>
{
}
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
42942fcb
package
com
.
tanpu
.
community
.
manager
;
import
com.tanpu.community.api.beans.ForwardThemeDTO
;
import
com.tanpu.community.api.beans.ThemeDTO
;
import
com.tanpu.community.api.constants.BlockTypeEnum
;
import
com.tanpu.community.api.constants.CollectionTypeEnum
;
...
...
@@ -10,6 +11,7 @@ import com.tanpu.community.dao.entity.community.FansRelEntity;
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.user.OrderFlowEntity
;
import
com.tanpu.community.dao.entity.zhibo.ZhiboThemeEntity
;
import
com.tanpu.community.service.*
;
import
com.tanpu.community.util.ConvertUtil
;
...
...
@@ -52,50 +54,28 @@ public class ThemeManager {
@Autowired
private
CurriculumResService
curriculumResService
;
@Autowired
private
OrderFlowService
orderFlowService
;
// 返回推荐主题文章
public
List
<
ThemeDTO
>
selectHotThemes
()
{
public
List
<
ThemeDTO
>
selectHotThemes
(
String
userId
)
{
// TODO:根据算法计算推荐主题
List
<
ThemeEntity
>
themeEntities
=
themeService
.
selectAll
();
List
<
ThemeDTO
>
themeDTOS
=
ConvertUtil
.
themeEntitiesToDTOs
(
themeEntities
);
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
()));
//TODO 添加用户名、头像、认证
fillDTOExtraInfo
(
themeDTO
,
userId
);
}
return
themeDTOS
;
}
// 返回关注主题
public
List
<
ThemeDTO
>
selectInterestThemes
(
String
userId
)
{
List
<
String
>
fansList
=
fansRelService
.
queryFansByFollowerId
(
userId
).
stream
().
map
(
FansRelEntity:
:
getIdolId
).
collect
(
Collectors
.
toList
());
List
<
ThemeEntity
>
themeEntities
=
themeService
.
selectByFans
(
fansList
);
List
<
ThemeDTO
>
themeDTOS
=
ConvertUtil
.
themeEntitiesToDTOs
(
themeEntities
);
for
(
ThemeDTO
themeDTO
:
themeDTOS
)
{
themeDTO
.
setUpToNowTime
(
calUpToNowTime
(
themeDTO
.
getCreateTime
()));
//TODO 添加用户名、头像、认证
fillDTOExtraInfo
(
themeDTO
,
userId
);
}
return
themeDTOS
;
}
...
...
@@ -136,8 +116,16 @@ public class ThemeManager {
}
//转发
public
void
forward
(
String
themeId
,
String
user
)
{
//TODO
public
void
forward
(
ForwardThemeDTO
forwardThemeDTO
,
String
userId
)
{
ThemeEntity
targetTheme
=
themeService
.
selectById
(
forwardThemeDTO
.
getFormerThemeId
());
ThemeEntity
newTheme
=
ThemeEntity
.
builder
()
.
content
(
targetTheme
.
getContent
())
.
formerThemeId
(
targetTheme
.
getId
())
.
authorId
(
userId
)
.
createBy
(
userId
)
.
build
();
themeService
.
insertTheme
(
newTheme
);
}
...
...
@@ -157,7 +145,7 @@ public class ThemeManager {
//屏蔽(用户)
public
void
blockUser
(
String
themeId
,
String
userId
)
{
String
blockId
=
themeService
.
select
Theme
(
themeId
).
getAuthorId
();
String
blockId
=
themeService
.
select
ById
(
themeId
).
getAuthorId
();
blackListService
.
addBlock
(
blockId
,
userId
,
BlockTypeEnum
.
USER
);
}
...
...
@@ -168,9 +156,9 @@ public class ThemeManager {
// 屏蔽(主题)
public
void
blockTheme
(
String
themeId
,
String
userId
)
{
blackListService
.
addBlock
(
themeId
,
userId
,
BlockTypeEnum
.
THEME
);
BlackListEntity
selectOne
=
blackListService
.
selectOne
(
userId
,
BlockTypeEnum
.
USER
.
getCode
(),
themeService
.
select
Theme
(
themeId
).
getAuthorId
());
BlackListEntity
selectOne
=
blackListService
.
selectOne
(
userId
,
BlockTypeEnum
.
USER
.
getCode
(),
themeService
.
select
ById
(
themeId
).
getAuthorId
());
if
(
selectOne
==
null
)
{
blackListService
.
addBlock
(
themeService
.
select
Theme
(
themeId
).
getAuthorId
(),
userId
,
BlockTypeEnum
.
USER
);
blackListService
.
addBlock
(
themeService
.
select
ById
(
themeId
).
getAuthorId
(),
userId
,
BlockTypeEnum
.
USER
);
}
}
...
...
@@ -191,4 +179,38 @@ public class ThemeManager {
themeService
.
insertTheme
(
themeEntity
);
}
//查询话题所需关联信息
private
void
fillDTOExtraInfo
(
ThemeDTO
themeDTO
,
String
userId
)
{
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
.
selectShortVideo
(
themeDTO
.
getAttachment
());
themeDTO
.
setAttachmentInfo
(
curriculumResEntity
);
break
;
case
4
:
//todo 栏目详情,需要判断当前用户是否购买
curriculumResEntity
=
curriculumResService
.
selectById
(
themeDTO
.
getAttachment
());
themeDTO
.
setAttachmentInfo
(
curriculumResEntity
);
OrderFlowEntity
orderFlowEntity
=
orderFlowService
.
queryByUserAndProId
(
themeDTO
.
getId
(),
userId
);
break
;
default
:
break
;
}
themeDTO
.
setUpToNowTime
(
calUpToNowTime
(
themeDTO
.
getCreateTime
()));
//TODO 添加用户名、头像、认证
}
}
community-service/src/main/java/com/tanpu/community/service/CurriculumPriceService.java
0 → 100644
View file @
42942fcb
package
com
.
tanpu
.
community
.
service
;
import
com.tanpu.community.dao.entity.user.CurriculumPriceEntity
;
import
com.tanpu.community.dao.mapper.user.CurriculumPriceMapper
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.Collections
;
import
java.util.List
;
@Service
public
class
CurriculumPriceService
{
@Resource
private
CurriculumPriceMapper
curriculumPriceMapper
;
public
CurriculumPriceEntity
selectById
(
String
id
){
return
curriculumPriceMapper
.
selectById
(
id
);
}
public
List
<
CurriculumPriceEntity
>
selectByIds
(
List
<
String
>
ids
){
if
(
CollectionUtils
.
isEmpty
(
ids
)){
return
Collections
.
emptyList
();
}
return
curriculumPriceMapper
.
selectBatchIds
(
ids
);
}
}
community-service/src/main/java/com/tanpu/community/service/CurriculumResService.java
View file @
42942fcb
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.tanpu.community.api.constants.CurriculumEnum
;
import
com.tanpu.community.api.constants.DeleteTagEnum
;
import
com.tanpu.community.dao.entity.user.CurriculumResEntity
;
import
com.tanpu.community.dao.mapper.user.CurriculumResMapper
;
import
org.springframework.stereotype.Service
;
...
...
@@ -18,4 +21,11 @@ public class CurriculumResService {
public
CurriculumResEntity
selectById
(
String
id
)
{
return
curriculumResMapper
.
selectById
(
id
);
}
public
CurriculumResEntity
selectShortVideo
(
String
id
){
curriculumResMapper
.
selectOne
(
new
LambdaQueryWrapper
<
CurriculumResEntity
>()
.
eq
(
CurriculumResEntity:
:
getId
,
id
)
.
eq
(
CurriculumResEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
())
.
eq
(
CurriculumResEntity:
:
getStatus
,
CurriculumEnum
.
CcStatus
.
up
));
}
}
community-service/src/main/java/com/tanpu/community/service/OrderFlowService.java
0 → 100644
View file @
42942fcb
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.tanpu.community.api.constants.DeleteTagEnum
;
import
com.tanpu.community.dao.entity.user.OrderFlowEntity
;
import
com.tanpu.community.dao.mapper.user.OrderFlowMapper
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.Collections
;
import
java.util.List
;
@Service
public
class
OrderFlowService
{
@Resource
private
OrderFlowMapper
orderFlowMapper
;
public
OrderFlowEntity
selectById
(
String
id
){
return
orderFlowMapper
.
selectById
(
id
);
}
public
List
<
OrderFlowEntity
>
selectByIds
(
List
<
String
>
ids
){
if
(
CollectionUtils
.
isEmpty
(
ids
)){
return
Collections
.
emptyList
();
}
return
orderFlowMapper
.
selectBatchIds
(
ids
);
}
public
OrderFlowEntity
queryByUserAndProId
(
String
proId
,
String
userId
){
return
orderFlowMapper
.
selectOne
(
new
LambdaQueryWrapper
<
OrderFlowEntity
>()
.
eq
(
OrderFlowEntity:
:
getCreateby
,
userId
)
.
eq
(
OrderFlowEntity:
:
getAbProid
,
proId
)
.
eq
(
OrderFlowEntity:
:
getDeletetag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
())
.
eq
(
OrderFlowEntity:
:
getAbStatus
,
"SUCCESS"
));
}
}
community-service/src/main/java/com/tanpu/community/service/ThemeService.java
View file @
42942fcb
...
...
@@ -19,7 +19,7 @@ public class ThemeService {
}
//根据id返回主题详情
public
ThemeEntity
select
Theme
(
String
themeId
){
public
ThemeEntity
select
ById
(
String
themeId
){
return
themeMapper
.
selectById
(
themeId
);
}
...
...
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