diff --git a/apps/daren_detail/daren_detail.md b/apps/daren_detail/daren_detail.md index c5482aa..01556f5 100644 --- a/apps/daren_detail/daren_detail.md +++ b/apps/daren_detail/daren_detail.md @@ -676,9 +676,9 @@ Authorization: Token "category": ["Beauty & Personal Care"], // 多选 "e_commerce_level": ["L1", "L2", "L3"], // 多选 "exposure_level": ["KOL-1", "KOC-1"], // 多选 - "platform": ["tiktok"], // 单选 + "platform": "tiktok", // 单选 "gmv_range": ["$0-$5k", "$5k-$25k"], // 多选 - "views_range": ["100, 10000"], // 单选 + "views_range": [100, 10000] // 数值数组,表示观看量范围 } } ``` @@ -687,15 +687,15 @@ Authorization: Token ### 5.3 添加达人到公有库 - **接口路径**: `POST /public/creators/add/` -- **功能**: 将达人添加到公有达人库 +- **功能**: 将达人添加到公有达人库(仅管理员可操作) - **请求方法**: POST **请求体参数**: ```json { - "creator_id": 456, // 必填 - "category": "分类", // 可选 - "remark": "备注信息" // 可选 + "creator_ids": [456, 457, 458], // 必填,支持批量添加 + "category": "分类", // 可选 + "remark": "备注信息" // 可选 } ``` @@ -703,24 +703,37 @@ Authorization: Token ```json { "code": 200, - "message": "成功添加达人到公有库", // 或"成功更新达人到公有库" + "message": "成功添加2个达人到公有库,1个达人已存在于公有库", "data": { - "creator": { - "id": 456, - "name": "达人姓名" - }, - "public_pool": { - "id": 123, - "category": "分类", - "remark": "备注信息" - } + "success_count": 2, + "failed_count": 0, + "failed_ids": [], + "existed_creators": [ + { + "id": 457, + "name": "达人姓名" + } + ], + "results": [ + { + "creator": { + "id": 456, + "name": "达人姓名" + }, + "public_pool": { + "id": 123, + "category": "分类", + "remark": "备注信息" + } + } + ] } } ``` ### 5.4 从公有库移除达人 - **接口路径**: `POST /public/creators/remove/` -- **功能**: 从公有达人库中移除达人,同时更新私有库中相关记录的状态 +- **功能**: 从公有达人库中移除达人,同时删除所有用户私有库中的相关记录(仅管理员可操作) - **请求方法**: POST **请求体参数**: @@ -742,8 +755,9 @@ Authorization: Token "name": "达人姓名" }, "removed_from_public": true, - "updated_private_relations": 3, - "note": "已更新 3 个私有库中的相关记录状态" + "deleted_private_relations": 3, + "affected_users": 2, + "note": "已删除 3 个私有库中的相关记录,影响了 2 个用户" } } ``` @@ -870,7 +884,7 @@ Authorization: Token **请求体参数**: ```json { - "pool_id": 123, // 必填 + "pool_id": 123, // 可选,不提供时使用默认私有库 "creator_id": 456, // 单个添加时使用 "creator_ids": [456, 457, 458], // 批量添加时使用 "notes": "备注信息" // 可选 @@ -893,7 +907,9 @@ Authorization: Token "already_exists_count": 2, "pool": { "id": 123, - "name": "我的收藏" + "name": "我的收藏", + "is_default": true, + "auto_created": false } } } @@ -972,15 +988,16 @@ Authorization: Token **请求体参数**: ```json { - "pool_id": 123, // 必填 + "pool_id": 123, // 可选,如果不提供则跨库筛选 "filter": { "category": ["Beauty & Personal Care"], // 多选 "e_commerce_level": ["L1", "L2", "L3"], // 多选 "exposure_level": ["KOL-1", "KOC-1"], // 多选 - "platform": ["tiktok"], // 单选 + "platform": "tiktok", // 单选 "gmv_range": ["$0-$5k", "$5k-$25k"], // 多选 - "views_range": ["100, 10000"], // 单选 - "pricing": ["100, 500"] // 单选 + "views_range": [100, 10000], // 数值数组,表示观看量范围 + "pricing": [100, 500], // 数值数组,表示价格范围 + "status": "active" // 状态过滤,可选:active, archived, public_removed } } ``` @@ -1010,7 +1027,7 @@ Authorization: Token ## 7. 搜索功能相关接口 ### 7.1 公有达人库搜索 -- **接口路径**: `GET /search/creators/` +- **接口路径**: `GET /creators/search/` - **功能**: 基于关键词搜索公有达人库中的达人,支持多关键词搜索 - **请求方法**: GET @@ -1025,55 +1042,47 @@ Authorization: Token { "code": 200, "message": "搜索成功", - "data": { - "creators": [ - { - "Creator": { - "name": "达人姓名", - "avatar": "头像URL" - }, - "Category": "Beauty & Personal Care", - "E-commerce Level": "L3", - "Exposure Level": "KOL-1", - "Followers": "125k", - "GMV": "$534k", - "Items Sold": "2.5k", - "Avg. Video Views": "85k", - "Pricing": "$200", - "Pricing Package": "套餐描述", - "# Collab": 15, - "Latest Collab.": "2024-03-15", - "E-commerce": ["TikTok Shop"], - "creator_id": 123, - "profile": "tiktok", - "public_pool_category": "公有库分类", - "public_pool_remark": "公有库备注", - "is_public": true - } - ], - "pagination": { - "current_page": 1, - "total_pages": 15, - "total_count": 150, - "has_next": true, - "has_prev": false, - "page_size": 10 - }, - "search_info": { - "query": "搜索关键词", - "keywords": ["关键词1", "关键词2"], - "search_mode": "and", - "results_count": 150, - "search_applied": true, - "supports_single_char": true, - "search_scope": "public_only" + "data": [ + { + "public_id": 123, + "creator_id": 456, + "name": "达人姓名", + "avatar": "头像URL", + "category": "Beauty & Personal Care", + "e_commerce_level": "L3", + "exposure_level": "KOL-1", + "platform": "tiktok", + "followers": "125k", + "gmv": "$534k", + "avg_video_views": "85k", + "pricing": "$200", + "pricing_package": "套餐描述", + "collab_count": 15, + "remark": "公有库备注", + "category_public": "公有库分类" } + ], + "pagination": { + "current_page": 1, + "total_pages": 15, + "total_count": 150, + "has_next": true, + "has_prev": false + }, + "search_info": { + "query": "搜索关键词", + "keywords": ["关键词1", "关键词2"], + "search_mode": "and", + "results_count": 150, + "search_applied": true, + "supports_single_char": true, + "search_scope": "public_only" } } ``` ### 7.2 私有达人库搜索 -- **接口路径**: `GET /search/private/creators/` +- **接口路径**: `GET /private/creators/search/` - **功能**: 基于关键词搜索用户私有达人库中的达人,支持多关键词搜索 - **请求方法**: GET @@ -1089,56 +1098,89 @@ Authorization: Token { "code": 200, "message": "搜索成功", - "data": { - "creators": [ - { - "Creator": { - "name": "达人姓名", - "avatar": "头像URL" - }, - "Category": "Beauty & Personal Care", - "E-commerce Level": "L3", - "Exposure Level": "KOL-1", - "Followers": "125k", - "GMV": "$534k", - "Items Sold": "2.5k", - "Avg. Video Views": "85k", - "Pricing": "$200", - "Pricing Package": "套餐描述", - "# Collab": 15, - "Latest Collab.": "2024-03-15", - "E-commerce": ["TikTok Shop"], - "creator_id": 123, - "profile": "tiktok", - "private_pool": { - "id": 456, - "name": "我的收藏", - "is_default": true - }, - "notes": "私有库中的笔记", - "status": "active", - "relation_id": 789, - "is_private": true - } - ], - "pagination": { - "current_page": 1, - "total_pages": 3, - "total_count": 25, - "has_next": true, - "has_prev": false, - "page_size": 10 - }, - "search_info": { - "query": "搜索关键词", - "keywords": ["关键词1", "关键词2"], - "search_mode": "and", - "results_count": 25, - "search_applied": true, - "supports_single_char": true, - "search_scope": "private_only", - "pool_id": "456" + "data": [ + { + "relation_id": 789, + "creator_id": 456, + "name": "达人姓名", + "avatar": "头像URL", + "category": "Beauty & Personal Care", + "e_commerce_level": "L3", + "exposure_level": "KOL-1", + "platform": "tiktok", + "followers": "125k", + "gmv": "$534k", + "avg_video_views": "85k", + "pricing": "$200", + "collab_count": 15, + "notes": "私有库备注", + "status": "active", + "added_from_public": true, + "added_at": "2024-03-15", + "is_public_removed": false, + "status_note": null, + "pool_name": "私有库名称" } + ], + "pagination": { + "current_page": 1, + "total_pages": 3, + "total_count": 25, + "has_next": true, + "has_prev": false + }, + "search_info": { + "query": "搜索关键词", + "keywords": ["关键词1", "关键词2"], + "search_mode": "and", + "results_count": 25, + "search_applied": true, + "supports_single_char": true, + "search_scope": "private_only", + "is_deduplicated": true + } +} +``` + +### 7.3 获取品牌合作活动列表 +- **接口路径**: `GET /brand/campaigns/` +- **功能**: 获取品牌合作活动列表,必须指定达人ID +- **请求方法**: GET + +**URL参数**: +- `creator_id`: 达人ID(必填) +- `brand_id`: 品牌ID(可选,用于过滤特定品牌) +- `status`: 状态(可选,用于过滤特定状态) +- `page`: 页码,默认为1 +- `page_size`: 每页数量,默认为10 + +**响应格式**: +```json +{ + "code": 200, + "message": "获取成功", + "data": [ + { + "brand": { + "id": "U", + "name": "品牌名称", + "first_letter": "U" + }, + "pricing_detail": "$80", + "start_date": "05/31/2024", + "end_date": "05/29/2024", + "status": "completed", + "gmv_achieved": "$120", + "views_achieved": "650", + "video_link": "视频链接" + } + ], + "pagination": { + "current_page": 1, + "total_pages": 5, + "total_count": 45, + "has_next": true, + "has_prev": false } } ``` @@ -1147,7 +1189,7 @@ Authorization: Token ### 筛选达人示例 ```bash -curl -X POST "https://api.example.com/creators/filter/?page=1" \ +curl -X POST "https://api.example.com/public/creators/filter/?page=1" \ -H "Authorization: Token your_token_here" \ -H "Content-Type: application/json" \ -d '{ @@ -1183,4 +1225,4 @@ curl -X POST "https://api.example.com/creators/metrics/update/" \ "avg_likes": 2500 } }' -``` +``` \ No newline at end of file