Implement Board CRUD API: Add, Edit, Delete with authorization check
This commit is contained in:
@@ -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":
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user