Files
EchoChat/backend/go-service/app/group/model/group.go
bujinyuan 19979da59e feat(phase2c): 群聊与已读回执功能完整实现
Phase 2c 全部 14 个 Task 完成,包含:

后端(Go):
- MinIO 文件存储服务集成(Docker + Go SDK + 通用上传 API)
- Group 模块完整实现(DAO + Service + Controller + Router + Wire)
  - 18 个群管理 REST API + 11 个 WS 群事件推送
  - 群创建/解散/邀请/踢人/退出/转让群主/设管理员/禁言/全体禁言/群公告/群昵称/免打扰/搜索
- IM Service 扩展(群消息发送/撤回 + @提醒 + 管理员无时限撤回)
- 已读回执后端(单聊会话级 last_read_msg_id + 群聊消息级 im_message_reads)
- 管理端群组管理(列表/详情/解散)
- 数据库迁移(3 张新表 + 2 张表字段扩展)

前端(uni-app):
- 群聊 Store + API 封装 + 11 个 WS 事件监听
- 已读回执 UI(单聊已读/未读标记 + 群聊 X人已读 + 已读详情页)
- 7 个群聊页面(对话/创建/设置/成员/邀请/审批/搜索)
- 会话列表改造(全部/单聊/群聊 Tab + @标记 + 免打扰标识)

管理端(Vue 3 + Element Plus):
- 群组列表页(搜索/分页/详情弹窗/解散群聊)
- 侧边栏群组管理入口

文档同步:进度/架构/设计/API/规范文档全部更新

Made-with: Cursor
2026-03-04 14:58:23 +08:00

28 lines
1.7 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Package model 定义 group 模块的数据库模型
package model
import "time"
// Group 群聊信息模型,对应 im_groups 表
// 与 im_conversations (type=2) 一对一关联
// Status: 1=正常2=已解散
type Group struct {
ID int64 `json:"id" gorm:"primaryKey;autoIncrement"` // 群唯一标识
ConversationID int64 `json:"conversation_id" gorm:"not null;uniqueIndex"` // 关联 im_conversations.id
Name string `json:"name" gorm:"size:100;not null;default:''"` // 群名称
Avatar string `json:"avatar" gorm:"size:500;default:''"` // 群头像 URLMinIO
OwnerID int64 `json:"owner_id" gorm:"not null;index:idx_im_groups_owner"` // 群主用户 ID
Notice string `json:"notice" gorm:"type:text;default:''"` // 群公告内容
MaxMembers int `json:"max_members" gorm:"not null;default:200"` // 最大成员数
IsSearchable bool `json:"is_searchable" gorm:"not null;default:true"` // 是否可被搜索发现
IsAllMuted bool `json:"is_all_muted" gorm:"not null;default:false"` // 是否全体禁言
Status int `json:"status" gorm:"not null;default:1"` // 群状态1=正常2=已解散
CreatedAt time.Time `json:"created_at" gorm:"not null;autoCreateTime;type:timestamp(0)"` // 创建时间
UpdatedAt time.Time `json:"updated_at" gorm:"not null;autoUpdateTime;type:timestamp(0)"` // 更新时间
}
// TableName 指定数据库表名
func (Group) TableName() string {
return "im_groups"
}