feat: 迁移plant
This commit is contained in:
+263
-1
@@ -72,6 +72,11 @@ type (
|
||||
Content string `json:"content,optional"`
|
||||
ImgIds []string `json:"imgIds,optional"`
|
||||
}
|
||||
// ---------- 完成任务 ----------
|
||||
CompleteTaskApiReq {
|
||||
TaskId string `json:"taskId"`
|
||||
Remark string `json:"remark,optional"`
|
||||
}
|
||||
// ---------- 百科 ----------
|
||||
WikiListReq {
|
||||
Current int `json:"current,optional"`
|
||||
@@ -80,10 +85,44 @@ type (
|
||||
ClassId string `json:"classId,optional"`
|
||||
IsHot int `json:"isHot,optional"`
|
||||
}
|
||||
CreateWikiReq {
|
||||
Name string `json:"name"`
|
||||
LatinName string `json:"latinName,optional"`
|
||||
Aliases string `json:"aliases,optional"`
|
||||
Genus string `json:"genus,optional"`
|
||||
Difficulty int `json:"difficulty,optional"`
|
||||
IsHot int `json:"isHot,optional"`
|
||||
GrowthHabit string `json:"growthHabit,optional"`
|
||||
LightIntensity string `json:"lightIntensity,optional"`
|
||||
OptimalTempPeriod string `json:"optimalTempPeriod,optional"`
|
||||
ClassId string `json:"classId,optional"`
|
||||
DistributionArea string `json:"distributionArea,optional"`
|
||||
LifeCycle string `json:"lifeCycle,optional"`
|
||||
}
|
||||
UpdateWikiReq {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name,optional"`
|
||||
LatinName string `json:"latinName,optional"`
|
||||
Aliases string `json:"aliases,optional"`
|
||||
Genus string `json:"genus,optional"`
|
||||
Difficulty int `json:"difficulty,optional"`
|
||||
IsHot int `json:"isHot,optional"`
|
||||
GrowthHabit string `json:"growthHabit,optional"`
|
||||
LightIntensity string `json:"lightIntensity,optional"`
|
||||
OptimalTempPeriod string `json:"optimalTempPeriod,optional"`
|
||||
ClassId string `json:"classId,optional"`
|
||||
DistributionArea string `json:"distributionArea,optional"`
|
||||
LifeCycle string `json:"lifeCycle,optional"`
|
||||
}
|
||||
WikiClassReq {
|
||||
Name string `json:"name"`
|
||||
Icon string `json:"icon,optional"`
|
||||
}
|
||||
UpdateWikiClassReq {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name,optional"`
|
||||
Icon string `json:"icon,optional"`
|
||||
}
|
||||
// ---------- 帖子 ----------
|
||||
CreatePostReq {
|
||||
Title string `json:"title"`
|
||||
@@ -109,6 +148,12 @@ type (
|
||||
Icon string `json:"icon,optional"`
|
||||
Desc string `json:"desc,optional"`
|
||||
}
|
||||
UpdateTopicReq {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name,optional"`
|
||||
Icon string `json:"icon,optional"`
|
||||
Desc string `json:"desc,optional"`
|
||||
}
|
||||
// ---------- OCR ----------
|
||||
OcrReq {
|
||||
ImageUrl string `json:"imageUrl"`
|
||||
@@ -117,10 +162,37 @@ type (
|
||||
ExchangeItemListReq {
|
||||
Current int `json:"current,optional"`
|
||||
PageSize int `json:"pageSize,optional"`
|
||||
Status int `json:"status,optional"`
|
||||
}
|
||||
ExchangeOrderReq {
|
||||
ItemId string `json:"itemId"`
|
||||
}
|
||||
CreateExchangeItemReq {
|
||||
Name string `json:"name"`
|
||||
Desc string `json:"desc,optional"`
|
||||
ImgId string `json:"imgId,optional"`
|
||||
Cost int64 `json:"cost"`
|
||||
Stock int `json:"stock"`
|
||||
}
|
||||
UpdateExchangeItemReq {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name,optional"`
|
||||
Desc string `json:"desc,optional"`
|
||||
ImgId string `json:"imgId,optional"`
|
||||
Cost int64 `json:"cost,optional"`
|
||||
Stock int `json:"stock,optional"`
|
||||
Status int `json:"status,optional"`
|
||||
}
|
||||
ExchangeOrderListReq {
|
||||
Current int `json:"current,optional"`
|
||||
PageSize int `json:"pageSize,optional"`
|
||||
UserId string `json:"userId,optional"`
|
||||
Status int `json:"status,optional"`
|
||||
}
|
||||
UpdateExchangeOrderReq {
|
||||
Id string `json:"id"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
// ---------- AI ----------
|
||||
AiChatReq {
|
||||
Question string `json:"question"`
|
||||
@@ -135,11 +207,49 @@ type (
|
||||
Current int `json:"current,optional"`
|
||||
PageSize int `json:"pageSize,optional"`
|
||||
}
|
||||
CreateLevelConfigReq {
|
||||
Level int `json:"level"`
|
||||
Title string `json:"title"`
|
||||
MinSunlight int64 `json:"minSunlight"`
|
||||
Perks string `json:"perks,optional"`
|
||||
}
|
||||
UpdateLevelConfigReq {
|
||||
Id string `json:"id"`
|
||||
Level int `json:"level,optional"`
|
||||
Title string `json:"title,optional"`
|
||||
MinSunlight int64 `json:"minSunlight,optional"`
|
||||
Perks string `json:"perks,optional"`
|
||||
}
|
||||
BadgeConfigListReq {
|
||||
Current int `json:"current,optional"`
|
||||
PageSize int `json:"pageSize,optional"`
|
||||
Dimension string `json:"dimension,optional"`
|
||||
}
|
||||
CreateBadgeConfigReq {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description,optional"`
|
||||
Dimension string `json:"dimension"`
|
||||
GroupId string `json:"groupId,optional"`
|
||||
Tier int `json:"tier,optional"`
|
||||
TargetAction string `json:"targetAction"`
|
||||
Threshold int64 `json:"threshold"`
|
||||
RewardSunlight int64 `json:"rewardSunlight,optional"`
|
||||
IconId string `json:"iconId,optional"`
|
||||
Sort int `json:"sort,optional"`
|
||||
}
|
||||
UpdateBadgeConfigReq {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name,optional"`
|
||||
Description string `json:"description,optional"`
|
||||
Dimension string `json:"dimension,optional"`
|
||||
GroupId string `json:"groupId,optional"`
|
||||
Tier int `json:"tier,optional"`
|
||||
TargetAction string `json:"targetAction,optional"`
|
||||
Threshold int64 `json:"threshold,optional"`
|
||||
RewardSunlight int64 `json:"rewardSunlight,optional"`
|
||||
IconId string `json:"iconId,optional"`
|
||||
Sort int `json:"sort,optional"`
|
||||
}
|
||||
)
|
||||
|
||||
// ========== 无需鉴权 ==========
|
||||
@@ -184,6 +294,14 @@ service plant-api {
|
||||
@handler AddCarePlan
|
||||
post /my/carePlan (CarePlanReq)
|
||||
|
||||
@doc "删除养护计划"
|
||||
@handler DeleteCarePlan
|
||||
post /my/deletePlan (IdsReq)
|
||||
|
||||
@doc "今日养护任务"
|
||||
@handler GetTodayTaskList
|
||||
get /my/todayTask
|
||||
|
||||
@doc "添加养护记录"
|
||||
@handler AddCareRecord
|
||||
post /my/careRecord (CareRecordReq)
|
||||
@@ -207,6 +325,18 @@ service plant-api {
|
||||
@handler GetWikiDetail
|
||||
get /wiki/:id (IdPathReq)
|
||||
|
||||
@doc "创建百科"
|
||||
@handler CreateWiki
|
||||
post /wiki/create (CreateWikiReq)
|
||||
|
||||
@doc "更新百科"
|
||||
@handler UpdateWiki
|
||||
post /wiki/update (UpdateWikiReq)
|
||||
|
||||
@doc "删除百科"
|
||||
@handler DeleteWiki
|
||||
post /wiki/delete (IdsReq)
|
||||
|
||||
@doc "百科分类列表"
|
||||
@handler GetWikiClassList
|
||||
get /wiki/class/list
|
||||
@@ -215,6 +345,14 @@ service plant-api {
|
||||
@handler CreateWikiClass
|
||||
post /wiki/class/create (WikiClassReq)
|
||||
|
||||
@doc "更新百科分类"
|
||||
@handler UpdateWikiClass
|
||||
post /wiki/class/update (UpdateWikiClassReq)
|
||||
|
||||
@doc "删除百科分类"
|
||||
@handler DeleteWikiClass
|
||||
post /wiki/class/delete (IdsReq)
|
||||
|
||||
@doc "收藏/取消收藏百科"
|
||||
@handler ToggleWikiStar
|
||||
post /wiki/star (IdReq)
|
||||
@@ -234,6 +372,10 @@ service plant-api {
|
||||
@handler GetPostList
|
||||
post /post/list (PostListReq)
|
||||
|
||||
@doc "我的帖子"
|
||||
@handler GetMyPostList
|
||||
post /post/my (PostListReq)
|
||||
|
||||
@doc "帖子详情"
|
||||
@handler GetPostDetail
|
||||
get /post/:id (IdPathReq)
|
||||
@@ -249,6 +391,10 @@ service plant-api {
|
||||
@doc "点赞帖子"
|
||||
@handler LikePost
|
||||
post /post/like (IdReq)
|
||||
|
||||
@doc "收藏帖子"
|
||||
@handler StarPost
|
||||
post /post/star (IdReq)
|
||||
}
|
||||
|
||||
@server (
|
||||
@@ -261,10 +407,18 @@ service plant-api {
|
||||
@handler GetTopicList
|
||||
get /topic/list
|
||||
|
||||
@doc "话题详情"
|
||||
@handler GetTopicDetail
|
||||
get /topic/:id (IdPathReq)
|
||||
|
||||
@doc "创建话题"
|
||||
@handler CreateTopic
|
||||
post /topic/create (TopicReq)
|
||||
|
||||
@doc "更新话题"
|
||||
@handler UpdateTopic
|
||||
post /topic/update (UpdateTopicReq)
|
||||
|
||||
@doc "删除话题"
|
||||
@handler DeleteTopic
|
||||
post /topic/delete (IdsReq)
|
||||
@@ -279,6 +433,14 @@ service plant-api {
|
||||
@doc "OCR植物识别"
|
||||
@handler OcrClassify
|
||||
post /ocr/classify (OcrReq)
|
||||
|
||||
@doc "我的识别记录"
|
||||
@handler GetMyClassifyLog
|
||||
get /ocr/myLog
|
||||
|
||||
@doc "删除识别记录"
|
||||
@handler DeleteClassifyLog
|
||||
post /ocr/deleteLog (IdsReq)
|
||||
}
|
||||
|
||||
@server (
|
||||
@@ -291,9 +453,33 @@ service plant-api {
|
||||
@handler GetExchangeItemList
|
||||
post /exchange/list (ExchangeItemListReq)
|
||||
|
||||
@doc "兑换商品"
|
||||
@doc "创建兑换商品"
|
||||
@handler CreateExchangeItem
|
||||
post /exchange/item/create (CreateExchangeItemReq)
|
||||
|
||||
@doc "更新兑换商品"
|
||||
@handler UpdateExchangeItem
|
||||
post /exchange/item/update (UpdateExchangeItemReq)
|
||||
|
||||
@doc "删除兑换商品"
|
||||
@handler DeleteExchangeItem
|
||||
post /exchange/item/delete (IdsReq)
|
||||
|
||||
@doc "发起兑换"
|
||||
@handler CreateExchangeOrder
|
||||
post /exchange/order (ExchangeOrderReq)
|
||||
|
||||
@doc "我的兑换记录"
|
||||
@handler GetMyExchangeOrders
|
||||
post /exchange/myOrders (ExchangeOrderListReq)
|
||||
|
||||
@doc "管理端订单列表"
|
||||
@handler GetExchangeOrderList
|
||||
post /exchange/order/list (ExchangeOrderListReq)
|
||||
|
||||
@doc "更新订单状态"
|
||||
@handler UpdateExchangeOrder
|
||||
post /exchange/order/update (UpdateExchangeOrderReq)
|
||||
}
|
||||
|
||||
@server (
|
||||
@@ -309,6 +495,18 @@ service plant-api {
|
||||
@doc "聊天历史"
|
||||
@handler GetAiChatHistory
|
||||
get /ai/history
|
||||
|
||||
@doc "删除聊天历史"
|
||||
@handler DeleteAiChatHistory
|
||||
post /ai/history/delete (IdsReq)
|
||||
|
||||
@doc "清空聊天历史"
|
||||
@handler ClearAiChatHistory
|
||||
post /ai/history/clear
|
||||
|
||||
@doc "今日AI额度"
|
||||
@handler GetAiChatQuota
|
||||
get /ai/quota
|
||||
}
|
||||
|
||||
@server (
|
||||
@@ -324,6 +522,14 @@ service plant-api {
|
||||
@doc "更新用户资料"
|
||||
@handler UpdateUserProfile
|
||||
post /profile/update (UpdateProfileReq)
|
||||
|
||||
@doc "我的徽章"
|
||||
@handler GetMyBadges
|
||||
get /profile/badge
|
||||
|
||||
@doc "我的收藏"
|
||||
@handler GetMyStars
|
||||
post /profile/star (PageReq)
|
||||
}
|
||||
|
||||
@server (
|
||||
@@ -336,8 +542,64 @@ service plant-api {
|
||||
@handler GetLevelConfigList
|
||||
post /config/level/list (LevelConfigListReq)
|
||||
|
||||
@doc "创建等级配置"
|
||||
@handler CreateLevelConfig
|
||||
post /config/level/create (CreateLevelConfigReq)
|
||||
|
||||
@doc "更新等级配置"
|
||||
@handler UpdateLevelConfig
|
||||
post /config/level/update (UpdateLevelConfigReq)
|
||||
|
||||
@doc "删除等级配置"
|
||||
@handler DeleteLevelConfig
|
||||
post /config/level/delete (IdsReq)
|
||||
|
||||
@doc "徽章配置列表"
|
||||
@handler GetBadgeConfigList
|
||||
post /config/badge/list (BadgeConfigListReq)
|
||||
|
||||
@doc "创建徽章配置"
|
||||
@handler CreateBadgeConfig
|
||||
post /config/badge/create (CreateBadgeConfigReq)
|
||||
|
||||
@doc "更新徽章配置"
|
||||
@handler UpdateBadgeConfig
|
||||
post /config/badge/update (UpdateBadgeConfigReq)
|
||||
|
||||
@doc "删除徽章配置"
|
||||
@handler DeleteBadgeConfig
|
||||
post /config/badge/delete (IdsReq)
|
||||
}
|
||||
|
||||
// ========== 新增补全接口 ==========
|
||||
@server (
|
||||
prefix: /api/plant
|
||||
group: complete
|
||||
jwt: Auth
|
||||
)
|
||||
service plant-api {
|
||||
@doc "完成养护任务"
|
||||
@handler CompleteTask
|
||||
post /my/completeTask (CompleteTaskApiReq)
|
||||
|
||||
@doc "兑换商品详情"
|
||||
@handler GetExchangeItemDetail
|
||||
get /exchange/item/:id (IdPathReq)
|
||||
|
||||
@doc "等级配置详情"
|
||||
@handler GetLevelConfigDetail
|
||||
get /config/level/:id (IdPathReq)
|
||||
|
||||
@doc "徽章配置树"
|
||||
@handler GetBadgeConfigTree
|
||||
get /config/badge/tree
|
||||
|
||||
@doc "百科分类详情"
|
||||
@handler GetWikiClassDetail
|
||||
get /wiki/class/:id (IdPathReq)
|
||||
|
||||
@doc "AI聊天历史"
|
||||
@handler GetAiChatHistory
|
||||
post /ai/history (PageReq)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user