feat: Add callback and exchange features, refactor care plan task generation logic, and update wiki ordering to prioritize hot items.

This commit is contained in:
Blizzard
2026-02-26 08:57:13 +08:00
parent 9d4a5c6375
commit 3f05dccdce
23 changed files with 955 additions and 56 deletions
+14
View File
@@ -0,0 +1,14 @@
package plant
import (
"github.com/gin-gonic/gin"
)
type CallbackRouter struct{}
func (s *CallbackRouter) InitCallbackRouter(Router *gin.RouterGroup) {
callbackRouter := Router.Group("callback")
{
callbackRouter.POST("mediaCheck", callbackApi.MediaCheckCallback) // 接收微信媒体检测回调
}
}
+2
View File
@@ -13,6 +13,7 @@ type RouterGroup struct {
BadgeConfigRouter
UserProfileRouter
CallbackRouter
ExchangeRouter
}
// 初始化路由
@@ -27,4 +28,5 @@ var (
userProfileApi = v1.ApiGroupApp.PlantApiGroup.UserProfileApi
badgeConfigApi = v1.ApiGroupApp.PlantApiGroup.BadgeConfigApi
callbackApi = v1.ApiGroupApp.PlantApiGroup.CallbackApi
exchangeApi = v1.ApiGroupApp.PlantApiGroup.ExchangeApi
)
+27
View File
@@ -0,0 +1,27 @@
package plant
import "github.com/gin-gonic/gin"
type ExchangeRouter struct{}
func (r *ExchangeRouter) InitExchangeRouter(Router *gin.RouterGroup) {
// ========== 用户端路由 ==========
userRouter := Router.Group("exchange")
{
userRouter.GET("list", exchangeApi.UserItemList) // 商品列表
userRouter.GET("detail", exchangeApi.UserItemDetail) // 商品详情
userRouter.POST("redeem", exchangeApi.UserExchange) // 发起兑换
userRouter.GET("orders", exchangeApi.UserOrderList) // 我的兑换记录
}
// ========== 管理端路由 ==========
adminRouter := Router.Group("exchange")
{
adminRouter.POST("item/create", exchangeApi.CreateItem) // 创建商品
adminRouter.POST("item/update", exchangeApi.UpdateItem) // 更新商品
adminRouter.POST("item/delete", exchangeApi.DeleteItem) // 删除商品
adminRouter.POST("item/list", exchangeApi.AdminItemList) // 管理端商品列表
adminRouter.POST("order/list", exchangeApi.AdminOrderList) // 管理端订单列表
adminRouter.POST("order/update", exchangeApi.UpdateOrderStatus) // 更新订单状态
}
}