POST /admin/compliance/gdpr/consent
为指定用户创建一条数据处理同意记录
合规管理 - 同意 `bearerAuth` application/json
Request Body
Schema: dto.CreateConsentRequest
| Field | Type | Required | Example | Constraints | Description |
granted |
boolean |
Yes |
True |
|
是否同意 |
purpose |
string |
Yes |
marketing_communication |
|
目的 |
service |
string |
Yes |
newsletter |
|
服务 |
user_id |
string |
Yes |
usr_abc123 |
|
用户ID |
consent_method |
string |
No |
explicit |
|
同意方式 |
Referenced Schemas
dto.ConsentItem
用户同意记录
| Field | Type | Required | Example | Constraints | Description |
consent_method |
string |
No |
explicit |
|
同意方式 |
expired_at |
string |
No |
2026-04-16T14:00:00Z |
|
过期时间 |
granted |
boolean |
No |
True |
|
是否同意 |
granted_at |
string |
No |
2026-04-15T10:00:00Z |
|
同意时间 |
id |
string |
No |
consent_001 |
|
同意记录ID |
purpose |
string |
No |
marketing_communication |
|
处理目的 |
service |
string |
No |
newsletter |
|
服务名称 |
user_id |
string |
No |
usr_abc123 |
|
用户ID |
dto.ConsentItemResponse
| Field | Type | Required | Example | Constraints | Description |
code |
integer |
No |
|
|
|
data |
dto.ConsentItem |
No |
|
|
|
message |
string |
No |
|
|
|
timestamp |
string |
No |
|
|
|
dto.ErrorResponse
| Field | Type | Required | Example | Constraints | Description |
code |
integer |
No |
400 |
|
|
message |
string |
No |
invalid request |
|
|