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
36a449a1
Commit
36a449a1
authored
Jan 15, 2025
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑字段 最后编辑字段 修改提交
parent
22bca504
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
3 deletions
+53
-3
HomePopupController.java
...office/modules/manage/controller/HomePopupController.java
+35
-0
HomePopupEntity.java
...java/io/office/modules/manage/entity/HomePopupEntity.java
+6
-0
KnowledgecategoryEntity.java
...office/modules/manage/entity/KnowledgecategoryEntity.java
+7
-3
HomePopupServiceImpl.java
...ice/modules/manage/service/impl/HomePopupServiceImpl.java
+5
-0
No files found.
src/main/java/io/office/modules/manage/controller/HomePopupController.java
View file @
36a449a1
...
@@ -14,11 +14,15 @@ import io.office.common.validator.group.UpdateGroup;
...
@@ -14,11 +14,15 @@ import io.office.common.validator.group.UpdateGroup;
import
io.office.modules.manage.dao.WebsiteHitCountDetailDao
;
import
io.office.modules.manage.dao.WebsiteHitCountDetailDao
;
import
io.office.modules.manage.entity.HomePopupEntity
;
import
io.office.modules.manage.entity.HomePopupEntity
;
import
io.office.modules.manage.entity.ImportEntity
;
import
io.office.modules.manage.entity.ImportEntity
;
import
io.office.modules.manage.entity.TokenCount
;
import
io.office.modules.manage.form.HomePopupForm
;
import
io.office.modules.manage.form.HomePopupForm
;
import
io.office.modules.manage.service.HomePopupService
;
import
io.office.modules.manage.service.HomePopupService
;
import
io.office.modules.manage.service.TokenCountService
;
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.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -128,11 +132,42 @@ public class HomePopupController extends AbstractController {
...
@@ -128,11 +132,42 @@ public class HomePopupController extends AbstractController {
}
}
@Autowired
private
TokenCountService
tokenCountService
;
@Value
(
"${token.count}"
)
private
int
tokenCountConfig
;
@RequestMapping
(
"/api/getHomePopup/{id}/{token}"
)
public
R
getHomePopup
(
@PathVariable
(
"id"
)
Long
id
,
@PathVariable
(
"token"
)
String
token
)
{
if
(
StringUtils
.
isNotBlank
(
token
))
{
QueryWrapper
<
TokenCount
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"token"
,
token
);
TokenCount
tokenCount
=
tokenCountService
.
getOne
(
queryWrapper
);
if
(
tokenCount
==
null
)
{
return
R
.
error
(
"非法请求,请获取正确的预览链接!"
);
}
if
(
tokenCount
.
getCountFlag
()
>
tokenCountConfig
)
{
//删除无用token
return
R
.
error
(
"预览链接次数已达上限,请联系相关人员重新获取预览链接!"
);
}
tokenCount
.
setCountFlag
(
tokenCount
.
getCountFlag
()
+
1
);
tokenCountService
.
updateById
(
tokenCount
);
}
// 使用 Wrapper 来定义查询条件
QueryWrapper
<
HomePopupEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"id"
,
id
);
HomePopupEntity
homePopup
=
homePopupService
.
getOne
(
queryWrapper
);
return
R
.
ok
().
put
(
"data"
,
homePopup
);
}
@RequestMapping
(
"/api/getHomePopup"
)
@RequestMapping
(
"/api/getHomePopup"
)
public
R
getHomePopup
()
{
public
R
getHomePopup
()
{
// 使用 Wrapper 来定义查询条件
// 使用 Wrapper 来定义查询条件
QueryWrapper
<
HomePopupEntity
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
HomePopupEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"status"
,
1
);
queryWrapper
.
eq
(
"status"
,
1
);
HomePopupEntity
homePopup
=
homePopupService
.
getOne
(
queryWrapper
);
HomePopupEntity
homePopup
=
homePopupService
.
getOne
(
queryWrapper
);
return
R
.
ok
().
put
(
"data"
,
homePopup
);
return
R
.
ok
().
put
(
"data"
,
homePopup
);
}
}
...
...
src/main/java/io/office/modules/manage/entity/HomePopupEntity.java
View file @
36a449a1
package
io
.
office
.
modules
.
manage
.
entity
;
package
io
.
office
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -67,4 +68,9 @@ public class HomePopupEntity implements Serializable {
...
@@ -67,4 +68,9 @@ public class HomePopupEntity implements Serializable {
private
String
checkTime
;
private
String
checkTime
;
@TableField
(
value
=
"levels"
)
private
Integer
levels
;
private
String
keyWord
;
}
}
src/main/java/io/office/modules/manage/entity/KnowledgecategoryEntity.java
View file @
36a449a1
package
io
.
office
.
modules
.
manage
.
entity
;
package
io
.
office
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
lombok.Data
;
/**
/**
* ${comments}
* ${comments}
*
*
* @author wudi
* @author wudi
* @email
* @email
* @date 2022-06-07 14:27:45
* @date 2022-06-07 14:27:45
*/
*/
@Data
@Data
...
@@ -44,4 +45,7 @@ public class KnowledgecategoryEntity implements Serializable {
...
@@ -44,4 +45,7 @@ public class KnowledgecategoryEntity implements Serializable {
*/
*/
private
String
isshow
;
private
String
isshow
;
@TableField
(
value
=
"orderNum"
)
private
Integer
orderNum
;
}
}
src/main/java/io/office/modules/manage/service/impl/HomePopupServiceImpl.java
View file @
36a449a1
...
@@ -32,11 +32,16 @@ public class HomePopupServiceImpl extends ServiceImpl<HomePopupDao, HomePopupEnt
...
@@ -32,11 +32,16 @@ public class HomePopupServiceImpl extends ServiceImpl<HomePopupDao, HomePopupEnt
@Override
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
System
.
out
.
println
(
params
.
get
(
"levels"
)!=
null
&&
StringUtils
.
isNotBlank
(
params
.
get
(
"levels"
).
toString
()));
IPage
<
HomePopupEntity
>
page
=
this
.
page
(
IPage
<
HomePopupEntity
>
page
=
this
.
page
(
new
Query
<
HomePopupEntity
>().
getPage
(
params
),
new
Query
<
HomePopupEntity
>().
getPage
(
params
),
new
QueryWrapper
<
HomePopupEntity
>()
new
QueryWrapper
<
HomePopupEntity
>()
.
like
(
StringUtils
.
isNotBlank
(
params
.
get
(
"title"
)!=
null
?
params
.
get
(
"title"
).
toString
():
""
),
"title"
,
params
.
get
(
"title"
).
toString
())
.
like
(
StringUtils
.
isNotBlank
(
params
.
get
(
"title"
)!=
null
?
params
.
get
(
"title"
).
toString
():
""
),
"title"
,
params
.
get
(
"title"
).
toString
())
.
like
(
StringUtils
.
isNotBlank
(
params
.
get
(
"content"
)!=
null
?
params
.
get
(
"content"
).
toString
():
""
),
"content"
,
params
.
get
(
"content"
).
toString
())
.
like
(
StringUtils
.
isNotBlank
(
params
.
get
(
"content"
)!=
null
?
params
.
get
(
"content"
).
toString
():
""
),
"content"
,
params
.
get
(
"content"
).
toString
())
.
like
(
StringUtils
.
isNotBlank
(
params
.
get
(
"keyWord"
)!=
null
?
params
.
get
(
"keyWord"
).
toString
():
""
),
"key_word"
,
params
.
get
(
"keyWord"
).
toString
())
.
ne
(
params
.
get
(
"levels"
)==
null
||
StringUtils
.
isBlank
(
params
.
get
(
"levels"
).
toString
()),
"levels"
,
0
)
.
eq
(
params
.
get
(
"levels"
)!=
null
&&
StringUtils
.
isNotBlank
(
params
.
get
(
"levels"
).
toString
()),
"levels"
,
params
.
get
(
"levels"
))
.
eq
(
params
.
get
(
"status"
)!=
null
&&
StringUtils
.
isNotBlank
(
params
.
get
(
"status"
).
toString
()),
"status"
,
params
.
get
(
"status"
))
.
eq
(
params
.
get
(
"status"
)!=
null
&&
StringUtils
.
isNotBlank
(
params
.
get
(
"status"
).
toString
()),
"status"
,
params
.
get
(
"status"
))
);
);
...
...
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