add
This commit is contained in:
7
backend/README.md
Normal file
7
backend/README.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
curl -X POST "127.0.0.1:20000/user/register" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{
|
||||||
|
"account": "test",
|
||||||
|
"password": "test12341234"
|
||||||
|
}'
|
||||||
|
---
|
||||||
@@ -73,8 +73,8 @@ BEGIN
|
|||||||
CREATE OR REPLACE VIEW user_info_view AS
|
CREATE OR REPLACE VIEW user_info_view AS
|
||||||
SELECT
|
SELECT
|
||||||
u.id AS user_id,
|
u.id AS user_id,
|
||||||
ua.account AS user_account,
|
ua.account AS account,
|
||||||
up.password AS user_password,
|
up.password AS password,
|
||||||
u.deleted AS deleted
|
u.deleted AS deleted
|
||||||
FROM
|
FROM
|
||||||
"user" u
|
"user" u
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ func RegisterHandler(c *gin.Context) {
|
|||||||
|
|
||||||
// 7. 插入account表
|
// 7. 插入account表
|
||||||
insertAccountQuery := `
|
insertAccountQuery := `
|
||||||
INSERT INTO account (user_id, account)
|
INSERT INTO user_account (user_id, account)
|
||||||
VALUES ($1, $2)
|
VALUES ($1, $2)
|
||||||
`
|
`
|
||||||
zap.L().Info("💡 执行账号插入",
|
zap.L().Info("💡 执行账号插入",
|
||||||
@@ -196,7 +196,7 @@ func RegisterHandler(c *gin.Context) {
|
|||||||
|
|
||||||
// 8. 插入password表
|
// 8. 插入password表
|
||||||
insertPasswordQuery := `
|
insertPasswordQuery := `
|
||||||
INSERT INTO password (user_id, password)
|
INSERT INTO user_password (user_id, password)
|
||||||
VALUES ($1, $2)
|
VALUES ($1, $2)
|
||||||
`
|
`
|
||||||
zap.L().Info("💡 执行密码插入",
|
zap.L().Info("💡 执行密码插入",
|
||||||
|
|||||||
Reference in New Issue
Block a user