feat: 徽章api

This commit is contained in:
Blizzard
2026-02-12 14:34:31 +08:00
parent 01e13e736c
commit 0405968597
22 changed files with 1150 additions and 62 deletions
+263 -13
View File
@@ -586,6 +586,172 @@
}
}
},
"/config/badge/add": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"徽章配置"
],
"summary": "添加徽章配置",
"parameters": [
{
"description": "添加徽章配置",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/request.CreateBadge"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/config/badge/delete": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"徽章配置"
],
"summary": "删除徽章配置",
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/config/badge/find": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"徽章配置"
],
"summary": "根据ID获取徽章配置",
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/config/badge/tree": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"徽章配置"
],
"summary": "获取徽章配置树形结构",
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/config/badge/update": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"徽章配置"
],
"summary": "更新徽章配置",
"parameters": [
{
"description": "更新参数",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/request.UpdateBadge"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/config/level/add": {
"post": {
"security": [
@@ -3058,6 +3224,48 @@
}
}
},
"request.CreateBadge": {
"type": "object",
"properties": {
"comparator": {
"type": "string"
},
"description": {
"type": "string"
},
"dimension": {
"description": "维度: EXPERTISE(专家), PERSISTENCE(勤勉), JOURNAL(记录)",
"type": "string"
},
"groupId": {
"description": "组ID: 用于前端聚合显示 (e.g. \"fertilizerMaster\")",
"type": "string"
},
"iconId": {
"type": "string"
},
"name": {
"type": "string"
},
"rewardSunlight": {
"type": "integer"
},
"sort": {
"type": "integer"
},
"targetAction": {
"description": "触发动作: ACT_FERTILIZE, ACT_WATER...",
"type": "string"
},
"threshold": {
"type": "integer"
},
"tier": {
"description": "等级: 1=铜, 2=银, 3=金",
"type": "integer"
}
}
},
"request.CreateCarePlan": {
"type": "object",
"required": [
@@ -3222,13 +3430,13 @@
"request.CreateTopic": {
"type": "object",
"properties": {
"end_time": {
"endTime": {
"type": "string"
},
"remark": {
"type": "string"
},
"start_time": {
"startTime": {
"type": "string"
},
"title": {
@@ -3575,6 +3783,54 @@
}
}
},
"request.UpdateBadge": {
"type": "object",
"required": [
"id"
],
"properties": {
"comparator": {
"type": "string"
},
"description": {
"type": "string"
},
"dimension": {
"description": "维度: EXPERTISE(专家), PERSISTENCE(勤勉), JOURNAL(记录)",
"type": "string"
},
"groupId": {
"description": "组Id: 用于前端聚合显示 (e.g. \"fertilizerMaster\")",
"type": "string"
},
"iconId": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"rewardSunlight": {
"type": "integer"
},
"sort": {
"type": "integer"
},
"targetAction": {
"description": "触发动作: ACT_FERTILIZE, ACT_WATER...",
"type": "string"
},
"threshold": {
"type": "integer"
},
"tier": {
"description": "等级: 1=铜, 2=银, 3=金",
"type": "integer"
}
}
},
"request.UpdateLevelConf": {
"type": "object",
"required": [
@@ -3672,17 +3928,8 @@
"avatarId": {
"type": "string"
},
"currentSunlight": {
"type": "integer"
},
"levelId": {
"type": "string"
},
"nickname": {
"type": "string"
},
"totalSunlight": {
"type": "integer"
}
}
},
@@ -3692,7 +3939,7 @@
"id"
],
"properties": {
"end_time": {
"endTime": {
"type": "string"
},
"id": {
@@ -3701,7 +3948,7 @@
"remark": {
"type": "string"
},
"start_time": {
"startTime": {
"type": "string"
},
"title": {
@@ -3981,6 +4228,9 @@
"parentId": {
"type": "string"
},
"path": {
"type": "string"
},
"permission": {
"type": "string"
},