Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
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
吴迪
gs1-office-web-sit
Commits
febade2d
Commit
febade2d
authored
Nov 14, 2021
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】首页接口提交
parent
48484d07
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
160 additions
and
7 deletions
+160
-7
IndexCarouselManageController.java
...ules/manage/controller/IndexCarouselManageController.java
+17
-0
TopicnewsController.java
...office/modules/manage/controller/TopicnewsController.java
+20
-7
TopicnewsDao.java
src/main/java/io/office/modules/manage/dao/TopicnewsDao.java
+6
-0
TopicnewsService.java
...va/io/office/modules/manage/service/TopicnewsService.java
+6
-0
TopicnewsServiceImpl.java
...ice/modules/manage/service/impl/TopicnewsServiceImpl.java
+9
-0
TopicNewsPartyRequestVo.java
...ce/modules/manage/vo/request/TopicNewsPartyRequestVo.java
+46
-0
TopicNewsPartyVo.java
...o/office/modules/manage/vo/response/TopicNewsPartyVo.java
+28
-0
TopicnewsDao.xml
src/main/resources/mapper/manage/TopicnewsDao.xml
+28
-0
No files found.
src/main/java/io/office/modules/manage/controller/IndexCarouselManageController.java
View file @
febade2d
...
@@ -137,7 +137,24 @@ public class IndexCarouselManageController extends AbstractController {
...
@@ -137,7 +137,24 @@ public class IndexCarouselManageController extends AbstractController {
}
}
}
}
@Login
@PostMapping
(
"/api/smallImages"
)
// @RequiresPermissions("generator:indexcarouselmanage:bigImages")
public
R
smallImages
()
{
try
{
QueryWrapper
<
IndexCarouselManageEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
eq
(
"classnum"
,
"小轮播"
);
newsEntityQueryWrapper
.
eq
(
"checkflag_index"
,
"1"
);
newsEntityQueryWrapper
.
gt
(
"levels"
,
"0"
);
newsEntityQueryWrapper
.
orderByDesc
(
"levels_index"
);
List
<
IndexCarouselManageEntity
>
list
=
indexCarouselManageService
.
list
(
newsEntityQueryWrapper
);
return
R
.
ok
().
put
(
"data"
,
list
);
}
catch
(
Exception
e
)
{
log
.
error
(
"verifyIndexCarouselManage error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
...
...
src/main/java/io/office/modules/manage/controller/TopicnewsController.java
View file @
febade2d
package
io
.
office
.
modules
.
manage
.
controller
;
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.common.utils.R
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.TopicnewsEntity
;
import
io.office.modules.manage.entity.TopicnewsEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.service.TopicnewsService
;
import
io.office.modules.manage.service.TopicnewsService
;
import
io.office.modules.manage.vo.request.TopicNewsPartyRequestVo
;
import
io.office.modules.sys.controller.AbstractController
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -81,7 +80,7 @@ public class TopicnewsController extends AbstractController {
...
@@ -81,7 +80,7 @@ public class TopicnewsController extends AbstractController {
R
r
=
this
.
topicnewsService
.
updateHdbd
(
news
,
getUser
());
R
r
=
this
.
topicnewsService
.
updateHdbd
(
news
,
getUser
());
return
r
;
return
r
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"update error:"
,
e
);
log
.
error
(
"update error:
{}
"
,
e
);
return
R
.
error
(
e
.
getMessage
());
return
R
.
error
(
e
.
getMessage
());
}
}
}
}
...
@@ -96,7 +95,7 @@ public class TopicnewsController extends AbstractController {
...
@@ -96,7 +95,7 @@ public class TopicnewsController extends AbstractController {
R
r
=
this
.
topicnewsService
.
deleteHdbd
(
ids
,
getUser
());
R
r
=
this
.
topicnewsService
.
deleteHdbd
(
ids
,
getUser
());
return
r
;
return
r
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"delete error:"
,
e
);
log
.
error
(
"delete error:
{}
"
,
e
);
return
R
.
error
(
e
.
getMessage
());
return
R
.
error
(
e
.
getMessage
());
}
}
}
}
...
@@ -111,9 +110,23 @@ public class TopicnewsController extends AbstractController {
...
@@ -111,9 +110,23 @@ public class TopicnewsController extends AbstractController {
R
r
=
this
.
topicnewsService
.
verifyTopic
(
news
,
getUser
());
R
r
=
this
.
topicnewsService
.
verifyTopic
(
news
,
getUser
());
return
r
;
return
r
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"verifyTopic error:"
,
e
);
log
.
error
(
"verifyTopic error: {}"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
@Login
@PostMapping
(
"/api/get4PartyTopNews"
)
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
public
R
get4PartyTopNews
(
@RequestBody
TopicNewsPartyRequestVo
topicNewsPartyRequestVo
)
{
try
{
return
R
.
ok
().
put
(
"data"
,
topicnewsService
.
getTopicNewsByCondition
(
topicNewsPartyRequestVo
));
}
catch
(
Exception
e
)
{
log
.
error
(
"get4PartyTopNews error: {}"
,
e
);
return
R
.
error
(
e
.
getMessage
());
return
R
.
error
(
e
.
getMessage
());
}
}
}
}
}
}
src/main/java/io/office/modules/manage/dao/TopicnewsDao.java
View file @
febade2d
...
@@ -5,6 +5,8 @@ import io.office.modules.manage.entity.NewsEntity;
...
@@ -5,6 +5,8 @@ import io.office.modules.manage.entity.NewsEntity;
import
io.office.modules.manage.entity.TopicnewsEntity
;
import
io.office.modules.manage.entity.TopicnewsEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.vo.request.TopicNewsPartyRequestVo
;
import
io.office.modules.manage.vo.response.TopicNewsPartyVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -21,4 +23,8 @@ import java.util.List;
...
@@ -21,4 +23,8 @@ import java.util.List;
public
interface
TopicnewsDao
extends
BaseMapper
<
TopicnewsEntity
>
{
public
interface
TopicnewsDao
extends
BaseMapper
<
TopicnewsEntity
>
{
List
<
NewsEntity
>
selectTopicList
(
@Param
(
"newsParams"
)
NewsParams
newsParams
,
Page
page
);
List
<
NewsEntity
>
selectTopicList
(
@Param
(
"newsParams"
)
NewsParams
newsParams
,
Page
page
);
List
<
TopicNewsPartyVo
>
getTopicNewsByCondition
(
TopicNewsPartyRequestVo
topicNewsPartyRequestVo
);
}
}
src/main/java/io/office/modules/manage/service/TopicnewsService.java
View file @
febade2d
...
@@ -7,6 +7,8 @@ import io.office.common.utils.R;
...
@@ -7,6 +7,8 @@ import io.office.common.utils.R;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.TopicnewsEntity
;
import
io.office.modules.manage.entity.TopicnewsEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.vo.request.TopicNewsPartyRequestVo
;
import
io.office.modules.manage.vo.response.TopicNewsPartyVo
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
java.util.List
;
import
java.util.List
;
...
@@ -32,5 +34,9 @@ public interface TopicnewsService extends IService<TopicnewsEntity> {
...
@@ -32,5 +34,9 @@ public interface TopicnewsService extends IService<TopicnewsEntity> {
R
verifyTopic
(
NewsEntity
news
,
SysUserEntity
user
);
R
verifyTopic
(
NewsEntity
news
,
SysUserEntity
user
);
Page
<
NewsEntity
>
selectTopicList
(
NewsParams
newsParams
,
Page
page
);
Page
<
NewsEntity
>
selectTopicList
(
NewsParams
newsParams
,
Page
page
);
List
<
TopicNewsPartyVo
>
getTopicNewsByCondition
(
TopicNewsPartyRequestVo
topicNewsPartyRequestVo
);
}
}
src/main/java/io/office/modules/manage/service/impl/TopicnewsServiceImpl.java
View file @
febade2d
...
@@ -11,6 +11,8 @@ import io.office.modules.manage.entity.TopicnewsEntity;
...
@@ -11,6 +11,8 @@ import io.office.modules.manage.entity.TopicnewsEntity;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.service.NewsService
;
import
io.office.modules.manage.service.NewsService
;
import
io.office.modules.manage.service.TopicnewsService
;
import
io.office.modules.manage.service.TopicnewsService
;
import
io.office.modules.manage.vo.request.TopicNewsPartyRequestVo
;
import
io.office.modules.manage.vo.response.TopicNewsPartyVo
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -103,4 +105,10 @@ public class TopicnewsServiceImpl extends ServiceImpl<TopicnewsDao, TopicnewsEnt
...
@@ -103,4 +105,10 @@ public class TopicnewsServiceImpl extends ServiceImpl<TopicnewsDao, TopicnewsEnt
return
page
;
return
page
;
}
}
@Override
public
List
<
TopicNewsPartyVo
>
getTopicNewsByCondition
(
TopicNewsPartyRequestVo
topicNewsPartyRequestVo
)
{
return
topicnewsDao
.
getTopicNewsByCondition
(
topicNewsPartyRequestVo
);
}
}
}
\ No newline at end of file
src/main/java/io/office/modules/manage/vo/request/TopicNewsPartyRequestVo.java
0 → 100644
View file @
febade2d
package
io
.
office
.
modules
.
manage
.
vo
.
request
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
*
* @description:
*
* @author wudi
* @date 15:26 2021/11/13
*/
@Data
public
class
TopicNewsPartyRequestVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* $column.comments
*/
@TableId
private
Integer
id
;
/**
* $column.comments
*/
private
Integer
classid
;
/**
* $column.comments
*/
private
Integer
newsid
;
/**
* $column.comments
*/
private
Integer
newslevels
;
/**
* $column.comments
*/
private
Date
time
;
private
int
count
;
}
src/main/java/io/office/modules/manage/vo/response/TopicNewsPartyVo.java
0 → 100644
View file @
febade2d
package
io
.
office
.
modules
.
manage
.
vo
.
response
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
*
* @description:
*
* @author wudi
* @date 15:26 2021/11/13
*/
@Data
public
class
TopicNewsPartyVo
implements
Serializable
{
private
String
classid
;
private
String
newsid
;
private
String
yid
;
private
String
newslevels
;
private
String
time
;
private
String
title
;
private
String
author
;
private
String
updatedate
;
private
String
levels
;
private
String
id
;
}
src/main/resources/mapper/manage/TopicnewsDao.xml
View file @
febade2d
...
@@ -38,4 +38,31 @@
...
@@ -38,4 +38,31 @@
levels DESC,
levels DESC,
releasedate DESC
releasedate DESC
</select>
</select>
<select
id=
"getTopicNewsByCondition"
parameterType=
"io.office.modules.manage.vo.request.TopicNewsPartyRequestVo"
resultType=
"io.office.modules.manage.vo.response.TopicNewsPartyVo"
>
SELECT
top ${count} a.classid,
a.newsid,
a.id AS yid,
a.newslevels,
a.time,
b.title,
b.author,
b.updatedate,
b.levels,
b.id
FROM
TopIcNews AS a
LEFT JOIN news AS b ON a.newsid = b.id
WHERE
STATUS = 1
AND a.classid = #{classid}
ORDER BY
levels DESC,
releasedate DESC
</select>
</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