Skip to content

Comments

feat(api): return group_id in contact group create response#311

Open
Aliexe-code wants to merge 1 commit intoBillionmail:devfrom
Aliexe-code:feature/return-group-id-on-create
Open

feat(api): return group_id in contact group create response#311
Aliexe-code wants to merge 1 commit intoBillionmail:devfrom
Aliexe-code:feature/return-group-id-on-create

Conversation

@Aliexe-code
Copy link

Fixes #280
Purpose
The /api/contact/group/create endpoint currently returns success without the created group ID. Users need to query the group list to get the ID, which is inconvenient for automation and API integrations.
Implementation

  • Added Data struct with group_id field to CreateGroupRes response type
  • Set res.Data.GroupId for all 3 creation types (1, 2, 3) in the controller
    Testing
  • Code compiles successfully (go build ./api/contact/v1/... ./internal/controller/contact/...)
  • Unit tests added/updated
  • Manual API testing
    API Response Example
    Before:
    {
    "code": 0,
    "message": "Group created successfully",
    "data": null
    }
    After:
    {
    code: 0,
    message: Group created successfully,
    data: {
    group_id: 123
    }
    }

- Add group_id to CreateGroupRes data field
- Return group_id for all creation types (1, 2, 3)
- Fixes Billionmail#280
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

创建分组的api返回新分组id

1 participant