IOU ( Interior On You ) 의 Back end Server Project.
Clone or download and Use npm install
npm install
- USAGE : Make new user data in DB. - REQUEST - BODY(JSON) { id : {userID}, password : {userPW}, email : {userEmail} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 101- USAGE : Check log_in status of user. - REQUEST : Nothing. - RESPONSE - SUCCESS - BODY(JSON) { result : true } - NOT LOG_INED - BODY(JSON) { result : false } - POSSIBLE ERROR : 103- USAGE : Request log_in of user. - REQUEST - BODY(JSON) { id : {userID}, password : {userPW} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 101, 102- USAGE : Request log_out of user. - REQUEST : Nothing. - RESPONSE - SUCCESS - BODY(JSON) { result : true } - ALREADY LOG_OUT - BODY(JSON) { result : false } - POSSIBLE ERROR : 103- USAGE : Upload and make image data in DB. - REQUEST - BODY(JSON) { id : {userID}, imgFile : {imageFile}, lightColor : {lightColor} } - RESPONSE - SUCCESS - BODY(JSON) { result : {imageNum} } - POSSIBLE ERROR : 104- USAGE : Show user's uploaded image. - REQUEST - BODY(JSON) { id : {userID} } - RESPONSE - SUCCESS - BODY(JSON) { result : {list} } - POSSIBLE ERROR : 105- USAGE : Show user's specific uploaded image. - REQUEST - BODY(JSON) { imageNum : {imageNum} } - RESPONSE - SUCCESS - BODY(JSON) { result : {result} } - POSSIBLE ERROR : 105- USAGE : Show user's uploaded images which are changed completely. - REQUEST - BODY(JSON) { id : {userID} } - RESPONSE - SUCCESS - BODY(JSON) { result : {result} } - POSSIBLE ERROR : 105- USAGE : Delete image data in DB. - REQUEST - BODY(JSON) { id : {userID}, imageNum : {imageNum} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 106, 107- USAGE : Download image data in DB. - REQUEST - BODY(JSON) { image : {imageURI} } - RESPONSE - SUCCESS - BODY IMAGE - POSSIBLE ERROR :- USAGE : Download image data in DB with GET method. - REQUEST : It needs imageNum in URL. - RESPONSE - SUCCESS - Show IMAGE - POSSIBLE ERROR : 105- USAGE : Save preference selection data of user's in DB. - REQUEST - BODY(JSON) { id : {userID}, list : {array of imageNum} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 108- USAGE : Show preference selection data of user's. - REQUEST - BODY(JSON) { id : {userID} } - RESPONSE - SUCCESS - BODY(JSON) { result : {result} } - NOT EXIST - BODY(JSON) { result : false } - POSSIBLE ERROR :- USAGE : Show recommended preference data. - REQUEST : Nothing. - RESPONSE - SUCCESS - BODY(JSON) { result : {result} } - POSSIBLE ERROR : 105- USAGE : Edit preference selection data of user's in DB. - REQUEST - BODY(JSON) { id : {userID}, list : {array of imageNum} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 111- USAGE : Find user's ID. - REQUEST - BODY(JSON) { email : {userEmail} } - RESPONSE - SUCCESS - BODY(JSON) { result : {userID} } - POSSIBLE ERROR : 101- USAGE : Reset user's password. - REQUEST - BODY(JSON) { id : {userID}, email : {userEmail}, password: {newPassword} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 107, 110- USAGE : Show changed images in DB. - REQUEST - BODY(JSON) { id : {userID}, imageNum : {imageNum} } - RESPONSE - SUCCESS - BODY(JSON) { result : {result} } - NOT EXIST - BODY(JSON) { result : false } - POSSIBLE ERROR : 603- USAGE : Download Furniture image data in DB with GET method. - REQUEST : It needs FurnitureImageNum in URL. - RESPONSE - SUCCESS - Show IMAGE - POSSIBLE ERROR : 105- USAGE : Get all free board data. - REQUEST : Nothing. - RESPONSE - SUCCESS - BODY(JSON) { result : {postData} } - POSSIBLE ERROR : 201- USAGE : Get current user's entire free board data. - REQUEST - BODY(JSON) { id : {userID} } - RESPONSE - SUCCESS - BODY(JSON) { result : {postData} } - POSSIBLE ERROR : 201- USAGE : Get one specific free board data. - REQUEST - BODY(JSON) { postNum : {postNum} } - RESPONSE - SUCCESS - BODY(JSON) { board : {postData}, comment : {count, rows} } - POSSIBLE ERROR : 201- USAGE : Make free board data in DB. - REQUEST - BODY(JSON) { title : {title}, contentText : {contentText}, id : {userID}, imgFile : {imageFile} (여러장 가능, 생략 가능) } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 601- USAGE : Edit free board contentText in DB. - REQUEST - BODY(JSON) { postNum : {postNum}, contentText : {contentText}, id : {userID} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 107, 203- USAGE : Delete free board data in DB. - REQUEST - BODY(JSON) { id : {userID}, postNum : {postNum} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 105, 107, 202, 402, 504, 602- USAGE : Get all vote board data. - REQUEST : Nothing. - RESPONSE - SUCCESS - BODY(JSON) { result : {postData} } - POSSIBLE ERROR : 301- USAGE : Get current user's entire vote board data. - REQUEST - BODY(JSON) { id : {userID} } - RESPONSE - SUCCESS - BODY(JSON) { result : {postData} } - POSSIBLE ERROR : 301- USAGE : Get one specific vote board data. - REQUEST - BODY(JSON) { postNum : {postNum} } - RESPONSE - SUCCESS - BODY(JSON) { board : {postData}, count : {voteResult}, comment : {commentCount, rows} } - POSSIBLE ERROR : 301, 306- USAGE : Make vote board data in DB. - REQUEST - BODY(JSON) { title : {title}, contentText : {contentText}, id : {userID}, imgFile : {imageFile1}, imgFile : {imageFile2} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 307, 601- USAGE : Edit vote board contentText in DB. - REQUEST - BODY(JSON) { postNum : {postNum}, contentText : {contentText}, id : {userID} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 107, 310- USAGE : Delete vote board data in DB. - REQUEST - BODY(JSON) { id : {userID}, postNum : {postNum} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 105, 107, 301, 302, 402, 504, 602- USAGE : Make vote data in DB. - REQUEST - BODY(JSON) { id : {userID}, postNum : {postNum}, choice : {1 or 2} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 303, 308- USAGE : Show vote data in DB. - REQUEST - BODY(JSON) { postNum : {postNum} } - RESPONSE - SUCCESS - BODY(JSON) { result : {result} } - POSSIBLE ERROR : 304- USAGE : Delete vote data in DB. - REQUEST - BODY(JSON) { id : {userID}, postNum : {postNum} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 305, 309- USAGE : Show all free_board in recommend DESC Order. (if same recommend count, date desc order) - REQUEST : Nothing. - RESPONSE - SUCCESS - BODY(JSON) { result : {result} } - POSSIBLE ERROR : 502- USAGE : Show all comments data. - REQUEST - BODY(JSON) { postType : {postType} (1: free_board, 2: vote_board), postNum : {postNum} } - RESPONSE - SUCCESS - BODY(JSON) { result : {result} } - POSSIBLE ERROR :- USAGE : Make comment data in DB. - REQUEST - BODY(JSON) { postType : {postType} (1: free_board, 2: vote_board), postNum : {postNum}, content : {content}, id : {userID} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR :- USAGE : Delete user's specific comment data in DB. - REQUEST - BODY(JSON) { id : {userID}, commentNum: {commentNum} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 107, 401- USAGE : Make free board recommend data in DB. - REQUEST - BODY(JSON) { postNum : {postNum}, id : {userID} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 501, 503, 505- USAGE : Make vote board recommend data in DB. - REQUEST - BODY(JSON) { postNum : {postNum}, id : {userID} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 501, 503, 505- USAGE : Delete free board recommend data in DB. - REQUEST - BODY(JSON) { postNum : {postNum}, id : {userID} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 501, 504, 506- USAGE : Delete vote board recommend data in DB. - REQUEST - BODY(JSON) { postNum : {postNum}, id : {userID} } - RESPONSE - SUCCESS - BODY(JSON) { result : true } - POSSIBLE ERROR : 501, 504, 506- USAGE : Check whether user's recommend data exists in free board. - REQUEST - BODY(JSON) { postNum : {postNum}, id : {userID} } - RESPONSE - EXIST - BODY(JSON) { result : true } - NOT EXIST - BODY(JSON) { result : false } - POSSIBLE ERROR : 501- USAGE : Check whether user's recommend data exists in vote board. - REQUEST - BODY(JSON) { postNum : {postNum}, id : {userID} } - RESPONSE - EXIST - BODY(JSON) { result : true } - NOT EXIST - BODY(JSON) { result : false } - POSSIBLE ERROR : 501- case 0 : The Unexpected error. - RESPONSE - BODY(JSON) { result : false, errType : 0, msg : "Unexpected error" } - case 101 : ID doesn't exist in DB. - RESPONSE - BODY(JSON) { result : false, errType : 101, msg : "No ID Exists" } - case 102 : Password doesn't match with ID. - RESPONSE - BODY(JSON) { result : false, errType : 102, msg : "Incorrect Password" } - case 103 : Session is not valid. - RESPONSE - BODY(JSON) { result : false, errType : 103, msg : "Not valid session" } - case 104 : Fail to upload image. - RESPONSE - BODY(JSON) { result : false, errType : 104, msg : "Fail to upload image" } - case 105 : Fail to show image. - RESPONSE - BODY(JSON) { result : false, errType : 105, msg : "Fail to show image" } - case 106 : Fail to delete image. - RESPONSE - BODY(JSON) { result : false, errType : 106, msg : "Fail to delete image" } - case 107 : Current user's id doesn't match with image's userID. - RESPONSE - BODY(JSON) { result : false, errType : 107, msg : "ID doesn't match" } - case 108 : Fail to save preference of current user's. - RESPONSE - BODY(JSON) { result : false, errType : 108, msg : "Fail to save preference" } - case 109 : Fail to add preference of current user's. - RESPONSE - BODY(JSON) { result : false, errType : 109, msg : "Fail to add preference" } - case 110 : Fail to update user's password. - RESPONSE - BODY(JSON) { result : false, errType : 110, msg : "Fail to update password" } - case 111 : Fail to update user's preference. - RESPONSE - BODY(JSON) { result : false, errType : 111, msg : "Fail to update preference" } - case 201 : No Free Board Post exists in DB. - RESPONSE - BODY(JSON) { result : false, errType : 201, msg : "No Free Board Post exists" } - case 202 : Fail to delete Free Board Post. - RESPONSE - BODY(JSON) { result : false, errType : 202, msg : "Fail to delete Free Board Post" } - case 203 : Fail to update contentText in Free Board Post. - RESPONSE - BODY(JSON) { result : false, errType : 203, msg : "Fail to update contentText in DB" } - case 301 : No Vote Board Post exists in DB. - RESPONSE - BODY(JSON) { result : false, errType : 301, msg : "No Vote Board Post exists" } - case 302 : Fail to delete Vote Board Post. - RESPONSE - BODY(JSON) { result : false, errType : 302, msg : "Fail to delete Vote Board Post" } - case 303 : Fail to make vote data in DB. - RESPONSE - BODY(JSON) { result : false, errType : 303, msg : "Fail to make vote data in DB" } - case 304 : Fail to show vote data in DB. - RESPONSE - BODY(JSON) { result : false, errType : 304, msg : "Fail to show vote data in DB" } - case 305 : Fail to delete vote data in DB. - RESPONSE - BODY(JSON) { result : false, errType : 305, msg : "Fail to delete vote data in DB" } - case 306 : Fail to count vote data in DB. - RESPONSE - BODY(JSON) { result : false, errType : 306, msg : "Fail to count vote data in DB" } - case 307 : No image received. - RESPONSE - BODY(JSON) { result : false, errType : 307, msg : "No image received" } - case 308 : Vote data already exists in DB. - RESPONSE - BODY(JSON) { result : false, errType : 308, msg : "Already voted" } - case 309 : Post Num doesn't match. - RESPONSE - BODY(JSON) { result : false, errType : 309, msg : "Post Num doesn't match" } - case 310 : Fail to update contentText in Vote Board Post. - RESPONSE - BODY(JSON) { result : false, errType : 310, msg : "Fail to update contentText in DB" } - case 401 : Fail to show comment. - RESPONSE - BODY(JSON) { result : false, errType : 401, msg : "Fail to show comment" } - case 402 : Fail to delete comment. - RESPONSE - BODY(JSON) { result : false, errType : 402, msg : "Fail to delete comment" } - case 501 : Fail to find recommend. - RESPONSE - BODY(JSON) { result : false, errType : 501, msg : "Fail to find recommend" } - case 502 : Fail to order recommend. - RESPONSE - BODY(JSON) { result : false, errType : 502, msg : "Fail to order recommend" } - case 503 : Fail to make recommend. - RESPONSE - BODY(JSON) { result : false, errType : 503, msg : "Fail to make recommend" } - case 504 : Fail to delete recommend. - RESPONSE - BODY(JSON) { result : false, errType : 504, msg : "Fail to delete recommend" } - case 505 : Recommend Data already exists in DB. - RESPONSE - BODY(JSON) { result : false, errType : 505, msg : "Already recommended" } - case 506 : No recommend Data exists in DB. - RESPONSE - BODY(JSON) { result : false, errType : 506, msg : "No recommend Data exists" } - case 601 : Fail to save image in DB. - RESPONSE - BODY(JSON) { result : false, errType : 601, msg : "Fail to save image" } - case 602 : Fail to delete image in DB. - RESPONSE - BODY(JSON) { result : false, errType : 602, msg : "Fail to delete image" } - case 603 : Fail to show image in DB. - RESPONSE - BODY(JSON) { result : false, errType : 603, msg : "Fail to show image" } - case 604 : Fail to edit image in DB. - RESPONSE - BODY(JSON) { result : false, errType : 604, msg : "Fail to edit image" }