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
@@ -594,6 +594,172 @@ const docTemplate = `{
}
}
},
"/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": [
@@ -3066,6 +3232,48 @@ const docTemplate = `{
}
}
},
"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": [
@@ -3230,13 +3438,13 @@ const docTemplate = `{
"request.CreateTopic": {
"type": "object",
"properties": {
"end_time": {
"endTime": {
"type": "string"
},
"remark": {
"type": "string"
},
"start_time": {
"startTime": {
"type": "string"
},
"title": {
@@ -3583,6 +3791,54 @@ const docTemplate = `{
}
}
},
"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": [
@@ -3680,17 +3936,8 @@ const docTemplate = `{
"avatarId": {
"type": "string"
},
"currentSunlight": {
"type": "integer"
},
"levelId": {
"type": "string"
},
"nickname": {
"type": "string"
},
"totalSunlight": {
"type": "integer"
}
}
},
@@ -3700,7 +3947,7 @@ const docTemplate = `{
"id"
],
"properties": {
"end_time": {
"endTime": {
"type": "string"
},
"id": {
@@ -3709,7 +3956,7 @@ const docTemplate = `{
"remark": {
"type": "string"
},
"start_time": {
"startTime": {
"type": "string"
},
"title": {
@@ -3989,6 +4236,9 @@ const docTemplate = `{
"parentId": {
"type": "string"
},
"path": {
"type": "string"
},
"permission": {
"type": "string"
},
+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"
},
+168 -10
View File
@@ -27,6 +27,35 @@ definitions:
required:
- taskId
type: object
request.CreateBadge:
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
type: object
request.CreateCarePlan:
properties:
icon:
@@ -142,11 +171,11 @@ definitions:
type: object
request.CreateTopic:
properties:
end_time:
endTime:
type: string
remark:
type: string
start_time:
startTime:
type: string
title:
type: string
@@ -389,6 +418,39 @@ definitions:
description: 标题
type: string
type: object
request.UpdateBadge:
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
required:
- id
type: object
request.UpdateLevelConf:
properties:
id:
@@ -457,24 +519,18 @@ definitions:
properties:
avatarId:
type: string
currentSunlight:
type: integer
levelId:
type: string
nickname:
type: string
totalSunlight:
type: integer
type: object
request.UpdateTopic:
properties:
end_time:
endTime:
type: string
id:
type: integer
remark:
type: string
start_time:
startTime:
type: string
title:
type: string
@@ -671,6 +727,8 @@ definitions:
type: string
parentId:
type: string
path:
type: string
permission:
type: string
sort:
@@ -1102,6 +1160,106 @@ paths:
summary: 更新client
tags:
- 客户端管理
/config/badge/add:
post:
consumes:
- application/json
parameters:
- description: 添加徽章配置
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.CreateBadge'
produces:
- application/json
responses:
"200":
description: '{"success":true,"data":{},"msg":"添加成功"}'
schema:
type: string
security:
- BearerAuth: []
summary: 添加徽章配置
tags:
- 徽章配置
/config/badge/delete:
get:
parameters:
- description: id
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: '{"success":true,"data":{},"msg":"删除成功"}'
schema:
type: string
security:
- BearerAuth: []
summary: 删除徽章配置
tags:
- 徽章配置
/config/badge/find:
get:
parameters:
- description: id
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: '{"success":true,"data":{},"msg":"获取成功"}'
schema:
type: string
security:
- BearerAuth: []
summary: 根据ID获取徽章配置
tags:
- 徽章配置
/config/badge/tree:
get:
produces:
- application/json
responses:
"200":
description: '{"success":true,"data":{},"msg":"获取成功"}'
schema:
type: string
security:
- BearerAuth: []
summary: 获取徽章配置树形结构
tags:
- 徽章配置
/config/badge/update:
post:
consumes:
- application/json
parameters:
- description: 更新参数
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.UpdateBadge'
produces:
- application/json
responses:
"200":
description: '{"success":true,"data":{},"msg":"更新成功"}'
schema:
type: string
security:
- BearerAuth: []
summary: 更新徽章配置
tags:
- 徽章配置
/config/level/add:
post:
consumes: