---
# System prepended metadata

title: 3️⃣1️⃣ RCG2公告
tags: ['31']

---


新 Jira: [亞洲商務＿總監及代理後台＿公告功能調整](https://auforce.atlassian.net/browse/RCGABC-106)
提供 API 給狗哥呼叫，必須讓每個大股東下的會員都能看到大股東的的公告內容，資料結構 David 提供

```sql
USE [HKNetGame_HJ]
GO
- /****** Object:  Table [dbo].[T_UnitMessage]    Script Date: 2023/9/15 下午 04:40:46 ******/
SET ANSI_NULLS ON
GO
- SET QUOTED_IDENTIFIER ON
GO
- CREATE TABLE [dbo].[T_UnitMessage](
[UnitMessage_id] [bigint] IDENTITY(1,1) NOT NULL,
[Union_id] [varchar](20) NOT NULL,
[Create_Time] [datetimeoffset](7) NOT NULL,
[Time_Begin] [datetimeoffset](7) NOT NULL,
[Time_End] [datetimeoffset](7) NOT NULL,
[IsEnabled] [bit] NOT NULL,
[Send_Target] [tinyint] NOT NULL,
CONSTRAINT [PK_T_UnitMessage] PRIMARY KEY NONCLUSTERED 
(
[UnitMessage_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
- /****** Object:  Table [dbo].[T_UnitMessage_Body]    Script Date: 2023/9/15 下午 04:40:46 ******/
SET ANSI_NULLS ON
GO
- SET QUOTED_IDENTIFIER ON
GO
- CREATE TABLE [dbo].[T_UnitMessage_Body](
[UnitMessage_id] [bigint] NOT NULL,
[Language_id] [tinyint] NOT NULL,
[Message_Content] [nvarchar](1000) NOT NULL
) ON [PRIMARY]
GO
- ALTER TABLE [dbo].[T_UnitMessage] ADD  CONSTRAINT [DF_T_UnitMessage_Create_Time]  DEFAULT (sysdatetimeoffset()) FOR [Create_Time]
GO
- ALTER TABLE [dbo].[T_UnitMessage] ADD  CONSTRAINT [DF_T_UnitMessage_Time_Begin]  DEFAULT (sysdatetimeoffset()) FOR [Time_Begin]
GO
- ALTER TABLE [dbo].[T_UnitMessage] ADD  CONSTRAINT [DF_T_UnitMessage_IsEnabled]  DEFAULT ((0)) FOR [IsEnabled]
GO
- ALTER TABLE [dbo].[T_UnitMessage] ADD  CONSTRAINT [DF_T_UnitMessage_Send_Club]  DEFAULT ((0)) FOR [Send_Target]
GO
- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'階層訊息鍵，唯一值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_UnitMessage', @level2type=N'COLUMN',@level2name=N'UnitMessage_id'
GO
- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'聯盟代碼，只會發送給聯盟(代理線)下線節點的對象，參照表 T_Union 或其他等效資料' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_UnitMessage', @level2type=N'COLUMN',@level2name=N'Union_id'
GO
- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'此公告的起始時間' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_UnitMessage', @level2type=N'COLUMN',@level2name=N'Time_Begin'
GO
- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'此公告的結束時間' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_UnitMessage', @level2type=N'COLUMN',@level2name=N'Time_End'
GO
- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'此訊息是否啟用 0=停用 1=啟用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_UnitMessage', @level2type=N'COLUMN',@level2name=N'IsEnabled'
GO
- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'訊息發送對象 0=全體 1=代理 2=會員' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_UnitMessage', @level2type=N'COLUMN',@level2name=N'Send_Target'
GO
- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'階層公告的鍵值，對照主表用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_UnitMessage_Body', @level2type=N'COLUMN',@level2name=N'UnitMessage_id'
GO
- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'語系ID，參考 T_Language_LangID 或等效資料' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_UnitMessage_Body', @level2type=N'COLUMN',@level2name=N'Language_id'
GO
- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'訊息的內容，根據語系填寫' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_UnitMessage_Body', @level2type=N'COLUMN',@level2name=N'Message_Content'
GO
```
