|
|
@ -18,6 +18,7 @@ import (
|
|
|
|
func (s *userServer) DeleteUsers(_ context.Context, req *pbUser.DeleteUsersReq) (*pbUser.DeleteUsersResp, error) {
|
|
|
|
func (s *userServer) DeleteUsers(_ context.Context, req *pbUser.DeleteUsersReq) (*pbUser.DeleteUsersResp, error) {
|
|
|
|
log.InfoByKv("rpc DeleteUsers arrived server", req.OperationID, "args", req.String())
|
|
|
|
log.InfoByKv("rpc DeleteUsers arrived server", req.OperationID, "args", req.String())
|
|
|
|
var resp pbUser.DeleteUsersResp
|
|
|
|
var resp pbUser.DeleteUsersResp
|
|
|
|
|
|
|
|
var common pbUser.CommonResp
|
|
|
|
c, err := utils.ParseToken(req.Token)
|
|
|
|
c, err := utils.ParseToken(req.Token)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
log.ErrorByKv("parse token failed", req.OperationID, "err", err.Error())
|
|
|
|
log.ErrorByKv("parse token failed", req.OperationID, "err", err.Error())
|
|
|
@ -30,11 +31,12 @@ func (s *userServer) DeleteUsers(_ context.Context, req *pbUser.DeleteUsersReq)
|
|
|
|
for _, uid := range req.DeleteUidList {
|
|
|
|
for _, uid := range req.DeleteUidList {
|
|
|
|
err = im_mysql_model.UserDelete(uid)
|
|
|
|
err = im_mysql_model.UserDelete(uid)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
resp.CommonResp.ErrorCode = 201
|
|
|
|
common.ErrorCode = 201
|
|
|
|
resp.CommonResp.ErrorMsg = "some uid deleted failed"
|
|
|
|
common.ErrorMsg = "some uid deleted failed"
|
|
|
|
resp.FailedUidList = append(resp.FailedUidList, uid)
|
|
|
|
resp.FailedUidList = append(resp.FailedUidList, uid)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resp.CommonResp = &common
|
|
|
|
return &resp, nil
|
|
|
|
return &resp, nil
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|