From ff714ed09f0062258961adca2bc6fc6a596b263b Mon Sep 17 00:00:00 2001 From: Seonkyu_Kim Date: Wed, 2 Apr 2025 14:17:05 +0900 Subject: [PATCH] =?UTF-8?q?[=E2=9C=A8]=20Chatting=20=EA=B4=80=EB=A0=A8=20D?= =?UTF-8?q?b=20=EC=84=A4=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Program/V1/Models/Chatting.cs | 147 ++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 Program/V1/Models/Chatting.cs diff --git a/Program/V1/Models/Chatting.cs b/Program/V1/Models/Chatting.cs new file mode 100644 index 0000000..9450084 --- /dev/null +++ b/Program/V1/Models/Chatting.cs @@ -0,0 +1,147 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Diagnostics.CodeAnalysis; + +namespace AcaMate.V1.Models; + +[Table("chat_room")] +public class Chat_Room +{ + [Required(ErrorMessage = "필수 항목 누락")] + [MaxLength(16)] + public required string cid { get; set; } // bid + yyyyMMdd + count + + [Required(ErrorMessage = "필수 항목 누락")] + [MaxLength(6)] + public required string bid { get; set; } + + [Required(ErrorMessage = "필수 항목 누락")] + public required string name { get; set; } + + [Required(ErrorMessage = "필수 항목 누락")] + [MaxLength(4)] + public required string type { get; set; } + + [Required(ErrorMessage = "필수 항목 누락")] + public required DateTime create_date { get; set; } + + [Required(ErrorMessage = "필수 항목 누락")] + public required DateTime open_date { get; set; } + + public DateTime? close_date { get; set; } + + public Chat_Room(string cid, string bid, string name, string type, DateTime create_date, DateTime open_date) + { + this.cid = cid; + this.bid = bid; + this.name = name; + this.type = type; + this.create_date = create_date; + this.open_date = open_date; + } +} + +[Table("chat_join")] +public class Chat_Join +{ + [Required(ErrorMessage = "필수 항목 누락")] + [MaxLength(16)] + public required string cid { get; set; } + + [Required(ErrorMessage = "필수 항목 누락")] + [MaxLength(70)] + public required string uid { get; set; } + + public DateTime? join_date { get; set; } + public string? mid { get; set; } + + [Required(ErrorMessage = "필수 항목 누락")] + public required bool is_notice { get; set; } + + public Chat_Join(string cid, string uid, bool is_notice) + { + this.cid = cid; + this.uid = uid; + this.is_notice = is_notice; + } +} + +[Table("chat_message")] +public class Chat_Message +{ + + [Required(ErrorMessage = "필수 항목 누락")] + [MaxLength(36)] + public required string mid { get; set; } // UUID + + [Required(ErrorMessage = "필수 항목 누락")] + [MaxLength(16)] + public required string cid { get; set; } + + [Required(ErrorMessage = "필수 항목 누락")] + [MaxLength(70)] + public required string uid { get; set; } + + [Required(ErrorMessage = "필수 항목 누락")] + public required DateTime create_date { get; set; } + [Required(ErrorMessage = "필수 항목 누락")] + public required string content { get; set; } + [Required(ErrorMessage = "필수 항목 누락")] + public required bool is_hidden { get; set; } + + public string? media_url { get; set; } + + [Required(ErrorMessage = "필수 항목 누락")] + public required int read_count { get; set; } + + [Required(ErrorMessage = "필수 항목 누락")] + public required bool is_blind { get; set; } + + [Required(ErrorMessage = "필수 항목 누락")] + public required bool check_report { get; set; } + + public Chat_Message(string mid, string cid, string uid, DateTime create_date, string content, bool is_hidden, + int read_count, bool is_blind, bool check_report) + { + this.mid = mid; + this.cid = cid; + this.uid = uid; + this.create_date = create_date; + this.content = content; + this.is_hidden = is_hidden; + this.read_count = read_count; + this.check_report = check_report; + this.is_blind = is_blind; + this.check_report = check_report; + + } +} + + +[Table("chat_report_list")] +public class Chat_Report_List +{ + + [Required(ErrorMessage = "필수 항목 누락")] + [MaxLength(36)] + public required string mid { get; set; } // UUID + + [Required(ErrorMessage = "필수 항목 누락")] + [MaxLength(16)] + public required string cid { get; set; } + + [Required(ErrorMessage = "필수 항목 누락")] + [MaxLength(70)] + public required string uid { get; set; } + + [Required(ErrorMessage = "필수 항목 누락")] + public required string report { get; set; } + + public Chat_Report_List(string mid, string cid, string uid, string report) + { + this.mid = mid; + this.cid = cid; + this.uid = uid; + this.report = report; + } +} \ No newline at end of file