Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
积分问题
daoyianf6da464f1143
diff --git a/docs/api.json b/docs/api.jsonindex 1f2d56ef..0a7a952e 100644--- a/docs/api.json+++ b/docs/api.json@@ -184,7 +184,14 @@],"responses": {"default": {- "description": ""+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PointsRecordsVo"+ }+ }+ }}},"summary": "获取我的积分记录",@@ -4765,6 +4772,204 @@]}},+ "/api/channel/interactionRecord": {+ "post": {+ "operationId": "InteractionRecordController_add",+ "parameters": [],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/AddInteractionRecordDto"+ }+ }+ }+ },+ "responses": {+ "default": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "type": "boolean"+ }+ }+ }+ }+ },+ "summary": "添加渠道互动记录",+ "tags": [+ "渠道互动记录"+ ]+ }+ },+ "/api/channel/interactionRecord/list/{pageNo}/{pageSize}": {+ "get": {+ "operationId": "InteractionRecordController_getArcCommentList",+ "parameters": [+ {+ "name": "pageNo",+ "required": true,+ "in": "path",+ "description": "页码",+ "schema": {+ "title": "页码",+ "type": "number"+ }+ },+ {+ "name": "pageSize",+ "required": true,+ "in": "path",+ "description": "页数",+ "schema": {+ "title": "页数",+ "type": "number"+ }+ }+ ],+ "responses": {+ "default": {+ "description": ""+ }+ },+ "summary": "获取渠道互动记录列表",+ "tags": [+ "渠道互动记录"+ ]+ }+ },+ "/api/channel/interactionRecord/{id}": {+ "delete": {+ "operationId": "InteractionRecordController_replyComment",+ "parameters": [+ {+ "name": "id",+ "required": true,+ "in": "path",+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "default": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "type": "boolean"+ }+ }+ }+ }+ },+ "summary": "删除记录",+ "tags": [+ "渠道互动记录"+ ]+ }+ },+ "/api/channel/replyCommentRecord": {+ "post": {+ "operationId": "ReplyCommentRecordController_add",+ "parameters": [],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/AddReplyCommentRecordDto"+ }+ }+ }+ },+ "responses": {+ "default": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "type": "boolean"+ }+ }+ }+ }+ },+ "summary": "添加评论回复记录",+ "tags": [+ "评论回复记录"+ ]+ }+ },+ "/api/channel/replyCommentRecord/list/{pageNo}/{pageSize}": {+ "get": {+ "operationId": "ReplyCommentRecordController_getArcCommentList",+ "parameters": [+ {+ "name": "pageNo",+ "required": true,+ "in": "path",+ "description": "页码",+ "schema": {+ "title": "页码",+ "type": "number"+ }+ },+ {+ "name": "pageSize",+ "required": true,+ "in": "path",+ "description": "页数",+ "schema": {+ "title": "页数",+ "type": "number"+ }+ }+ ],+ "responses": {+ "default": {+ "description": ""+ }+ },+ "summary": "获取评论回复记录列表",+ "tags": [+ "评论回复记录"+ ]+ }+ },+ "/api/channel/replyCommentRecord/{id}": {+ "delete": {+ "operationId": "ReplyCommentRecordController_replyComment",+ "parameters": [+ {+ "name": "id",+ "required": true,+ "in": "path",+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "default": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "type": "boolean"+ }+ }+ }+ }+ },+ "summary": "删除评论回复记录",+ "tags": [+ "评论回复记录"+ ]+ }+ },"/api/account/login": {"post": {"operationId": "AccountController_createOrUpdateAccount",@@ -7460,6 +7665,70 @@"type": "object","properties": {}},+ "PointsRecordsVo": {+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "type": "object",+ "properties": {+ "list": {+ "description": "积分记录列表",+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "id": {+ "description": "记录ID",+ "type": "string"+ },+ "userId": {+ "description": "用户ID",+ "type": "string"+ },+ "amount": {+ "description": "积分变动数量",+ "type": "number"+ },+ "balance": {+ "description": "变动后余额",+ "type": "number"+ },+ "type": {+ "description": "积分变动类型, ai_service ai 生成, user_register 用户注册",+ "type": "string"+ },+ "description": {+ "description": "积分变动描述",+ "type": "string"+ },+ "metadata": {+ "description": "额外信息",+ "type": "object",+ "propertyNames": {+ "type": "string"+ },+ "additionalProperties": {}+ }+ },+ "required": [+ "id",+ "userId",+ "amount",+ "balance",+ "type"+ ],+ "additionalProperties": false+ }+ },+ "total": {+ "description": "总记录数",+ "type": "number"+ }+ },+ "required": [+ "list",+ "total"+ ],+ "additionalProperties": false+ },"MailLoginDto": {"type": "object","properties": {@@ -9151,6 +9420,114 @@"pageIds"]},+ "AddInteractionRecordDto": {+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "type": "object",+ "properties": {+ "accountId": {+ "type": "string",+ "minLength": 1+ },+ "type": {+ "type": "string",+ "enum": [+ "douyin",+ "xhs",+ "wxSph",+ "KWAI",+ "youtube",+ "wxGzh",+ "bilibili",+ "twitter",+ "tiktok",+ "facebook",+ "instagram",+ "threads"+ ]+ },+ "worksId": {+ "type": "string",+ "minLength": 1+ },+ "worksTitle": {+ "type": "string"+ },+ "worksCover": {+ "type": "string"+ },+ "worksContent": {+ "type": "string"+ },+ "commentContent": {+ "type": "string"+ },+ "commentRemark": {+ "type": "string"+ },+ "commentTime": {},+ "likeTime": {},+ "collectTime": {}+ },+ "required": [+ "accountId",+ "type",+ "worksId",+ "commentTime",+ "likeTime",+ "collectTime"+ ],+ "additionalProperties": false+ },+ "AddReplyCommentRecordDto": {+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "type": "object",+ "properties": {+ "accountId": {+ "type": "string",+ "minLength": 1+ },+ "type": {+ "type": "string",+ "enum": [+ "douyin",+ "xhs",+ "wxSph",+ "KWAI",+ "youtube",+ "wxGzh",+ "bilibili",+ "twitter",+ "tiktok",+ "facebook",+ "instagram",+ "threads"+ ]+ },+ "commentId": {+ "type": "string",+ "minLength": 1+ },+ "worksId": {+ "type": "string"+ },+ "commentContent": {+ "type": "string",+ "minLength": 1+ },+ "replyContent": {+ "type": "string",+ "minLength": 1+ }+ },+ "required": [+ "accountId",+ "type",+ "commentId",+ "commentContent",+ "replyContent"+ ],+ "additionalProperties": false+ },"CreateAccountDto": {"type": "object","properties": {@@ -9463,6 +9840,10 @@"type": "number","description": "组排序,默认为 1"},+ "proxyIp": {+ "type": "string",+ "description": "代理IP"+ },"browserConfig": {"type": "object","description": "浏览器配置必须为JSON格式"@@ -9471,6 +9852,7 @@"required": ["name","rank",+ "proxyIp","browserConfig"]},@@ -9485,6 +9867,10 @@"type": "number","description": "组排序,默认为 1"},+ "proxyIp": {+ "type": "string",+ "description": "代理IP"+ },"browserConfig": {"type": "object","description": "浏览器配置必须为JSON格式"@@ -9497,6 +9883,7 @@"required": ["name","rank",+ "proxyIp","browserConfig","id"]diff --git a/src/app/[lng]/profile/page.tsx b/src/app/[lng]/profile/page.tsxindex f7720da0..9562ef15 100644--- a/src/app/[lng]/profile/page.tsx+++ b/src/app/[lng]/profile/page.tsx@@ -53,6 +53,18 @@ export default function ProfilePage() {total: 0});+ // 积分记录类型定义+ interface PointsRecord {+ id: string;+ userId: string;+ amount: number;+ balance: number;+ type: string;+ description: string;+ metadata?: any;+ createdAt?: string;+ }+// 获取会员状态和过期时间const isVip = userInfo?.vipInfo?.cycleType && userInfo.vipInfo.cycleType > 0 &&userInfo?.vipInfo?.expireTime ? new Date(userInfo.vipInfo.expireTime) > new Date() : false;@@ -164,7 +176,7 @@ export default function ProfilePage() {setPointsPagination({current: params.page,pageSize: params.pageSize,- total: paginatedData.count || 0+ total: paginatedData.total || 0});} else {message.error(response?.message || '获取积分记录失败');@@ -452,11 +464,21 @@ export default function ProfilePage() {const pointsColumns = [{title: t('points.pointsChange'),- dataIndex: 'points',- key: 'points',- render: (points: number) => (- <span style={{ color: points > 0 ? '#52c41a' : '#ff4d4f', fontWeight: 'bold' }}>- {points > 0 ? '+' : ''}{points}+ dataIndex: 'amount',+ key: 'amount',+ render: (amount: number) => (+ <span style={{ color: amount > 0 ? '#52c41a' : '#ff4d4f', fontWeight: 'bold' }}>+ {amount > 0 ? '+' : ''}{amount}+ </span>+ ),+ },+ {+ title: t('points.balance'),+ dataIndex: 'balance',+ key: 'balance',+ render: (balance: number) => (+ <span style={{ fontWeight: 'bold' }}>+ {balance}</span>),},@@ -466,6 +488,8 @@ export default function ProfilePage() {key: 'type',render: (type: string) => {const typeMap: { [key: string]: { color: string; text: string } } = {+ 'ai_service': { color: 'green', text: t('points.aiService') },+ 'user_register': { color: 'blue', text: t('points.userRegister') },'earn': { color: 'green', text: t('points.earn') },'spend': { color: 'red', text: t('points.spend') },'refund': { color: 'blue', text: t('points.refund') },@@ -481,12 +505,6 @@ export default function ProfilePage() {key: 'description',ellipsis: true,},- {- title: t('points.time'),- dataIndex: 'createdAt',- key: 'createdAt',- render: (timestamp: string) => new Date(timestamp).toLocaleString(),- },];// 个人信息内容diff --git a/src/app/i18n/locales/en/profile.json b/src/app/i18n/locales/en/profile.jsonindex 7c1a9649..e5859181 100644--- a/src/app/i18n/locales/en/profile.json+++ b/src/app/i18n/locales/en/profile.json@@ -92,6 +92,7 @@"myPoints": "My Points","pointsDescription": "View your points change history and usage","pointsChange": "Points Change",+ "balance": "Balance","changeType": "Change Type","description": "Description","time": "Time",@@ -99,6 +100,8 @@"spend": "Spend","refund": "Refund","expire": "Expire",+ "aiService": "AI Service",+ "userRegister": "User Register","noPointsRecords": "No points records","totalRecords": "{{total}} records total"}diff --git a/src/app/i18n/locales/zh-CN/profile.json b/src/app/i18n/locales/zh-CN/profile.jsonindex f6bc0ffe..f8ca8ced 100644--- a/src/app/i18n/locales/zh-CN/profile.json+++ b/src/app/i18n/locales/zh-CN/profile.json@@ -92,6 +92,7 @@"myPoints": "我的积分","pointsDescription": "查看您的积分变动记录和使用情况","pointsChange": "积分变动",+ "balance": "余额","changeType": "变动类型","description": "描述","time": "时间",@@ -99,6 +100,8 @@"spend": "消费","refund": "退还","expire": "过期",+ "aiService": "AI服务",+ "userRegister": "用户注册","noPointsRecords": "暂无积分记录","totalRecords": "共 {{total}} 条记录"}