Files
sundynix-plant-be/router/plant/plant_router.go
T
2026-04-27 10:43:42 +08:00

36 lines
1.2 KiB
Go

package plant
import (
"github.com/gin-gonic/gin"
)
type MyPlantRouter struct{}
func (c *MyPlantRouter) InitPlantRouter(Router *gin.RouterGroup) {
myPlantRouter := Router.Group("plant")
{
myPlantRouter.POST("add", myPlantApi.AddPlant) // 添加植物
myPlantRouter.POST("page", myPlantApi.PlantPage) // 分页获取我的植物
myPlantRouter.GET("detail", myPlantApi.PlantDetail) // 获取植物详情
myPlantRouter.POST("update", myPlantApi.UpdatePlant) // 修改植物信息(可以修改养护事项)
myPlantRouter.POST("deletePlant", myPlantApi.DeletePlants) // 删除植物
myPlantRouter.POST("deletePlan", myPlantApi.DeletePlans) // 删除计划
//养护事项
myPlantRouter.POST("/plan/add", myPlantApi.AddCarePlan) //添加养护计划
myPlantRouter.GET("/plan/delete", myPlantApi.DeletePlan) //删除事项
//任务
myPlantRouter.GET("todayTask", myPlantApi.TodayTask) // 获取今日任务
myPlantRouter.POST("completeTask", myPlantApi.CompleteTask) // 完成任务
//成长记录
myPlantRouter.POST("/growth/add", myPlantApi.AddGrowthRecord) // 添加成长记录
//快捷养护
myPlantRouter.POST("quickCare", myPlantApi.QuickCare) // 快捷养护记录
}
}