tjddus: add MapView, Marker, StartFinshLocation frontend, update backend login
Showing
36 changed files
with
442 additions
and
23 deletions
code/.idea/code.iml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<module type="WEB_MODULE" version="4"> | ||
3 | + <component name="NewModuleRootManager"> | ||
4 | + <content url="file://$MODULE_DIR$" /> | ||
5 | + <orderEntry type="inheritedJdk" /> | ||
6 | + <orderEntry type="sourceFolder" forTests="false" /> | ||
7 | + </component> | ||
8 | +</module> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
code/.idea/misc.xml
0 → 100644
code/.idea/modules.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<project version="4"> | ||
3 | + <component name="ProjectModuleManager"> | ||
4 | + <modules> | ||
5 | + <module fileurl="file://$PROJECT_DIR$/.idea/code.iml" filepath="$PROJECT_DIR$/.idea/code.iml" /> | ||
6 | + </modules> | ||
7 | + </component> | ||
8 | +</project> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
code/.idea/vcs.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<project version="4"> | ||
3 | + <component name="VcsDirectoryMappings"> | ||
4 | + <mapping directory="$PROJECT_DIR$/locationTest/expo-location-example" vcs="Git" /> | ||
5 | + <mapping directory="$PROJECT_DIR$/my-project" vcs="Git" /> | ||
6 | + <mapping directory="$PROJECT_DIR$/render_server_react_native" vcs="Git" /> | ||
7 | + <mapping directory="$PROJECT_DIR$/render_server_react_native/@expo/vector-icons" vcs="Git" /> | ||
8 | + </component> | ||
9 | +</project> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
code/.idea/workspace.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<project version="4"> | ||
3 | + <component name="ChangeListManager"> | ||
4 | + <list default="true" id="940f1aa2-9848-4abc-bd75-a3db12d9e8e1" name="Default Changelist" comment=""> | ||
5 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/AuthContext.js" afterDir="false" /> | ||
6 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/components/CurrentUserLocationComponent.js" afterDir="false" /> | ||
7 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/components/LoginComponent.js" afterDir="false" /> | ||
8 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/components/MyProfileComponent.js" afterDir="false" /> | ||
9 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/components/SignUpComponent.js" afterDir="false" /> | ||
10 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/constants/layout.js" afterDir="false" /> | ||
11 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/navigations/SelectOrTakePhotoStackNavigation.js" afterDir="false" /> | ||
12 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/navigations/SelectOrTakePhotoTabNavigation.js" afterDir="false" /> | ||
13 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/navigations/TabNavigation.js" afterDir="false" /> | ||
14 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/reducers/index.js" afterDir="false" /> | ||
15 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/reducers/location.js" afterDir="false" /> | ||
16 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/reducers/user.js" afterDir="false" /> | ||
17 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/sagas/index.js" afterDir="false" /> | ||
18 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/sagas/location.js" afterDir="false" /> | ||
19 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/sagas/user.js" afterDir="false" /> | ||
20 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/screens/Gallery.js" afterDir="false" /> | ||
21 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/screens/Login.js" afterDir="false" /> | ||
22 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/screens/Main.js" afterDir="false" /> | ||
23 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/screens/Maps.js" afterDir="false" /> | ||
24 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/screens/Profile.js" afterDir="false" /> | ||
25 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/screens/TakePhoto.js" afterDir="false" /> | ||
26 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/screens/UploadPhoto.js" afterDir="false" /> | ||
27 | + <change afterPath="$PROJECT_DIR$/render_server_react_native/store.js" afterDir="false" /> | ||
28 | + </list> | ||
29 | + <option name="SHOW_DIALOG" value="false" /> | ||
30 | + <option name="HIGHLIGHT_CONFLICTS" value="true" /> | ||
31 | + <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> | ||
32 | + <option name="LAST_RESOLUTION" value="IGNORE" /> | ||
33 | + </component> | ||
34 | + <component name="FileTemplateManagerImpl"> | ||
35 | + <option name="RECENT_TEMPLATES"> | ||
36 | + <list> | ||
37 | + <option value="JavaScript File" /> | ||
38 | + </list> | ||
39 | + </option> | ||
40 | + </component> | ||
41 | + <component name="Git.Settings"> | ||
42 | + <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/render_server_react_native" /> | ||
43 | + </component> | ||
44 | + <component name="ProjectId" id="1baLVrrFUlmMeeq9EFLzndP0zML" /> | ||
45 | + <component name="ProjectLevelVcsManager" settingsEditedManually="true"> | ||
46 | + <ConfirmationsSetting value="2" id="Add" /> | ||
47 | + </component> | ||
48 | + <component name="ProjectViewState"> | ||
49 | + <option name="hideEmptyMiddlePackages" value="true" /> | ||
50 | + <option name="showExcludedFiles" value="true" /> | ||
51 | + <option name="showLibraryContents" value="true" /> | ||
52 | + </component> | ||
53 | + <component name="PropertiesComponent"> | ||
54 | + <property name="ASKED_ADD_EXTERNAL_FILES" value="true" /> | ||
55 | + <property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> | ||
56 | + <property name="WebServerToolWindowFactoryState" value="false" /> | ||
57 | + <property name="last_opened_file_path" value="$PROJECT_DIR$" /> | ||
58 | + <property name="nodejs_package_manager_path" value="npm" /> | ||
59 | + </component> | ||
60 | + <component name="RecentsManager"> | ||
61 | + <key name="CopyFile.RECENT_KEYS"> | ||
62 | + <recent name="$PROJECT_DIR$/user_and_post_server" /> | ||
63 | + <recent name="$PROJECT_DIR$" /> | ||
64 | + <recent name="$PROJECT_DIR$/my-project/sagas" /> | ||
65 | + <recent name="$PROJECT_DIR$/my-project/reducers" /> | ||
66 | + </key> | ||
67 | + </component> | ||
68 | + <component name="SvnConfiguration"> | ||
69 | + <configuration /> | ||
70 | + </component> | ||
71 | + <component name="TaskManager"> | ||
72 | + <task active="true" id="Default" summary="Default task"> | ||
73 | + <changelist id="940f1aa2-9848-4abc-bd75-a3db12d9e8e1" name="Default Changelist" comment="" /> | ||
74 | + <created>1588865284571</created> | ||
75 | + <option name="number" value="Default" /> | ||
76 | + <option name="presentableId" value="Default" /> | ||
77 | + <updated>1588865284571</updated> | ||
78 | + <workItem from="1588865285717" duration="748000" /> | ||
79 | + <workItem from="1588875642765" duration="2528000" /> | ||
80 | + <workItem from="1588878826886" duration="6053000" /> | ||
81 | + <workItem from="1588919313007" duration="576000" /> | ||
82 | + <workItem from="1589357475573" duration="2335000" /> | ||
83 | + <workItem from="1589800232399" duration="230000" /> | ||
84 | + <workItem from="1589865778893" duration="5143000" /> | ||
85 | + <workItem from="1589960196464" duration="11230000" /> | ||
86 | + <workItem from="1590036154083" duration="405000" /> | ||
87 | + <workItem from="1590039473513" duration="2083000" /> | ||
88 | + <workItem from="1590082072338" duration="1708000" /> | ||
89 | + <workItem from="1590302730003" duration="745000" /> | ||
90 | + <workItem from="1590304674918" duration="364000" /> | ||
91 | + <workItem from="1590305558438" duration="34000" /> | ||
92 | + <workItem from="1590392477108" duration="7362000" /> | ||
93 | + <workItem from="1590405423629" duration="8216000" /> | ||
94 | + </task> | ||
95 | + <servers /> | ||
96 | + </component> | ||
97 | + <component name="TypeScriptGeneratedFilesManager"> | ||
98 | + <option name="version" value="1" /> | ||
99 | + </component> | ||
100 | + <component name="VcsManagerConfiguration"> | ||
101 | + <option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" /> | ||
102 | + </component> | ||
103 | + <component name="WindowStateProjectService"> | ||
104 | + <state x="368" y="125" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1590082196823"> | ||
105 | + <screen x="0" y="23" width="1440" height="877" /> | ||
106 | + </state> | ||
107 | + <state x="368" y="125" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.23.1440.877@0.23.1440.877" timestamp="1590082196823" /> | ||
108 | + <state x="710" y="271" key="#com.intellij.fileTypes.FileTypeChooser" timestamp="1588881921466"> | ||
109 | + <screen x="0" y="23" width="1440" height="877" /> | ||
110 | + </state> | ||
111 | + <state x="710" y="271" key="#com.intellij.fileTypes.FileTypeChooser/0.23.1440.877@0.23.1440.877" timestamp="1588881921466" /> | ||
112 | + <state width="784" height="229" key="GridCell.Tab.0.bottom" timestamp="1588878772214"> | ||
113 | + <screen x="0" y="23" width="1440" height="877" /> | ||
114 | + </state> | ||
115 | + <state width="784" height="229" key="GridCell.Tab.0.bottom/0.23.1440.877@0.23.1440.877" timestamp="1588878772214" /> | ||
116 | + <state width="784" height="229" key="GridCell.Tab.0.center" timestamp="1588878772213"> | ||
117 | + <screen x="0" y="23" width="1440" height="877" /> | ||
118 | + </state> | ||
119 | + <state width="784" height="229" key="GridCell.Tab.0.center/0.23.1440.877@0.23.1440.877" timestamp="1588878772213" /> | ||
120 | + <state width="784" height="229" key="GridCell.Tab.0.left" timestamp="1588878772212"> | ||
121 | + <screen x="0" y="23" width="1440" height="877" /> | ||
122 | + </state> | ||
123 | + <state width="784" height="229" key="GridCell.Tab.0.left/0.23.1440.877@0.23.1440.877" timestamp="1588878772212" /> | ||
124 | + <state width="784" height="229" key="GridCell.Tab.0.right" timestamp="1588878772213"> | ||
125 | + <screen x="0" y="23" width="1440" height="877" /> | ||
126 | + </state> | ||
127 | + <state width="784" height="229" key="GridCell.Tab.0.right/0.23.1440.877@0.23.1440.877" timestamp="1588878772213" /> | ||
128 | + <state x="702" y="213" width="670" height="676" key="search.everywhere.popup" timestamp="1588882527475"> | ||
129 | + <screen x="0" y="23" width="1440" height="877" /> | ||
130 | + </state> | ||
131 | + <state x="702" y="213" width="670" height="676" key="search.everywhere.popup/0.23.1440.877@0.23.1440.877" timestamp="1588882527475" /> | ||
132 | + <state x="767" y="383" key="vcs.readOnlyHandler.ReadOnlyStatusDialog" timestamp="1588882053803"> | ||
133 | + <screen x="0" y="23" width="1440" height="877" /> | ||
134 | + </state> | ||
135 | + <state x="767" y="383" key="vcs.readOnlyHandler.ReadOnlyStatusDialog/0.23.1440.877@0.23.1440.877" timestamp="1588882053803" /> | ||
136 | + </component> | ||
137 | + <component name="XDebuggerManager"> | ||
138 | + <breakpoint-manager> | ||
139 | + <breakpoints> | ||
140 | + <line-breakpoint enabled="true" type="javascript"> | ||
141 | + <url>file://$PROJECT_DIR$/my-project/screens/HomeScreen.js</url> | ||
142 | + <option name="timeStamp" value="1" /> | ||
143 | + </line-breakpoint> | ||
144 | + </breakpoints> | ||
145 | + </breakpoint-manager> | ||
146 | + </component> | ||
147 | +</project> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +import React, {useState, useEffect} from 'react'; | ||
2 | +import MapView, {Marker} from 'react-native-maps'; | ||
3 | +import {StyleSheet, Text, TextInput, View, TouchableOpacity} from 'react-native'; | ||
4 | +import screen from '../constants/layout'; | ||
5 | +import {useSelector, useDispatch} from "react-redux"; | ||
6 | +import * as Location from 'expo-location'; | ||
7 | +import {set} from "react-native-reanimated"; | ||
8 | +import {MaterialCommunityIcons} from "@expo/vector-icons"; | ||
9 | +import {SET_LOC_REQUEST} from "../reducers/location"; | ||
10 | + | ||
11 | + | ||
12 | +const StartAndFinishLocationComponent = () => { | ||
13 | + const [hasPermission, setHasPermission] = useState(false); | ||
14 | + const [startTextLocation, setStartTextLocation] = useState(''); | ||
15 | + const [finishTextLocation, setFinishTextLocation] = useState(''); | ||
16 | + const [userLocation, setUserLocation] = useState(null); | ||
17 | + | ||
18 | + const onChangeStartLocation = async (startTextLocation) => { | ||
19 | + setStartTextLocation(startTextLocation); | ||
20 | + }; | ||
21 | + | ||
22 | + const onChangeFinishLocation = (finishTextLocation) => { | ||
23 | + setFinishTextLocation(finishTextLocation); | ||
24 | + }; | ||
25 | + | ||
26 | + const dispatch = useDispatch(); | ||
27 | + const setLocation = async () => { | ||
28 | + if (!startTextLocation || !finishTextLocation) { | ||
29 | + return | ||
30 | + } | ||
31 | + console.log(startTextLocation, finishTextLocation); | ||
32 | + await dispatch({ | ||
33 | + type: SET_LOC_REQUEST, | ||
34 | + data: { | ||
35 | + startTextLocation, | ||
36 | + finishTextLocation | ||
37 | + } | ||
38 | + } | ||
39 | + ) | ||
40 | + | ||
41 | + }; | ||
42 | + | ||
43 | + return ( | ||
44 | + <View style={styles.container}> | ||
45 | + <View style={styles.input}> | ||
46 | + <Text style={styles.textStyle}>출발지</Text> | ||
47 | + <TextInput | ||
48 | + style={styles.inputText} | ||
49 | + onChangeText={onChangeStartLocation} | ||
50 | + /> | ||
51 | + <TouchableOpacity> | ||
52 | + <MaterialCommunityIcons color={'grey'} name={'map-marker'} size={30}/> | ||
53 | + </TouchableOpacity> | ||
54 | + | ||
55 | + </View> | ||
56 | + <View style={styles.input}> | ||
57 | + <Text style={styles.textStyle}>도착지</Text> | ||
58 | + <TextInput | ||
59 | + style={styles.inputText} | ||
60 | + onChangeText={onChangeFinishLocation} | ||
61 | + /> | ||
62 | + </View> | ||
63 | + <View style={{flexDirection: 'row'}}> | ||
64 | + <TouchableOpacity style={styles.buttonStyle} onPress={setLocation}> | ||
65 | + <Text>MAP설정</Text> | ||
66 | + </TouchableOpacity> | ||
67 | + <TouchableOpacity style={styles.buttonStyle}> | ||
68 | + <Text>사용자최적경로검색</Text> | ||
69 | + </TouchableOpacity> | ||
70 | + </View> | ||
71 | + </View> | ||
72 | + ) | ||
73 | +}; | ||
74 | + | ||
75 | +export default StartAndFinishLocationComponent; | ||
76 | + | ||
77 | +const styles = StyleSheet.create({ | ||
78 | + container: { | ||
79 | + marginLeft: 20, | ||
80 | + marginRight: 20, | ||
81 | + }, | ||
82 | + input: { | ||
83 | + borderRadius: 10, | ||
84 | + backgroundColor: 'lightgrey', | ||
85 | + paddingLeft: 10, | ||
86 | + paddingRight: 10, | ||
87 | + width: 300, | ||
88 | + height: 40, | ||
89 | + alignItems: 'center', | ||
90 | + flexDirection: 'row', | ||
91 | + justifyContent: 'space-between', | ||
92 | + borderBottomColor: '#bbb', | ||
93 | + marginBottom: 10 | ||
94 | + // borderBottomWidth: StyleSheet.hairlineWidth, | ||
95 | + }, | ||
96 | + inputText: { | ||
97 | + flex: 1, | ||
98 | + }, | ||
99 | + textStyle: { | ||
100 | + fontWeight: 'bold', | ||
101 | + fontSize: 17, | ||
102 | + marginRight: 15, | ||
103 | + }, | ||
104 | + buttonStyle: { | ||
105 | + flex: 1, | ||
106 | + backgroundColor: '#ecf0f1', | ||
107 | + alignItems: 'center', | ||
108 | + justifyContent: 'center', | ||
109 | + width: 30, | ||
110 | + height: 30, | ||
111 | + borderWidth: 1, | ||
112 | + borderColor: 'black', | ||
113 | + marginBottom: 20 | ||
114 | + | ||
115 | + } | ||
116 | +}); |
This diff could not be displayed because it is too large.
... | @@ -17,6 +17,7 @@ | ... | @@ -17,6 +17,7 @@ |
17 | "expo-asset": "^8.1.4", | 17 | "expo-asset": "^8.1.4", |
18 | "expo-camera": "~8.2.0", | 18 | "expo-camera": "~8.2.0", |
19 | "expo-font": "^8.1.1", | 19 | "expo-font": "^8.1.1", |
20 | + "expo-location": "~8.1.0", | ||
20 | "expo-media-library": "~8.1.0", | 21 | "expo-media-library": "~8.1.0", |
21 | "expo-permissions": "~8.1.0", | 22 | "expo-permissions": "~8.1.0", |
22 | "expo-web-browser": "^8.2.1", | 23 | "expo-web-browser": "^8.2.1", | ... | ... |
1 | import {combineReducers} from "redux"; | 1 | import {combineReducers} from "redux"; |
2 | import user from './user'; | 2 | import user from './user'; |
3 | -// import post from './post'; | 3 | +import location from './location'; |
4 | 4 | ||
5 | const rootReducer = combineReducers({ | 5 | const rootReducer = combineReducers({ |
6 | user, | 6 | user, |
7 | - // post | 7 | + location |
8 | }); | 8 | }); |
9 | 9 | ||
10 | export default rootReducer; | 10 | export default rootReducer; |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | +export const initialState = { | ||
2 | + startLocation: null, | ||
3 | + finishLocation: null, | ||
4 | + | ||
5 | + settingLocation: false, | ||
6 | + | ||
7 | + info: '', | ||
8 | +}; | ||
9 | + | ||
10 | +export const SET_LOC_REQUEST = 'SET_LOC_REQUEST'; | ||
11 | +export const SET_LOC_SUCCESS = 'SET_LOC_SUCCESS'; | ||
12 | +export const SET_LOC_FAILURE = 'SET_LOC_FAILURE'; | ||
13 | + | ||
14 | +export default (state = initialState, action) => { | ||
15 | + switch (action.type) { | ||
16 | + | ||
17 | + case SET_LOC_REQUEST: { | ||
18 | + return { | ||
19 | + ...state, | ||
20 | + settingLocation: true, | ||
21 | + } | ||
22 | + } | ||
23 | + | ||
24 | + case SET_LOC_SUCCESS: { | ||
25 | + const {startLocation, finishLocation} = action.data; | ||
26 | + return { | ||
27 | + ...state, | ||
28 | + startLocation, | ||
29 | + finishLocation, | ||
30 | + isLoggingIn: false, | ||
31 | + }; | ||
32 | + } | ||
33 | + | ||
34 | + case SET_LOC_FAILURE: { | ||
35 | + const {info} = action.data; | ||
36 | + return { | ||
37 | + ...state, | ||
38 | + settingLocation: false, | ||
39 | + info, | ||
40 | + } | ||
41 | + } | ||
42 | + | ||
43 | + default: { | ||
44 | + return { | ||
45 | + ...state, | ||
46 | + }; | ||
47 | + } | ||
48 | + } | ||
49 | +}; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
File mode changed
1 | import {all, fork} from 'redux-saga/effects'; | 1 | import {all, fork} from 'redux-saga/effects'; |
2 | 2 | ||
3 | import user from './user'; | 3 | import user from './user'; |
4 | -// import post from './post'; | 4 | +import location from './location'; |
5 | 5 | ||
6 | -export default function* rootSaga(){ | 6 | +export default function* rootSaga() { |
7 | yield all([ | 7 | yield all([ |
8 | fork(user), | 8 | fork(user), |
9 | - // fork(post) | 9 | + fork(location), |
10 | ]) | 10 | ]) |
11 | } | 11 | } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | +import {all, call, fork, delay, put, takeEvery, takeLatest} from 'redux-saga/effects'; | ||
2 | +import axios from 'axios'; | ||
3 | +import {coordAPIKEY} from '../env'; | ||
4 | +import { | ||
5 | + SET_LOC_REQUEST, | ||
6 | + SET_LOC_SUCCESS, | ||
7 | + SET_LOC_FAILURE, | ||
8 | +} from "../reducers/location"; | ||
9 | + | ||
10 | +function setLocationAPI(data) { | ||
11 | + const {startTextLocation, finishTextLocation} = data; | ||
12 | + console.log(startTextLocation, finishTextLocation); | ||
13 | + const startRes = axios.get(`http://api.vworld.kr/req/address?service=address&request=getcoord&version=2.0&crs=epsg:4326&address=${startTextLocation}&refine=true&simple=false&format=xml&type=road&key=${coordAPIKEY}`); | ||
14 | + const finishRes = axios.get(`http://api.vworld.kr/req/address?service=address&request=getcoord&version=2.0&crs=epsg:4326&address=${finishTextLocation}&refine=true&simple=false&format=xml&type=road&key=${coordAPIKEY}`); | ||
15 | + | ||
16 | + return {startRes, finishRes}; | ||
17 | +} | ||
18 | + | ||
19 | + | ||
20 | +function* setLocation(action) { | ||
21 | + try { | ||
22 | + console.log('saga의 setLocation', action.data); | ||
23 | + const res = yield call(setLocationAPI, action.data); | ||
24 | + console.log(res.startRes, res.finishRes); | ||
25 | + const {result} = res.startRes; | ||
26 | + console.log(result); | ||
27 | + } catch (e) { | ||
28 | + console.error(e); | ||
29 | + } | ||
30 | +}; | ||
31 | + | ||
32 | +function* watchSetLocation() { | ||
33 | + console.log('watchSetLocation'); | ||
34 | + yield takeLatest(SET_LOC_REQUEST, setLocation); | ||
35 | +} | ||
36 | + | ||
37 | +export default function* locationSaga() { | ||
38 | + yield all([ | ||
39 | + fork(watchSetLocation), | ||
40 | + ]); | ||
41 | +}; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
File mode changed
... | @@ -37,6 +37,9 @@ function loginAPI(data) { | ... | @@ -37,6 +37,9 @@ function loginAPI(data) { |
37 | const {email, password} = data; | 37 | const {email, password} = data; |
38 | console.log(email, password); | 38 | console.log(email, password); |
39 | console.log(`http://${host}:4001/user/login`); | 39 | console.log(`http://${host}:4001/user/login`); |
40 | + // const res1 = axios.get(`http://${host}:4001/user/test`, { | ||
41 | + // withCredentials: true | ||
42 | + // }); | ||
40 | return axios.post(`http://${host}:4001/user/login`, { | 43 | return axios.post(`http://${host}:4001/user/login`, { |
41 | email, password | 44 | email, password |
42 | }, { | 45 | }, { | ... | ... |
1 | -import React from 'react'; | 1 | +import React, {useState, useEffect} from 'react'; |
2 | -import MapView from 'react-native-maps'; | 2 | +import MapView, {Marker} from 'react-native-maps'; |
3 | import {StyleSheet, Text, View, Dimensions} from 'react-native'; | 3 | import {StyleSheet, Text, View, Dimensions} from 'react-native'; |
4 | import screen from '../constants/layout'; | 4 | import screen from '../constants/layout'; |
5 | +import StartAndFinishLocationComponent from "../components/CurrentUserLocationComponent"; | ||
5 | 6 | ||
6 | 7 | ||
7 | const Maps = () => { | 8 | const Maps = () => { |
9 | + const [initialRegion, setInitialRegion] = useState( | ||
10 | + { | ||
11 | + latitude: 37.56647, | ||
12 | + longitude: 126.977963, | ||
13 | + latitudeDelta: 0.3922, | ||
14 | + longitudeDelta: 0.3421 | ||
15 | + }); | ||
16 | + | ||
8 | return ( | 17 | return ( |
9 | <View style={styles.container}> | 18 | <View style={styles.container}> |
19 | + <Text style={styles.textStyle}>Current User Location</Text> | ||
20 | + <StartAndFinishLocationComponent/> | ||
10 | <MapView | 21 | <MapView |
11 | style={styles.mapStyle} | 22 | style={styles.mapStyle} |
12 | - initialRegion={{ | 23 | + initialRegion={initialRegion} |
13 | - latitude: 37.78825, | 24 | + > |
14 | - longitude: -122.4324, | 25 | + <Marker |
15 | - latitudeDelta: 0.0922, | 26 | + coordinate={initialRegion} |
16 | - longitudeDelta: 0.0421 | 27 | + title="this is a marker" |
17 | - }} | 28 | + description="this is a marker example"> |
18 | - /> | 29 | + </Marker> |
30 | + | ||
31 | + </MapView> | ||
19 | </View> | 32 | </View> |
20 | ) | 33 | ) |
21 | }; | 34 | }; |
... | @@ -32,4 +45,10 @@ const styles = StyleSheet.create({ | ... | @@ -32,4 +45,10 @@ const styles = StyleSheet.create({ |
32 | width: screen.width, | 45 | width: screen.width, |
33 | height: screen.height / 2, | 46 | height: screen.height / 2, |
34 | }, | 47 | }, |
48 | + textStyle: { | ||
49 | + fontWeight: 'bold', | ||
50 | + fontSize: 20, | ||
51 | + color: 'grey', | ||
52 | + marginBottom: 20, | ||
53 | + } | ||
35 | }); | 54 | }); | ... | ... |
code/user_and_post_server/.gitignore
0 → 100644
1 | +node_modules/ |
1 | { | 1 | { |
2 | "development": { | 2 | "development": { |
3 | "username": "root", | 3 | "username": "root", |
4 | - "password": "test", | 4 | + "password": "ksy98042!", |
5 | "database": "capstone_design_prj1", | 5 | "database": "capstone_design_prj1", |
6 | "host": "127.0.0.1", | 6 | "host": "127.0.0.1", |
7 | "dialect": "mysql", | 7 | "dialect": "mysql", | ... | ... |
code/user_and_post_server/crawling.js
0 → 100644
This diff is collapsed. Click to expand it.
File moved
... | @@ -2587,9 +2587,9 @@ | ... | @@ -2587,9 +2587,9 @@ |
2587 | } | 2587 | } |
2588 | }, | 2588 | }, |
2589 | "needle": { | 2589 | "needle": { |
2590 | - "version": "2.4.1", | 2590 | + "version": "2.5.0", |
2591 | - "resolved": "https://registry.npmjs.org/needle/-/needle-2.4.1.tgz", | 2591 | + "resolved": "https://registry.npmjs.org/needle/-/needle-2.5.0.tgz", |
2592 | - "integrity": "sha512-x/gi6ijr4B7fwl6WYL9FwlCvRQKGlUNvnceho8wxkwXqN8jvVmmmATTmZPRRG7b/yC1eode26C2HO9jl78Du9g==", | 2592 | + "integrity": "sha512-o/qITSDR0JCyCKEQ1/1bnUXMmznxabbwi/Y4WwJElf+evwJNFNwIDMCCt5IigFVxgeGBJESLohGtIS9gEzo1fA==", |
2593 | "requires": { | 2593 | "requires": { |
2594 | "debug": "^3.2.6", | 2594 | "debug": "^3.2.6", |
2595 | "iconv-lite": "^0.4.4", | 2595 | "iconv-lite": "^0.4.4", |
... | @@ -4428,6 +4428,11 @@ | ... | @@ -4428,6 +4428,11 @@ |
4428 | "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", | 4428 | "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", |
4429 | "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=" | 4429 | "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=" |
4430 | }, | 4430 | }, |
4431 | + "xmlhttprequest": { | ||
4432 | + "version": "1.8.0", | ||
4433 | + "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", | ||
4434 | + "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" | ||
4435 | + }, | ||
4431 | "xmlhttprequest-ssl": { | 4436 | "xmlhttprequest-ssl": { |
4432 | "version": "1.5.5", | 4437 | "version": "1.5.5", |
4433 | "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", | 4438 | "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", | ... | ... |
... | @@ -30,6 +30,7 @@ | ... | @@ -30,6 +30,7 @@ |
30 | "pug": "2.0.0-beta11", | 30 | "pug": "2.0.0-beta11", |
31 | "sequelize": "^5.21.5", | 31 | "sequelize": "^5.21.5", |
32 | "sequelize-cli": "^5.5.1", | 32 | "sequelize-cli": "^5.5.1", |
33 | - "socket.io": "^2.3.0" | 33 | + "socket.io": "^2.3.0", |
34 | + "xmlhttprequest": "^1.8.0" | ||
34 | } | 35 | } |
35 | } | 36 | } | ... | ... |
File moved
... | @@ -4,9 +4,10 @@ const bcrypt = require('bcrypt'); | ... | @@ -4,9 +4,10 @@ const bcrypt = require('bcrypt'); |
4 | const passport = require('passport'); | 4 | const passport = require('passport'); |
5 | const {isLoggedIn, isNotLoggedIn} = require("./middleware"); | 5 | const {isLoggedIn, isNotLoggedIn} = require("./middleware"); |
6 | const models = require('../models/index'); | 6 | const models = require('../models/index'); |
7 | +const {searchPubTransPathAJAX} = require('../crawling'); | ||
7 | 8 | ||
8 | router.get('/loadMe', isLoggedIn, (req, res, next) => { | 9 | router.get('/loadMe', isLoggedIn, (req, res, next) => { |
9 | - console.log('loadMe요청옴', req.user); | 10 | + // console.log('loadMe요청옴', req.user); |
10 | return res.json({user: req.user}); | 11 | return res.json({user: req.user}); |
11 | }); | 12 | }); |
12 | 13 | ||
... | @@ -113,4 +114,8 @@ router.get('/logout', (req, res, next) => { | ... | @@ -113,4 +114,8 @@ router.get('/logout', (req, res, next) => { |
113 | return res.send(); | 114 | return res.send(); |
114 | }); | 115 | }); |
115 | 116 | ||
117 | +router.get('/test', (req, res, next) => { | ||
118 | + searchPubTransPathAJAX(); | ||
119 | +}); | ||
120 | + | ||
116 | module.exports = router; | 121 | module.exports = router; |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment