feat: 新增IM联系我们字典配置,优化用户搜索与邀请绑定功能

1. 优化IM用户列表搜索逻辑,支持长数字用户ID精确匹配
2. 修复前端雪花ID精度丢失问题,改用字符串传输用户ID
3. 新增邀请码批量绑定用户功能,支持搜索绑定指定用户
4. 新增字典配置接口,新增联系我们字典SQL脚本
5. 完善字典数据变更事件推送,优化弹窗关闭与页面刷新逻辑
This commit is contained in:
Austin
2026-09-21 13:11:08 +08:00
parent 0381984939
commit b4174a6412
12 changed files with 215 additions and 10 deletions
@@ -107,6 +107,30 @@ func (c *cConfig) ThirdParty(ctx context.Context, req *api.ThirdPartyReq) (res *
return &api.ThirdPartyRes{Values: values}, nil
}
func (c *cConfig) Dictionary(ctx context.Context, req *api.DictionaryReq) (res *api.DictionaryRes, err error) {
dictType := strings.TrimSpace(req.Type)
if dictType == "" || dictType == consts.ImInternalSecretDictType {
return nil, gerror.New("字典类型不合法")
}
var rows []*entity.SysDictData
if err = dao.SysDictData.Ctx(ctx).
Where(dao.SysDictData.Columns().Type, dictType).
Where(dao.SysDictData.Columns().Status, consts.StatusEnabled).
Order(dao.SysDictData.Columns().Sort + " asc, " + dao.SysDictData.Columns().Id + " desc").
Scan(&rows); err != nil {
return nil, gerror.Wrap(err, "获取IM字典配置失败")
}
res = &api.DictionaryRes{Items: make([]*api.DictionaryItemModel, 0, len(rows))}
for _, row := range rows {
res.Items = append(res.Items, &api.DictionaryItemModel{
Label: row.Label,
Value: row.Value,
Sort: row.Sort,
})
}
return res, nil
}
func (c *cConfig) ModerationProvider(ctx context.Context, req *api.ModerationProviderReq) (res *api.ModerationProviderRes, err error) {
tenant, err := getTenant(ctx, dao.ImTenant.Columns().Code, defaultModerationTenantCode)
if err != nil {