Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
Today KU
Commits
7176f8e0
Commit
7176f8e0
authored
Nov 01, 2021
by
Choi Ga Young
Browse files
user, todo model, controller 작성
parent
3f4275dd
Changes
5
Hide whitespace changes
Inline
Side-by-side
client/src/utils/context.js
0 → 100644
View file @
7176f8e0
server/controllers/todo.controller.js
0 → 100644
View file @
7176f8e0
import
{
Todo
}
from
'
../db/index.js
'
;
const
AddTodo
=
async
(
req
,
res
)
=>
{
}
export
default
{
AddTodo
,
}
\ No newline at end of file
server/controllers/user.controller.js
View file @
7176f8e0
...
@@ -14,7 +14,8 @@ const signup = async (req, res) => {
...
@@ -14,7 +14,8 @@ const signup = async (req, res) => {
userID
:
userId
,
userID
:
userId
,
password
:
password
,
password
:
password
,
userName
:
userName
,
userName
:
userName
,
studNum
:
userStudNum
studNum
:
userStudNum
,
role
:
"
user
"
});
});
res
.
status
(
201
).
json
(
"
success
"
)
res
.
status
(
201
).
json
(
"
success
"
)
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
server/models/todo.model.js
0 → 100644
View file @
7176f8e0
import
Sequelize
from
"
sequelize
"
;
const
{
DataTypes
}
=
Sequelize
;
const
TodoModel
=
(
sequelize
)
=>
{
const
Todo
=
sequelize
.
define
(
"
todo
"
,
{
id
:
{
type
:
DataTypes
.
UUID
,
defaultValue
:
DataTypes
.
UUIDV4
,
primaryKey
:
true
},
title
:
{
type
:
DataTypes
.
STRING
},
date
:
{
type
:
DataTypes
.
STRING
},
done
:
{
type
:
DataTypes
.
BOOLEAN
,
defaultValue
:
false
}
},
{
timestamps
:
true
,
freezeTableName
:
true
,
tableName
:
"
todos
"
,
}
);
return
Todo
};
export
default
TodoModel
;
\ No newline at end of file
server/models/user.model.js
View file @
7176f8e0
...
@@ -7,6 +7,11 @@ const UserModel = (sequelize) => {
...
@@ -7,6 +7,11 @@ const UserModel = (sequelize) => {
const
User
=
sequelize
.
define
(
const
User
=
sequelize
.
define
(
"
user
"
,
"
user
"
,
{
{
id
:
{
type
:
DataTypes
.
UUID
,
defaultValue
:
DataTypes
.
UUIDV4
,
primaryKey
:
true
},
userID
:
{
userID
:
{
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
...
@@ -18,6 +23,9 @@ const UserModel = (sequelize) => {
...
@@ -18,6 +23,9 @@ const UserModel = (sequelize) => {
},
},
studNum
:
{
studNum
:
{
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
role
:
{
type
:
DataTypes
.
STRING
}
}
},
},
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment