Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile managment api #165

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions New_APIs/Profile_Management_API/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
package-lock.json
30 changes: 30 additions & 0 deletions New_APIs/Profile_Management_API/checkoutProfileRoute.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const express=require("express");
const router=express.Router();
const CheckoutProfileService=require("./service/checkoutProfileService");
const UserProfileListResponse=require("./responseModel/userProfileListResponse");

router.post('/profile',async(req,res)=>{
console.log(req.query);
const userId = req.query.id;
console.log(userId);
try {
let checkoutProfileResponse=await CheckoutProfileService.checkoutProfile(userId);
res.send(checkoutProfileResponse);
} catch (error) {
res.json({ error: error.message });
}
})

router.post('/userProfilesList',async(req,res)=>{
console.log(req.query);
const userId = req.query.id;
console.log(userId);
try {
let userProfileListResponse=await CheckoutProfileService.userProfileListData(userId);
res.send(userProfileListResponse);
} catch (error) {
res.json({ error: error.message });
}
})

module.exports=router;
13 changes: 13 additions & 0 deletions New_APIs/Profile_Management_API/database.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE TABLE user_details(
id BIGINT PRIMARY KEY NOT NULL AUTO_INCREMENT,
name VARCHAR(250),
image VARCHAR(1000),
bio LONGTEXT,
phone_number VARCHAR(10),
email VARCHAR(50),
password TEXT,
profile_type VARCHAR(45),
role VARCHAR(45),
create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
google_id VARCHAR(1000)
);
14 changes: 14 additions & 0 deletions New_APIs/Profile_Management_API/db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const mysql = require('mysql');

// Create a connection pool
const pool = mysql.createPool({
host: 'localhost',
user: 'root',
password: 'Charvi',
database: 'voosh',
waitForConnections: true,
connectionLimit: 10,
queueLimit: 0
});

module.exports = pool;
Loading
Loading