Skip to content

Commit 1e99425

Browse files
author
bu2000
committed
ocr 까지 백앤드 연결완료 하지만 성능이 안좋아서 사용못함
1 parent 15f9b54 commit 1e99425

6 files changed

Lines changed: 288 additions & 212 deletions

File tree

.screen-graph.json

Lines changed: 43 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@
3333
]
3434
},
3535
{
36-
"id": "src/screens/CommunityContent/CommunityContent.jsx",
37-
"label": "CommunityContent",
36+
"id": "src/screens/CommunityContent/sections/Communitycontentpage/Communitycontentpage.jsx",
37+
"label": "Communitycontentpage",
3838
"routes": [
3939
"/communitycontentpage/:id"
40-
],
41-
"dataModelId": "107:399"
40+
]
4241
},
4342
{
4443
"id": "src/screens/AddIngredientPage/AddIngredientPage.jsx",
@@ -240,15 +239,15 @@
240239
}
241240
},
242241
{
243-
"id": "src\\screens\\Desktop\\sections\\Community\\Community.jsx:18:6-to-src\\screens\\CommunityPage\\CommunityPage.jsx",
242+
"id": "src\\screens\\Desktop\\sections\\Community\\Community.jsx:53:6-to-src\\screens\\CommunityPage\\CommunityPage.jsx",
244243
"source": "src\\screens\\Desktop\\Desktop.jsx",
245244
"target": "src\\screens\\CommunityPage\\CommunityPage.jsx",
246245
"data": {
247246
"viaRoute": "/communitypage",
248247
"trigger": {
249248
"element": "<Link className=\"community-header\" to=\"/communitypage\">\r\n <div className=\"community-header-2\">재료 나눔 게시판</div>\r\n </Link>",
250-
"line": 18,
251-
"endLine": 20,
249+
"line": 53,
250+
"endLine": 55,
252251
"column": 6,
253252
"endColumn": 13,
254253
"sourceFile": "src\\screens\\Desktop\\sections\\Community\\Community.jsx"
@@ -672,130 +671,50 @@
672671
}
673672
},
674673
{
675-
"id": "src\\components\\UnifiedHeader\\UnifiedHeader.jsx:74:14-to-src\\screens\\Desktop\\Desktop.jsx",
676-
"source": "src\\screens\\Desktop\\Desktop.jsx",
677-
"target": "src\\screens\\Desktop\\Desktop.jsx",
678-
"data": {
679-
"viaRoute": "/desktop",
680-
"trigger": {
681-
"element": "<Link\r\n to=\"/desktop\"\r\n className=\"menu-item\"\r\n onClick={() => setShowMenu(false)}\r\n >\r\n\r\n </Link>",
682-
"line": 74,
683-
"endLine": 80,
684-
"column": 14,
685-
"endColumn": 21,
686-
"sourceFile": "src\\components\\UnifiedHeader\\UnifiedHeader.jsx"
687-
}
688-
}
689-
},
690-
{
691-
"id": "src\\components\\UnifiedHeader\\UnifiedHeader.jsx:81:14-to-src\\screens\\MenuRecommendationPage\\MenuRecommendationPage.jsx",
692-
"source": "src\\screens\\Desktop\\Desktop.jsx",
693-
"target": "src\\screens\\MenuRecommendationPage\\MenuRecommendationPage.jsx",
694-
"data": {
695-
"viaRoute": "/menurecommendation",
696-
"trigger": {
697-
"element": "<Link\r\n to=\"/menurecommendation\"\r\n className=\"menu-item\"\r\n onClick={() => setShowMenu(false)}\r\n >\r\n 메뉴 추천\r\n </Link>",
698-
"line": 81,
699-
"endLine": 87,
700-
"column": 14,
701-
"endColumn": 21,
702-
"sourceFile": "src\\components\\UnifiedHeader\\UnifiedHeader.jsx"
703-
}
704-
}
705-
},
706-
{
707-
"id": "src\\components\\UnifiedHeader\\UnifiedHeader.jsx:88:14-to-src\\screens\\CommunityPage\\CommunityPage.jsx",
708-
"source": "src\\screens\\Desktop\\Desktop.jsx",
674+
"id": "src\\screens\\CommunityContent\\sections\\Communitycontentpage\\Communitycontentpage.jsx:51:10-to-src\\screens\\CommunityPage\\CommunityPage.jsx",
675+
"source": "src\\screens\\CommunityContent\\sections\\Communitycontentpage\\Communitycontentpage.jsx",
709676
"target": "src\\screens\\CommunityPage\\CommunityPage.jsx",
710677
"data": {
711678
"viaRoute": "/communitypage",
712679
"trigger": {
713-
"element": "<Link\r\n to=\"/communitypage\"\r\n className=\"menu-item\"\r\n onClick={() => setShowMenu(false)}\r\n >\r\n 재료 나눔 게시판\r\n </Link>",
714-
"line": 88,
715-
"endLine": 94,
716-
"column": 14,
717-
"endColumn": 21,
718-
"sourceFile": "src\\components\\UnifiedHeader\\UnifiedHeader.jsx"
719-
}
720-
}
721-
},
722-
{
723-
"id": "src\\components\\UnifiedHeader\\UnifiedHeader.jsx:95:14-to-src\\screens\\MyPage\\MyPage.jsx",
724-
"source": "src\\screens\\Desktop\\Desktop.jsx",
725-
"target": "src\\screens\\MyPage\\MyPage.jsx",
726-
"data": {
727-
"viaRoute": "/mypage",
728-
"trigger": {
729-
"element": "<Link\r\n to=\"/mypage\"\r\n className=\"menu-item\"\r\n onClick={() => setShowMenu(false)}\r\n >\r\n 마이페이지\r\n </Link>",
730-
"line": 95,
731-
"endLine": 101,
732-
"column": 14,
733-
"endColumn": 21,
734-
"sourceFile": "src\\components\\UnifiedHeader\\UnifiedHeader.jsx"
735-
}
736-
}
737-
},
738-
{
739-
"id": "src\\components\\UnifiedHeader\\UnifiedHeader.jsx:104:10-to-src\\screens\\Desktop\\Desktop.jsx",
740-
"source": "src\\screens\\Desktop\\Desktop.jsx",
741-
"target": "src\\screens\\Desktop\\Desktop.jsx",
742-
"data": {
743-
"viaRoute": "/desktop",
744-
"trigger": {
745-
"element": "<Link to=\"/desktop\">\r\n <img\r\n className=\"unified-header-logo\"\r\n alt=\"Logo\"\r\n src=\"https://c.animaapp.com/sjWITF5i/img/iconimage-1.svg\"\r\n />\r\n </Link>",
746-
"line": 104,
747-
"endLine": 110,
680+
"element": "navigate(\"/communitypage\")",
681+
"line": 51,
682+
"endLine": 51,
748683
"column": 10,
749-
"endColumn": 17,
750-
"sourceFile": "src\\components\\UnifiedHeader\\UnifiedHeader.jsx"
684+
"endColumn": 36,
685+
"sourceFile": "src\\screens\\CommunityContent\\sections\\Communitycontentpage\\Communitycontentpage.jsx"
751686
}
752687
}
753688
},
754689
{
755-
"id": "src\\components\\UnifiedHeader\\UnifiedHeader.jsx:113:8-to-src\\screens\\Desktop\\Desktop.jsx",
756-
"source": "src\\screens\\Desktop\\Desktop.jsx",
757-
"target": "src\\screens\\Desktop\\Desktop.jsx",
690+
"id": "src\\screens\\CommunityContent\\sections\\Communitycontentpage\\Communitycontentpage.jsx:125:8-to-src\\screens\\CommunityPage\\CommunityPage.jsx",
691+
"source": "src\\screens\\CommunityContent\\sections\\Communitycontentpage\\Communitycontentpage.jsx",
692+
"target": "src\\screens\\CommunityPage\\CommunityPage.jsx",
758693
"data": {
759-
"viaRoute": "/desktop",
694+
"viaRoute": "/communitypage",
760695
"trigger": {
761-
"element": "<Link to=\"/desktop\" className=\"unified-header-center\">\r\n <p className=\"unified-header-title\">\r\n <span className=\"title-text-black\">알고리즘 </span>\r\n <span className=\"title-text-orange\">셰프</span>\r\n </p>\r\n </Link>",
762-
"line": 113,
763-
"endLine": 118,
696+
"element": "navigate(\"/communitypage\")",
697+
"line": 125,
698+
"endLine": 125,
764699
"column": 8,
765-
"endColumn": 15,
766-
"sourceFile": "src\\components\\UnifiedHeader\\UnifiedHeader.jsx"
767-
}
768-
}
769-
},
770-
{
771-
"id": "src\\components\\UnifiedHeader\\UnifiedHeader.jsx:121:10-to-src\\screens\\MyPage\\MyPage.jsx",
772-
"source": "src\\screens\\Desktop\\Desktop.jsx",
773-
"target": "src\\screens\\MyPage\\MyPage.jsx",
774-
"data": {
775-
"viaRoute": "/mypage",
776-
"trigger": {
777-
"element": "<Link to=\"/mypage\" className=\"unified-mypage-btn\">\r\n <div className=\"unified-mypage-text\">마이페이지</div>\r\n </Link>",
778-
"line": 121,
779-
"endLine": 123,
780-
"column": 10,
781-
"endColumn": 17,
782-
"sourceFile": "src\\components\\UnifiedHeader\\UnifiedHeader.jsx"
700+
"endColumn": 34,
701+
"sourceFile": "src\\screens\\CommunityContent\\sections\\Communitycontentpage\\Communitycontentpage.jsx"
783702
}
784703
}
785704
},
786705
{
787-
"id": "src\\components\\PreferencesPopup\\PreferencesPopup.jsx:87:8-to-src\\screens\\Desktop\\Desktop.jsx",
788-
"source": "src\\screens\\Desktop\\Desktop.jsx",
789-
"target": "src\\screens\\Desktop\\Desktop.jsx",
706+
"id": "src\\screens\\CommunityContent\\sections\\Communitycontentpage\\Communitycontentpage.jsx:319:27-to-src\\screens\\CommunityPage\\CommunityPage.jsx",
707+
"source": "src\\screens\\CommunityContent\\sections\\Communitycontentpage\\Communitycontentpage.jsx",
708+
"target": "src\\screens\\CommunityPage\\CommunityPage.jsx",
790709
"data": {
791-
"viaRoute": "/desktop",
710+
"viaRoute": "/communitypage",
792711
"trigger": {
793-
"element": "navigate(\"/desktop\")",
794-
"line": 87,
795-
"endLine": 87,
796-
"column": 8,
797-
"endColumn": 28,
798-
"sourceFile": "src\\components\\PreferencesPopup\\PreferencesPopup.jsx"
712+
"element": "navigate(\"/communitypage\")",
713+
"line": 319,
714+
"endLine": 319,
715+
"column": 27,
716+
"endColumn": 53,
717+
"sourceFile": "src\\screens\\CommunityContent\\sections\\Communitycontentpage\\Communitycontentpage.jsx"
799718
}
800719
}
801720
},
@@ -960,47 +879,47 @@
960879
}
961880
},
962881
{
963-
"id": "src\\screens\\CreatePostPage\\CreatePostPage.jsx:16:6-to-src\\screens\\CommunityPage\\CommunityPage.jsx",
882+
"id": "src\\screens\\CreatePostPage\\CreatePostPage.jsx:18:6-to-src\\screens\\CommunityPage\\CommunityPage.jsx",
964883
"source": "src\\screens\\CreatePostPage\\CreatePostPage.jsx",
965884
"target": "src\\screens\\CommunityPage\\CommunityPage.jsx",
966885
"data": {
967886
"viaRoute": "/communitypage",
968887
"trigger": {
969888
"element": "navigate(\"/communitypage\")",
970-
"line": 16,
971-
"endLine": 16,
889+
"line": 18,
890+
"endLine": 18,
972891
"column": 6,
973892
"endColumn": 32,
974893
"sourceFile": "src\\screens\\CreatePostPage\\CreatePostPage.jsx"
975894
}
976895
}
977896
},
978897
{
979-
"id": "src\\screens\\CreatePostPage\\CreatePostPage.jsx:49:4-to-src\\screens\\CommunityPage\\CommunityPage.jsx",
898+
"id": "src\\screens\\CreatePostPage\\CreatePostPage.jsx:44:8-to-src\\screens\\CommunityPage\\CommunityPage.jsx",
980899
"source": "src\\screens\\CreatePostPage\\CreatePostPage.jsx",
981900
"target": "src\\screens\\CommunityPage\\CommunityPage.jsx",
982901
"data": {
983902
"viaRoute": "/communitypage",
984903
"trigger": {
985904
"element": "navigate(\"/communitypage\")",
986-
"line": 49,
987-
"endLine": 49,
988-
"column": 4,
989-
"endColumn": 30,
905+
"line": 44,
906+
"endLine": 44,
907+
"column": 8,
908+
"endColumn": 34,
990909
"sourceFile": "src\\screens\\CreatePostPage\\CreatePostPage.jsx"
991910
}
992911
}
993912
},
994913
{
995-
"id": "src\\screens\\CreatePostPage\\CreatePostPage.jsx:88:12-to-src\\screens\\CommunityPage\\CommunityPage.jsx",
914+
"id": "src\\screens\\CreatePostPage\\CreatePostPage.jsx:101:12-to-src\\screens\\CommunityPage\\CommunityPage.jsx",
996915
"source": "src\\screens\\CreatePostPage\\CreatePostPage.jsx",
997916
"target": "src\\screens\\CommunityPage\\CommunityPage.jsx",
998917
"data": {
999918
"viaRoute": "/communitypage",
1000919
"trigger": {
1001920
"element": "<Link to=\"/communitypage\" className=\"create-post-cancel-btn\">\r\n 취소\r\n </Link>",
1002-
"line": 88,
1003-
"endLine": 90,
921+
"line": 101,
922+
"endLine": 103,
1004923
"column": 12,
1005924
"endColumn": 19,
1006925
"sourceFile": "src\\screens\\CreatePostPage\\CreatePostPage.jsx"

src/api/Community/community.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const getPostList = async (page, size, filter) => {
99
Authorization: `Bearer ${token}`,
1010
},
1111
params: {
12-
page: page,
12+
page,
1313
size,
1414
filter: filter || null,
1515
},
@@ -24,6 +24,24 @@ export const getPostList = async (page, size, filter) => {
2424
}
2525
};
2626

27+
export const getPosts = async () => {
28+
const token = localStorage.getItem("accessToken");
29+
try {
30+
const response = await axios.get(`${BACKEND_DOMAIN}/posts`, {
31+
headers: {
32+
Authorization: `Bearer ${token}`,
33+
},
34+
});
35+
return response.data;
36+
} catch (error) {
37+
if (error.response) {
38+
console.log(error.response.status);
39+
console.log(error.response.data);
40+
}
41+
throw error;
42+
}
43+
};
44+
2745
export const createPost = async (post) => {
2846
const token = localStorage.getItem("accessToken");
2947
try {

src/api/Ocr/ocrApi.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import axios from "axios";
2+
const BACKEND_DOMAIN = "http://localhost:8080/ocr/request";
3+
4+
export const uploadReceipt = async (file) => {
5+
const token = localStorage.getItem("accessToken");
6+
7+
const formData = new FormData();
8+
formData.append("imageFile", file);
9+
10+
try {
11+
const response = await axios.post(`${BACKEND_DOMAIN}/upload`, formData, {
12+
headers: {
13+
Authorization: `Bearer ${token}`,
14+
"Content-Type": "multipart/form-data",
15+
},
16+
});
17+
18+
console.log("OCR 분석 성공, 항목 수:", response.data.items.length);
19+
20+
return response.data;
21+
} catch (error) {
22+
if (error.response) {
23+
console.error(
24+
"OCR 요청 실패:",
25+
error.response.status,
26+
error.response.data
27+
);
28+
} else {
29+
console.error("서버 연결 실패:", error.message);
30+
}
31+
throw error;
32+
}
33+
};

0 commit comments

Comments
 (0)