Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = function () {
require("../src/app/Alert/alertRoute")(app);
require("../src/app/Report/reportRoute")(app);
require("../src/app/datamap/dmRoute")(app);
require("../src/app/PinView/pinViewRoute")(app);

return app;
};
12 changes: 10 additions & 2 deletions config/responseStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ module.exports = {
message: "이미 신고한 핀리뷰입니다.",
},



//핀지도 관련 오류
PINVIEW_LONGITUDE_EMPTY : {"isSuccess": false, "code": 4000, "message": "경도를 입력해주세요."},
PINVIEW_LATITUDE_EMPTY : {"isSuccess": false, "code": 4000, "message": "위도를 입력해주세요."},
PINVIEW_ADDRESS_EMPTY : {"isSuccess": false, "code": 4000, "message": "주소를 입력해주세요."},
PINVIEW_PINCONGEST_EMPTY : {"isSuccess": false, "code": 4000, "message": "핀 혼잡도를 입력해주세요."},
PINVIEW_PINFEELING_EMPTY : {"isSuccess": false, "code": 4000, "message": "핀 기분을 입력해주세요."},
PINVIEW_USERID_EMPTY : {"isSuccess": false, "code": 4000, "message": "userId를 입력해주세요."},
PINVIEW_PINID_EMPTY : {"isSuccess": false, "code": 4000, "message": "pinId를 입력해주세요."},

PINVIEW_CONTENTS_LENGTH : {"isSuccess": false, "code": 4000, "message": "내용을 300자 이내로 입력해주세요."}
};
2 changes: 1 addition & 1 deletion src/app/Alert/alertController.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const schedule = require("node-schedule");
const baseResponse = require("../../../config/responseStatus");
const { response, errResponse } = require("../../../config/response");
const admin = require("../../../config/pushConnect");
// const admin = require("../../../config/pushConnect");
const alertService = require("../../app/Alert/alertService");
const alertProvider = require("../../app/Alert/alertProvider");

Expand Down
14 changes: 7 additions & 7 deletions src/app/PinView/pinViewController.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ exports.postPin = async function (req, res){
* Body: longitude, latitude, address, pinCongest, pinFeeling, contents
*/
const {longitude, latitude, address, pinCongest, pinFeeling, contents} = req.body;
const userId = req.params.userId;
const userId = req.verifiedToken.userId;


// 빈 값 체크
Expand Down Expand Up @@ -84,7 +84,7 @@ exports.getPinById = async function (req, res) {
* Path Variable: pinId
*/
const pinId = req.params.pinId;
const userId = req.params.userId;
const userId = req.verifiedToken.userId;

if (!pinId) return res.send(errResponse(baseResponse.PINVIEW_PINID_EMPTY));

Expand All @@ -102,7 +102,7 @@ exports.getPinById = async function (req, res) {

exports.deletePin= async function(req, res){

const userId = req.params.userId
const userId = req.verifiedToken.userId;
const pinId=req.params.pinId;

if (!pinId) return res.send(errResponse(baseResponse.PINVIEW_PINID_EMPTY));
Expand All @@ -122,7 +122,7 @@ exports.postPinLike= async function(req, res){


const pinId=req.params.pinId;
const userId = req.params.userId;
const userId = req.verifiedToken.userId;

if (!userId) return res.send(errResponse(baseResponse.PINVIEW_USERID_EMPTY));
if (!pinId) return res.send(errResponse(baseResponse.PINVIEW_PINID_EMPTY));
Expand All @@ -140,7 +140,7 @@ exports.postPinLike= async function(req, res){

exports.deletePinLike= async function(req, res){

const userId = req.params.userId;
const userId = req.verifiedToken.userId;
const pinId=req.params.pinId;

if (!userId) return res.send(errResponse(baseResponse.PINVIEW_USERID_EMPTY));
Expand All @@ -159,7 +159,7 @@ exports.deletePinLike= async function(req, res){

exports.getMyPin = async function (req, res) {

const userId = req.params.userId;
const userId = req.verifiedToken.userId;

if (!userId) return res.send(errResponse(baseResponse.PINVIEW_USERID_EMPTY));

Expand All @@ -175,7 +175,7 @@ exports.getMyPin = async function (req, res) {

exports.deleteMyPin = async function (req, res) {

const userId = req.params.userId;
const userId = req.verifiedToken.userId;
Comment thread
jyjyjy25 marked this conversation as resolved.
const pinId = req.params.pinId;

if (!userId) return res.send(errResponse(baseResponse.PINVIEW_USERID_EMPTY));
Expand Down
1 change: 1 addition & 0 deletions src/app/PinView/pinViewDao.js

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 insertNearByPinQuery 에서 pinView 테이블의 createdAt도 nearByPin 테이블에 추가해주실 수 있을까용??

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

추가했습니다 !! 핀 생성 api 에서 핀이 테이블에 저장되면서 1km 이내인 핀도 인근핀 테이블에 저장되도록 해놨으니 필요할 때 조회만 하시면 될 것 같아요!!

Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
insertPin,
selectPin,
selectPinById,
insertNearByPin,
deleteRecentPin,
insertRecentPin,
selectRecentPin,
Expand Down
2 changes: 1 addition & 1 deletion src/app/PinView/pinViewRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = function(app) {


// @. my pin 조회 API -> 추후 myPage로 이동
app.get('/app/myPage/myPin/:userId', pinView.getMyPin);
app.get('/app/myPage/myPin', pinView.getMyPin);


// @. my pin 삭제 API -> 추후 myPage로 이동
Expand Down