Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/api/contact/v1/contact.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ type CreateGroupReq struct {

type CreateGroupRes struct {
api_v1.StandardRes
Data struct {
GroupId int `json:"group_id" dc:"Created Group ID"`
} `json:"data"`
}

// ImportContactsReq Import contacts request
Expand Down
7 changes: 6 additions & 1 deletion core/internal/controller/contact/contact_v1_create_group.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package contact

import (
"billionmail-core/api/contact/v1"
v1 "billionmail-core/api/contact/v1"
"billionmail-core/internal/consts"
"billionmail-core/internal/service/contact"
"billionmail-core/internal/service/public"
"context"

"github.com/gogf/gf/v2/errors/gerror"
)

Expand Down Expand Up @@ -65,6 +66,7 @@ func (c *ControllerV1) CreateGroup(ctx context.Context, req *v1.CreateGroupReq)
})

res.SetSuccess(public.LangCtx(ctx, "Group created successfully"))
res.Data.GroupId = groupId
return
}
res.Code = 400
Expand Down Expand Up @@ -103,10 +105,13 @@ func (c *ControllerV1) CreateGroup(ctx context.Context, req *v1.CreateGroupReq)
switch req.CreateType {
case 1:
res.SetSuccess(public.LangCtx(ctx, "Group created successfully"))
res.Data.GroupId = groupId
case 2:
res.SetSuccess(public.LangCtx(ctx, "Group created and contacts imported successfully"))
res.Data.GroupId = groupId
case 3:
res.SetSuccess(public.LangCtx(ctx, "Contacts imported to existing group successfully"))
res.Data.GroupId = groupId
}

return
Expand Down