Commit 84e1ca6e authored by shj's avatar shj

[ADD] 다음 가이드, 이전 가이드 할당 함수 개편

- 개편된 Guide Model 적용
- depth와 order를 활용하여 find
- 미사용 코드 삭제
parent 1ae93788
......@@ -6,6 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import nonapi.io.github.classgraph.json.Id;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;
import java.io.Serializable;
......@@ -24,13 +25,14 @@ public class GuideTest implements Serializable {
private String title;
private Integer order;
private String path;
private Integer depth;
private Integer view;
private Integer like;
// @Transient
// private Guide prevContent;
// @Transient
// private Guide nextContent;
@Transient
private GuideTest prevGuide;
@Transient
private GuideTest nextGuide;
private LocalDateTime createDate;
@LastModifiedDate
......
......@@ -10,10 +10,10 @@ import java.util.List;
@Repository
public interface GuideTestRepository extends CrudRepository<GuideTest, String> {
List<GuideTest> findAll();
List<GuideTest> findAllByOrderByOrder();
// List<GuideTest> findAllByParentIdOrderByOrderAsc(String parentId);
// List<GuideTest> findAllByKeywordSetContaining(String keyword);
int countAllBy();
// int countAllByParentId(String parentId);
List<GuideTest> findAllByPathContainingAndDepth(String path, Integer depth);
List<GuideTest> findAllByPathContainingAndDepthOrderByOrderDesc(String path, Integer depth);
GuideTest findByPath(String path);
GuideTest findByPathContainingAndDepthAndOrder(String path, Integer depth, Integer order);
}
......@@ -84,7 +84,7 @@
<v-divider class="my-8"/>
<v-row no-gutters align="center">
<v-btn class="primary--text" :ripple="false" height="64" text outlined @click="openGuide(guide.prevContent)" v-if="guide !== null && guide.prevContent">
<v-btn class="primary--text" :ripple="false" height="64" text outlined @click="openGuide(guide.prevGuide)" v-if="guide !== null && guide.prevGuide">
<v-row no-gutters align="center">
<v-col class="mr-8">
<v-icon left>mdi-chevron-left</v-icon>
......@@ -92,7 +92,7 @@
<v-col align="end" justify="end">
<span class="grey--text">이전 페이지</span> <br/>
<span style="font-size:1.1rem;font-weight:bold;">
{{parsingContentTitle(guide.prevContent)}}
{{guide.prevGuide.title}}
</span>
</v-col>
......@@ -107,13 +107,13 @@
<v-spacer/>
<v-btn class="primary--text" :ripple="false" height="64" text outlined @click="openGuide(guide.nextContent)" v-if="guide !== null && guide.nextContent">
<v-btn class="primary--text" :ripple="false" height="64" text outlined @click="openGuide(guide.nextGuide)" v-if="guide !== null && guide.nextGuide">
<v-row no-gutters align="center">
<v-col align="start" justify="start">
<span class="grey--text">다음 페이지</span> <br/>
<span style="font-size:1.1rem;font-weight:bold;">
{{ parsingContentTitle(guide.nextContent)}}
{{ guide.nextGuide.title}}
</span>
</v-col>
<v-col class="ml-8">
......@@ -157,7 +157,7 @@ export default {
await this.getGuideContents()
this.loading = false
// this.generateNavitator()
this.generateNavigator()
},
async getGuideContents() {
......@@ -272,9 +272,7 @@ export default {
},
openGuide(guide) {
this.$router.push('/' + this.parsingContentTitle(guide))
this.$store.commit('setGuide', {guideId:guide.id, flag:true})
this.$store.state.guideId = guide.id
this.$router.push('/' + guide.id)
},
openGithub(contentKey) {
......@@ -286,7 +284,7 @@ export default {
return false
},
async generateNavitator() {
async generateNavigator() {
this.loading = true
let newNavigator = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment