feat: Add light mode and dark mode.(#89) (#558)

* feat: Add light mode and dark mode.(#89)

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* fix: make file code len

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: fix scripts support win

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* fix: make build issue

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* fix: golint and format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add scripts sudo limits of authority

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* fix: docker images fix

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* fix: docker images fix

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

---------

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong
2023-07-14 16:17:59 +08:00
committed by GitHub
parent 70d8ae4c19
commit b85c5ad84e
113 changed files with 1158 additions and 926 deletions
+11 -11
View File
@@ -35,12 +35,12 @@ func (f *FriendGorm) NewTx(tx any) relation.FriendModelInterface {
return &FriendGorm{NewMetaDB(tx.(*gorm.DB), &relation.FriendModel{})}
}
// 插入多条记录
// 插入多条记录.
func (f *FriendGorm) Create(ctx context.Context, friends []*relation.FriendModel) (err error) {
return utils.Wrap(f.db(ctx).Create(&friends).Error, "")
}
// 删除ownerUserID指定的好友
// 删除ownerUserID指定的好友.
func (f *FriendGorm) Delete(ctx context.Context, ownerUserID string, friendUserIDs []string) (err error) {
err = utils.Wrap(
f.db(ctx).
@@ -52,7 +52,7 @@ func (f *FriendGorm) Delete(ctx context.Context, ownerUserID string, friendUserI
return err
}
// 更新ownerUserID单个好友信息 更新零值
// 更新ownerUserID单个好友信息 更新零值.
func (f *FriendGorm) UpdateByMap(
ctx context.Context,
ownerUserID string,
@@ -65,12 +65,12 @@ func (f *FriendGorm) UpdateByMap(
)
}
// 更新好友信息的非零值
// 更新好友信息的非零值.
func (f *FriendGorm) Update(ctx context.Context, friends []*relation.FriendModel) (err error) {
return utils.Wrap(f.db(ctx).Updates(&friends).Error, "")
}
// 更新好友备注(也支持零值
// 更新好友备注(也支持零值 .
func (f *FriendGorm) UpdateRemark(ctx context.Context, ownerUserID, friendUserID, remark string) (err error) {
if remark != "" {
return utils.Wrap(
@@ -86,7 +86,7 @@ func (f *FriendGorm) UpdateRemark(ctx context.Context, ownerUserID, friendUserID
return utils.Wrap(f.db(ctx).Where("owner_user_id = ?", ownerUserID).Updates(m).Error, "")
}
// 获取单个好友信息,如没找到 返回错误
// 获取单个好友信息,如没找到 返回错误.
func (f *FriendGorm) Take(
ctx context.Context,
ownerUserID, friendUserID string,
@@ -98,7 +98,7 @@ func (f *FriendGorm) Take(
)
}
// 查找好友关系,如果是双向关系,则都返回
// 查找好友关系,如果是双向关系,则都返回.
func (f *FriendGorm) FindUserState(
ctx context.Context,
userID1, userID2 string,
@@ -112,7 +112,7 @@ func (f *FriendGorm) FindUserState(
)
}
// 获取 owner指定的好友列表 如果有friendUserIDs不存在,也不返回错误
// 获取 owner指定的好友列表 如果有friendUserIDs不存在,也不返回错误.
func (f *FriendGorm) FindFriends(
ctx context.Context,
ownerUserID string,
@@ -124,7 +124,7 @@ func (f *FriendGorm) FindFriends(
)
}
// 获取哪些人添加了friendUserID 如果有ownerUserIDs不存在,也不返回错误
// 获取哪些人添加了friendUserID 如果有ownerUserIDs不存在,也不返回错误.
func (f *FriendGorm) FindReversalFriends(
ctx context.Context,
friendUserID string,
@@ -136,7 +136,7 @@ func (f *FriendGorm) FindReversalFriends(
)
}
// 获取ownerUserID好友列表 支持翻页
// 获取ownerUserID好友列表 支持翻页.
func (f *FriendGorm) FindOwnerFriends(
ctx context.Context,
ownerUserID string,
@@ -158,7 +158,7 @@ func (f *FriendGorm) FindOwnerFriends(
return
}
// 获取哪些人添加了friendUserID 支持翻页
// 获取哪些人添加了friendUserID 支持翻页.
func (f *FriendGorm) FindInWhoseFriends(
ctx context.Context,
friendUserID string,