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

Merge branch 'gyumin'

parents c4a8991d bd9ff2cc
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 appConfig from "./config/app.config.js";
import { ROLE_NAME } from './models/role.model.js';
......@@ -18,17 +18,19 @@ sequelize
})
);
// const adminRole = await Role.findOne({ where: { name: "admin" } });
// await User.create({
// userId: "admin",
// nickname: "admin@example.com",
// birth: "990926",
// phoneNumber: "01086074580",
// password: "admin!",
// isMember: true,
// roleId: adminRole?.id,
// });
const adminRole = await Role.findOne({ where: { name: "admin" } });
console.log("adminRole : ", adminRole);
// if (!adminRole) {
await User.create({
userId: "admin",
email: "han35799@naver.com",
nickname: "haha",
birth: "990926",
phoneNumber: "01086074580",
password: "admin!",
roleId: adminRole?.id,
});
// }else{}
app.listen(appConfig.port, () => {
console.log(`Server is running on port ${appConfig.port}`);
......
......@@ -16,6 +16,9 @@ const UserModel = (sequelize) => {
userId: {
type: DataTypes.STRING,
},
email: {
type: DataTypes.STRING,
},
nickname: {
type: DataTypes.STRING,
},
......@@ -28,9 +31,6 @@ const UserModel = (sequelize) => {
password: {
type: DataTypes.STRING,
},
roleId: {
type: DataTypes.INTEGER
}
},
{
timestamps: true,
......
......@@ -19,4 +19,12 @@ router
.route("/:userId")
.get(userCtrl.compareId)
router
.route("/:id/:token")
.get(userCtrl.confirmMbnum)
router
.route("/:iddd")
.get(userCtrl.getNickName)
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