Commit 3639e9fe authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

Merge branch 'gyumin'

parents c4a8991d bd9ff2cc
import dotenv from "dotenv"; import dotenv from "dotenv";
import { sequelize, Role } from "./db/index.js"; import { sequelize, User, Role } from "./db/index.js";
import app from "./app.js"; import app from "./app.js";
import appConfig from "./config/app.config.js"; import appConfig from "./config/app.config.js";
import { ROLE_NAME } from './models/role.model.js'; import { ROLE_NAME } from './models/role.model.js';
...@@ -18,17 +18,19 @@ sequelize ...@@ -18,17 +18,19 @@ sequelize
}) })
); );
// const adminRole = await Role.findOne({ where: { name: "admin" } }); const adminRole = await Role.findOne({ where: { name: "admin" } });
console.log("adminRole : ", adminRole);
// await User.create({ // if (!adminRole) {
// userId: "admin", await User.create({
// nickname: "admin@example.com", userId: "admin",
// birth: "990926", email: "han35799@naver.com",
// phoneNumber: "01086074580", nickname: "haha",
// password: "admin!", birth: "990926",
// isMember: true, phoneNumber: "01086074580",
// roleId: adminRole?.id, password: "admin!",
// }); roleId: adminRole?.id,
});
// }else{}
app.listen(appConfig.port, () => { app.listen(appConfig.port, () => {
console.log(`Server is running on port ${appConfig.port}`); console.log(`Server is running on port ${appConfig.port}`);
......
...@@ -16,6 +16,9 @@ const UserModel = (sequelize) => { ...@@ -16,6 +16,9 @@ const UserModel = (sequelize) => {
userId: { userId: {
type: DataTypes.STRING, type: DataTypes.STRING,
}, },
email: {
type: DataTypes.STRING,
},
nickname: { nickname: {
type: DataTypes.STRING, type: DataTypes.STRING,
}, },
...@@ -28,9 +31,6 @@ const UserModel = (sequelize) => { ...@@ -28,9 +31,6 @@ const UserModel = (sequelize) => {
password: { password: {
type: DataTypes.STRING, type: DataTypes.STRING,
}, },
roleId: {
type: DataTypes.INTEGER
}
}, },
{ {
timestamps: true, timestamps: true,
......
...@@ -19,4 +19,12 @@ router ...@@ -19,4 +19,12 @@ router
.route("/:userId") .route("/:userId")
.get(userCtrl.compareId) .get(userCtrl.compareId)
router
.route("/:id/:token")
.get(userCtrl.confirmMbnum)
router
.route("/:iddd")
.get(userCtrl.getNickName)
export default router; export default router;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment