This commit is contained in:
wangchuxiao
2022-04-08 15:40:07 +08:00
parent 59cc45eaab
commit 4efdabc1ff
14 changed files with 240 additions and 43 deletions
+13 -15
View File
@@ -8,7 +8,7 @@ type GroupResponse struct {
CreateTime string `json:"create_time"`
IsBanChat bool `json:"is_ban_chat"`
IsBanPrivateChat bool `json:"is_ban_private_chat"`
ProfilePhoto string `json:"profile_photo"`
ProfilePhoto string `json:"profile_photo"`
}
type GetGroupByIdRequest struct {
@@ -63,7 +63,6 @@ type SetGroupMemberRequest struct {
}
type SetGroupMemberRespones struct {
}
type BanGroupChatRequest struct {
@@ -88,7 +87,7 @@ type DeleteGroupResponse struct {
}
type GetGroupMembersRequest struct {
GroupId string `form:"group_id" binding:"required"`
GroupId string `form:"group_id" binding:"required"`
UserName string `form:"user_name"`
RequestPagination
}
@@ -96,24 +95,24 @@ type GetGroupMembersRequest struct {
type GroupMemberResponse struct {
MemberPosition int `json:"member_position"`
MemberNickName string `json:"member_nick_name"`
MemberId string `json:"member_id"`
MemberId string `json:"member_id"`
JoinTime string `json:"join_time"`
}
type GetGroupMembersResponse struct {
GroupMembers []GroupMemberResponse `json:"group_members"`
GroupMembers []GroupMemberResponse `json:"group_members"`
ResponsePagination
MemberNums int `json:"member_nums"`
}
type GroupMemberRequest struct {
GroupId string `json:"group_id" binding:"required"`
GroupId string `json:"group_id" binding:"required"`
Members []string `json:"members" binding:"required"`
}
type GroupMemberOperateResponse struct {
Success []string `json:"success"`
Failed []string `json:"failed"`
Failed []string `json:"failed"`
}
type AddGroupMembersRequest struct {
@@ -128,19 +127,18 @@ type RemoveGroupMembersRequest struct {
GroupMemberRequest
}
type RemoveGroupMembersResponse struct{
type RemoveGroupMembersResponse struct {
GroupMemberOperateResponse
}
type AlterGroupInfoRequest struct {
GroupID string `json:"group_id"`
GroupName string `json:"group_name"`
Notification string `json:"notification"`
Introduction string `json:"introduction"`
ProfilePhoto string `json:"profile_photo"`
GroupType int `json:"group_type"`
GroupID string `json:"group_id"`
GroupName string `json:"group_name"`
Notification string `json:"notification"`
Introduction string `json:"introduction"`
ProfilePhoto string `json:"profile_photo"`
GroupType int `json:"group_type"`
}
type AlterGroupInfoResponse struct {
}
+9
View File
@@ -152,12 +152,21 @@ type config struct {
AccessID string `yaml:"accessID"`
SecretKey string `yaml:"secretKey"`
}
Enable bool `yaml:"enable"`
}
Jpns struct {
AppKey string `yaml:"appKey"`
MasterSecret string `yaml:"masterSecret"`
PushUrl string `yaml:"pushUrl"`
PushIntent string `yaml:"pushIntent"`
Enable bool `yaml:"enable"`
}
Getui struct {
PushUrl string `yaml:"pushUrl"`
Sign string `yaml:"sign"`
AppKey string `yaml:"appkey"`
Enable bool `yaml:"enable"`
Intent string `yaml:"intent"`
}
}
Manager struct {
+1 -1
View File
@@ -217,7 +217,7 @@ const (
const FriendAcceptTip = "You have successfully become friends, so start chatting"
func GroupIsBanChat(status int32) bool {
if status != GroupBanChat {
if status != GroupStatusMuted {
return false
}
return true
+11
View File
@@ -14,6 +14,7 @@ const (
userMinSeq = "REDIS_USER_MIN_SEQ:"
uidPidToken = "UID_PID_TOKEN_STATUS:"
conversationReceiveMessageOpt = "CON_RECV_MSG_OPT:"
GetuiToken = "GETUI"
)
func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error) {
@@ -144,3 +145,13 @@ func (d *DataBases) GetMultiConversationMsgOpt(userID string, conversationIDs []
return m, nil
}
func (d *DataBases) SetGetuiToken(token string, expireTime int64) error {
_, err := d.Exec("SET", GetuiToken, token, "ex", expireTime)
return err
}
func (d *DataBases) GetGetuiToken() (string, error) {
result, err := redis.String(d.Exec("GET", GetuiToken))
return result, err
}
+2 -2
View File
@@ -38,6 +38,6 @@ func RespHttp200(ctx *gin.Context, err error, data interface{}) {
}
// warp error
func WrapError(err constant.ErrInfo) error {
return status.Error(codes.Code(err.ErrCode), err.ErrMsg)
func WrapError(err constant.ErrInfo, msg ...string) error {
return status.Error(codes.Code(err.ErrCode), err.ErrMsg+msg[0])
}