Implement Board CRUD API: Add, Edit, Delete with authorization check

This commit is contained in:
backuppc
2025-12-02 17:33:39 +09:00
parent ee08dc2e8c
commit 1aad3ee2bf
5 changed files with 319 additions and 16 deletions

View File

@@ -917,6 +917,41 @@ namespace Project.Web
}
break;
case "BOARD_ADD":
{
int bidx = json.bidx ?? 5;
string header = json.header ?? "";
string cate = json.cate ?? "";
string title = json.title ?? "";
string contents = json.contents ?? "";
string result = _bridge.Board_Add(bidx, header, cate, title, contents);
var response = new { type = "BOARD_ADDED", data = JsonConvert.DeserializeObject(result) };
await Send(socket, JsonConvert.SerializeObject(response));
}
break;
case "BOARD_EDIT":
{
int idx = json.idx ?? 0;
string header = json.header ?? "";
string cate = json.cate ?? "";
string title = json.title ?? "";
string contents = json.contents ?? "";
string result = _bridge.Board_Edit(idx, header, cate, title, contents);
var response = new { type = "BOARD_EDITED", data = JsonConvert.DeserializeObject(result) };
await Send(socket, JsonConvert.SerializeObject(response));
}
break;
case "BOARD_DELETE":
{
int idx = json.idx ?? 0;
string result = _bridge.Board_Delete(idx);
var response = new { type = "BOARD_DELETED", data = JsonConvert.DeserializeObject(result) };
await Send(socket, JsonConvert.SerializeObject(response));
}
break;
// ===== Mail API (메일 발신 내역) =====
case "MAIL_GET_LIST":
{