add dms table
This commit is contained in:
parent
3c8fe6097c
commit
7ebe1e2050
@ -17,7 +17,7 @@ CREATE TABLE `users` (
|
|||||||
`User_Settings` json NOT NULL,
|
`User_Settings` json NOT NULL,
|
||||||
PRIMARY KEY (`User_ID`,`User_Name`),
|
PRIMARY KEY (`User_ID`,`User_Name`),
|
||||||
UNIQUE KEY `User_Name_UNIQUE` (`User_Name`)
|
UNIQUE KEY `User_Name_UNIQUE` (`User_Name`)
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=62 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -32,4 +32,17 @@ CREATE TABLE `posts` (
|
|||||||
`post_from_bot` tinyint DEFAULT '0',
|
`post_from_bot` tinyint DEFAULT '0',
|
||||||
`post_reply_id` bigint unsigned DEFAULT NULL,
|
`post_reply_id` bigint unsigned DEFAULT NULL,
|
||||||
PRIMARY KEY (`post_id`)
|
PRIMARY KEY (`post_id`)
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `dms` (
|
||||||
|
`post_id` bigint NOT NULL AUTO_INCREMENT,
|
||||||
|
`post_user_name` varchar(100) NOT NULL,
|
||||||
|
`post_text` varchar(4000) NOT NULL,
|
||||||
|
`post_time` bigint NOT NULL,
|
||||||
|
`post_special_text` varchar(100) DEFAULT NULL,
|
||||||
|
`post_receiver_name` varchar(100) DEFAULT NULL,
|
||||||
|
`post_is_private` tinyint DEFAULT '0',
|
||||||
|
`post_from_bot` tinyint DEFAULT '0',
|
||||||
|
`post_reply_id` bigint unsigned DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`post_id`)
|
||||||
|
);
|
||||||
|
@ -614,7 +614,7 @@ router.get("/api/getPost", async function(req,res) {
|
|||||||
|
|
||||||
router.get("/api/getPersonalPosts", async function(req,res) {
|
router.get("/api/getPersonalPosts", async function(req,res) {
|
||||||
res.set("Access-Control-Allow-Origin","")
|
res.set("Access-Control-Allow-Origin","")
|
||||||
let sql = `select post_user_name,post_text,post_time,post_special_text,post_id,post_from_bot,post_reply_id from ipost.posts where (post_receiver_name = ?) order by post_id desc;`
|
let sql = `select post_user_name,post_text,post_time,post_special_text,post_id,post_from_bot,post_reply_id from ipost.dms where (post_receiver_name = ?) order by post_id desc;`
|
||||||
con.query(sql, [encodeURIComponent(res.locals.username)], function (err, result) {
|
con.query(sql, [encodeURIComponent(res.locals.username)], function (err, result) {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
res.json(result)
|
res.json(result)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user