|
|
@@ -2,20 +2,45 @@ package api |
|
|
|
|
|
|
|
import ( |
|
|
|
"context" |
|
|
|
"encoding/json" |
|
|
|
"errors" |
|
|
|
"gim/internal/business/app" |
|
|
|
comm "gim/internal/business/comm" |
|
|
|
"gim/internal/business/comm/utils" |
|
|
|
"gim/internal/business/domain/user/repo" |
|
|
|
friend2 "gim/internal/logic/domain/friend" |
|
|
|
"gim/internal/logic/domain/group/model" |
|
|
|
repo2 "gim/internal/logic/domain/group/repo" |
|
|
|
"gim/internal/logic/domain/message/service" |
|
|
|
"gim/pkg/grpclib" |
|
|
|
"gim/pkg/pb" |
|
|
|
"strconv" |
|
|
|
"time" |
|
|
|
) |
|
|
|
|
|
|
|
type BusinessExtServer struct{} |
|
|
|
|
|
|
|
func (s *BusinessExtServer) ComplainGroup(ctx context.Context, req *pb.ComplainGroupReq) (*pb.Empty, error) { |
|
|
|
now := time.Now() |
|
|
|
userId, _, err := grpclib.GetCtxData(ctx) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
imageList, _ := json.Marshal(req.ImageList) |
|
|
|
groupComplain := model.GroupComplain{ |
|
|
|
GroupId: req.GroupId, |
|
|
|
UserId: userId, |
|
|
|
ComplainType: int(req.ComplainType), |
|
|
|
Text: req.Text, |
|
|
|
ImageList: string(imageList), |
|
|
|
Status: 0, |
|
|
|
CreateTime: now, |
|
|
|
UpdateTime: now, |
|
|
|
} |
|
|
|
|
|
|
|
return new(pb.Empty), repo2.GroupComplainDao.Save(&groupComplain) |
|
|
|
} |
|
|
|
|
|
|
|
func (s *BusinessExtServer) IsFriends(ctx context.Context, req *pb.IsFriendsReq) (*pb.IsFriendsResp, error) { |
|
|
|
masterId, err := grpclib.GetCtxMasterId(ctx) |
|
|
|
if err != nil { |
|
|
|