Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lingxi-lxy-yanshou
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
后端-黄柯铭
lingxi-lxy-yanshou
Commits
4a30cdb8
Commit
4a30cdb8
authored
Aug 06, 2021
by
fhj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模板服务 -> 活动页需求
parent
8b46ecbb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
9 deletions
+22
-9
PageTemplateWebController.java
...ate/service/controller/web/PageTemplateWebController.java
+4
-2
PageTemplateRepository.java
...m/template/service/repository/PageTemplateRepository.java
+3
-2
PageTemplateWebService.java
.../template/service/service/web/PageTemplateWebService.java
+3
-1
PageTemplateWebServiceImpl.java
...e/service/serviceimpl/web/PageTemplateWebServiceImpl.java
+12
-4
No files found.
platform-template-service/src/main/java/com/ssy/lingxi/platform/template/service/controller/web/PageTemplateWebController.java
View file @
4a30cdb8
package
com
.
ssy
.
lingxi
.
platform
.
template
.
service
.
controller
.
web
;
import
com.ssy.lingxi.common.controller.BaseController
;
import
com.ssy.lingxi.common.model.vo.PageVO
;
import
com.ssy.lingxi.common.response.PageData
;
import
com.ssy.lingxi.common.response.Wrapper
;
import
com.ssy.lingxi.platform.template.service.entity.adorn.PageTemplate
;
import
com.ssy.lingxi.platform.template.service.model.dto.common.IdDTO
;
...
...
@@ -106,7 +108,7 @@ public class PageTemplateWebController extends BaseController {
@ApiOperation
(
value
=
"获取所有活动模板"
)
@GetMapping
(
"/findAllActivityTemplate"
)
public
Wrapper
<
List
<
PageTemplate
>>
findAllActivityTemplate
(
Integer
environment
)
{
return
pageTemplateWebService
.
findAllActivityTemplate
(
environment
);
public
Wrapper
<
PageData
<
PageTemplate
>>
findAllActivityTemplate
(
PageVO
dto
,
Integer
environment
)
{
return
pageTemplateWebService
.
findAllActivityTemplate
(
dto
,
environment
);
}
}
platform-template-service/src/main/java/com/ssy/lingxi/platform/template/service/repository/PageTemplateRepository.java
View file @
4a30cdb8
package
com
.
ssy
.
lingxi
.
platform
.
template
.
service
.
repository
;
import
com.ssy.lingxi.platform.template.service.entity.adorn.PageTemplate
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -23,6 +25,5 @@ public interface PageTemplateRepository extends JpaRepository<PageTemplate, Long
List
<
PageTemplate
>
findByEnvironmentAndTypeAndStatusAndShelf
(
Integer
environment
,
Integer
type
,
Integer
status
,
Integer
shelf
);
List
<
PageTemplate
>
findByEnvironmentAndTypeAndAllow
(
Integer
environment
,
Integer
type
,
Integer
allow
);
Page
<
PageTemplate
>
findByEnvironmentAndTypeAndAllow
(
Integer
environment
,
Integer
type
,
Integer
allow
,
Pageable
pageable
);
}
platform-template-service/src/main/java/com/ssy/lingxi/platform/template/service/service/web/PageTemplateWebService.java
View file @
4a30cdb8
package
com
.
ssy
.
lingxi
.
platform
.
template
.
service
.
service
.
web
;
import
com.ssy.lingxi.common.model.dto.UserLoginCacheDTO
;
import
com.ssy.lingxi.common.model.vo.PageVO
;
import
com.ssy.lingxi.common.response.PageData
;
import
com.ssy.lingxi.common.response.Wrapper
;
import
com.ssy.lingxi.platform.template.service.entity.adorn.PageTemplate
;
import
com.ssy.lingxi.platform.template.service.model.dto.common.IdDTO
;
...
...
@@ -44,5 +46,5 @@ public interface PageTemplateWebService {
Wrapper
<
Void
>
useChannelTemplate
(
IdDTO
dto
,
UserLoginCacheDTO
user
);
Wrapper
<
List
<
PageTemplate
>>
findAllActivityTemplate
(
Integer
environment
);
Wrapper
<
PageData
<
PageTemplate
>>
findAllActivityTemplate
(
PageVO
dto
,
Integer
environment
);
}
platform-template-service/src/main/java/com/ssy/lingxi/platform/template/service/serviceimpl/web/PageTemplateWebServiceImpl.java
View file @
4a30cdb8
...
...
@@ -3,6 +3,8 @@ package com.ssy.lingxi.platform.template.service.serviceimpl.web;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.ssy.lingxi.common.exception.BusinessException
;
import
com.ssy.lingxi.common.model.dto.UserLoginCacheDTO
;
import
com.ssy.lingxi.common.model.vo.PageVO
;
import
com.ssy.lingxi.common.response.PageData
;
import
com.ssy.lingxi.common.response.ResponseCode
;
import
com.ssy.lingxi.common.response.Wrapper
;
import
com.ssy.lingxi.platform.template.service.constant.CommonBooleanEnum
;
...
...
@@ -26,6 +28,8 @@ import com.ssy.lingxi.platform.template.service.service.web.PageTemplateWebServi
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -378,14 +382,18 @@ public class PageTemplateWebServiceImpl implements PageTemplateWebService {
@Override
@ApiOperation
(
value
=
"获取所有活动模板"
)
public
Wrapper
<
List
<
PageTemplate
>>
findAllActivityTemplate
(
Integer
environment
)
{
public
Wrapper
<
PageData
<
PageTemplate
>>
findAllActivityTemplate
(
PageVO
dto
,
Integer
environment
)
{
if
(
environment
==
null
)
{
return
Wrapper
.
fail
(
"商城环境不能为空"
);
}
return
Wrapper
.
success
(
pageTemplateRepository
.
findByEnvironmentAndTypeAndAllow
(
Page
<
PageTemplate
>
page
=
pageTemplateRepository
.
findByEnvironmentAndTypeAndAllow
(
environment
,
PageTemplateTypeEnum
.
ACTIVITY
.
getCode
(),
CommonBooleanEnum
.
YES
.
getCode
()
));
CommonBooleanEnum
.
YES
.
getCode
(),
PageRequest
.
of
(
dto
.
getCurrent
()
-
1
,
dto
.
getPageSize
())
);
return
Wrapper
.
success
(
new
PageData
<>(
page
.
getTotalElements
(),
page
.
getContent
()));
}
}
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