Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
vridge-docs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
JIRA
JIRA
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Gyeongho Park
vridge-docs
Commits
fa102c17
Commit
fa102c17
authored
Feb 16, 2023
by
전성희
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] 조회수 카운팅 추가
- guide get 요청 시 view count +1
parent
c4bd6995
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
GuideTestService.java
.../java/com/vazil/vridge/docs/service/GuideTestService.java
+6
-3
guide.scss
docs-front/assets/scss/guide.scss
+8
-0
index.vue
docs-front/pages/_guide/index.vue
+1
-0
No files found.
docs-back/src/main/java/com/vazil/vridge/docs/service/GuideTestService.java
View file @
fa102c17
...
...
@@ -12,9 +12,7 @@ import lombok.extern.log4j.Log4j2;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.NoSuchElementException
;
import
java.util.*
;
@Service
@AllArgsConstructor
...
...
@@ -39,6 +37,11 @@ public class GuideTestService {
@Transactional
public
GuideTest
findGuideById
(
String
guideId
)
throws
Exception
{
GuideTest
targetGuide
=
guideTestRepository
.
findById
(
guideId
).
orElseThrow
(
NoSuchElementException:
:
new
);
int
viewCount
=
targetGuide
.
getView
()
!=
null
?
targetGuide
.
getView
()
:
0
;
targetGuide
.
setView
(
viewCount
+
1
);
guideTestRepository
.
save
(
targetGuide
);
// List<Guide> sortedGuideList = new ArrayList<>();
// for(Guide guide : guideRepository.findAllByParentIdOrderByOrderAsc("")) {
// sortedGuideList.add(guide);
...
...
docs-front/assets/scss/guide.scss
View file @
fa102c17
...
...
@@ -31,6 +31,14 @@
color
:
#fff
;
background-color
:
#1E88E5
;
.view-count
{
position
:
absolute
;
right
:
0
;
top
:
0
;
padding
:
5px
10px
;
font-size
:
1rem
;
}
.v-breadcrumbs
{
color
:
#ddd
;
font-size
:
0
.95rem
;
...
...
docs-front/pages/_guide/index.vue
View file @
fa102c17
...
...
@@ -15,6 +15,7 @@
style=
"width:100%;"
></v-skeleton-loader>
<span
v-if=
"!loading && guide"
>
<span
class=
"view-count"
>
{{
guide
.
view
.
toLocaleString
()
}}
viewd
</span>
<v-breadcrumbs
class=
"ma-0 px-0 py-2 "
:items=
"getBreadcrumbs()"
...
...
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