This commit is contained in:
Shen Junzheng
2025-03-21 21:45:08 +08:00
parent 78cce92ce3
commit 80c7e67106
86 changed files with 7061 additions and 2316 deletions

View File

@@ -0,0 +1,28 @@
package model
// CREATE TABLE chat_room(
// id INTEGER PRIMARY KEY,
// username TEXT,
// owner TEXT,
// ext_buffer BLOB
// )
type ChatRoomV4 struct {
ID int `json:"id"`
UserName string `json:"username"`
Owner string `json:"owner"`
ExtBuffer []byte `json:"ext_buffer"`
}
func (c *ChatRoomV4) Wrap() *ChatRoom {
var users []ChatRoomUser
if len(c.ExtBuffer) != 0 {
users = ParseRoomData(c.ExtBuffer)
}
return &ChatRoom{
Name: c.UserName,
Owner: c.Owner,
Users: users,
}
}