-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve: issue #39 register new user
- Loading branch information
Showing
18 changed files
with
433 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import { useDispatch, useSelector } from "react-redux"; | ||
|
||
const Chat = () => { | ||
return ( | ||
<>chat</> | ||
) | ||
} | ||
|
||
export default Chat; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import { useDispatch, useSelector } from "react-redux"; | ||
|
||
const Register = () => { | ||
return ( | ||
<>Register</> | ||
) | ||
} | ||
|
||
export default Register; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Configuration, OpenAIApi } from 'openai'; | ||
import dotenv from 'dotenv'; | ||
dotenv.config(); | ||
|
||
const configuration = new Configuration({ | ||
apiKey: '', | ||
}); | ||
|
||
const openai = new OpenAIApi(configuration); | ||
|
||
export default openai; |
52 changes: 52 additions & 0 deletions
52
server-web/migrations/20240611041406-create-register-table.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
'use strict'; | ||
|
||
/** @type {import('sequelize-cli').Migration} */ | ||
module.exports = { | ||
async up (queryInterface, Sequelize) { | ||
await queryInterface.createTable('registers', | ||
{ | ||
id: { | ||
type: Sequelize.STRING, | ||
allowNull: false, | ||
primaryKey: true, | ||
}, | ||
email:{ | ||
type: Sequelize.STRING, | ||
allowNull: false, | ||
}, | ||
password:{ | ||
type: Sequelize.STRING, | ||
allowNull: false, | ||
}, | ||
username: { | ||
type: Sequelize.STRING, | ||
allowNull: false, | ||
}, | ||
gender: { | ||
type: Sequelize.INTEGER, | ||
}, | ||
birth: { | ||
type: Sequelize.BIGINT, | ||
allowNull: false, | ||
}, | ||
phone_number: Sequelize.STRING, | ||
image: Sequelize.STRING, | ||
status: { | ||
type: Sequelize.INTEGER, | ||
allowNull: false, | ||
}, | ||
information: Sequelize.STRING, | ||
role: { | ||
type: Sequelize.INTEGER, | ||
allowNull: false, | ||
}, | ||
created_at: Sequelize.BIGINT, | ||
updated_at: Sequelize.BIGINT, | ||
} | ||
); | ||
}, | ||
|
||
async down (queryInterface, Sequelize) { | ||
await queryInterface.dropTable('register'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const Sequelize = require("sequelize"); | ||
const sequelize = require("../../config/sequelize"); | ||
|
||
const User = sequelize.define( | ||
"registers", | ||
{ | ||
id: { | ||
type: Sequelize.STRING, | ||
allowNull: false, | ||
primaryKey: true, | ||
}, | ||
email: { | ||
type: Sequelize.STRING, | ||
allowNull: false, | ||
}, | ||
password: { | ||
type: Sequelize.STRING, | ||
allowNull: false, | ||
}, | ||
username: { | ||
type: Sequelize.STRING, | ||
allowNull: false, | ||
}, | ||
gender: { | ||
type: Sequelize.INTEGER, | ||
}, | ||
birth: { | ||
type: Sequelize.BIGINT, | ||
allowNull: false, | ||
}, | ||
phone_number: Sequelize.STRING, | ||
image: Sequelize.STRING, | ||
status: { | ||
type: Sequelize.INTEGER, | ||
allowNull: false, | ||
}, | ||
information: Sequelize.STRING, | ||
role: { | ||
type: Sequelize.INTEGER, | ||
allowNull: false, | ||
}, | ||
created_at: Sequelize.BIGINT, | ||
updated_at: Sequelize.BIGINT, | ||
} | ||
); | ||
|
||
module.exports = User; |
Oops, something went wrong.