Skip to content

Commit

Permalink
Merge pull request #236 from woowacourse-teams/develop
Browse files Browse the repository at this point in the history
버전 1.3 릴리즈
  • Loading branch information
include42 authored Oct 13, 2020
2 parents 1d7bdf7 + d639e21 commit db31cb3
Show file tree
Hide file tree
Showing 71 changed files with 1,369 additions and 415 deletions.
21 changes: 13 additions & 8 deletions src/docs/asciidoc/api-docs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,25 @@ operation::analysis/comments[snippets='http-request,http-response,request-header
[[resources-likes]]
== Likes

[[resources-likes-article]]
[[resources-article-likes-create]]
=== 게시글 공감

operation::likes/article[snippets='http-request,http-response,path-parameters,request-headers,response-headers']
operation::likes/article-likes/create[snippets='http-request,http-response,path-parameters,request-headers,response-headers']

[[resources-unlikes-article]]
[[resources-article-likes-delete]]
=== 게시글 공감 취소

operation::unlikes/article[snippets='http-request,http-response,path-parameters,request-headers']
operation::likes/article-likes/delete[snippets='http-request,http-response,path-parameters,request-headers']

[[resources-likes-comment]]
[[resources-comment-likes-create]]
=== 댓글 공감

operation::likes/comment[snippets='http-request,http-response,path-parameters,request-headers,response-headers']
operation::likes/comment-likes/create[snippets='http-request,http-response,path-parameters,request-headers,response-headers']

[[resources-unlikes-comment]]
[[resources-comment-likes-delete]]
=== 댓글 공감 취소

operation::unlikes/comment[snippets='http-request,http-response,path-parameters,request-headers']
operation::likes/comment-likes/delete[snippets='http-request,http-response,path-parameters,request-headers']

[[resources-reports]]
== Reports
Expand All @@ -115,3 +115,8 @@ operation::unlikes/comment[snippets='http-request,http-response,path-parameters,
=== 신고 분류 전체 조회

operation::reports/categories[snippets='http-request,http-response,request-headers,response-fields']

[[resources-reports-create]]
=== 신고 생성

operation::reports/create[snippets='http-request,http-response,request-headers,request-fields,response-headers']
4 changes: 2 additions & 2 deletions src/frontend/src/api/modules/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ const ArticleService = {
return ApiService.delete(`${BASE_URL}/${articleId}`);
},
like(articleId) {
return ApiService.post(`/likes/article/${articleId}`);
return ApiService.post(`${BASE_URL}/${articleId}/likes`);
},
unlike(articleId) {
return ApiService.delete(`/likes/article/${articleId}`);
return ApiService.delete(`${BASE_URL}/${articleId}/likes`);
}
};

Expand Down
12 changes: 8 additions & 4 deletions src/frontend/src/api/modules/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ const CommentService = {
`${BASE_URL}/${params.articleId}/comments/${params.commentId}`
);
},
like(commentId) {
return ApiService.post(`/likes/comment/${commentId}`);
like(params) {
return ApiService.post(
`${BASE_URL}/${params.articleId}/comments/${params.commentId}/likes`
);
},
unlike(commentId) {
return ApiService.delete(`/likes/comment/${commentId}`);
unlike(params) {
return ApiService.delete(
`${BASE_URL}/${params.articleId}/comments/${params.commentId}/likes`
);
}
};

Expand Down
13 changes: 2 additions & 11 deletions src/frontend/src/api/modules/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,10 @@ const BASE_URL = '/reports';

const ReportService = {
getCategories() {
return ApiService.get(`/reports/categories`);
return ApiService.get(`${BASE_URL}/categories`);
},
create(report) {
createReport(report) {
return ApiService.post(`${BASE_URL}`, report);
},
get(reportId) {
return ApiService.get(`${BASE_URL}/${reportId}`);
},
getAll(params) {
return ApiService.getWithParams(`${BASE_URL}`, params);
},
delete(reportId) {
return ApiService.delete(`${BASE_URL}/${reportId}`);
}
};

Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/components/FilterButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import EmotionFilter from '../components/EmotionFilter';
export default {
name: 'FilterButton',
components: { EmotionFilter },
data: () => ({
menu: false
Expand Down
40 changes: 40 additions & 0 deletions src/frontend/src/components/LoginButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<div>
<v-icon @click.stop="dialog = true">mdi-login</v-icon>
<v-dialog v-model="dialog" max-width="290">
<v-card>
<v-card-title class="text-h6">새벽에 로그인 하시겠어요?</v-card-title>

<v-card-actions>
<v-spacer></v-spacer>

<v-btn color="#B2A4D4" text @click="dialog = false">아니요</v-btn>

<v-btn color="#B2A4D4" text @click="login">네, 할게요</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>

<script>
import { mapMutations } from 'vuex';
import { SHOW_SNACKBAR } from '../store/shared/mutationTypes';
export default {
name: 'LoginButton',
data() {
return {
dialog: false
};
},
methods: {
...mapMutations([SHOW_SNACKBAR]),
login() {
this.$router.push('/signin');
}
}
};
</script>

<style></style>
1 change: 1 addition & 0 deletions src/frontend/src/components/LogoutButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { mapMutations } from 'vuex';
import { SHOW_SNACKBAR } from '../store/shared/mutationTypes';
export default {
name: 'LogoutButton',
data() {
return {
dialog: false
Expand Down
45 changes: 31 additions & 14 deletions src/frontend/src/components/ReportButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<v-dialog v-model="dialog" max-width="400">
<v-card>
<v-card-title class="text-h7 pl-3">
이 {{ getReportTypeText() }}을 신고하시겠어요?
이 {{ getReportTargetText() }}을 신고하시겠어요?
</v-card-title>

<v-card-actions>
Expand Down Expand Up @@ -72,11 +72,14 @@
</div>
</template>
<script>
import { REPORT_TYPE } from '@/utils/ReportType.js';
import { REPORT_TARGET } from '@/utils/ReportTarget.js';
import { SHOW_SNACKBAR } from '@/store/shared/mutationTypes';
import { FETCH_REPORT_CATEGORIES } from '@/store/shared/actionTypes';
import {
CREATE_REPORT,
FETCH_REPORT_CATEGORIES
} from '@/store/shared/actionTypes';
import { mapMutations, mapActions, mapGetters } from 'vuex';
import { mapActions, mapGetters, mapMutations } from 'vuex';
export default {
name: 'ReportButton',
Expand All @@ -97,40 +100,54 @@ export default {
methods: {
...mapMutations([SHOW_SNACKBAR]),
...mapActions([FETCH_REPORT_CATEGORIES]),
...mapActions([CREATE_REPORT]),
onReport() {
if (this.choiceCategory === undefined) {
this.invalidCategoryChoice = true;
return;
}
//todo : 여기에 신고 연산이 들어간다
this.dialog = false;
this.showSnackbar('신고가 접수되었습니다. 감사합니다.');
this.submitReport();
},
submitReport() {
const reportCreateRequest = {
content: this.textContent,
targetContentId: this.targetContentId,
reportTarget: this.reportTarget.toString(),
reportCategoryId: this.reportCategories[this.choiceCategory].id
};
this.createReport(reportCreateRequest)
.then(() => {
this.dialog = false;
this.showSnackbar('신고가 접수되었습니다. 감사합니다.');
})
.catch(error => {
this.showSnackbar(error.response.data.errorMessage);
});
},
onClickAlarmButton() {
this.invalidCategoryChoice = false;
this.choiceCategory = undefined;
this.textContent = '';
this.dialog = true;
},
getReportTypeText() {
switch (this.reportType) {
case REPORT_TYPE.ARTICLE:
getReportTargetText() {
switch (this.reportTarget) {
case REPORT_TARGET.ARTICLE:
return '게시물';
case REPORT_TYPE.COMMENT:
case REPORT_TARGET.COMMENT:
return '댓글';
default:
return '게시물';
}
}
},
props: {
reportType: {
reportTarget: {
type: String,
required: true,
default: ''
},
reportedId: {
targetContentId: {
type: Number,
required: true,
default: 0
Expand Down
10 changes: 5 additions & 5 deletions src/frontend/src/components/card/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
<v-col align="right" justify="end" style="padding:0px" cols="2">
<report-button
v-if="!article.isMine"
:reportType="getReportType()"
:reportedId="article.id"
:reportTarget="getReportTarget()"
:targetContentId="article.id"
/>
</v-col>
</v-row>
Expand All @@ -81,7 +81,7 @@ import EmotionImage from '@/components/card/EmotionImage';
import SubEmotionChips from '@/components/card/SubEmotionChips';
import ReportButton from '@/components/ReportButton';
import DetailCardMenu from '@/components/card/DetailCardMenu';
import { REPORT_TYPE } from '@/utils/ReportType.js';
import { REPORT_TARGET } from '@/utils/ReportTarget.js';
import { mapActions } from 'vuex';
import { LIKE_ARTICLE, UNLIKE_ARTICLE } from '@/store/shared/actionTypes';
Expand Down Expand Up @@ -115,8 +115,8 @@ export default {
});
}
},
getReportType() {
return REPORT_TYPE.ARTICLE;
getReportTarget() {
return REPORT_TARGET.ARTICLE;
},
clickCardContent() {
this.$emit('clickCardContent');
Expand Down
Loading

0 comments on commit db31cb3

Please sign in to comment.