Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
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
徐少华
midjourney-proxy
Commits
db75852f
Commit
db75852f
authored
Jun 30, 2020
by
郑永强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1003101] 资讯原文编辑不展示来源支持外链添加,原文资讯支持第三方小程序联接
parent
2d5fcb6b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
737 additions
and
21 deletions
+737
-21
AppletNewsServeDTO.java
...n/java/com/pcloud/book/applet/dto/AppletNewsServeDTO.java
+61
-0
AppletNewsVO.java
...rc/main/java/com/pcloud/book/applet/dto/AppletNewsVO.java
+4
-0
AppletNewsServeTypeEnum.java
...com/pcloud/book/applet/enums/AppletNewsServeTypeEnum.java
+18
-0
AppletNewsServeBiz.java
...n/java/com/pcloud/book/applet/biz/AppletNewsServeBiz.java
+52
-0
AppletNewsBizImpl.java
...va/com/pcloud/book/applet/biz/impl/AppletNewsBizImpl.java
+135
-0
AppletNewsServeBizImpl.java
...m/pcloud/book/applet/biz/impl/AppletNewsServeBizImpl.java
+73
-0
AppletNewsServeDao.java
...n/java/com/pcloud/book/applet/dao/AppletNewsServeDao.java
+19
-0
AppletNewsServeDaoImpl.java
...m/pcloud/book/applet/dao/impl/AppletNewsServeDaoImpl.java
+29
-0
AppletNewsDTO.java
...c/main/java/com/pcloud/book/applet/dto/AppletNewsDTO.java
+11
-0
AppletNews.java
...c/main/java/com/pcloud/book/applet/entity/AppletNews.java
+9
-0
AppletNewsServe.java
...n/java/com/pcloud/book/applet/entity/AppletNewsServe.java
+47
-0
AppletNewsServeFacade.java
.../com/pcloud/book/applet/facade/AppletNewsServeFacade.java
+73
-0
SelfPushBiz.java
...k/src/main/java/com/pcloud/book/push/biz/SelfPushBiz.java
+1
-1
SelfPushBizImpl.java
...n/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
+2
-1
PersonalAppletsDao.java
...ain/java/com/pcloud/book/push/dao/PersonalAppletsDao.java
+4
-2
PersonalAppletsDaoImpl.java
...com/pcloud/book/push/dao/impl/PersonalAppletsDaoImpl.java
+7
-1
PersonalApplets.java
...ain/java/com/pcloud/book/push/entity/PersonalApplets.java
+3
-0
SelfPushFacade.java
...main/java/com/pcloud/book/push/facade/SelfPushFacade.java
+2
-1
AppletNews.xml
...vice-book/src/main/resources/mapper/applet/AppletNews.xml
+27
-10
AppletNewsServe.Mapper.xml
...c/main/resources/mapper/applet/AppletNewsServe.Mapper.xml
+140
-0
PersonalAppletsMapper.xml
.../src/main/resources/mapper/push/PersonalAppletsMapper.xml
+20
-5
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/applet/dto/AppletNewsServeDTO.java
0 → 100644
View file @
db75852f
package
com
.
pcloud
.
book
.
applet
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.dto.BaseDto
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* (AppletNewsServe)实体类
*
* @author makejava
* @since 2020-06-30 16:56:08
*/
@Data
public
class
AppletNewsServeDTO
extends
BaseDto
{
private
Long
id
;
@ApiModelProperty
(
"资讯id"
)
private
Long
appletNewsId
;
@ApiModelProperty
(
"标题"
)
private
String
title
;
@ApiModelProperty
(
"导图"
)
private
String
picUrl
;
@ApiModelProperty
(
"跳转地址"
)
private
String
linkUrl
;
@ApiModelProperty
(
"服务id"
)
private
Long
serveId
;
@ApiModelProperty
(
"服务类型,1:applet;2:第三方资讯;"
)
private
Integer
serveType
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
@ApiModelProperty
(
"小程序id"
)
private
String
appletsId
;
@ApiModelProperty
(
"小程序宣传语"
)
private
String
slogan
;
@ApiModelProperty
(
"小程序宣传图片"
)
private
String
sloganImgUrl
;
@ApiModelProperty
(
"小程序访问地址"
)
private
String
appletsUrl
;
@ApiModelProperty
(
"小程序备注"
)
private
String
remark
;
}
pcloud-facade-book/src/main/java/com/pcloud/book/applet/dto/AppletNewsVO.java
View file @
db75852f
...
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
...
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import
com.pcloud.common.dto.BaseDto
;
import
com.pcloud.common.dto.BaseDto
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -80,4 +81,7 @@ public class AppletNewsVO extends BaseDto {
...
@@ -80,4 +81,7 @@ public class AppletNewsVO extends BaseDto {
private
Integer
jumpType
;
private
Integer
jumpType
;
@ApiModelProperty
(
"跳转地址"
)
@ApiModelProperty
(
"跳转地址"
)
private
String
jumpUrl
;
private
String
jumpUrl
;
@ApiModelProperty
(
"选取的服务"
)
List
<
AppletNewsServeDTO
>
appletNewsServeList
;
}
}
pcloud-facade-book/src/main/java/com/pcloud/book/applet/enums/AppletNewsServeTypeEnum.java
0 → 100644
View file @
db75852f
package
com
.
pcloud
.
book
.
applet
.
enums
;
public
enum
AppletNewsServeTypeEnum
{
/**
* 第三方小程序
*/
APPLET
(
1
),
/**
* 第三方资源
*/
LINK
(
2
);
public
Integer
code
;
AppletNewsServeTypeEnum
(
Integer
code
)
{
this
.
code
=
code
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/AppletNewsServeBiz.java
0 → 100644
View file @
db75852f
package
com
.
pcloud
.
book
.
applet
.
biz
;
import
com.pcloud.book.applet.entity.AppletNewsServe
;
import
com.pcloud.common.page.PageBeanNew
;
import
java.util.List
;
/**
* (AppletNewsServe)表服务接口
*
* @author makejava
* @since 2020-06-30 16:56:08
*/
public
interface
AppletNewsServeBiz
{
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
AppletNewsServe
getById
(
Long
id
);
/**
* 分页查询
*/
PageBeanNew
getList
(
Integer
currentPage
,
Integer
numPerPage
);
/**
* 新增数据
*
* @param appletNewsServe 实例对象
* @return 主键
*/
Long
insert
(
AppletNewsServe
appletNewsServe
);
/**
* 修改数据
*
* @param appletNewsServe 实例对象
*/
void
update
(
AppletNewsServe
appletNewsServe
);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
void
deleteById
(
Long
id
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletNewsBizImpl.java
View file @
db75852f
This diff is collapsed.
Click to expand it.
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletNewsServeBizImpl.java
0 → 100644
View file @
db75852f
package
com
.
pcloud
.
book
.
applet
.
biz
.
impl
;
import
com.pcloud.book.applet.entity.AppletNewsServe
;
import
com.pcloud.book.applet.dao.AppletNewsServeDao
;
import
com.pcloud.book.applet.biz.AppletNewsServeBiz
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.NumberUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* (AppletNewsServe)表服务实现类
*
* @author makejava
* @since 2020-06-30 16:56:08
*/
@Service
(
"appletNewsServeBiz"
)
public
class
AppletNewsServeBizImpl
implements
AppletNewsServeBiz
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
AppletNewsServeBizImpl
.
class
);
@Autowired
private
AppletNewsServeDao
appletNewsServeDao
;
@Override
@ParamLog
(
"通过ID查询单条数据"
)
public
AppletNewsServe
getById
(
Long
id
)
{
return
appletNewsServeDao
.
getById
(
id
);
}
@Override
@ParamLog
(
"查询多条数据"
)
public
PageBeanNew
getList
(
Integer
currentPage
,
Integer
numPerPage
)
{
PageBeanNew
pageBeanNew
=
appletNewsServeDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
null
,
"getList"
);
List
recordList
=
pageBeanNew
.
getRecordList
();
if
(
ListUtils
.
isEmpty
(
recordList
)){
return
pageBeanNew
;
}
// 加载其它数据
return
pageBeanNew
;
}
@Override
@ParamLog
(
"新增"
)
public
Long
insert
(
AppletNewsServe
appletNewsServe
)
{
appletNewsServeDao
.
insert
(
appletNewsServe
);
return
appletNewsServe
.
getId
();
}
@Override
@ParamLog
(
"修改"
)
public
void
update
(
AppletNewsServe
appletNewsServe
)
{
if
(
appletNewsServe
==
null
||
!
NumberUtil
.
isNumber
(
appletNewsServe
.
getId
())){
throw
BizException
.
PARAM_IS_NULL
;
}
appletNewsServeDao
.
update
(
appletNewsServe
);
}
@Override
@ParamLog
(
"删除"
)
public
void
deleteById
(
Long
id
)
{
appletNewsServeDao
.
deleteById
(
id
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/AppletNewsServeDao.java
0 → 100644
View file @
db75852f
package
com
.
pcloud
.
book
.
applet
.
dao
;
import
com.pcloud.book.applet.dto.AppletNewsServeDTO
;
import
com.pcloud.book.applet.entity.AppletNewsServe
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
/**
* (AppletNewsServe)表数据库访问层
*
* @author makejava
* @since 2020-06-30 16:56:08
*/
public
interface
AppletNewsServeDao
extends
BaseDao
<
AppletNewsServe
>
{
int
deleteByAppletNewsId
(
Long
appletNewsId
);
List
<
AppletNewsServeDTO
>
getByAppletNewsId
(
Long
appletNewsId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/impl/AppletNewsServeDaoImpl.java
0 → 100644
View file @
db75852f
package
com
.
pcloud
.
book
.
applet
.
dao
.
impl
;
import
com.pcloud.book.applet.dto.AppletNewsServeDTO
;
import
com.pcloud.book.applet.entity.AppletNewsServe
;
import
com.pcloud.book.applet.dao.AppletNewsServeDao
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* (AppletNewsServe)表数据库访问层
*
* @author makejava
* @since 2020-06-30 16:56:08
*/
@Repository
(
"appletNewsServeDaoImpl"
)
public
class
AppletNewsServeDaoImpl
extends
BaseDaoImpl
<
AppletNewsServe
>
implements
AppletNewsServeDao
{
@Override
public
int
deleteByAppletNewsId
(
Long
appletNewsId
)
{
return
this
.
sqlSessionTemplate
.
delete
(
getStatement
(
"deleteByAppletNewsId"
),
appletNewsId
);
}
@Override
public
List
<
AppletNewsServeDTO
>
getByAppletNewsId
(
Long
appletNewsId
)
{
return
this
.
sqlSessionTemplate
.
selectList
(
getStatement
(
"getByAppletNewsId"
),
appletNewsId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/AppletNewsDTO.java
View file @
db75852f
package
com
.
pcloud
.
book
.
applet
.
dto
;
package
com
.
pcloud
.
book
.
applet
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.book.applet.entity.AppletNewsServe
;
import
com.pcloud.common.dto.BaseDto
;
import
com.pcloud.common.dto.BaseDto
;
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.Date
;
import
java.util.Date
;
import
java.util.List
;
@Data
@Data
@ApiModel
(
"小程序资讯"
)
@ApiModel
(
"小程序资讯"
)
...
@@ -89,4 +91,13 @@ public class AppletNewsDTO extends BaseDto {
...
@@ -89,4 +91,13 @@ public class AppletNewsDTO extends BaseDto {
private
String
customTag
;
private
String
customTag
;
@ApiModelProperty
(
"自定义标识id"
)
@ApiModelProperty
(
"自定义标识id"
)
private
Long
customTagId
;
private
Long
customTagId
;
@ApiModelProperty
(
"展示来源"
)
private
Integer
showSource
;
@ApiModelProperty
(
"展示第三方资源"
)
private
Integer
showLink
;
@ApiModelProperty
(
"浏览量pv"
)
private
Integer
browseCount
;
@ApiModelProperty
(
"选取的服务"
)
List
<
AppletNewsServeDTO
>
appletNewsServeList
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/entity/AppletNews.java
View file @
db75852f
...
@@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModel;
...
@@ -6,6 +6,8 @@ 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
(
"小程序资讯"
)
@ApiModel
(
"小程序资讯"
)
public
class
AppletNews
extends
BaseTempletClassify
{
public
class
AppletNews
extends
BaseTempletClassify
{
...
@@ -54,4 +56,11 @@ public class AppletNews extends BaseTempletClassify {
...
@@ -54,4 +56,11 @@ public class AppletNews extends BaseTempletClassify {
private
String
urlNumber
;
private
String
urlNumber
;
@ApiModelProperty
(
"自定义标识id"
)
@ApiModelProperty
(
"自定义标识id"
)
private
Long
customTagId
;
private
Long
customTagId
;
@ApiModelProperty
(
"展示来源"
)
private
Integer
showSource
;
@ApiModelProperty
(
"展示第三方资源"
)
private
Integer
showLink
;
@ApiModelProperty
(
"选取的服务"
)
List
<
AppletNewsServe
>
appletNewsServeList
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/entity/AppletNewsServe.java
0 → 100644
View file @
db75852f
package
com
.
pcloud
.
book
.
applet
.
entity
;
import
java.util.Date
;
import
java.math.BigDecimal
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* (AppletNewsServe)实体类
*
* @author makejava
* @since 2020-06-30 16:56:08
*/
@Data
public
class
AppletNewsServe
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
367325712059908419L
;
private
Long
id
;
@ApiModelProperty
(
"资讯id"
)
private
Long
appletNewsId
;
@ApiModelProperty
(
"标题"
)
private
String
title
;
@ApiModelProperty
(
"导图"
)
private
String
picUrl
;
@ApiModelProperty
(
"跳转地址"
)
private
String
linkUrl
;
@ApiModelProperty
(
"服务id"
)
private
Long
serveId
;
@ApiModelProperty
(
"服务类型,1:applet;2:第三方资讯;"
)
private
Integer
serveType
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/facade/AppletNewsServeFacade.java
0 → 100644
View file @
db75852f
package
com
.
pcloud
.
book
.
applet
.
facade
;
import
com.pcloud.book.applet.entity.AppletNewsServe
;
import
com.pcloud.book.applet.biz.AppletNewsServeBiz
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
io.swagger.annotations.ApiOperation
;
/**
* (AppletNewsServe)表控制层
*
* @author makejava
* @since 2020-06-30 16:56:08
*/
@RestController
(
"appletNewsServeFacade"
)
@RequestMapping
(
"appletNewsServe"
)
public
class
AppletNewsServeFacade
{
@Autowired
private
AppletNewsServeBiz
appletNewsServeBiz
;
@ApiOperation
(
"通过主键查询单条数据"
)
@GetMapping
(
"getById"
)
public
ResponseDto
<?>
getById
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
Long
id
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<>(
appletNewsServeBiz
.
getById
(
id
));
}
@ApiOperation
(
"分页查询"
)
@GetMapping
(
"getList"
)
public
ResponseDto
<?>
getList
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"currentPage"
,
defaultValue
=
"0"
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
defaultValue
=
"10"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<>(
appletNewsServeBiz
.
getList
(
currentPage
,
numPerPage
));
}
@ApiOperation
(
"新增"
)
@PostMapping
(
"insert"
)
public
ResponseDto
<?>
insert
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
AppletNewsServe
appletNewsServe
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<>(
appletNewsServeBiz
.
insert
(
appletNewsServe
));
}
@ApiOperation
(
"更新"
)
@PostMapping
(
"update"
)
public
ResponseDto
<?>
update
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
AppletNewsServe
appletNewsServe
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
appletNewsServeBiz
.
update
(
appletNewsServe
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"删除"
)
@GetMapping
(
"deleteById"
)
public
ResponseDto
<?>
deleteById
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
Long
id
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
if
(
null
==
id
)
{
throw
BookBizException
.
PARAM_DELETION
;
}
appletNewsServeBiz
.
deleteById
(
id
);
return
new
ResponseDto
<>();
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/SelfPushBiz.java
View file @
db75852f
...
@@ -73,7 +73,7 @@ public interface SelfPushBiz {
...
@@ -73,7 +73,7 @@ public interface SelfPushBiz {
void
updatePersonalApplets
(
PersonalApplets
applets
);
void
updatePersonalApplets
(
PersonalApplets
applets
);
PageBeanNew
<
PersonalApplets
>
getAllApplets
(
String
appletsId
,
Integer
currentPage
,
Integer
numPerPage
);
PageBeanNew
<
PersonalApplets
>
getAllApplets
(
String
appletsId
,
String
content
,
Integer
currentPage
,
Integer
numPerPage
);
PageBeanNew
<
PersonalAppletsRecordDTO
>
getSendAppletsRecords
(
Integer
currentPage
,
Integer
numPerPage
,
String
startTime
,
String
endTime
,
Integer
status
,
Long
partyId
);
PageBeanNew
<
PersonalAppletsRecordDTO
>
getSendAppletsRecords
(
Integer
currentPage
,
Integer
numPerPage
,
String
startTime
,
String
endTime
,
Integer
status
,
Long
partyId
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
View file @
db75852f
...
@@ -993,10 +993,11 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -993,10 +993,11 @@ public class SelfPushBizImpl implements SelfPushBiz {
}
}
@Override
@Override
public
PageBeanNew
<
PersonalApplets
>
getAllApplets
(
String
appletsId
,
Integer
currentPage
,
Integer
numPerPage
)
{
public
PageBeanNew
<
PersonalApplets
>
getAllApplets
(
String
appletsId
,
String
content
,
Integer
currentPage
,
Integer
numPerPage
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"appletsId"
,
appletsId
);
map
.
put
(
"appletsId"
,
appletsId
);
map
.
put
(
"content"
,
content
);
return
personalAppletsDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getAllApplets"
);
return
personalAppletsDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getAllApplets"
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/dao/PersonalAppletsDao.java
View file @
db75852f
package
com
.
pcloud
.
book
.
push
.
dao
;
package
com
.
pcloud
.
book
.
push
.
dao
;
import
com.pcloud.book.push.entity.PersonalApplets
;
import
com.pcloud.book.push.entity.PersonalApplets
;
import
com.pcloud.book.push.entity.SelfPush
;
import
com.pcloud.common.core.dao.BaseDao
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @描述:小程序
* @描述:小程序
...
@@ -15,5 +15,7 @@ import java.util.List;
...
@@ -15,5 +15,7 @@ import java.util.List;
public
interface
PersonalAppletsDao
extends
BaseDao
<
PersonalApplets
>{
public
interface
PersonalAppletsDao
extends
BaseDao
<
PersonalApplets
>{
List
<
PersonalApplets
>
getAllApplets
(
String
appletsId
);
List
<
PersonalApplets
>
getAllApplets
(
String
appletsId
,
String
content
);
Map
<
Long
,
PersonalApplets
>
mapByIds
(
List
<
Long
>
personalAppletIds
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/dao/impl/PersonalAppletsDaoImpl.java
View file @
db75852f
...
@@ -23,9 +23,15 @@ public class PersonalAppletsDaoImpl extends BaseDaoImpl<PersonalApplets> impleme
...
@@ -23,9 +23,15 @@ public class PersonalAppletsDaoImpl extends BaseDaoImpl<PersonalApplets> impleme
@Override
@Override
public
List
<
PersonalApplets
>
getAllApplets
(
String
appletsId
)
{
public
List
<
PersonalApplets
>
getAllApplets
(
String
appletsId
,
String
content
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"appletsId"
,
appletsId
);
map
.
put
(
"appletsId"
,
appletsId
);
map
.
put
(
"content"
,
content
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getAllApplets"
),
map
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getAllApplets"
),
map
);
}
}
@Override
public
Map
<
Long
,
PersonalApplets
>
mapByIds
(
List
<
Long
>
list
)
{
return
this
.
sqlSessionTemplate
.
selectMap
(
getStatement
(
"mapByIds"
),
list
,
"id"
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/entity/PersonalApplets.java
View file @
db75852f
...
@@ -24,4 +24,7 @@ public class PersonalApplets extends BaseEntity {
...
@@ -24,4 +24,7 @@ public class PersonalApplets extends BaseEntity {
@ApiModelProperty
(
"小程序访问地址"
)
@ApiModelProperty
(
"小程序访问地址"
)
private
String
appletsUrl
;
private
String
appletsUrl
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/facade/SelfPushFacade.java
View file @
db75852f
...
@@ -169,13 +169,14 @@ public class SelfPushFacade {
...
@@ -169,13 +169,14 @@ public class SelfPushFacade {
@GetMapping
(
"getAllApplets"
)
@GetMapping
(
"getAllApplets"
)
public
ResponseDto
<?>
getAllApplets
(
@RequestHeader
(
"token"
)
String
token
,
public
ResponseDto
<?>
getAllApplets
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"appletsId"
,
required
=
false
)
@ApiParam
(
"小程序id"
)
String
appletsId
,
@RequestParam
(
value
=
"appletsId"
,
required
=
false
)
@ApiParam
(
"小程序id"
)
String
appletsId
,
@RequestParam
(
value
=
"content"
,
required
=
false
)
@ApiParam
(
"小程序id或备注"
)
String
content
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页数量"
)
Integer
numPerPage
)
throws
PermissionException
{
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页数量"
)
Integer
numPerPage
)
throws
PermissionException
{
SessionUtil
.
getInfoToken4Redis
(
token
);
SessionUtil
.
getInfoToken4Redis
(
token
);
if
(
null
==
currentPage
||
null
==
numPerPage
)
{
if
(
null
==
currentPage
||
null
==
numPerPage
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少分页参数"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少分页参数"
);
}
}
PageBeanNew
<
PersonalApplets
>
pageBeanNew
=
selfPushBiz
.
getAllApplets
(
appletsId
,
currentPage
,
numPerPage
);
PageBeanNew
<
PersonalApplets
>
pageBeanNew
=
selfPushBiz
.
getAllApplets
(
appletsId
,
c
ontent
,
c
urrentPage
,
numPerPage
);
return
new
ResponseDto
<>(
pageBeanNew
);
return
new
ResponseDto
<>(
pageBeanNew
);
}
}
...
...
pcloud-service-book/src/main/resources/mapper/applet/AppletNews.xml
View file @
db75852f
...
@@ -27,25 +27,27 @@
...
@@ -27,25 +27,27 @@
<result
column=
"jump_url"
property=
"jumpUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"jump_url"
property=
"jumpUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"url_number"
property=
"urlNumber"
jdbcType=
"VARCHAR"
/>
<result
column=
"url_number"
property=
"urlNumber"
jdbcType=
"VARCHAR"
/>
<result
column=
"custom_tag_id"
property=
"customTagId"
jdbcType=
"BIGINT"
/>
<result
column=
"custom_tag_id"
property=
"customTagId"
jdbcType=
"BIGINT"
/>
<result
column=
"show_source"
property=
"showSource"
jdbcType=
"INTEGER"
/>
<result
column=
"show_link"
property=
"showLink"
jdbcType=
"INTEGER"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, news_name, source, news_classify_id, pro_label_id, dep_label_id, pur_label_id, type, digest,
id, news_name, source, news_classify_id, pro_label_id, dep_label_id, pur_label_id, type, digest,
pic1, pic2, pic3, content, show_state, create_time, update_time, first_classify, second_classify, grade_label_id, subject_label_id, rights_classify_id,
pic1, pic2, pic3, content, show_state, create_time, update_time, first_classify, second_classify, grade_label_id, subject_label_id, rights_classify_id,
jump_type, jump_url, url_number, custom_tag_id
jump_type, jump_url, url_number, custom_tag_id
, show_source, show_link
</sql>
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.applet.entity.AppletNews"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.applet.entity.AppletNews"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into applet_news(
insert into applet_news(
news_name, source, news_classify_id, pro_label_id, dep_label_id, pur_label_id, type, digest,
news_name, source, news_classify_id, pro_label_id, dep_label_id, pur_label_id, type, digest,
pic1, pic2, pic3, content, show_state, create_time, update_time , first_classify, second_classify, grade_label_id, subject_label_id, rights_classify_id,
pic1, pic2, pic3, content, show_state, create_time, update_time , first_classify, second_classify, grade_label_id, subject_label_id, rights_classify_id,
jump_type, jump_url,url_number, custom_tag_id
jump_type, jump_url,url_number, custom_tag_id
, show_source, show_link
)
)
values (
values (
#{newsName}, #{source}, #{newsClassifyId}, #{proLabelId}, #{depLabelId}, #{purLabelId}, #{type}, #{digest},
#{newsName}, #{source}, #{newsClassifyId}, #{proLabelId}, #{depLabelId}, #{purLabelId}, #{type}, #{digest},
#{pic1}, #{pic2}, #{pic3}, #{content}, #{showState}, NOW(), NOW(), #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT},
#{pic1}, #{pic2}, #{pic3}, #{content}, #{showState}, NOW(), NOW(), #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT},
#{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, #{rightsClassifyId,jdbcType=BIGINT},
#{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, #{rightsClassifyId,jdbcType=BIGINT},
#{jumpType}, #{jumpUrl}, #{urlNumber}, #{customTagId}
#{jumpType}, #{jumpUrl}, #{urlNumber}, #{customTagId}
, #{showSource}, #{showLink}
)
)
</insert>
</insert>
...
@@ -83,6 +85,12 @@
...
@@ -83,6 +85,12 @@
<if
test=
"jumpType != null"
>
<if
test=
"jumpType != null"
>
jump_type = #{jumpType},
jump_type = #{jumpType},
</if>
</if>
<if
test=
"showSource != null"
>
show_source = #{showSource},
</if>
<if
test=
"showLink != null"
>
show_link = #{showLink},
</if>
jump_url = #{jumpUrl},
jump_url = #{jumpUrl},
url_number = #{urlNumber},
url_number = #{urlNumber},
update_time=NOW()
update_time=NOW()
...
@@ -135,7 +143,9 @@
...
@@ -135,7 +143,9 @@
n.jump_url jumpUrl,
n.jump_url jumpUrl,
n.url_number urlNumber,
n.url_number urlNumber,
n.custom_tag_id customTagId,
n.custom_tag_id customTagId,
t.custom_tag customTag
t.custom_tag customTag,
n.show_source showSource,
n.show_link showLink
FROM applet_news n
FROM applet_news n
LEFT JOIN applet_news_classify c ON n.news_classify_id=c.id
LEFT JOIN applet_news_classify c ON n.news_classify_id=c.id
LEFT JOIN rights_setting_classify d ON n.rights_classify_id = d.id
LEFT JOIN rights_setting_classify d ON n.rights_classify_id = d.id
...
@@ -205,7 +215,9 @@
...
@@ -205,7 +215,9 @@
n.rights_classify_id rightsClassifyId,
n.rights_classify_id rightsClassifyId,
n.jump_type jumpType,
n.jump_type jumpType,
n.jump_url jumpUrl,
n.jump_url jumpUrl,
n.url_number urlNumber
n.url_number urlNumber,
n.show_source showSource,
n.show_link showLink
FROM applet_news n
FROM applet_news n
WHERE 1=1
WHERE 1=1
and n.show_state = 1
and n.show_state = 1
...
@@ -363,7 +375,9 @@
...
@@ -363,7 +375,9 @@
d.classify rightsClassifyContent,
d.classify rightsClassifyContent,
n.jump_type jumpType,
n.jump_type jumpType,
n.jump_url jumpUrl,
n.jump_url jumpUrl,
n.url_number urlNumber
n.url_number urlNumber,
n.show_source showSource,
n.show_link showLink
FROM applet_news n
FROM applet_news n
LEFT JOIN applet_news_classify c ON n.news_classify_id=c.id
LEFT JOIN applet_news_classify c ON n.news_classify_id=c.id
LEFT JOIN rights_setting_classify d ON n.rights_classify_id = d.id
LEFT JOIN rights_setting_classify d ON n.rights_classify_id = d.id
...
@@ -415,7 +429,9 @@
...
@@ -415,7 +429,9 @@
n.rights_classify_id rightsClassifyId,
n.rights_classify_id rightsClassifyId,
n.jump_type jumpType,
n.jump_type jumpType,
n.jump_url jumpUrl,
n.jump_url jumpUrl,
n.url_number urlNumber
n.url_number urlNumber,
n.show_source showSource,
n.show_link showLink
FROM applet_news n
FROM applet_news n
WHERE n.show_state = 1
WHERE n.show_state = 1
AND n.id IN
AND n.id IN
...
@@ -450,7 +466,9 @@
...
@@ -450,7 +466,9 @@
n.subject_label_id subjectLabelId,
n.subject_label_id subjectLabelId,
n.rights_classify_id rightsClassifyId,
n.rights_classify_id rightsClassifyId,
n.jump_type jumpType,
n.jump_type jumpType,
n.jump_url jumpUrl
n.jump_url jumpUrl,
n.show_source showSource,
n.show_link showLink
FROM applet_news n
FROM applet_news n
LEFT JOIN applet_news_classify c ON n.news_classify_id=c.id
LEFT JOIN applet_news_classify c ON n.news_classify_id=c.id
WHERE n.show_state = 1
WHERE n.show_state = 1
...
@@ -530,4 +548,4 @@
...
@@ -530,4 +548,4 @@
ORDER BY create_time DESC
ORDER BY create_time DESC
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/applet/AppletNewsServe.Mapper.xml
0 → 100644
View file @
db75852f
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.pcloud.book.applet.dao.impl.AppletNewsServeDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.applet.entity.AppletNewsServe"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"applet_news_id"
property=
"appletNewsId"
jdbcType=
"BIGINT"
/>
<result
column=
"title"
property=
"title"
jdbcType=
"VARCHAR"
/>
<result
column=
"pic_url"
property=
"picUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"link_url"
property=
"linkUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"serve_id"
property=
"serveId"
jdbcType=
"BIGINT"
/>
<result
column=
"serve_type"
property=
"serveType"
jdbcType=
"INTEGER"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<resultMap
id=
"BaseDTOResultMap"
type=
"com.pcloud.book.applet.dto.AppletNewsServeDTO"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"applet_news_id"
property=
"appletNewsId"
jdbcType=
"BIGINT"
/>
<result
column=
"title"
property=
"title"
jdbcType=
"VARCHAR"
/>
<result
column=
"pic_url"
property=
"picUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"link_url"
property=
"linkUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"serve_id"
property=
"serveId"
jdbcType=
"BIGINT"
/>
<result
column=
"serve_type"
property=
"serveType"
jdbcType=
"INTEGER"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, applet_news_id, title, pic_url, link_url, serve_id, serve_type, update_time, create_time
</sql>
<sql
id=
"BaseDto_Column_List"
>
id, applet_news_id, title, pic_url, link_url, serve_id, serve_type, update_time, create_time
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM applet_news_serve
WHERE id = #{id}
</select>
<select
id=
"getList"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM applet_news_serve
</select>
<select
id=
"getByAppletNewsId"
resultMap=
"BaseDTOResultMap"
>
SELECT
<include
refid=
"BaseDto_Column_List"
/>
FROM applet_news_serve
WHERE applet_news_id = #{appletNewsId}
</select>
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
INSERT INTO applet_news_serve(
applet_news_id,
title,
pic_url,
link_url,
serve_id,
serve_type,
update_time,
create_time
) VALUES (
#{appletNewsId, jdbcType=BIGINT},
#{title, jdbcType=VARCHAR},
#{picUrl, jdbcType=VARCHAR},
#{linkUrl, jdbcType=VARCHAR},
#{serveId, jdbcType=INTEGER},
#{serveType, jdbcType=INTEGER},
NOW(),
NOW()
)
</insert>
<insert
id=
"batchInsert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
INSERT INTO applet_news_serve (
applet_news_id,
title,
pic_url,
link_url,
serve_id,
serve_type,
update_time,
create_time
) VALUES
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(
#{item.appletNewsId, jdbcType=BIGINT},
#{item.title, jdbcType=VARCHAR},
#{item.picUrl, jdbcType=VARCHAR},
#{item.linkUrl, jdbcType=VARCHAR},
#{item.serveId, jdbcType=BIGINT},
#{item.serveType, jdbcType=INTEGER},
NOW(),
NOW()
)
</foreach>
</insert>
<!--通过主键修改数据-->
<update
id=
"update"
>
UPDATE applet_news_serve
<set>
<if
test=
"appletNewsId != null"
>
applet_news_id = #{appletNewsId},
</if>
<if
test=
"title != null and title != ''"
>
title = #{title},
</if>
<if
test=
"picUrl != null and picUrl != ''"
>
pic_url = #{picUrl},
</if>
<if
test=
"linkUrl != null and linkUrl != ''"
>
link_url = #{linkUrl},
</if>
<if
test=
"serveId != null"
>
serve_id = #{serveId},
</if>
<if
test=
"serveType != null"
>
serve_type = #{serveType},
</if>
</set>
WHERE id = #{id}
</update>
<!--通过主键删除-->
<delete
id=
"deleteById"
>
DELETE FROM applet_news_serve where id = #{id}
</delete>
<!--通过主键删除-->
<delete
id=
"deleteByAppletNewsId"
>
DELETE FROM applet_news_serve where applet_news_id = #{appletNewsId}
</delete>
</mapper>
pcloud-service-book/src/main/resources/mapper/push/PersonalAppletsMapper.xml
View file @
db75852f
...
@@ -9,20 +9,21 @@
...
@@ -9,20 +9,21 @@
<result
column=
"applets_url"
property=
"appletsUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"applets_url"
property=
"appletsUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"remark"
property=
"remark"
jdbcType=
"VARCHAR"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, applets_id, slogan, slogan_img_url, applets_url, create_time, update_time
id, applets_id, slogan, slogan_img_url, applets_url, create_time, update_time
, remark
</sql>
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.push.entity.PersonalApplets"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.push.entity.PersonalApplets"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into personal_applets ( applets_id,
insert into personal_applets ( applets_id,
slogan, slogan_img_url, applets_url,
slogan, slogan_img_url, applets_url,
create_time, update_time
create_time, update_time
, remark
)
)
values (#{appletsId,jdbcType=VARCHAR}, #{slogan,jdbcType=VARCHAR},
values (#{appletsId,jdbcType=VARCHAR}, #{slogan,jdbcType=VARCHAR},
#{sloganImgUrl,jdbcType=VARCHAR}, #{appletsUrl,jdbcType=VARCHAR},
#{sloganImgUrl,jdbcType=VARCHAR}, #{appletsUrl,jdbcType=VARCHAR},
now(), now()
now(), now()
, #{remark}
)
)
</insert>
</insert>
...
@@ -38,9 +39,21 @@
...
@@ -38,9 +39,21 @@
<if
test=
"appletsId!=null"
>
<if
test=
"appletsId!=null"
>
and applets_id=#{appletsId}
and applets_id=#{appletsId}
</if>
</if>
<if
test=
"content!=null"
>
and (applets_id LIKE concat('%',#{content},'%') OR remark LIKE concat('%',#{content},'%'))
</if>
order by create_time desc
order by create_time desc
</select>
</select>
<select
id=
"mapByIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from personal_applets
where id IN
<foreach
collection=
"list"
item=
"item"
separator=
","
open=
"("
close=
")"
>
${item}
</foreach>
</select>
<update
id=
"update"
parameterType=
"com.pcloud.book.push.entity.PersonalApplets"
>
<update
id=
"update"
parameterType=
"com.pcloud.book.push.entity.PersonalApplets"
>
update personal_applets
update personal_applets
<set>
<set>
...
@@ -56,6 +69,9 @@
...
@@ -56,6 +69,9 @@
<if
test=
"appletsUrl != null"
>
<if
test=
"appletsUrl != null"
>
applets_url = #{appletsUrl,jdbcType=VARCHAR},
applets_url = #{appletsUrl,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"remark != null"
>
remark = #{remark,jdbcType=VARCHAR},
</if>
update_time = NOW(),
update_time = NOW(),
</set>
</set>
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
...
@@ -70,4 +86,4 @@
...
@@ -70,4 +86,4 @@
</mapper>
</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