diff --git a/app/auth/api/etc/auth-api.yaml b/app/auth/api/etc/auth-api.yaml index 30b79d0..a9be3c0 100644 --- a/app/auth/api/etc/auth-api.yaml +++ b/app/auth/api/etc/auth-api.yaml @@ -16,6 +16,13 @@ SystemRpc: - 192.168.100.127:2379 Key: system.rpc +# 各业务 RPC(新增小程序时在此追加) +PlantRpc: + Etcd: + Hosts: + - 192.168.100.127:2379 + Key: plant.rpc + # Redis(验证码存储,DB2) Redis: Host: 192.168.100.127:6379 diff --git a/app/auth/api/internal/config/config.go b/app/auth/api/internal/config/config.go index bdb7a31..46e9660 100644 --- a/app/auth/api/internal/config/config.go +++ b/app/auth/api/internal/config/config.go @@ -12,7 +12,10 @@ type Config struct { AccessExpire int64 } SystemRpc zrpc.RpcClientConf - Redis struct { + // 各业务 RPC(可选,新增小程序时在此追加) + PlantRpc zrpc.RpcClientConf `json:",optional"` + // RadioRpc zrpc.RpcClientConf `json:",optional"` // 待接入 + Redis struct { Host string Pass string DB int `json:",optional"` diff --git a/app/auth/api/internal/handler/auth/miniLoginHandler.go b/app/auth/api/internal/handler/auth/miniLoginHandler.go index 6f2b0dc..c61015a 100644 --- a/app/auth/api/internal/handler/auth/miniLoginHandler.go +++ b/app/auth/api/internal/handler/auth/miniLoginHandler.go @@ -22,6 +22,12 @@ func MiniLoginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return } + // 从请求头读取 clientId,优先级高于 body + // 前端统一在请求头设置 X-Client-Id: plant_mini / radio_mini 等 + if clientId := r.Header.Get("X-Client-Id"); clientId != "" { + req.ClientId = clientId + } + l := auth.NewMiniLoginLogic(r.Context(), svcCtx) resp, err := l.MiniLogin(&req) if err != nil { diff --git a/app/auth/api/internal/logic/auth/miniLoginLogic.go b/app/auth/api/internal/logic/auth/miniLoginLogic.go index ffaee44..cfbaf3f 100644 --- a/app/auth/api/internal/logic/auth/miniLoginLogic.go +++ b/app/auth/api/internal/logic/auth/miniLoginLogic.go @@ -13,11 +13,24 @@ import ( "sundynix-micro-go/app/auth/api/internal/svc" "sundynix-micro-go/app/auth/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" sysPb "sundynix-micro-go/app/system/rpc/system" "github.com/zeromicro/go-zero/core/logx" ) +// clientId 常量 — 新增小程序时在此添加 +const ( + ClientIdPlant = "sundynix-plant" // 植物小程序 + // ClientIdRadio = "radio_mini" // 电台小程序(待接入) +) + +// MiniAppAdditionalInfo 小程序客户端扩展信息(存储在 additional_info JSON 字段中) +type MiniAppAdditionalInfo struct { + AppId string `json:"appId"` + AppSecret string `json:"appSecret"` +} + type MiniLoginLogic struct { logx.Logger ctx context.Context @@ -43,14 +56,30 @@ type WxCode2SessionResp struct { } func (l *MiniLoginLogic) MiniLogin(req *types.MiniLoginReq) (resp *types.LoginResp, err error) { - // 1. 调用微信接口获取openid和session_key - // TODO: 从配置中获取AppId和AppSecret,当前先用固定值 - appID := "wxb463820bf36dd5d6" - appSecret := "731784a74c76c6d31fa00bb847af2c7d" + // 1. 根据 clientId 查询客户端配置,从 additional_info 中动态读取 appId/appSecret + clientResp, err := l.svcCtx.SystemRpc.GetClientById(l.ctx, &sysPb.GetClientByIdReq{ + ClientId: req.ClientId, + }) + if err != nil { + l.Errorf("[MiniLogin] 查询客户端失败: clientId=%s, err=%v", req.ClientId, err) + return nil, fmt.Errorf("无效的客户端: %s", req.ClientId) + } + // 2. 解析 additional_info 获取微信凭证 + var miniInfo MiniAppAdditionalInfo + if err = json.Unmarshal([]byte(clientResp.Client.AdditionalInfo), &miniInfo); err != nil { + l.Errorf("[MiniLogin] 解析客户端 additional_info 失败: clientId=%s, info=%s, err=%v", + req.ClientId, clientResp.Client.AdditionalInfo, err) + return nil, fmt.Errorf("客户端配置格式错误,请检查 additional_info") + } + if miniInfo.AppId == "" || miniInfo.AppSecret == "" { + return nil, fmt.Errorf("客户端 %s 未配置 appId 或 appSecret", req.ClientId) + } + + // 3. 调用微信 code2session 接口 params := url.Values{} - params.Set("appid", appID) - params.Set("secret", appSecret) + params.Set("appid", miniInfo.AppId) + params.Set("secret", miniInfo.AppSecret) params.Set("js_code", req.Code) params.Set("grant_type", "authorization_code") fullURL := "https://api.weixin.qq.com/sns/jscode2session?" + params.Encode() @@ -83,7 +112,7 @@ func (l *MiniLoginLogic) MiniLogin(req *types.MiniLoginReq) (resp *types.LoginRe return nil, fmt.Errorf("openid为空") } - // 2. 通过 user-rpc 创建或获取用户 + // 4. 通过 system-rpc 创建或获取基础用户 createResp, err := l.svcCtx.SystemRpc.CreateUser(l.ctx, &sysPb.CreateUserReq{ Name: "", OpenId: wxResp.Openid, @@ -95,7 +124,33 @@ func (l *MiniLoginLogic) MiniLogin(req *types.MiniLoginReq) (resp *types.LoginRe return nil, fmt.Errorf("登录失败") } - // 3. 生成JWT Token(复用统一的 generateToken 函数) + userId := createResp.User.Id + + // 5. 异步初始化各业务服务的用户扩展表 + // 新增小程序:在 switch 里加一个 case 即可 + go func(uid, clientId string) { + bgCtx := context.Background() + switch clientId { + case ClientIdPlant: + if l.svcCtx.PlantRpc == nil { + l.Errorf("[MiniLogin] PlantRpc 未配置,跳过 plant profile 初始化") + return + } + if _, err := l.svcCtx.PlantRpc.GetUserProfile(bgCtx, &plantPb.GetProfileReq{ + UserId: uid, + }); err != nil { + l.Errorf("[MiniLogin] 初始化 plant profile 失败: userId=%s, err=%v", uid, err) + } else { + l.Infof("[MiniLogin] plant profile 初始化成功: userId=%s", uid) + } + // case ClientIdRadio: + // l.svcCtx.RadioRpc.GetUserProfile(bgCtx, &radioPb.GetProfileReq{UserId: uid}) + default: + // 未知 clientId 或无需扩展表的场景,跳过 + } + }(userId, req.ClientId) + + // 6. 生成JWT Token token, err := generateToken(l.svcCtx.Config.Auth.AccessSecret, l.svcCtx.Config.Auth.AccessExpire, createResp.User) if err != nil { l.Errorf("生成Token失败: %v", err) diff --git a/app/auth/api/internal/svc/serviceContext.go b/app/auth/api/internal/svc/serviceContext.go index dfe127b..72c5325 100644 --- a/app/auth/api/internal/svc/serviceContext.go +++ b/app/auth/api/internal/svc/serviceContext.go @@ -2,6 +2,7 @@ package svc import ( "sundynix-micro-go/app/auth/api/internal/config" + "sundynix-micro-go/app/plant/rpc/plantservice" "sundynix-micro-go/app/system/rpc/systemservice" "sundynix-micro-go/common/utils/captcha" @@ -13,6 +14,9 @@ import ( type ServiceContext struct { Config config.Config SystemRpc systemservice.SystemService + // 各业务 RPC(可选,新增小程序时在此追加) + PlantRpc plantservice.PlantService + // RadioRpc radioservice.RadioService } func NewServiceContext(c config.Config) *ServiceContext { @@ -25,8 +29,16 @@ func NewServiceContext(c config.Config) *ServiceContext { captcha.InitWithRedis(rdb) logx.Infof("验证码存储已切换至 Redis (DB%d)", c.Redis.DB) - return &ServiceContext{ + svc := &ServiceContext{ Config: c, SystemRpc: systemservice.NewSystemService(zrpc.MustNewClient(c.SystemRpc)), } + + // 可选: PlantRpc(配置了才连接,避免强依赖) + if c.PlantRpc.Etcd.Key != "" || len(c.PlantRpc.Endpoints) > 0 { + svc.PlantRpc = plantservice.NewPlantService(zrpc.MustNewClient(c.PlantRpc)) + logx.Info("PlantRpc 已连接") + } + + return svc } diff --git a/app/plant/api/etc/plant-api.yaml b/app/plant/api/etc/plant-api.yaml index f3ccc9e..f00e684 100644 --- a/app/plant/api/etc/plant-api.yaml +++ b/app/plant/api/etc/plant-api.yaml @@ -6,7 +6,7 @@ Host: 0.0.0.0 Port: 9004 Auth: - AccessSecret: sundynix-jwt-secret-2024 + AccessSecret: 9149f2eb-d517-4a50-a03a-231dbcf0d872 AccessExpire: 604800 PlantRpc: @@ -19,10 +19,32 @@ UserRpc: Etcd: Hosts: - 192.168.100.127:2379 - Key: user.rpc + Key: system.rpc FileRpc: Etcd: Hosts: - 192.168.100.127:2379 Key: file.rpc + +DB: + DataSource: root:root@tcp(192.168.100.127:3307)/sundynix_micro_go?charset=utf8mb4&parseTime=True&loc=Local + +# 百度 AI 植物识别(可选,未配置时 OCR 接口返回错误提示) +BaiduOcr: + ApiKey: hpBfjwy8ifv3qswYGYjUCNKN + SecretKey: i5aXZdM4XZVuDroBslL0f3uIuwbAyXFS + +# OpenAI-compatible AI/RAG 配置。未配置 ChatApiUrl/ChatApiKey 时,AI 问答返回明确错误。 +Ai: + ChatApiUrl: + ChatApiKey: + ChatModelName: + EmbeddingApiUrl: + EmbeddingApiKey: + EmbeddingModelName: + QdrantUrl: + QdrantApiKey: + QdrantCollection: + VectorDimension: 0 + DailyQuota: 20 diff --git a/app/plant/api/internal/config/config.go b/app/plant/api/internal/config/config.go index a40d2b8..b187fd7 100644 --- a/app/plant/api/internal/config/config.go +++ b/app/plant/api/internal/config/config.go @@ -1,6 +1,3 @@ -// Code scaffolded by goctl. Safe to edit. -// goctl 1.10.1 - package config import ( @@ -17,4 +14,25 @@ type Config struct { PlantRpc zrpc.RpcClientConf UserRpc zrpc.RpcClientConf FileRpc zrpc.RpcClientConf + DB struct { + DataSource string + } + // 百度 OCR 植物识别 + BaiduOcr struct { + ApiKey string + SecretKey string + } `json:",optional"` + Ai struct { + ChatApiUrl string `json:",optional"` + ChatApiKey string `json:",optional"` + ChatModelName string `json:",optional"` + EmbeddingApiUrl string `json:",optional"` + EmbeddingApiKey string `json:",optional"` + EmbeddingModelName string `json:",optional"` + QdrantUrl string `json:",optional"` + QdrantApiKey string `json:",optional"` + QdrantCollection string `json:",optional"` + VectorDimension int `json:",optional"` + DailyQuota int64 `json:",optional"` + } `json:",optional"` } diff --git a/app/plant/api/internal/handler/ai/aiChatHandler.go b/app/plant/api/internal/handler/ai/aiChatHandler.go index e4f0a61..6da5aaf 100644 --- a/app/plant/api/internal/handler/ai/aiChatHandler.go +++ b/app/plant/api/internal/handler/ai/aiChatHandler.go @@ -23,11 +23,11 @@ func AiChatHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { } l := ai.NewAiChatLogic(r.Context(), svcCtx) - err := l.AiChat(&req) + resp, err := l.AiChat(&req) if err != nil { response.Fail(w, err.Error()) } else { - response.Ok(w) + response.OkWithData(w, map[string]string{"answer": resp}) } } } diff --git a/app/plant/api/internal/handler/ai/clearaichathistoryhandler.go b/app/plant/api/internal/handler/ai/clearaichathistoryhandler.go new file mode 100644 index 0000000..51f24ef --- /dev/null +++ b/app/plant/api/internal/handler/ai/clearaichathistoryhandler.go @@ -0,0 +1,25 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package ai + +import ( + "net/http" + + "sundynix-micro-go/app/plant/api/internal/logic/ai" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/common/response" +) + +// 清空聊天历史 +func ClearAiChatHistoryHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := ai.NewClearAiChatHistoryLogic(r.Context(), svcCtx) + err := l.ClearAiChatHistory() + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/ai/deleteaichathistoryhandler.go b/app/plant/api/internal/handler/ai/deleteaichathistoryhandler.go new file mode 100644 index 0000000..55667f1 --- /dev/null +++ b/app/plant/api/internal/handler/ai/deleteaichathistoryhandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package ai + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/ai" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 删除聊天历史 +func DeleteAiChatHistoryHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.IdsReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := ai.NewDeleteAiChatHistoryLogic(r.Context(), svcCtx) + err := l.DeleteAiChatHistory(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/ai/getAiChatHistoryHandler.go b/app/plant/api/internal/handler/ai/getAiChatHistoryHandler.go index f85a869..9498172 100644 --- a/app/plant/api/internal/handler/ai/getAiChatHistoryHandler.go +++ b/app/plant/api/internal/handler/ai/getAiChatHistoryHandler.go @@ -15,11 +15,11 @@ import ( func GetAiChatHistoryHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { l := ai.NewGetAiChatHistoryLogic(r.Context(), svcCtx) - err := l.GetAiChatHistory() + resp, err := l.GetAiChatHistory() if err != nil { response.Fail(w, err.Error()) } else { - response.Ok(w) + response.OkWithData(w, resp) } } } diff --git a/app/plant/api/internal/handler/ai/getaichatquotahandler.go b/app/plant/api/internal/handler/ai/getaichatquotahandler.go new file mode 100644 index 0000000..554f3c5 --- /dev/null +++ b/app/plant/api/internal/handler/ai/getaichatquotahandler.go @@ -0,0 +1,20 @@ +package ai + +import ( + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/ai" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/common/response" +) + +func GetAiChatQuotaHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := ai.NewGetAiChatQuotaLogic(r.Context(), svcCtx) + resp, err := l.GetAiChatQuota() + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/banner/createBannerHandler.go b/app/plant/api/internal/handler/banner/createBannerHandler.go new file mode 100644 index 0000000..7c6182a --- /dev/null +++ b/app/plant/api/internal/handler/banner/createBannerHandler.go @@ -0,0 +1,29 @@ +package banner + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/banner" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 创建Banner +func CreateBannerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreateBannerReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + l := banner.NewCreateBannerLogic(r.Context(), svcCtx) + err := l.CreateBanner(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/banner/deleteBannerHandler.go b/app/plant/api/internal/handler/banner/deleteBannerHandler.go new file mode 100644 index 0000000..8c11239 --- /dev/null +++ b/app/plant/api/internal/handler/banner/deleteBannerHandler.go @@ -0,0 +1,29 @@ +package banner + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/banner" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 删除Banner +func DeleteBannerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.IdReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + l := banner.NewDeleteBannerLogic(r.Context(), svcCtx) + err := l.DeleteBanner(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/banner/getActiveBannerListHandler.go b/app/plant/api/internal/handler/banner/getActiveBannerListHandler.go new file mode 100644 index 0000000..b1b413b --- /dev/null +++ b/app/plant/api/internal/handler/banner/getActiveBannerListHandler.go @@ -0,0 +1,22 @@ +package banner + +import ( + "net/http" + + "sundynix-micro-go/app/plant/api/internal/logic/banner" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/common/response" +) + +// 启用的Banner列表(客户端) +func GetActiveBannerListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := banner.NewGetActiveBannerListLogic(r.Context(), svcCtx) + resp, err := l.GetActiveBannerList() + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/banner/getBannerListHandler.go b/app/plant/api/internal/handler/banner/getBannerListHandler.go new file mode 100644 index 0000000..feb2350 --- /dev/null +++ b/app/plant/api/internal/handler/banner/getBannerListHandler.go @@ -0,0 +1,29 @@ +package banner + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/banner" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// Banner列表 +func GetBannerListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.BannerListReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + l := banner.NewGetBannerListLogic(r.Context(), svcCtx) + resp, err := l.GetBannerList(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/banner/updateBannerHandler.go b/app/plant/api/internal/handler/banner/updateBannerHandler.go new file mode 100644 index 0000000..a9ef645 --- /dev/null +++ b/app/plant/api/internal/handler/banner/updateBannerHandler.go @@ -0,0 +1,29 @@ +package banner + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/banner" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 更新Banner +func UpdateBannerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdateBannerReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + l := banner.NewUpdateBannerLogic(r.Context(), svcCtx) + err := l.UpdateBanner(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/callback/wechatPayCallbackHandler.go b/app/plant/api/internal/handler/callback/wechatPayCallbackHandler.go index 6eb1bd7..5ec9782 100644 --- a/app/plant/api/internal/handler/callback/wechatPayCallbackHandler.go +++ b/app/plant/api/internal/handler/callback/wechatPayCallbackHandler.go @@ -8,18 +8,21 @@ import ( "sundynix-micro-go/app/plant/api/internal/logic/callback" "sundynix-micro-go/app/plant/api/internal/svc" - "sundynix-micro-go/common/response" ) // 微信支付回调 +// 注意:微信要求必须返回 200 OK,否则会持续重试,此处不走统一 response 包装 func WechatPayCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { l := callback.NewWechatPayCallbackLogic(r.Context(), svcCtx) - err := l.WechatPayCallback() - if err != nil { - response.Fail(w, err.Error()) - } else { - response.Ok(w) + if err := l.WechatPayCallback(r); err != nil { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusBadRequest) + _, _ = w.Write([]byte(`{"code":"FAIL","message":"处理失败"}`)) + return } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte(`{"code":"SUCCESS","message":"成功"}`)) } } diff --git a/app/plant/api/internal/handler/complete/completetaskhandler.go b/app/plant/api/internal/handler/complete/completetaskhandler.go new file mode 100644 index 0000000..b96ac93 --- /dev/null +++ b/app/plant/api/internal/handler/complete/completetaskhandler.go @@ -0,0 +1,27 @@ +package complete + +import ( + "github.com/zeromicro/go-zero/rest/httpx" + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/complete" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +func CompleteTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CompleteTaskApiReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + l := complete.NewCompleteTaskLogic(r.Context(), svcCtx) + resp, err := l.CompleteTask(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/complete/getaichathistoryhandler.go b/app/plant/api/internal/handler/complete/getaichathistoryhandler.go new file mode 100644 index 0000000..290ded1 --- /dev/null +++ b/app/plant/api/internal/handler/complete/getaichathistoryhandler.go @@ -0,0 +1,27 @@ +package complete + +import ( + "github.com/zeromicro/go-zero/rest/httpx" + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/complete" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +func GetAiChatHistoryHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.PageReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + l := complete.NewGetAiChatHistoryLogic(r.Context(), svcCtx) + resp, err := l.GetAiChatHistory(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/complete/getbadgeconfigtreehandler.go b/app/plant/api/internal/handler/complete/getbadgeconfigtreehandler.go new file mode 100644 index 0000000..32544ba --- /dev/null +++ b/app/plant/api/internal/handler/complete/getbadgeconfigtreehandler.go @@ -0,0 +1,20 @@ +package complete + +import ( + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/complete" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/common/response" +) + +func GetBadgeConfigTreeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := complete.NewGetBadgeConfigTreeLogic(r.Context(), svcCtx) + resp, err := l.GetBadgeConfigTree() + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/complete/getexchangeitemdetailhandler.go b/app/plant/api/internal/handler/complete/getexchangeitemdetailhandler.go new file mode 100644 index 0000000..090e2be --- /dev/null +++ b/app/plant/api/internal/handler/complete/getexchangeitemdetailhandler.go @@ -0,0 +1,27 @@ +package complete + +import ( + "github.com/zeromicro/go-zero/rest/httpx" + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/complete" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +func GetExchangeItemDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.IdPathReq + if err := httpx.ParsePath(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + l := complete.NewGetExchangeItemDetailLogic(r.Context(), svcCtx) + resp, err := l.GetExchangeItemDetail(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/complete/getlevelconfigdetailhandler.go b/app/plant/api/internal/handler/complete/getlevelconfigdetailhandler.go new file mode 100644 index 0000000..8987637 --- /dev/null +++ b/app/plant/api/internal/handler/complete/getlevelconfigdetailhandler.go @@ -0,0 +1,27 @@ +package complete + +import ( + "github.com/zeromicro/go-zero/rest/httpx" + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/complete" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +func GetLevelConfigDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.IdPathReq + if err := httpx.ParsePath(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + l := complete.NewGetLevelConfigDetailLogic(r.Context(), svcCtx) + resp, err := l.GetLevelConfigDetail(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/complete/getwikiclassdetailhandler.go b/app/plant/api/internal/handler/complete/getwikiclassdetailhandler.go new file mode 100644 index 0000000..671c518 --- /dev/null +++ b/app/plant/api/internal/handler/complete/getwikiclassdetailhandler.go @@ -0,0 +1,27 @@ +package complete + +import ( + "github.com/zeromicro/go-zero/rest/httpx" + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/complete" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +func GetWikiClassDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.IdPathReq + if err := httpx.ParsePath(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + l := complete.NewGetWikiClassDetailLogic(r.Context(), svcCtx) + resp, err := l.GetWikiClassDetail(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/config/createbadgeconfighandler.go b/app/plant/api/internal/handler/config/createbadgeconfighandler.go new file mode 100644 index 0000000..a8ab770 --- /dev/null +++ b/app/plant/api/internal/handler/config/createbadgeconfighandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package config + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/config" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 创建徽章配置 +func CreateBadgeConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreateBadgeConfigReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := config.NewCreateBadgeConfigLogic(r.Context(), svcCtx) + err := l.CreateBadgeConfig(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/config/createlevelconfighandler.go b/app/plant/api/internal/handler/config/createlevelconfighandler.go new file mode 100644 index 0000000..e505e5e --- /dev/null +++ b/app/plant/api/internal/handler/config/createlevelconfighandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package config + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/config" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 创建等级配置 +func CreateLevelConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreateLevelConfigReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := config.NewCreateLevelConfigLogic(r.Context(), svcCtx) + err := l.CreateLevelConfig(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/config/deletebadgeconfighandler.go b/app/plant/api/internal/handler/config/deletebadgeconfighandler.go new file mode 100644 index 0000000..949e7d6 --- /dev/null +++ b/app/plant/api/internal/handler/config/deletebadgeconfighandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package config + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/config" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 删除徽章配置 +func DeleteBadgeConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.IdsReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := config.NewDeleteBadgeConfigLogic(r.Context(), svcCtx) + err := l.DeleteBadgeConfig(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/config/deletelevelconfighandler.go b/app/plant/api/internal/handler/config/deletelevelconfighandler.go new file mode 100644 index 0000000..42beea2 --- /dev/null +++ b/app/plant/api/internal/handler/config/deletelevelconfighandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package config + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/config" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 删除等级配置 +func DeleteLevelConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.IdsReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := config.NewDeleteLevelConfigLogic(r.Context(), svcCtx) + err := l.DeleteLevelConfig(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/config/getBadgeConfigListHandler.go b/app/plant/api/internal/handler/config/getBadgeConfigListHandler.go index f7cdac2..e643f1a 100644 --- a/app/plant/api/internal/handler/config/getBadgeConfigListHandler.go +++ b/app/plant/api/internal/handler/config/getBadgeConfigListHandler.go @@ -23,11 +23,11 @@ func GetBadgeConfigListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { } l := config.NewGetBadgeConfigListLogic(r.Context(), svcCtx) - err := l.GetBadgeConfigList(&req) + resp, err := l.GetBadgeConfigList(&req) if err != nil { response.Fail(w, err.Error()) } else { - response.Ok(w) + response.OkWithData(w, resp) } } } diff --git a/app/plant/api/internal/handler/config/getLevelConfigListHandler.go b/app/plant/api/internal/handler/config/getLevelConfigListHandler.go index ff8dd5c..83222a8 100644 --- a/app/plant/api/internal/handler/config/getLevelConfigListHandler.go +++ b/app/plant/api/internal/handler/config/getLevelConfigListHandler.go @@ -23,11 +23,11 @@ func GetLevelConfigListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { } l := config.NewGetLevelConfigListLogic(r.Context(), svcCtx) - err := l.GetLevelConfigList(&req) + resp, err := l.GetLevelConfigList(&req) if err != nil { response.Fail(w, err.Error()) } else { - response.Ok(w) + response.OkWithData(w, resp) } } } diff --git a/app/plant/api/internal/handler/config/updatebadgeconfighandler.go b/app/plant/api/internal/handler/config/updatebadgeconfighandler.go new file mode 100644 index 0000000..36f44b0 --- /dev/null +++ b/app/plant/api/internal/handler/config/updatebadgeconfighandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package config + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/config" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 更新徽章配置 +func UpdateBadgeConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdateBadgeConfigReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := config.NewUpdateBadgeConfigLogic(r.Context(), svcCtx) + err := l.UpdateBadgeConfig(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/config/updatelevelconfighandler.go b/app/plant/api/internal/handler/config/updatelevelconfighandler.go new file mode 100644 index 0000000..a9d7574 --- /dev/null +++ b/app/plant/api/internal/handler/config/updatelevelconfighandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package config + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/config" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 更新等级配置 +func UpdateLevelConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdateLevelConfigReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := config.NewUpdateLevelConfigLogic(r.Context(), svcCtx) + err := l.UpdateLevelConfig(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/exchange/createexchangeitemhandler.go b/app/plant/api/internal/handler/exchange/createexchangeitemhandler.go new file mode 100644 index 0000000..6dee3cf --- /dev/null +++ b/app/plant/api/internal/handler/exchange/createexchangeitemhandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package exchange + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/exchange" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 创建兑换商品 +func CreateExchangeItemHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreateExchangeItemReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := exchange.NewCreateExchangeItemLogic(r.Context(), svcCtx) + err := l.CreateExchangeItem(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/exchange/deleteexchangeitemhandler.go b/app/plant/api/internal/handler/exchange/deleteexchangeitemhandler.go new file mode 100644 index 0000000..4ff91a7 --- /dev/null +++ b/app/plant/api/internal/handler/exchange/deleteexchangeitemhandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package exchange + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/exchange" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 删除兑换商品 +func DeleteExchangeItemHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.IdsReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := exchange.NewDeleteExchangeItemLogic(r.Context(), svcCtx) + err := l.DeleteExchangeItem(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/exchange/getExchangeItemListHandler.go b/app/plant/api/internal/handler/exchange/getExchangeItemListHandler.go index 7bbcd4b..579e454 100644 --- a/app/plant/api/internal/handler/exchange/getExchangeItemListHandler.go +++ b/app/plant/api/internal/handler/exchange/getExchangeItemListHandler.go @@ -23,11 +23,11 @@ func GetExchangeItemListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { } l := exchange.NewGetExchangeItemListLogic(r.Context(), svcCtx) - err := l.GetExchangeItemList(&req) + resp, err := l.GetExchangeItemList(&req) if err != nil { response.Fail(w, err.Error()) } else { - response.Ok(w) + response.OkWithData(w, resp) } } } diff --git a/app/plant/api/internal/handler/exchange/getexchangeorderlisthandler.go b/app/plant/api/internal/handler/exchange/getexchangeorderlisthandler.go new file mode 100644 index 0000000..bc20b75 --- /dev/null +++ b/app/plant/api/internal/handler/exchange/getexchangeorderlisthandler.go @@ -0,0 +1,27 @@ +package exchange + +import ( + "github.com/zeromicro/go-zero/rest/httpx" + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/exchange" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +func GetExchangeOrderListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ExchangeOrderListReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + l := exchange.NewGetExchangeOrderListLogic(r.Context(), svcCtx) + resp, err := l.GetExchangeOrderList(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/exchange/getmyexchangeordershandler.go b/app/plant/api/internal/handler/exchange/getmyexchangeordershandler.go new file mode 100644 index 0000000..92e7ceb --- /dev/null +++ b/app/plant/api/internal/handler/exchange/getmyexchangeordershandler.go @@ -0,0 +1,27 @@ +package exchange + +import ( + "github.com/zeromicro/go-zero/rest/httpx" + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/exchange" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +func GetMyExchangeOrdersHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ExchangeOrderListReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + l := exchange.NewGetMyExchangeOrdersLogic(r.Context(), svcCtx) + resp, err := l.GetMyExchangeOrders(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/exchange/updateexchangeitemhandler.go b/app/plant/api/internal/handler/exchange/updateexchangeitemhandler.go new file mode 100644 index 0000000..9572ea8 --- /dev/null +++ b/app/plant/api/internal/handler/exchange/updateexchangeitemhandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package exchange + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/exchange" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 更新兑换商品 +func UpdateExchangeItemHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdateExchangeItemReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := exchange.NewUpdateExchangeItemLogic(r.Context(), svcCtx) + err := l.UpdateExchangeItem(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/exchange/updateexchangeorderhandler.go b/app/plant/api/internal/handler/exchange/updateexchangeorderhandler.go new file mode 100644 index 0000000..469e585 --- /dev/null +++ b/app/plant/api/internal/handler/exchange/updateexchangeorderhandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package exchange + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/exchange" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 更新订单状态 +func UpdateExchangeOrderHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdateExchangeOrderReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := exchange.NewUpdateExchangeOrderLogic(r.Context(), svcCtx) + err := l.UpdateExchangeOrder(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/legacy/legacy.go b/app/plant/api/internal/handler/legacy/legacy.go new file mode 100644 index 0000000..fd24f21 --- /dev/null +++ b/app/plant/api/internal/handler/legacy/legacy.go @@ -0,0 +1,894 @@ +package legacy + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "time" + + filePb "sundynix-micro-go/app/file/rpc/file" + "sundynix-micro-go/app/plant/api/internal/logic/complete" + plantLogic "sundynix-micro-go/app/plant/api/internal/logic/myPlant" + postLogic "sundynix-micro-go/app/plant/api/internal/logic/post" + topicLogic "sundynix-micro-go/app/plant/api/internal/logic/topic" + wikiLogic "sundynix-micro-go/app/plant/api/internal/logic/wiki" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantModel "sundynix-micro-go/app/plant/model" + plantPb "sundynix-micro-go/app/plant/rpc/plant" + "sundynix-micro-go/common/response" + + "github.com/zeromicro/go-zero/rest/httpx" + "gorm.io/gorm" +) + +func idFromQuery(r *http.Request) string { + if id := r.URL.Query().Get("id"); id != "" { + return id + } + if id := r.URL.Query().Get("wikiId"); id != "" { + return id + } + if id := r.URL.Query().Get("postId"); id != "" { + return id + } + if id := r.URL.Query().Get("itemId"); id != "" { + return id + } + return r.URL.Query().Get("classId") +} + +func fileListByIDs(r *http.Request, svcCtx *svc.ServiceContext, ids []string) []map[string]interface{} { + if len(ids) == 0 { + return []map[string]interface{}{} + } + resp, err := svcCtx.FileRpc.GetFilesByIds(r.Context(), &filePb.GetFilesByIdsReq{Ids: ids}) + if err != nil { + return []map[string]interface{}{} + } + list := make([]map[string]interface{}, 0, len(resp.Files)) + for _, f := range resp.Files { + list = append(list, map[string]interface{}{ + "id": f.Id, "name": f.Name, "url": f.Url, "tag": f.Tag, + "key": f.Key, "suffix": f.Suffix, "md5": f.Md5, "createdAt": f.CreatedAt, + }) + } + return list +} + +func PlantDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var myPlant plantModel.MyPlant + if err := svcCtx.DB. + Preload("CarePlans"). + Preload("CareRecords", func(db *gorm.DB) *gorm.DB { + return db.Order("created_at desc") + }). + Preload("GrowthRecords", func(db *gorm.DB) *gorm.DB { + return db.Order("created_at desc") + }). + Where("id = ?", idFromQuery(r)).First(&myPlant).Error; err != nil { + response.Fail(w, err.Error()) + return + } + + // 查图片(本地关联表 + FileRpc) + imgList := queryImagesByPlant(svcCtx, r.Context(), myPlant.ID) + + // 成长记录图片 + growthImgMap := queryGrowthImages(svcCtx, r.Context(), myPlant.GrowthRecords) + + response.OkWithData(w, map[string]interface{}{ + "plant": toPlantMap(myPlant), + "imgList": imgList, + "carePlans": toPlanMapList(myPlant.CarePlans), + "careRecords": toRecordMapList(myPlant.CareRecords), + "careTasks": nil, + "growthRecords": toGrowthMapList(myPlant.GrowthRecords, growthImgMap), + }) + } +} + +func DeletePlanHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := plantLogic.NewDeleteCarePlanLogic(r.Context(), svcCtx) + if err := l.DeleteCarePlan(&types.IdsReq{Ids: []string{idFromQuery(r)}}); err != nil { + response.Fail(w, err.Error()) + return + } + response.Ok(w) + } +} + +func WikiDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + resp, err := svcCtx.PlantRpc.GetWikiDetail(r.Context(), &plantPb.IdReq{Id: idFromQuery(r)}) + if err != nil { + response.Fail(w, err.Error()) + return + } + if resp != nil && resp.Wiki != nil { + // 通过 FileRpc 获取完整图片信息 + imgList := fetchFileMap(svcCtx, r.Context(), resp.Wiki.OssIds) + response.OkWithData(w, map[string]interface{}{ + "wiki": resp.Wiki, "imgList": imgListToList(imgList, resp.Wiki.OssIds), + "classIds": resp.Wiki.ClassIds, "relatedWikiIds": resp.Wiki.RelatedWikiIds, + }) + return + } + response.OkWithData(w, resp) + } +} + +func WikiPageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.WikiListReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + resp, err := svcCtx.PlantRpc.GetWikiList(r.Context(), &plantPb.WikiListReq{ + Current: int32(req.Current), + PageSize: int32(req.PageSize), + Name: req.Name, + ClassId: req.ClassId, + IsHot: int32(req.IsHot), + }) + if err != nil { + response.Fail(w, err.Error()) + return + } + + // 查询所有 wiki 的图片 + var wikiIds []string + for _, w := range resp.List { + wikiIds = append(wikiIds, w.Id) + } + + // 查本地关联表获取 OSS ID + type rel struct { + WikiID string `gorm:"column:wiki_id"` + OssID string `gorm:"column:oss_id"` + } + var rels []rel + if len(wikiIds) > 0 { + svcCtx.DB.Table("sundynix_plant_wiki_oss"). + Where("wiki_id IN ?", wikiIds). + Find(&rels) + } + wikiOssMap := make(map[string][]string) + var allOssIds []string + for _, r := range rels { + wikiOssMap[r.WikiID] = append(wikiOssMap[r.WikiID], r.OssID) + allOssIds = append(allOssIds, r.OssID) + } + + // 通过 FileRpc 获取图片信息 + fileMap := fetchFileMap(svcCtx, r.Context(), allOssIds) + + // 组装返回 + var list []map[string]interface{} + for _, w := range resp.List { + ossIds := wikiOssMap[w.Id] + imgList := imgListToList(fileMap, ossIds) + hasStarVal := 0 + if w.IsStar { + hasStarVal = 1 + } + list = append(list, map[string]interface{}{ + "id": w.Id, "name": w.Name, "latinName": w.LatinName, + "aliases": w.Aliases, "genus": w.Genus, "difficulty": w.Difficulty, + "isHot": w.IsHot, "growthHabit": w.GrowthHabit, + "lightIntensity": w.LightIntensity, "classId": w.ClassId, + "createdAt": w.CreatedAt, "hasStar": hasStarVal, + "imgList": imgList, + }) + } + if list == nil { + list = []map[string]interface{}{} + } + + response.OkWithData(w, map[string]interface{}{ + "list": list, "total": resp.Total, + }) + } +} + +// imgListToList 将 fileMap 按顺序转为列表 +func imgListToList(fileMap map[string]map[string]interface{}, ossIds []string) []map[string]interface{} { + var list []map[string]interface{} + for _, id := range ossIds { + if img, ok := fileMap[id]; ok { + list = append(list, img) + } + } + if list == nil { + list = []map[string]interface{}{} + } + return list +} + +func WikiStarHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := wikiLogic.NewToggleWikiStarLogic(r.Context(), svcCtx) + if err := l.ToggleWikiStar(&types.IdReq{Id: idFromQuery(r)}); err != nil { + response.Fail(w, err.Error()) + return + } + response.Ok(w) + } +} + +func TopicDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := topicLogic.NewGetTopicDetailLogic(r.Context(), svcCtx) + resp, err := l.GetTopicDetail(&types.IdPathReq{Id: idFromQuery(r)}) + if err != nil { + response.Fail(w, err.Error()) + return + } + response.OkWithData(w, resp) + } +} + +func LikePostHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := postLogic.NewLikePostLogic(r.Context(), svcCtx) + if err := l.LikePost(&types.IdReq{Id: idFromQuery(r)}); err != nil { + response.Fail(w, err.Error()) + return + } + response.Ok(w) + } +} + +func StarPostHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := postLogic.NewStarPostLogic(r.Context(), svcCtx) + if err := l.StarPost(&types.IdReq{Id: idFromQuery(r)}); err != nil { + response.Fail(w, err.Error()) + return + } + response.Ok(w) + } +} + +func ExchangeItemDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := complete.NewGetExchangeItemDetailLogic(r.Context(), svcCtx) + resp, err := l.GetExchangeItemDetail(&types.IdPathReq{Id: idFromQuery(r)}) + if err != nil { + response.Fail(w, err.Error()) + return + } + response.OkWithData(w, resp) + } +} + +func PostPageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.PostListReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + userId := fmt.Sprintf("%v", r.Context().Value("userId")) + + db := svcCtx.DB.Model(&plantModel.Post{}) + if req.Keyword != "" { + db = db.Where("title like ? OR content like ?", "%"+req.Keyword+"%", "%"+req.Keyword+"%") + } + + var total int64 + db.Count(&total) + pageSize := req.PageSize + if pageSize <= 0 { + pageSize = 20 + } + page := req.Current + if page <= 0 { + page = 1 + } + offset := (page - 1) * pageSize + + var posts []*plantModel.Post + if err := db. + Preload("CommentList", func(db *gorm.DB) *gorm.DB { + return db.Order("created_at asc") + }). + Preload("LikeList"). + Limit(pageSize).Offset(offset).Order("created_at desc").Find(&posts).Error; err != nil { + response.Fail(w, err.Error()) + return + } + + // 组装完整响应 + list := buildPostListResponse(svcCtx, r.Context(), posts, userId) + response.OkWithData(w, map[string]interface{}{ + "list": list, "total": total, "page": page, "pageSize": pageSize, + }) + } +} + +func MyPostPageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.PostListReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + userId := fmt.Sprintf("%v", r.Context().Value("userId")) + + db := svcCtx.DB.Model(&plantModel.Post{}).Where("user_id = ?", userId) + + var total int64 + db.Count(&total) + pageSize := req.PageSize + if pageSize <= 0 { + pageSize = 20 + } + page := req.Current + if page <= 0 { + page = 1 + } + offset := (page - 1) * pageSize + + var posts []*plantModel.Post + if err := db. + Preload("CommentList", func(db *gorm.DB) *gorm.DB { + return db.Order("created_at asc") + }). + Preload("LikeList"). + Limit(pageSize).Offset(offset).Order("created_at desc").Find(&posts).Error; err != nil { + response.Fail(w, err.Error()) + return + } + + list := buildPostListResponse(svcCtx, r.Context(), posts, userId) + response.OkWithData(w, map[string]interface{}{ + "list": list, "total": total, "page": page, "pageSize": pageSize, + }) + } +} + +// ========== Post 列表辅助函数 ========== + +// buildPostListResponse 组装完整帖子列表响应 +func buildPostListResponse(svcCtx *svc.ServiceContext, ctx context.Context, posts []*plantModel.Post, userId string) []map[string]interface{} { + if len(posts) == 0 { + return []map[string]interface{}{} + } + + var postIds []string + for _, p := range posts { + postIds = append(postIds, p.ID) + } + + // 1. 查帖子图片(本地关联表 + FileRpc) + postImgMap := queryPostImages(svcCtx, ctx, postIds) + + // 2. 查用户信息 + allUserIds := collectPostUserIds(posts) + userMap := queryUserMapV2(svcCtx, allUserIds) + + // 3. 查当前用户点赞/收藏状态 + likedSet, starredSet := queryLikeStarStatus(svcCtx, userId, postIds) + + // 4. 组装 + var list []map[string]interface{} + for _, p := range posts { + item := map[string]interface{}{ + "id": p.ID, "title": p.Title, "content": p.Content, + "userId": p.UserID, "location": p.Location, + "viewCount": p.ViewCount, "commentCount": p.CommentCount, + "likeCount": p.LikeCount, "starCount": p.StarCount, + "hasReviewed": p.HasReviewed, + "createdAt": p.CreatedAt.Format(time.RFC3339), + "updatedAt": p.UpdatedAt.Format(time.RFC3339), + "createdAtStr": p.CreatedAt.Format("2006-01-02 15:04:05"), + "hasLiked": 0, "hasStar": 0, + "imgList": postImgMap[p.ID], + "publisher": buildPublisherInfo(userMap, p.UserID), + "commentList": buildCommentList(userMap, p.CommentList), + "likeList": buildLikeList(userMap, p.LikeList), + "starList": []map[string]interface{}{}, + } + if likedSet[p.ID] { + item["hasLiked"] = 1 + } + if starredSet[p.ID] { + item["hasStar"] = 1 + } + list = append(list, item) + } + return list +} + +func collectPostUserIds(posts []*plantModel.Post) []string { + set := make(map[string]bool) + for _, p := range posts { + set[p.UserID] = true + for _, c := range p.CommentList { + set[c.UserID] = true + } + for _, l := range p.LikeList { + set[l.UserID] = true + } + } + var ids []string + for id := range set { + ids = append(ids, id) + } + return ids +} + +// queryPostImages 查询帖子图片 +func queryPostImages(svcCtx *svc.ServiceContext, ctx context.Context, postIds []string) map[string][]map[string]interface{} { + type rel struct { + PostID string `gorm:"column:post_id"` + OssID string `gorm:"column:oss_id"` + } + var rels []rel + svcCtx.DB.Table("sundynix_plant_post_oss"). + Where("post_id IN ?", postIds). + Find(&rels) + + var allOssIds []string + pidMap := make(map[string][]string) + for _, r := range rels { + pidMap[r.PostID] = append(pidMap[r.PostID], r.OssID) + allOssIds = append(allOssIds, r.OssID) + } + + // 通过 FileRpc 获取文件信息 + fileInfos := fetchFileMap(svcCtx, ctx, allOssIds) + + result := make(map[string][]map[string]interface{}) + for pid, ids := range pidMap { + var imgs []map[string]interface{} + for _, oid := range ids { + if info, ok := fileInfos[oid]; ok { + imgs = append(imgs, info) + } + } + if imgs == nil { + imgs = []map[string]interface{}{} + } + result[pid] = imgs + } + // 没有图片的帖子也返回空数组 + for _, pid := range postIds { + if _, ok := result[pid]; !ok { + result[pid] = []map[string]interface{}{} + } + } + return result +} + +// fetchFileMap 通过 FileRpc 获取文件信息 +func fetchFileMap(svcCtx *svc.ServiceContext, ctx context.Context, ids []string) map[string]map[string]interface{} { + result := make(map[string]map[string]interface{}) + if len(ids) == 0 { + return result + } + resp, err := svcCtx.FileRpc.GetFilesByIds(ctx, &filePb.GetFilesByIdsReq{Ids: ids}) + if err != nil || resp == nil { + return result + } + for _, f := range resp.Files { + result[f.Id] = map[string]interface{}{ + "id": f.Id, "name": f.Name, "url": f.Url, "tag": f.Tag, + "key": f.Key, "suffix": f.Suffix, "md5": f.Md5, + "createdAt": unixToTimeStr(f.CreatedAt), + "updatedAt": unixToTimeStr(f.CreatedAt), + "createdAtStr": unixToTimeStrShort(f.CreatedAt), + } + } + return result +} + +func unixToTimeStr(ts int64) string { + if ts == 0 { + return "" + } + return time.Unix(ts, 0).Format(time.RFC3339) +} + +func unixToTimeStrShort(ts int64) string { + if ts == 0 { + return "" + } + return time.Unix(ts, 0).Format("2006-01-02 15:04:05") +} + +// queryUserMapV2 查询用户信息 +func queryUserMapV2(svcCtx *svc.ServiceContext, ids []string) map[string]map[string]interface{} { + result := make(map[string]map[string]interface{}) + if len(ids) == 0 { + return result + } + type userRow struct { + ID string `gorm:"column:id"` + NickName string `gorm:"column:nick_name"` + Name string `gorm:"column:name"` + AvatarID string `gorm:"column:avatar_id"` + } + var rows []userRow + svcCtx.DB.Table("sundynix_user").Where("id IN ?", ids).Find(&rows) + + var avatarIds []string + for _, row := range rows { + if row.AvatarID != "" { + avatarIds = append(avatarIds, row.AvatarID) + } + } + // 头像通过 FileRpc 获取 + avatarMap := fetchFileMap(svcCtx, context.Background(), avatarIds) + + for _, row := range rows { + avatarData := map[string]interface{}{} + if av, ok := avatarMap[row.AvatarID]; ok { + avatarData = av + } + result[row.ID] = map[string]interface{}{ + "id": row.ID, "nickName": row.NickName, "name": row.Name, + "avatarId": row.AvatarID, "avatar": avatarData, + } + } + return result +} + +// queryLikeStarStatus 查询当前用户的点赞/收藏状态 +func queryLikeStarStatus(svcCtx *svc.ServiceContext, userId string, postIds []string) (likedSet, starredSet map[string]bool) { + likedSet = make(map[string]bool) + starredSet = make(map[string]bool) + if len(postIds) == 0 { + return + } + type rel struct { + PostID string `gorm:"column:post_id"` + } + var likes []rel + svcCtx.DB.Table("sundynix_plant_post_like"). + Where("post_id IN ? AND user_id = ?", postIds, userId).Find(&likes) + for _, l := range likes { + likedSet[l.PostID] = true + } + var stars []rel + svcCtx.DB.Table("sundynix_plant_user_star"). + Where("target_id IN ? AND user_id = ? AND type = 'post'", postIds, userId).Find(&stars) + for _, s := range stars { + starredSet[s.PostID] = true + } + return +} + +func buildPublisherInfo(userMap map[string]map[string]interface{}, userId string) map[string]interface{} { + if u, ok := userMap[userId]; ok { + return u + } + return map[string]interface{}{ + "id": userId, "nickName": "", "name": "", "avatarId": "", "avatar": map[string]interface{}{}, + } +} + +func buildCommentList(userMap map[string]map[string]interface{}, comments []*plantModel.PostComment) []map[string]interface{} { + var list []map[string]interface{} + for _, c := range comments { + list = append(list, map[string]interface{}{ + "id": c.ID, "postId": c.PostID, "userId": c.UserID, + "content": c.Content, "parentId": c.ParentID, + "createdAt": c.CreatedAt.Format(time.RFC3339), + "updatedAt": c.UpdatedAt.Format(time.RFC3339), + "createdAtStr": c.CreatedAt.Format("2006-01-02 15:04:05"), + "commentator": buildPublisherInfo(userMap, c.UserID), + }) + } + if list == nil { + list = []map[string]interface{}{} + } + return list +} + +func buildLikeList(userMap map[string]map[string]interface{}, likes []*plantModel.PostLike) []map[string]interface{} { + var list []map[string]interface{} + for _, l := range likes { + list = append(list, map[string]interface{}{ + "id": l.ID, "postId": l.PostID, "userId": l.UserID, + "liker": buildPublisherInfo(userMap, l.UserID), + }) + } + if list == nil { + list = []map[string]interface{}{} + } + return list +} + +// ========== Plant Detail 辅助函数 ========== + +func queryImagesByPlant(svcCtx *svc.ServiceContext, ctx context.Context, plantID string) []map[string]interface{} { + type rel struct { + OssID string `gorm:"column:sundynix_oss_id"` + } + var rels []rel + svcCtx.DB.Table("sundynix_plant_my_plant_oss"). + Where("sundynix_my_plant_id = ?", plantID). + Order("sundynix_oss_id asc"). + Find(&rels) + var ids []string + for _, r := range rels { + ids = append(ids, r.OssID) + } + fileMap := fetchFileMap(svcCtx, ctx, ids) + var result []map[string]interface{} + for _, id := range ids { + if f, ok := fileMap[id]; ok { + result = append(result, f) + } + } + if result == nil { + result = []map[string]interface{}{} + } + return result +} + +func queryGrowthImages(svcCtx *svc.ServiceContext, ctx context.Context, records []*plantModel.GrowthRecord) map[string][]map[string]interface{} { + if len(records) == 0 { + return nil + } + var ids []string + for _, gr := range records { + ids = append(ids, gr.ID) + } + type rel struct { + GrowthRecordID string `gorm:"column:growth_record_id"` + OssID string `gorm:"column:oss_id"` + } + var rels []rel + svcCtx.DB.Table("sundynix_plant_growth_record_oss"). + Where("growth_record_id IN ?", ids). + Find(&rels) + + var allOssIds []string + gidMap := make(map[string][]string) + for _, r := range rels { + gidMap[r.GrowthRecordID] = append(gidMap[r.GrowthRecordID], r.OssID) + allOssIds = append(allOssIds, r.OssID) + } + fileMap := fetchFileMap(svcCtx, ctx, allOssIds) + + result := make(map[string][]map[string]interface{}) + for gid, ossIds := range gidMap { + var imgs []map[string]interface{} + for _, oid := range ossIds { + if f, ok := fileMap[oid]; ok { + imgs = append(imgs, f) + } + } + result[gid] = imgs + } + return result +} + +func toPlantMap(p plantModel.MyPlant) map[string]interface{} { + return map[string]interface{}{ + "id": p.ID, "createdAt": p.CreatedAt.Format(time.RFC3339), + "updatedAt": p.UpdatedAt.Format(time.RFC3339), "createdAtStr": p.CreatedAt.Format("2006-01-02 15:04:05"), + "userId": p.UserID, "name": p.Name, "plantTime": p.PlantTime.Format(time.RFC3339), + "status": p.Status, "placement": p.Placement, + "potMaterial": p.PotMaterial, "potSize": p.PotSize, + "sunlight": p.Sunlight, "plantingMaterial": p.PlantingMaterial, + } +} + +func toPlanMapList(plans []*plantModel.CarePlan) []map[string]interface{} { + var list []map[string]interface{} + for _, p := range plans { + list = append(list, map[string]interface{}{ + "id": p.ID, "createdAt": p.CreatedAt.Format(time.RFC3339), + "updatedAt": p.UpdatedAt.Format(time.RFC3339), "createdAtStr": p.CreatedAt.Format("2006-01-02 15:04:05"), + "userId": p.UserID, "plantId": p.PlantID, "name": p.Name, "icon": p.Icon, + "period": p.Period, "targetAction": p.TargetAction, + }) + } + if list == nil { + list = []map[string]interface{}{} + } + return list +} + +func toRecordMapList(records []*plantModel.CareRecord) []map[string]interface{} { + var list []map[string]interface{} + for _, r := range records { + list = append(list, map[string]interface{}{ + "id": r.ID, "createdAt": r.CreatedAt.Format(time.RFC3339), + "updatedAt": r.UpdatedAt.Format(time.RFC3339), "createdAtStr": r.CreatedAt.Format("2006-01-02 15:04:05"), + "userId": r.UserID, "plantId": r.PlantID, "planId": r.PlanID, + "name": r.Name, "remark": r.Remark, "icon": r.Icon, + }) + } + if list == nil { + list = []map[string]interface{}{} + } + return list +} + +func toGrowthMapList(records []*plantModel.GrowthRecord, imgMap map[string][]map[string]interface{}) []map[string]interface{} { + var list []map[string]interface{} + for _, gr := range records { + imgs := imgMap[gr.ID] + if imgs == nil { + imgs = []map[string]interface{}{} + } + list = append(list, map[string]interface{}{ + "id": gr.ID, "createdAt": gr.CreatedAt.Format(time.RFC3339), + "updatedAt": gr.UpdatedAt.Format(time.RFC3339), "createdAtStr": gr.CreatedAt.Format("2006-01-02 15:04:05"), + "plantId": gr.PlantID, "userId": gr.UserID, "name": gr.Name, + "tag": gr.Tag, "desc": gr.Desc, "content": gr.Content, + "imgList": imgs, + }) + } + if list == nil { + list = []map[string]interface{}{} + } + return list +} + +// queryOssList 批量查询 Oss 图片信息(供 WikiDetailHandler 使用) +func queryOssList(svcCtx *svc.ServiceContext, ossIds []string) []map[string]interface{} { + if len(ossIds) == 0 { + return []map[string]interface{}{} + } + type OssRow struct { + ID string `gorm:"column:id"` + Name string `gorm:"column:name"` + Url string `gorm:"column:url"` + Tag string `gorm:"column:tag"` + Key string `gorm:"column:key"` + Suffix string `gorm:"column:suffix"` + CreatedAt time.Time `gorm:"column:created_at"` + UpdatedAt time.Time `gorm:"column:updated_at"` + } + var rows []OssRow + svcCtx.DB.Table("sundynix_oss").Where("id IN ?", ossIds).Find(&rows) + ossMap := make(map[string]OssRow) + for _, row := range rows { + ossMap[row.ID] = row + } + var result []map[string]interface{} + for _, id := range ossIds { + if row, ok := ossMap[id]; ok { + result = append(result, map[string]interface{}{ + "id": row.ID, "name": row.Name, "url": row.Url, "tag": row.Tag, + "key": row.Key, "suffix": row.Suffix, + "createdAt": row.CreatedAt.Format(time.RFC3339), + "updatedAt": row.UpdatedAt.Format(time.RFC3339), + "createdAtStr": row.CreatedAt.Format("2006-01-02 15:04:05"), + }) + } + } + return result +} + +func AiChatSyncHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + resp, err := svcCtx.PlantRpc.SyncAllWikiVector(r.Context(), &plantPb.PageReq{}) + if err != nil { + response.Fail(w, err.Error()) + return + } + response.OkWithMsg(w, resp.Msg) + } +} + +func WikiSyncQdrantHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + wikiID := idFromQuery(r) + if wikiID == "" { + var req types.IdReq + _ = httpx.Parse(r, &req) + wikiID = req.Id + } + if wikiID == "" { + response.Fail(w, "wikiId 不能为空") + return + } + if _, err := svcCtx.PlantRpc.SyncWikiVector(r.Context(), &plantPb.SyncWikiVectorReq{WikiId: wikiID}); err != nil { + response.Fail(w, err.Error()) + return + } + response.Ok(w) + } +} + +func WikiDeleteQdrantHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + wikiID := idFromQuery(r) + if wikiID == "" { + var req types.IdReq + _ = httpx.Parse(r, &req) + wikiID = req.Id + } + if wikiID == "" { + response.Fail(w, "wikiId 不能为空") + return + } + if _, err := svcCtx.PlantRpc.DeleteWikiVector(r.Context(), &plantPb.SyncWikiVectorReq{WikiId: wikiID}); err != nil { + response.Fail(w, err.Error()) + return + } + response.Ok(w) + } +} + +func WikiUploadImgHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + response.FailWithCode(w, 409, "设计/百科图片上传已迁移到 file-api,请先调用文件服务上传,再将返回的文件 id 作为 ossIds 传给 plant") + } +} + +func BadgeConfigDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + resp, err := svcCtx.PlantRpc.GetBadgeConfigDetail(r.Context(), &plantPb.IdReq{Id: idFromQuery(r)}) + if err != nil { + response.Fail(w, err.Error()) + return + } + response.OkWithData(w, resp) + } +} + +func BadgeConfigDeleteHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + if _, err := svcCtx.PlantRpc.DeleteBadgeConfig(r.Context(), &plantPb.IdsReq{Ids: []string{idFromQuery(r)}}); err != nil { + response.Fail(w, err.Error()) + return + } + response.Ok(w) + } +} + +func LevelConfigDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + resp, err := svcCtx.PlantRpc.GetLevelConfigDetail(r.Context(), &plantPb.IdReq{Id: idFromQuery(r)}) + if err != nil { + response.Fail(w, err.Error()) + return + } + response.OkWithData(w, resp) + } +} + +func MediaCheckCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var payload struct { + TraceID string `json:"traceId"` + PostID string `json:"postId"` + OssID string `json:"ossId"` + UserID string `json:"userId"` + Status int32 `json:"status"` + Type int32 `json:"type"` + ErrMsg string `json:"errMsg"` + } + if err := json.NewDecoder(r.Body).Decode(&payload); err != nil { + response.Fail(w, err.Error()) + return + } + + if _, err := svcCtx.PlantRpc.MediaCheckCallback(r.Context(), &plantPb.MediaCheckCallbackReq{ + TraceId: payload.TraceID, + PostId: payload.PostID, + OssId: payload.OssID, + UserId: payload.UserID, + Status: payload.Status, + Type: payload.Type, + ErrMsg: payload.ErrMsg, + }); err != nil { + response.Fail(w, err.Error()) + return + } + response.Ok(w) + } +} diff --git a/app/plant/api/internal/handler/myPlant/deletecareplanhandler.go b/app/plant/api/internal/handler/myPlant/deletecareplanhandler.go new file mode 100644 index 0000000..f9c5d26 --- /dev/null +++ b/app/plant/api/internal/handler/myPlant/deletecareplanhandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package myPlant + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/myPlant" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 删除养护计划 +func DeleteCarePlanHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.IdsReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := myPlant.NewDeleteCarePlanLogic(r.Context(), svcCtx) + err := l.DeleteCarePlan(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/myPlant/gettodaytasklisthandler.go b/app/plant/api/internal/handler/myPlant/gettodaytasklisthandler.go new file mode 100644 index 0000000..911d7ef --- /dev/null +++ b/app/plant/api/internal/handler/myPlant/gettodaytasklisthandler.go @@ -0,0 +1,20 @@ +package myPlant + +import ( + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/myPlant" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/common/response" +) + +func GetTodayTaskListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := myPlant.NewGetTodayTaskListLogic(r.Context(), svcCtx) + resp, err := l.GetTodayTaskList() + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/myPlant/quickCareHandler.go b/app/plant/api/internal/handler/myPlant/quickCareHandler.go new file mode 100644 index 0000000..ba12bdc --- /dev/null +++ b/app/plant/api/internal/handler/myPlant/quickCareHandler.go @@ -0,0 +1,30 @@ +package myPlant + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/myPlant" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 快捷养护 +func QuickCareHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.QuickCareReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := myPlant.NewQuickCareLogic(r.Context(), svcCtx) + err := l.QuickCare(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/ocr/deleteclassifyloghandler.go b/app/plant/api/internal/handler/ocr/deleteclassifyloghandler.go new file mode 100644 index 0000000..a99f45d --- /dev/null +++ b/app/plant/api/internal/handler/ocr/deleteclassifyloghandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package ocr + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/ocr" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 删除识别记录 +func DeleteClassifyLogHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.IdsReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := ocr.NewDeleteClassifyLogLogic(r.Context(), svcCtx) + err := l.DeleteClassifyLog(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/ocr/getmyclassifyloghandler.go b/app/plant/api/internal/handler/ocr/getmyclassifyloghandler.go new file mode 100644 index 0000000..fdb26dd --- /dev/null +++ b/app/plant/api/internal/handler/ocr/getmyclassifyloghandler.go @@ -0,0 +1,20 @@ +package ocr + +import ( + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/ocr" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/common/response" +) + +func GetMyClassifyLogHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := ocr.NewGetMyClassifyLogLogic(r.Context(), svcCtx) + resp, err := l.GetMyClassifyLog() + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/ocr/ocrClassifyHandler.go b/app/plant/api/internal/handler/ocr/ocrClassifyHandler.go index b78641c..1d6862b 100644 --- a/app/plant/api/internal/handler/ocr/ocrClassifyHandler.go +++ b/app/plant/api/internal/handler/ocr/ocrClassifyHandler.go @@ -23,11 +23,11 @@ func OcrClassifyHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { } l := ocr.NewOcrClassifyLogic(r.Context(), svcCtx) - err := l.OcrClassify(&req) + resp, err := l.OcrClassify(&req) if err != nil { response.Fail(w, err.Error()) } else { - response.Ok(w) + response.OkWithData(w, resp) } } } diff --git a/app/plant/api/internal/handler/post/getPostDetailHandler.go b/app/plant/api/internal/handler/post/getPostDetailHandler.go index 1ccfa1f..682a181 100644 --- a/app/plant/api/internal/handler/post/getPostDetailHandler.go +++ b/app/plant/api/internal/handler/post/getPostDetailHandler.go @@ -23,11 +23,11 @@ func GetPostDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { } l := post.NewGetPostDetailLogic(r.Context(), svcCtx) - err := l.GetPostDetail(&req) + resp, err := l.GetPostDetail(&req) if err != nil { response.Fail(w, err.Error()) } else { - response.Ok(w) + response.OkWithData(w, resp) } } } diff --git a/app/plant/api/internal/handler/post/getPostListHandler.go b/app/plant/api/internal/handler/post/getPostListHandler.go index 4f61871..e1126f7 100644 --- a/app/plant/api/internal/handler/post/getPostListHandler.go +++ b/app/plant/api/internal/handler/post/getPostListHandler.go @@ -23,11 +23,11 @@ func GetPostListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { } l := post.NewGetPostListLogic(r.Context(), svcCtx) - err := l.GetPostList(&req) + resp, err := l.GetPostList(&req) if err != nil { response.Fail(w, err.Error()) } else { - response.Ok(w) + response.OkWithData(w, resp) } } } diff --git a/app/plant/api/internal/handler/post/getmypostlisthandler.go b/app/plant/api/internal/handler/post/getmypostlisthandler.go new file mode 100644 index 0000000..03a30fb --- /dev/null +++ b/app/plant/api/internal/handler/post/getmypostlisthandler.go @@ -0,0 +1,27 @@ +package post + +import ( + "github.com/zeromicro/go-zero/rest/httpx" + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/post" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +func GetMyPostListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.PostListReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + l := post.NewGetMyPostListLogic(r.Context(), svcCtx) + resp, err := l.GetMyPostList(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/post/starposthandler.go b/app/plant/api/internal/handler/post/starposthandler.go new file mode 100644 index 0000000..b2ed2f3 --- /dev/null +++ b/app/plant/api/internal/handler/post/starposthandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package post + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/post" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 收藏帖子 +func StarPostHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.IdReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := post.NewStarPostLogic(r.Context(), svcCtx) + err := l.StarPost(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/routes.go b/app/plant/api/internal/handler/routes.go index 5a82b7a..ca54c1e 100644 --- a/app/plant/api/internal/handler/routes.go +++ b/app/plant/api/internal/handler/routes.go @@ -7,9 +7,12 @@ import ( "net/http" ai "sundynix-micro-go/app/plant/api/internal/handler/ai" + banner "sundynix-micro-go/app/plant/api/internal/handler/banner" callback "sundynix-micro-go/app/plant/api/internal/handler/callback" + complete "sundynix-micro-go/app/plant/api/internal/handler/complete" config "sundynix-micro-go/app/plant/api/internal/handler/config" exchange "sundynix-micro-go/app/plant/api/internal/handler/exchange" + legacy "sundynix-micro-go/app/plant/api/internal/handler/legacy" myPlant "sundynix-micro-go/app/plant/api/internal/handler/myPlant" ocr "sundynix-micro-go/app/plant/api/internal/handler/ocr" post "sundynix-micro-go/app/plant/api/internal/handler/post" @@ -36,6 +39,24 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/ai/history", Handler: ai.GetAiChatHistoryHandler(serverCtx), }, + { + // 清空聊天历史 + Method: http.MethodPost, + Path: "/ai/history/clear", + Handler: ai.ClearAiChatHistoryHandler(serverCtx), + }, + { + // 删除聊天历史 + Method: http.MethodPost, + Path: "/ai/history/delete", + Handler: ai.DeleteAiChatHistoryHandler(serverCtx), + }, + { + // 今日AI额度 + Method: http.MethodGet, + Path: "/ai/quota", + Handler: ai.GetAiChatQuotaHandler(serverCtx), + }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/plant"), @@ -49,6 +70,12 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/callback/wechatpay", Handler: callback.WechatPayCallbackHandler(serverCtx), }, + { + // 微信媒体安全回调 + Method: http.MethodPost, + Path: "/callback/mediaCheck", + Handler: legacy.MediaCheckCallbackHandler(serverCtx), + }, }, rest.WithPrefix("/api/plant"), ) @@ -56,16 +83,40 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { server.AddRoutes( []rest.Route{ { - // 徽章配置列表 + // AI聊天历史 Method: http.MethodPost, - Path: "/config/badge/list", - Handler: config.GetBadgeConfigListHandler(serverCtx), + Path: "/ai/history", + Handler: complete.GetAiChatHistoryHandler(serverCtx), }, { - // 等级配置列表 + // 徽章配置树 + Method: http.MethodGet, + Path: "/config/badge/tree", + Handler: complete.GetBadgeConfigTreeHandler(serverCtx), + }, + { + // 等级配置详情 + Method: http.MethodGet, + Path: "/config/level/:id", + Handler: complete.GetLevelConfigDetailHandler(serverCtx), + }, + { + // 兑换商品详情 + Method: http.MethodGet, + Path: "/exchange/item/:id", + Handler: complete.GetExchangeItemDetailHandler(serverCtx), + }, + { + // 完成养护任务 Method: http.MethodPost, - Path: "/config/level/list", - Handler: config.GetLevelConfigListHandler(serverCtx), + Path: "/my/completeTask", + Handler: complete.CompleteTaskHandler(serverCtx), + }, + { + // 百科分类详情 + Method: http.MethodGet, + Path: "/wiki/class/:id", + Handler: complete.GetWikiClassDetailHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), @@ -74,6 +125,85 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { server.AddRoutes( []rest.Route{ + { + // 创建徽章配置 + Method: http.MethodPost, + Path: "/config/badge/create", + Handler: config.CreateBadgeConfigHandler(serverCtx), + }, + {Method: http.MethodPost, Path: "/config/badge/add", Handler: config.CreateBadgeConfigHandler(serverCtx)}, + { + // 删除徽章配置 + Method: http.MethodPost, + Path: "/config/badge/delete", + Handler: config.DeleteBadgeConfigHandler(serverCtx), + }, + {Method: http.MethodGet, Path: "/config/badge/delete", Handler: legacy.BadgeConfigDeleteHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/config/badge/find", Handler: legacy.BadgeConfigDetailHandler(serverCtx)}, + { + // 徽章配置列表 + Method: http.MethodPost, + Path: "/config/badge/list", + Handler: config.GetBadgeConfigListHandler(serverCtx), + }, + { + // 更新徽章配置 + Method: http.MethodPost, + Path: "/config/badge/update", + Handler: config.UpdateBadgeConfigHandler(serverCtx), + }, + { + // 创建等级配置 + Method: http.MethodPost, + Path: "/config/level/create", + Handler: config.CreateLevelConfigHandler(serverCtx), + }, + {Method: http.MethodPost, Path: "/config/level/add", Handler: config.CreateLevelConfigHandler(serverCtx)}, + { + // 删除等级配置 + Method: http.MethodPost, + Path: "/config/level/delete", + Handler: config.DeleteLevelConfigHandler(serverCtx), + }, + { + // 等级配置列表 + Method: http.MethodPost, + Path: "/config/level/list", + Handler: config.GetLevelConfigListHandler(serverCtx), + }, + {Method: http.MethodGet, Path: "/config/level/list", Handler: config.GetLevelConfigListHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/config/level/detail", Handler: legacy.LevelConfigDetailHandler(serverCtx)}, + { + // 更新等级配置 + Method: http.MethodPost, + Path: "/config/level/update", + Handler: config.UpdateLevelConfigHandler(serverCtx), + }, + }, + rest.WithJwt(serverCtx.Config.Auth.AccessSecret), + rest.WithPrefix("/api/plant"), + ) + + server.AddRoutes( + []rest.Route{ + { + // 创建兑换商品 + Method: http.MethodPost, + Path: "/exchange/item/create", + Handler: exchange.CreateExchangeItemHandler(serverCtx), + }, + { + // 删除兑换商品 + Method: http.MethodPost, + Path: "/exchange/item/delete", + Handler: exchange.DeleteExchangeItemHandler(serverCtx), + }, + { + // 更新兑换商品 + Method: http.MethodPost, + Path: "/exchange/item/update", + Handler: exchange.UpdateExchangeItemHandler(serverCtx), + }, { // 兑换商品列表 Method: http.MethodPost, @@ -81,11 +211,29 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Handler: exchange.GetExchangeItemListHandler(serverCtx), }, { - // 兑换商品 + // 我的兑换记录 + Method: http.MethodPost, + Path: "/exchange/myOrders", + Handler: exchange.GetMyExchangeOrdersHandler(serverCtx), + }, + { + // 发起兑换 Method: http.MethodPost, Path: "/exchange/order", Handler: exchange.CreateExchangeOrderHandler(serverCtx), }, + { + // 管理端订单列表 + Method: http.MethodPost, + Path: "/exchange/order/list", + Handler: exchange.GetExchangeOrderListHandler(serverCtx), + }, + { + // 更新订单状态 + Method: http.MethodPost, + Path: "/exchange/order/update", + Handler: exchange.UpdateExchangeOrderHandler(serverCtx), + }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/plant"), @@ -119,10 +267,16 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { }, { // 删除植物 - Method: http.MethodDelete, + Method: http.MethodPost, Path: "/my/delete", Handler: myPlant.DeletePlantHandler(serverCtx), }, + { + // 删除养护计划 + Method: http.MethodPost, + Path: "/my/deletePlan", + Handler: myPlant.DeleteCarePlanHandler(serverCtx), + }, { // 添加成长记录 Method: http.MethodPost, @@ -135,12 +289,24 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/my/list", Handler: myPlant.GetMyPlantListHandler(serverCtx), }, + { + // 今日养护任务 + Method: http.MethodGet, + Path: "/my/todayTask", + Handler: myPlant.GetTodayTaskListHandler(serverCtx), + }, { // 更新植物 - Method: http.MethodPut, + Method: http.MethodPost, Path: "/my/update", Handler: myPlant.UpdatePlantHandler(serverCtx), }, + { + // 快捷养护 + Method: http.MethodPost, + Path: "/my/quickCare", + Handler: myPlant.QuickCareHandler(serverCtx), + }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/plant"), @@ -154,6 +320,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/ocr/classify", Handler: ocr.OcrClassifyHandler(serverCtx), }, + { + // 删除识别记录 + Method: http.MethodPost, + Path: "/ocr/deleteLog", + Handler: ocr.DeleteClassifyLogHandler(serverCtx), + }, + { + // 我的识别记录 + Method: http.MethodGet, + Path: "/ocr/myLog", + Handler: ocr.GetMyClassifyLogHandler(serverCtx), + }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/plant"), @@ -181,7 +359,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { }, { // 删除帖子 - Method: http.MethodDelete, + Method: http.MethodPost, Path: "/post/delete", Handler: post.DeletePostHandler(serverCtx), }, @@ -197,6 +375,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/post/list", Handler: post.GetPostListHandler(serverCtx), }, + { + // 我的帖子 + Method: http.MethodPost, + Path: "/post/my", + Handler: post.GetMyPostListHandler(serverCtx), + }, + { + // 收藏帖子 + Method: http.MethodPost, + Path: "/post/star", + Handler: post.StarPostHandler(serverCtx), + }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/plant"), @@ -204,6 +394,12 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { server.AddRoutes( []rest.Route{ + { + // 话题详情 + Method: http.MethodGet, + Path: "/topic/:id", + Handler: topic.GetTopicDetailHandler(serverCtx), + }, { // 创建话题 Method: http.MethodPost, @@ -212,7 +408,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { }, { // 删除话题 - Method: http.MethodDelete, + Method: http.MethodPost, Path: "/topic/delete", Handler: topic.DeleteTopicHandler(serverCtx), }, @@ -222,6 +418,12 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/topic/list", Handler: topic.GetTopicListHandler(serverCtx), }, + { + // 更新话题 + Method: http.MethodPost, + Path: "/topic/update", + Handler: topic.UpdateTopicHandler(serverCtx), + }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/plant"), @@ -229,15 +431,28 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { server.AddRoutes( []rest.Route{ + { + // 我的徽章 + Method: http.MethodGet, + Path: "/profile/badge", + Handler: userProfile.GetMyBadgesHandler(serverCtx), + }, { // 获取用户资料 Method: http.MethodGet, Path: "/profile/info", Handler: userProfile.GetUserProfileHandler(serverCtx), }, + {Method: http.MethodGet, Path: "/profile/detail", Handler: userProfile.GetUserProfileHandler(serverCtx)}, + { + // 我的收藏 + Method: http.MethodPost, + Path: "/profile/star", + Handler: userProfile.GetMyStarsHandler(serverCtx), + }, { // 更新用户资料 - Method: http.MethodPut, + Method: http.MethodPost, Path: "/profile/update", Handler: userProfile.UpdateUserProfileHandler(serverCtx), }, @@ -260,12 +475,36 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/wiki/class/create", Handler: wiki.CreateWikiClassHandler(serverCtx), }, + { + // 删除百科分类 + Method: http.MethodPost, + Path: "/wiki/class/delete", + Handler: wiki.DeleteWikiClassHandler(serverCtx), + }, { // 百科分类列表 Method: http.MethodGet, Path: "/wiki/class/list", Handler: wiki.GetWikiClassListHandler(serverCtx), }, + { + // 更新百科分类 + Method: http.MethodPost, + Path: "/wiki/class/update", + Handler: wiki.UpdateWikiClassHandler(serverCtx), + }, + { + // 创建百科 + Method: http.MethodPost, + Path: "/wiki/create", + Handler: wiki.CreateWikiHandler(serverCtx), + }, + { + // 删除百科 + Method: http.MethodPost, + Path: "/wiki/delete", + Handler: wiki.DeleteWikiHandler(serverCtx), + }, { // 百科列表 Method: http.MethodPost, @@ -278,6 +517,111 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/wiki/star", Handler: wiki.ToggleWikiStarHandler(serverCtx), }, + { + // 更新百科 + Method: http.MethodPost, + Path: "/wiki/update", + Handler: wiki.UpdateWikiHandler(serverCtx), + }, + }, + rest.WithJwt(serverCtx.Config.Auth.AccessSecret), + rest.WithPrefix("/api/plant"), + ) + + server.AddRoutes( + []rest.Route{ + { + // 创建Banner + Method: http.MethodPost, + Path: "/banner/create", + Handler: banner.CreateBannerHandler(serverCtx), + }, + { + // 删除Banner + Method: http.MethodPost, + Path: "/banner/delete", + Handler: banner.DeleteBannerHandler(serverCtx), + }, + { + // 更新Banner + Method: http.MethodPost, + Path: "/banner/update", + Handler: banner.UpdateBannerHandler(serverCtx), + }, + { + // Banner列表(管理端) + Method: http.MethodPost, + Path: "/banner/list", + Handler: banner.GetBannerListHandler(serverCtx), + }, + { + // 启用的Banner列表(客户端) + Method: http.MethodGet, + Path: "/banner/activeList", + Handler: banner.GetActiveBannerListHandler(serverCtx), + }, + }, + rest.WithJwt(serverCtx.Config.Auth.AccessSecret), + rest.WithPrefix("/api/plant"), + ) + + server.AddRoutes( + []rest.Route{ + {Method: http.MethodPost, Path: "/add", Handler: myPlant.CreatePlantHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/page", Handler: myPlant.GetMyPlantListHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/detail", Handler: legacy.PlantDetailHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/update", Handler: myPlant.UpdatePlantHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/deletePlant", Handler: myPlant.DeletePlantHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/deletePlan", Handler: myPlant.DeleteCarePlanHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/plan/add", Handler: myPlant.AddCarePlanHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/plan/delete", Handler: legacy.DeletePlanHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/todayTask", Handler: myPlant.GetTodayTaskListHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/completeTask", Handler: complete.CompleteTaskHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/growth/add", Handler: myPlant.AddGrowthRecordHandler(serverCtx)}, + + {Method: http.MethodPost, Path: "/wiki/add", Handler: wiki.CreateWikiHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/wiki/page", Handler: legacy.WikiPageHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/wiki/detail", Handler: legacy.WikiDetailHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/wiki/uploadImg", Handler: legacy.WikiUploadImgHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/wiki/sync-qdrant", Handler: legacy.WikiSyncQdrantHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/wiki/delete-qdrant", Handler: legacy.WikiDeleteQdrantHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/wiki/star", Handler: legacy.WikiStarHandler(serverCtx)}, + + {Method: http.MethodPost, Path: "/wiki-class/add", Handler: wiki.CreateWikiClassHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/wiki-class/update", Handler: wiki.UpdateWikiClassHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/wiki-class/page", Handler: wiki.GetWikiClassListHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/wiki-class/delete", Handler: wiki.DeleteWikiClassHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/wiki-class/list", Handler: wiki.GetWikiClassListHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/wiki-class/detail", Handler: complete.GetWikiClassDetailHandler(serverCtx)}, + + {Method: http.MethodPost, Path: "/post/publish", Handler: post.CreatePostHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/post/page", Handler: legacy.PostPageHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/post/myPost", Handler: legacy.MyPostPageHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/post/like", Handler: legacy.LikePostHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/post/star", Handler: legacy.StarPostHandler(serverCtx)}, + + {Method: http.MethodPost, Path: "/topic/add", Handler: topic.CreateTopicHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/topic/page", Handler: topic.GetTopicListHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/topic/detail", Handler: legacy.TopicDetailHandler(serverCtx)}, + + {Method: http.MethodPost, Path: "/classify/plant", Handler: ocr.OcrClassifyHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/classify/myClassifyLog", Handler: ocr.GetMyClassifyLogHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/classify/deleteClassifyLog", Handler: ocr.DeleteClassifyLogHandler(serverCtx)}, + + {Method: http.MethodGet, Path: "/exchange/list", Handler: exchange.GetExchangeItemListHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/exchange/detail", Handler: legacy.ExchangeItemDetailHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/exchange/redeem", Handler: exchange.CreateExchangeOrderHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/exchange/orders", Handler: exchange.GetMyExchangeOrdersHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/exchange/item/list", Handler: exchange.GetExchangeItemListHandler(serverCtx)}, + + {Method: http.MethodGet, Path: "/chat/history", Handler: ai.GetAiChatHistoryHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/chat/history/delete", Handler: ai.DeleteAiChatHistoryHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/chat/history/clear", Handler: ai.ClearAiChatHistoryHandler(serverCtx)}, + {Method: http.MethodGet, Path: "/chat/quota", Handler: ai.GetAiChatQuotaHandler(serverCtx)}, + {Method: http.MethodPost, Path: "/chat/sync", Handler: legacy.AiChatSyncHandler(serverCtx)}, + + // 快捷养护(旧版兼容) + {Method: http.MethodPost, Path: "/quickCare", Handler: myPlant.QuickCareHandler(serverCtx)}, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/plant"), diff --git a/app/plant/api/internal/handler/topic/getTopicListHandler.go b/app/plant/api/internal/handler/topic/getTopicListHandler.go index c3a25b8..7d40071 100644 --- a/app/plant/api/internal/handler/topic/getTopicListHandler.go +++ b/app/plant/api/internal/handler/topic/getTopicListHandler.go @@ -15,11 +15,11 @@ import ( func GetTopicListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { l := topic.NewGetTopicListLogic(r.Context(), svcCtx) - err := l.GetTopicList() + resp, err := l.GetTopicList() if err != nil { response.Fail(w, err.Error()) } else { - response.Ok(w) + response.OkWithData(w, resp) } } } diff --git a/app/plant/api/internal/handler/topic/gettopicdetailhandler.go b/app/plant/api/internal/handler/topic/gettopicdetailhandler.go new file mode 100644 index 0000000..57c851f --- /dev/null +++ b/app/plant/api/internal/handler/topic/gettopicdetailhandler.go @@ -0,0 +1,27 @@ +package topic + +import ( + "github.com/zeromicro/go-zero/rest/httpx" + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/topic" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +func GetTopicDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.IdPathReq + if err := httpx.ParsePath(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + l := topic.NewGetTopicDetailLogic(r.Context(), svcCtx) + resp, err := l.GetTopicDetail(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/topic/updatetopichandler.go b/app/plant/api/internal/handler/topic/updatetopichandler.go new file mode 100644 index 0000000..ec39a4a --- /dev/null +++ b/app/plant/api/internal/handler/topic/updatetopichandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package topic + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/topic" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 更新话题 +func UpdateTopicHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdateTopicReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := topic.NewUpdateTopicLogic(r.Context(), svcCtx) + err := l.UpdateTopic(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/userProfile/getUserProfileHandler.go b/app/plant/api/internal/handler/userProfile/getUserProfileHandler.go index 5acb0ca..5f4675b 100644 --- a/app/plant/api/internal/handler/userProfile/getUserProfileHandler.go +++ b/app/plant/api/internal/handler/userProfile/getUserProfileHandler.go @@ -15,11 +15,11 @@ import ( func GetUserProfileHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { l := userProfile.NewGetUserProfileLogic(r.Context(), svcCtx) - err := l.GetUserProfile() + resp, err := l.GetUserProfile() if err != nil { response.Fail(w, err.Error()) } else { - response.Ok(w) + response.OkWithData(w, resp) } } } diff --git a/app/plant/api/internal/handler/userProfile/getmybadgeshandler.go b/app/plant/api/internal/handler/userProfile/getmybadgeshandler.go new file mode 100644 index 0000000..cbb9de9 --- /dev/null +++ b/app/plant/api/internal/handler/userProfile/getmybadgeshandler.go @@ -0,0 +1,20 @@ +package userProfile + +import ( + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/userProfile" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/common/response" +) + +func GetMyBadgesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := userProfile.NewGetMyBadgesLogic(r.Context(), svcCtx) + resp, err := l.GetMyBadges() + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/userProfile/getmystarshandler.go b/app/plant/api/internal/handler/userProfile/getmystarshandler.go new file mode 100644 index 0000000..cf8d31d --- /dev/null +++ b/app/plant/api/internal/handler/userProfile/getmystarshandler.go @@ -0,0 +1,27 @@ +package userProfile + +import ( + "github.com/zeromicro/go-zero/rest/httpx" + "net/http" + "sundynix-micro-go/app/plant/api/internal/logic/userProfile" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +func GetMyStarsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.PageReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + l := userProfile.NewGetMyStarsLogic(r.Context(), svcCtx) + resp, err := l.GetMyStars(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.OkWithData(w, resp) + } + } +} diff --git a/app/plant/api/internal/handler/wiki/createwikihandler.go b/app/plant/api/internal/handler/wiki/createwikihandler.go new file mode 100644 index 0000000..a52a0fc --- /dev/null +++ b/app/plant/api/internal/handler/wiki/createwikihandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package wiki + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/wiki" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 创建百科 +func CreateWikiHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreateWikiReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := wiki.NewCreateWikiLogic(r.Context(), svcCtx) + err := l.CreateWiki(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/wiki/deletewikiclasshandler.go b/app/plant/api/internal/handler/wiki/deletewikiclasshandler.go new file mode 100644 index 0000000..0c64923 --- /dev/null +++ b/app/plant/api/internal/handler/wiki/deletewikiclasshandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package wiki + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/wiki" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 删除百科分类 +func DeleteWikiClassHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.IdsReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := wiki.NewDeleteWikiClassLogic(r.Context(), svcCtx) + err := l.DeleteWikiClass(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/wiki/deletewikihandler.go b/app/plant/api/internal/handler/wiki/deletewikihandler.go new file mode 100644 index 0000000..e3acd09 --- /dev/null +++ b/app/plant/api/internal/handler/wiki/deletewikihandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package wiki + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/wiki" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 删除百科 +func DeleteWikiHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.IdsReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := wiki.NewDeleteWikiLogic(r.Context(), svcCtx) + err := l.DeleteWiki(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/wiki/getWikiClassListHandler.go b/app/plant/api/internal/handler/wiki/getWikiClassListHandler.go index 62a2607..0d0f1a8 100644 --- a/app/plant/api/internal/handler/wiki/getWikiClassListHandler.go +++ b/app/plant/api/internal/handler/wiki/getWikiClassListHandler.go @@ -15,11 +15,11 @@ import ( func GetWikiClassListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { l := wiki.NewGetWikiClassListLogic(r.Context(), svcCtx) - err := l.GetWikiClassList() + resp, err := l.GetWikiClassList() if err != nil { response.Fail(w, err.Error()) } else { - response.Ok(w) + response.OkWithData(w, resp) } } } diff --git a/app/plant/api/internal/handler/wiki/getWikiDetailHandler.go b/app/plant/api/internal/handler/wiki/getWikiDetailHandler.go index b58d68d..44d1574 100644 --- a/app/plant/api/internal/handler/wiki/getWikiDetailHandler.go +++ b/app/plant/api/internal/handler/wiki/getWikiDetailHandler.go @@ -23,11 +23,11 @@ func GetWikiDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { } l := wiki.NewGetWikiDetailLogic(r.Context(), svcCtx) - err := l.GetWikiDetail(&req) + resp, err := l.GetWikiDetail(&req) if err != nil { response.Fail(w, err.Error()) } else { - response.Ok(w) + response.OkWithData(w, resp) } } } diff --git a/app/plant/api/internal/handler/wiki/getWikiListHandler.go b/app/plant/api/internal/handler/wiki/getWikiListHandler.go index 4b408f3..8757a0f 100644 --- a/app/plant/api/internal/handler/wiki/getWikiListHandler.go +++ b/app/plant/api/internal/handler/wiki/getWikiListHandler.go @@ -23,11 +23,11 @@ func GetWikiListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { } l := wiki.NewGetWikiListLogic(r.Context(), svcCtx) - err := l.GetWikiList(&req) + resp, err := l.GetWikiList(&req) if err != nil { response.Fail(w, err.Error()) } else { - response.Ok(w) + response.OkWithData(w, resp) } } } diff --git a/app/plant/api/internal/handler/wiki/updatewikiclasshandler.go b/app/plant/api/internal/handler/wiki/updatewikiclasshandler.go new file mode 100644 index 0000000..a95aeb6 --- /dev/null +++ b/app/plant/api/internal/handler/wiki/updatewikiclasshandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package wiki + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/wiki" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 更新百科分类 +func UpdateWikiClassHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdateWikiClassReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := wiki.NewUpdateWikiClassLogic(r.Context(), svcCtx) + err := l.UpdateWikiClass(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/handler/wiki/updatewikihandler.go b/app/plant/api/internal/handler/wiki/updatewikihandler.go new file mode 100644 index 0000000..4b17d23 --- /dev/null +++ b/app/plant/api/internal/handler/wiki/updatewikihandler.go @@ -0,0 +1,33 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package wiki + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "sundynix-micro-go/app/plant/api/internal/logic/wiki" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/common/response" +) + +// 更新百科 +func UpdateWikiHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdateWikiReq + if err := httpx.Parse(r, &req); err != nil { + response.Fail(w, err.Error()) + return + } + + l := wiki.NewUpdateWikiLogic(r.Context(), svcCtx) + err := l.UpdateWiki(&req) + if err != nil { + response.Fail(w, err.Error()) + } else { + response.Ok(w) + } + } +} diff --git a/app/plant/api/internal/logic/ai/aiChatLogic.go b/app/plant/api/internal/logic/ai/aiChatLogic.go index 7723535..2c07de1 100644 --- a/app/plant/api/internal/logic/ai/aiChatLogic.go +++ b/app/plant/api/internal/logic/ai/aiChatLogic.go @@ -5,6 +5,7 @@ package ai import ( "context" + "fmt" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" @@ -27,8 +28,8 @@ func NewAiChatLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AiChatLogi } } -func (l *AiChatLogic) AiChat(req *types.AiChatReq) error { - // todo: add your logic here and delete this line - - return nil +func (l *AiChatLogic) AiChat(req *types.AiChatReq) (string, error) { + l.Logger.Infof("AI chat request: %s", req.Question) + userID := fmt.Sprintf("%v", l.ctx.Value("userId")) + return ChatCompletion(l.ctx, l.svcCtx, userID, req.Question) } diff --git a/app/plant/api/internal/logic/ai/clearaichathistorylogic.go b/app/plant/api/internal/logic/ai/clearaichathistorylogic.go new file mode 100644 index 0000000..61aab15 --- /dev/null +++ b/app/plant/api/internal/logic/ai/clearaichathistorylogic.go @@ -0,0 +1,25 @@ +package ai + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type ClearAiChatHistoryLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewClearAiChatHistoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ClearAiChatHistoryLogic { + return &ClearAiChatHistoryLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *ClearAiChatHistoryLogic) ClearAiChatHistory() error { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + _, err := l.svcCtx.PlantRpc.ClearAiChatHistory(l.ctx, &plantPb.GetProfileReq{UserId: userId}) + return err +} diff --git a/app/plant/api/internal/logic/ai/deleteaichathistorylogic.go b/app/plant/api/internal/logic/ai/deleteaichathistorylogic.go new file mode 100644 index 0000000..20f72cf --- /dev/null +++ b/app/plant/api/internal/logic/ai/deleteaichathistorylogic.go @@ -0,0 +1,24 @@ +package ai + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteAiChatHistoryLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteAiChatHistoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteAiChatHistoryLogic { + return &DeleteAiChatHistoryLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *DeleteAiChatHistoryLogic) DeleteAiChatHistory(req *types.IdsReq) error { + _, err := l.svcCtx.PlantRpc.DeleteAiChatHistory(l.ctx, &plantPb.IdsReq{Ids: req.Ids}) + return err +} diff --git a/app/plant/api/internal/logic/ai/getAiChatHistoryLogic.go b/app/plant/api/internal/logic/ai/getAiChatHistoryLogic.go index 7f8a8d7..2dcf4ba 100644 --- a/app/plant/api/internal/logic/ai/getAiChatHistoryLogic.go +++ b/app/plant/api/internal/logic/ai/getAiChatHistoryLogic.go @@ -5,6 +5,7 @@ package ai import ( "context" + "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/plant/api/internal/svc" @@ -25,8 +26,10 @@ func NewGetAiChatHistoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) * } } -func (l *GetAiChatHistoryLogic) GetAiChatHistory() error { - // todo: add your logic here and delete this line - - return nil +// GetAiChatHistory TODO: 完善 AI 聊天历史查询 +func (l *GetAiChatHistoryLogic) GetAiChatHistory() (interface{}, error) { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + l.Logger.Infof("get ai chat history for user: %s", userId) + // 待实现:从 sundynix_ai_chat_history 表分页查询 + return map[string]interface{}{"list": []interface{}{}}, nil } diff --git a/app/plant/api/internal/logic/ai/getaichatquotalogic.go b/app/plant/api/internal/logic/ai/getaichatquotalogic.go new file mode 100644 index 0000000..fe81ad2 --- /dev/null +++ b/app/plant/api/internal/logic/ai/getaichatquotalogic.go @@ -0,0 +1,24 @@ +package ai + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetAiChatQuotaLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetAiChatQuotaLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetAiChatQuotaLogic { + return &GetAiChatQuotaLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetAiChatQuotaLogic) GetAiChatQuota() (*plantPb.AiQuotaResp, error) { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + return l.svcCtx.PlantRpc.GetAiChatQuota(l.ctx, &plantPb.GetProfileReq{UserId: userId}) +} diff --git a/app/plant/api/internal/logic/ai/openai.go b/app/plant/api/internal/logic/ai/openai.go new file mode 100644 index 0000000..dec8e66 --- /dev/null +++ b/app/plant/api/internal/logic/ai/openai.go @@ -0,0 +1,246 @@ +package ai + +import ( + "bufio" + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "strings" + + "sundynix-micro-go/app/plant/api/internal/svc" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type chatMessage struct { + Role string `json:"role"` + Content string `json:"content"` +} + +type chatRequest struct { + Model string `json:"model,omitempty"` + Messages []chatMessage `json:"messages"` + Stream bool `json:"stream"` +} + +func chatModel(svcCtx *svc.ServiceContext) string { + if svcCtx.Config.Ai.ChatModelName != "" { + return svcCtx.Config.Ai.ChatModelName + } + return "gpt-4o-mini" +} + +func requestBody(svcCtx *svc.ServiceContext, question string, stream bool) ([]byte, error) { + systemPrompt := "你是一个专业的植物百科助手。回答规则:基于知识库信息回答,不够则结合通用知识;不要使用 Markdown;用纯文本分段;回答简洁专业、条理清晰。" + if ctxText := retrieveRAGContext(context.Background(), svcCtx, question); ctxText != "" { + systemPrompt += "\n--- 知识库 ---\n" + ctxText + "\n--------------" + } + return json.Marshal(chatRequest{ + Model: chatModel(svcCtx), + Messages: []chatMessage{ + {Role: "system", Content: systemPrompt}, + {Role: "user", Content: question}, + }, + Stream: stream, + }) +} + +func retrieveRAGContext(ctx context.Context, svcCtx *svc.ServiceContext, question string) string { + c := svcCtx.Config.Ai + if c.EmbeddingApiUrl == "" || c.EmbeddingApiKey == "" || c.QdrantUrl == "" || c.QdrantCollection == "" { + return "" + } + body, _ := json.Marshal(map[string]interface{}{ + "model": c.EmbeddingModelName, + "input": question, + }) + req, err := http.NewRequestWithContext(ctx, http.MethodPost, c.EmbeddingApiUrl, bytes.NewReader(body)) + if err != nil { + return "" + } + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Authorization", "Bearer "+c.EmbeddingApiKey) + resp, err := http.DefaultClient.Do(req) + if err != nil { + return "" + } + defer resp.Body.Close() + var emb struct { + Data []struct { + Embedding []float32 `json:"embedding"` + } `json:"data"` + } + if resp.StatusCode < 200 || resp.StatusCode >= 300 || json.NewDecoder(resp.Body).Decode(&emb) != nil || len(emb.Data) == 0 { + return "" + } + + searchBody, _ := json.Marshal(map[string]interface{}{ + "vector": emb.Data[0].Embedding, + "limit": 3, + "with_payload": true, + }) + searchReq, err := http.NewRequestWithContext(ctx, http.MethodPost, strings.TrimRight(c.QdrantUrl, "/")+"/collections/"+c.QdrantCollection+"/points/search", bytes.NewReader(searchBody)) + if err != nil { + return "" + } + searchReq.Header.Set("Content-Type", "application/json") + if c.QdrantApiKey != "" { + searchReq.Header.Set("api-key", c.QdrantApiKey) + } + searchResp, err := http.DefaultClient.Do(searchReq) + if err != nil { + return "" + } + defer searchResp.Body.Close() + var parsed struct { + Result []struct { + Payload map[string]interface{} `json:"payload"` + } `json:"result"` + } + if searchResp.StatusCode < 200 || searchResp.StatusCode >= 300 || json.NewDecoder(searchResp.Body).Decode(&parsed) != nil { + return "" + } + var b strings.Builder + for _, item := range parsed.Result { + if text, ok := item.Payload["full_text"].(string); ok && text != "" { + b.WriteString(text) + b.WriteString("\n") + } + } + return b.String() +} + +func newChatRequest(ctx context.Context, svcCtx *svc.ServiceContext, body []byte) (*http.Request, error) { + if svcCtx.Config.Ai.ChatApiUrl == "" || svcCtx.Config.Ai.ChatApiKey == "" { + return nil, errors.New("AI/RAG 未配置 ChatApiUrl 或 ChatApiKey") + } + req, err := http.NewRequestWithContext(ctx, http.MethodPost, svcCtx.Config.Ai.ChatApiUrl, bytes.NewReader(body)) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Authorization", "Bearer "+svcCtx.Config.Ai.ChatApiKey) + return req, nil +} + +func SaveHistory(ctx context.Context, svcCtx *svc.ServiceContext, userID, question, answer string) { + if userID == "" || question == "" || answer == "" { + return + } + _, _ = svcCtx.PlantRpc.SaveAiChatHistory(ctx, &plantPb.SaveAiChatHistoryReq{ + UserId: userID, Question: question, Answer: answer, + }) +} + +func ChatCompletion(ctx context.Context, svcCtx *svc.ServiceContext, userID, question string) (string, error) { + if err := ensureQuota(ctx, svcCtx, userID); err != nil { + return "", err + } + body, err := requestBody(svcCtx, question, false) + if err != nil { + return "", err + } + req, err := newChatRequest(ctx, svcCtx, body) + if err != nil { + return "", err + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + return "", err + } + defer resp.Body.Close() + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + raw, _ := io.ReadAll(io.LimitReader(resp.Body, 4096)) + return "", fmt.Errorf("AI 请求失败: %s %s", resp.Status, strings.TrimSpace(string(raw))) + } + + var parsed struct { + Choices []struct { + Message struct { + Content string `json:"content"` + } `json:"message"` + } `json:"choices"` + } + if err := json.NewDecoder(resp.Body).Decode(&parsed); err != nil { + return "", err + } + if len(parsed.Choices) == 0 || parsed.Choices[0].Message.Content == "" { + return "", errors.New("AI 响应为空") + } + answer := parsed.Choices[0].Message.Content + SaveHistory(ctx, svcCtx, userID, question, answer) + return answer, nil +} + +func StreamChat(ctx context.Context, svcCtx *svc.ServiceContext, userID, question string, w io.Writer) error { + if err := ensureQuota(ctx, svcCtx, userID); err != nil { + return err + } + body, err := requestBody(svcCtx, question, true) + if err != nil { + return err + } + req, err := newChatRequest(ctx, svcCtx, body) + if err != nil { + return err + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + raw, _ := io.ReadAll(io.LimitReader(resp.Body, 4096)) + return fmt.Errorf("AI 请求失败: %s %s", resp.Status, strings.TrimSpace(string(raw))) + } + + var answer strings.Builder + scanner := bufio.NewScanner(resp.Body) + for scanner.Scan() { + line := scanner.Text() + _, _ = fmt.Fprintln(w, line) + if flusher, ok := w.(http.Flusher); ok { + flusher.Flush() + } + + if !strings.HasPrefix(line, "data: ") { + continue + } + data := strings.TrimSpace(strings.TrimPrefix(line, "data: ")) + if data == "[DONE]" { + continue + } + var chunk struct { + Choices []struct { + Delta struct { + Content string `json:"content"` + } `json:"delta"` + } `json:"choices"` + } + if json.Unmarshal([]byte(data), &chunk) == nil && len(chunk.Choices) > 0 { + answer.WriteString(chunk.Choices[0].Delta.Content) + } + } + if err := scanner.Err(); err != nil { + return err + } + SaveHistory(ctx, svcCtx, userID, question, answer.String()) + return nil +} + +func ensureQuota(ctx context.Context, svcCtx *svc.ServiceContext, userID string) error { + if userID == "" { + return nil + } + quota, err := svcCtx.PlantRpc.GetAiChatQuota(ctx, &plantPb.GetProfileReq{UserId: userID}) + if err != nil { + return err + } + if quota.Limit > 0 && quota.Remaining <= 0 { + return fmt.Errorf("今日问答次数已达上限(%d次),明天再来吧", quota.Limit) + } + return nil +} diff --git a/app/plant/api/internal/logic/banner/createBannerLogic.go b/app/plant/api/internal/logic/banner/createBannerLogic.go new file mode 100644 index 0000000..f2b09d8 --- /dev/null +++ b/app/plant/api/internal/logic/banner/createBannerLogic.go @@ -0,0 +1,38 @@ +package banner + +import ( + "context" + "fmt" + + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantModel "sundynix-micro-go/app/plant/model" + + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateBannerLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateBannerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateBannerLogic { + return &CreateBannerLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *CreateBannerLogic) CreateBanner(req *types.CreateBannerReq) error { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + _ = userId + banner := plantModel.Banner{ + Title: req.Title, + ImageID: req.ImageId, + Sort: req.Sort, + IsActive: req.IsActive, + TargetURL: req.TargetUrl, + } + if banner.IsActive == 0 { + banner.IsActive = 1 + } + return l.svcCtx.DB.Create(&banner).Error +} diff --git a/app/plant/api/internal/logic/banner/deleteBannerLogic.go b/app/plant/api/internal/logic/banner/deleteBannerLogic.go new file mode 100644 index 0000000..2a976cd --- /dev/null +++ b/app/plant/api/internal/logic/banner/deleteBannerLogic.go @@ -0,0 +1,26 @@ +package banner + +import ( + "context" + + "sundynix-micro-go/app/plant/api/internal/types" + plantModel "sundynix-micro-go/app/plant/model" + + "sundynix-micro-go/app/plant/api/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteBannerLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteBannerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteBannerLogic { + return &DeleteBannerLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *DeleteBannerLogic) DeleteBanner(req *types.IdReq) error { + return l.svcCtx.DB.Where("id = ?", req.Id).Delete(&plantModel.Banner{}).Error +} diff --git a/app/plant/api/internal/logic/banner/getActiveBannerListLogic.go b/app/plant/api/internal/logic/banner/getActiveBannerListLogic.go new file mode 100644 index 0000000..95a576c --- /dev/null +++ b/app/plant/api/internal/logic/banner/getActiveBannerListLogic.go @@ -0,0 +1,88 @@ +package banner + +import ( + "context" + + "sundynix-micro-go/app/file/rpc/fileservice" + "sundynix-micro-go/app/plant/api/internal/svc" + plantModel "sundynix-micro-go/app/plant/model" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetActiveBannerListLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetActiveBannerListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetActiveBannerListLogic { + return &GetActiveBannerListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetActiveBannerListLogic) GetActiveBannerList() (interface{}, error) { + var list []plantModel.Banner + l.svcCtx.DB.Model(&plantModel.Banner{}). + Where("is_active = 1"). + Order("sort asc, created_at desc"). + Find(&list) + + // Collect image IDs for batch fetch + var imageIds []string + for _, item := range list { + if item.ImageID != "" { + imageIds = append(imageIds, item.ImageID) + } + } + + // Fetch image URLs from file service + imageUrlMap := make(map[string]string) + if len(imageIds) > 0 { + resp, err := l.svcCtx.FileRpc.GetFilesByIds(l.ctx, &fileservice.GetFilesByIdsReq{Ids: imageIds}) + if err != nil { + logx.Errorf("Fetch banner image files failed: %v", err) + } else if resp != nil { + for _, f := range resp.Files { + if f != nil && f.Url != "" { + imageUrlMap[f.Id] = f.Url + } + } + } + } + + type BannerItem struct { + Id string `json:"id"` + Title string `json:"title"` + ImageId string `json:"imageId"` + ImageUrl string `json:"imageUrl"` + Sort int `json:"sort"` + IsActive int `json:"isActive"` + TargetUrl string `json:"targetUrl"` + CreatedAt string `json:"createdAt"` + } + var result []BannerItem + for _, item := range list { + imageUrl := "" + if u, ok := imageUrlMap[item.ImageID]; ok { + imageUrl = u + } + createdAt := "" + if !item.CreatedAt.IsZero() { + createdAt = item.CreatedAt.Format("2006-01-02 15:04:05") + } + result = append(result, BannerItem{ + Id: item.ID, + Title: item.Title, + ImageId: item.ImageID, + ImageUrl: imageUrl, + Sort: item.Sort, + IsActive: item.IsActive, + TargetUrl: item.TargetURL, + CreatedAt: createdAt, + }) + } + + return map[string]interface{}{ + "list": result, + }, nil +} diff --git a/app/plant/api/internal/logic/banner/getBannerListLogic.go b/app/plant/api/internal/logic/banner/getBannerListLogic.go new file mode 100644 index 0000000..293ef9e --- /dev/null +++ b/app/plant/api/internal/logic/banner/getBannerListLogic.go @@ -0,0 +1,78 @@ +package banner + +import ( + "context" + "math" + + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantModel "sundynix-micro-go/app/plant/model" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetBannerListLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetBannerListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetBannerListLogic { + return &GetBannerListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetBannerListLogic) GetBannerList(req *types.BannerListReq) (interface{}, error) { + db := l.svcCtx.DB.Model(&plantModel.Banner{}) + if req.Title != "" { + db = db.Where("title LIKE ?", "%"+req.Title+"%") + } + if req.IsActive > 0 { + db = db.Where("is_active = ?", req.IsActive) + } + + var total int64 + db.Count(&total) + + pageSize := req.PageSize + if pageSize <= 0 { + pageSize = 10 + } + current := req.Current + if current <= 0 { + current = 1 + } + offset := (current - 1) * pageSize + + var list []plantModel.Banner + db.Order("sort asc, created_at desc").Limit(pageSize).Offset(offset).Find(&list) + + type BannerItem struct { + Id string `json:"id"` + Title string `json:"title"` + ImageId string `json:"imageId"` + Sort int `json:"sort"` + IsActive int `json:"isActive"` + TargetUrl string `json:"targetUrl"` + CreatedAt string `json:"createdAt"` + } + var result []BannerItem + for _, item := range list { + result = append(result, BannerItem{ + Id: item.ID, + Title: item.Title, + ImageId: item.ImageID, + Sort: item.Sort, + IsActive: item.IsActive, + TargetUrl: item.TargetURL, + CreatedAt: item.CreatedAt.Format("2006-01-02 15:04:05"), + }) + } + + return map[string]interface{}{ + "list": result, + "total": total, + "page": current, + "pageSize": pageSize, + "totalPage": math.Ceil(float64(total) / float64(pageSize)), + }, nil +} diff --git a/app/plant/api/internal/logic/banner/updateBannerLogic.go b/app/plant/api/internal/logic/banner/updateBannerLogic.go new file mode 100644 index 0000000..f5c64f4 --- /dev/null +++ b/app/plant/api/internal/logic/banner/updateBannerLogic.go @@ -0,0 +1,41 @@ +package banner + +import ( + "context" + + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantModel "sundynix-micro-go/app/plant/model" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateBannerLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateBannerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateBannerLogic { + return &UpdateBannerLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *UpdateBannerLogic) UpdateBanner(req *types.UpdateBannerReq) error { + updates := map[string]interface{}{} + if req.Title != "" { + updates["title"] = req.Title + } + if req.ImageId != "" { + updates["image_id"] = req.ImageId + } + if req.Sort != 0 { + updates["sort"] = req.Sort + } + if req.IsActive != 0 { + updates["is_active"] = req.IsActive + } + if req.TargetUrl != "" { + updates["target_url"] = req.TargetUrl + } + return l.svcCtx.DB.Model(&plantModel.Banner{}).Where("id = ?", req.Id).Updates(updates).Error +} diff --git a/app/plant/api/internal/logic/callback/wechatPayCallbackLogic.go b/app/plant/api/internal/logic/callback/wechatPayCallbackLogic.go index 71471ad..fc5e90b 100644 --- a/app/plant/api/internal/logic/callback/wechatPayCallbackLogic.go +++ b/app/plant/api/internal/logic/callback/wechatPayCallbackLogic.go @@ -5,6 +5,9 @@ package callback import ( "context" + "encoding/json" + "io" + "net/http" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/plant/api/internal/svc" @@ -25,8 +28,52 @@ func NewWechatPayCallbackLogic(ctx context.Context, svcCtx *svc.ServiceContext) } } -func (l *WechatPayCallbackLogic) WechatPayCallback() error { - // todo: add your logic here and delete this line +// wechatNotify 微信支付回调通知结构 +type wechatNotify struct { + Id string `json:"id"` + EventType string `json:"event_type"` + Summary string `json:"summary"` + ResourceType string `json:"resource_type"` + Resource struct { + Algorithm string `json:"algorithm"` + Ciphertext string `json:"ciphertext"` + AssociatedData string `json:"associated_data"` + Nonce string `json:"nonce"` + } `json:"resource"` +} + +// WechatPayCallback 微信支付回调处理 +// TODO: 接入 wechatpay-go SDK 完成验签 + 解密 + 订单状态更新 +// +// 完整接入步骤: +// 1. go get github.com/wechatpay-apiv3/wechatpay-go +// 2. 在 config 中添加 WechatPay{ MchId, MchAPIv3Key, PrivateKeyPath, PublicKeyId, PublicKeyPath } +// 3. 使用 notify.NewRSANotifyHandler 验签解密 +// 4. 解析 payments.Transaction 后根据 TradeState == "SUCCESS" 更新 sundynix_exchange_order 状态 +func (l *WechatPayCallbackLogic) WechatPayCallback(r *http.Request) error { + // 1. 读取请求体 + body, err := io.ReadAll(r.Body) + if err != nil { + l.Logger.Errorf("[微信支付回调] 读取请求体失败: %v", err) + return err + } + defer r.Body.Close() + + // 2. 解析通知基本结构(不验签,记录日志) + var notify wechatNotify + if err = json.Unmarshal(body, ¬ify); err != nil { + l.Logger.Errorf("[微信支付回调] 解析通知失败: %v, body: %s", err, string(body)) + return err + } + + l.Logger.Infof("[微信支付回调] 收到通知 id=%s, event=%s, summary=%s", + notify.Id, notify.EventType, notify.Summary) + + // TODO: 完成验签 + 解密 + 业务处理 + // if notify.EventType == "TRANSACTION.SUCCESS" { + // transaction := decrypt(notify.Resource, mchAPIv3Key) + // updateOrderStatus(transaction.OutTradeNo, "SUCCESS") + // } return nil } diff --git a/app/plant/api/internal/logic/complete/completetasklogic.go b/app/plant/api/internal/logic/complete/completetasklogic.go new file mode 100644 index 0000000..cf863a6 --- /dev/null +++ b/app/plant/api/internal/logic/complete/completetasklogic.go @@ -0,0 +1,28 @@ +package complete + +import ( + "context" + "fmt" + + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type CompleteTaskLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCompleteTaskLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CompleteTaskLogic { + return &CompleteTaskLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *CompleteTaskLogic) CompleteTask(req *types.CompleteTaskApiReq) (*plantPb.TaskCompletionResult, error) { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + return l.svcCtx.PlantRpc.CompleteTask(l.ctx, &plantPb.CompleteTaskReq{ + UserId: userId, TaskId: req.TaskId, Remark: req.Remark, + }) +} diff --git a/app/plant/api/internal/logic/complete/getaichathistorylogic.go b/app/plant/api/internal/logic/complete/getaichathistorylogic.go new file mode 100644 index 0000000..00793a8 --- /dev/null +++ b/app/plant/api/internal/logic/complete/getaichathistorylogic.go @@ -0,0 +1,28 @@ +package complete + +import ( + "context" + "fmt" + + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetAiChatHistoryLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetAiChatHistoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetAiChatHistoryLogic { + return &GetAiChatHistoryLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetAiChatHistoryLogic) GetAiChatHistory(req *types.PageReq) (*plantPb.AiChatHistoryResp, error) { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + return l.svcCtx.PlantRpc.GetAiChatHistory(l.ctx, &plantPb.AiChatHistoryReq{ + UserId: userId, Current: int32(req.Current), PageSize: int32(req.PageSize), + }) +} diff --git a/app/plant/api/internal/logic/complete/getbadgeconfigtreelogic.go b/app/plant/api/internal/logic/complete/getbadgeconfigtreelogic.go new file mode 100644 index 0000000..50c529e --- /dev/null +++ b/app/plant/api/internal/logic/complete/getbadgeconfigtreelogic.go @@ -0,0 +1,23 @@ +package complete + +import ( + "context" + + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetBadgeConfigTreeLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetBadgeConfigTreeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetBadgeConfigTreeLogic { + return &GetBadgeConfigTreeLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetBadgeConfigTreeLogic) GetBadgeConfigTree() (*plantPb.BadgeConfigTreeResp, error) { + return l.svcCtx.PlantRpc.GetBadgeConfigTree(l.ctx, &plantPb.IdReq{}) +} diff --git a/app/plant/api/internal/logic/complete/getexchangeitemdetaillogic.go b/app/plant/api/internal/logic/complete/getexchangeitemdetaillogic.go new file mode 100644 index 0000000..ddcd2a8 --- /dev/null +++ b/app/plant/api/internal/logic/complete/getexchangeitemdetaillogic.go @@ -0,0 +1,24 @@ +package complete + +import ( + "context" + + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetExchangeItemDetailLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetExchangeItemDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetExchangeItemDetailLogic { + return &GetExchangeItemDetailLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetExchangeItemDetailLogic) GetExchangeItemDetail(req *types.IdPathReq) (*plantPb.ExchangeItemInfo, error) { + return l.svcCtx.PlantRpc.GetExchangeItemDetail(l.ctx, &plantPb.IdReq{Id: req.Id}) +} diff --git a/app/plant/api/internal/logic/complete/getlevelconfigdetaillogic.go b/app/plant/api/internal/logic/complete/getlevelconfigdetaillogic.go new file mode 100644 index 0000000..4801725 --- /dev/null +++ b/app/plant/api/internal/logic/complete/getlevelconfigdetaillogic.go @@ -0,0 +1,24 @@ +package complete + +import ( + "context" + + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetLevelConfigDetailLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetLevelConfigDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetLevelConfigDetailLogic { + return &GetLevelConfigDetailLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetLevelConfigDetailLogic) GetLevelConfigDetail(req *types.IdPathReq) (*plantPb.LevelConfigInfo, error) { + return l.svcCtx.PlantRpc.GetLevelConfigDetail(l.ctx, &plantPb.IdReq{Id: req.Id}) +} diff --git a/app/plant/api/internal/logic/complete/getwikiclassdetaillogic.go b/app/plant/api/internal/logic/complete/getwikiclassdetaillogic.go new file mode 100644 index 0000000..fa4d39b --- /dev/null +++ b/app/plant/api/internal/logic/complete/getwikiclassdetaillogic.go @@ -0,0 +1,24 @@ +package complete + +import ( + "context" + + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetWikiClassDetailLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetWikiClassDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetWikiClassDetailLogic { + return &GetWikiClassDetailLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetWikiClassDetailLogic) GetWikiClassDetail(req *types.IdPathReq) (*plantPb.WikiClassInfo, error) { + return l.svcCtx.PlantRpc.GetWikiClassDetail(l.ctx, &plantPb.IdReq{Id: req.Id}) +} diff --git a/app/plant/api/internal/logic/config/createbadgeconfiglogic.go b/app/plant/api/internal/logic/config/createbadgeconfiglogic.go new file mode 100644 index 0000000..1e37f46 --- /dev/null +++ b/app/plant/api/internal/logic/config/createbadgeconfiglogic.go @@ -0,0 +1,28 @@ +package config + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type CreateBadgeConfigLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateBadgeConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateBadgeConfigLogic { + return &CreateBadgeConfigLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *CreateBadgeConfigLogic) CreateBadgeConfig(req *types.CreateBadgeConfigReq) error { + _, err := l.svcCtx.PlantRpc.CreateBadgeConfig(l.ctx, &plantPb.CreateBadgeConfigReq{ + Name: req.Name, Description: req.Description, Dimension: req.Dimension, + GroupId: req.GroupId, Tier: int32(req.Tier), TargetAction: req.TargetAction, + Threshold: req.Threshold, RewardSunlight: req.RewardSunlight, IconId: req.IconId, Sort: int32(req.Sort), + }) + return err +} diff --git a/app/plant/api/internal/logic/config/createlevelconfiglogic.go b/app/plant/api/internal/logic/config/createlevelconfiglogic.go new file mode 100644 index 0000000..4cfe94a --- /dev/null +++ b/app/plant/api/internal/logic/config/createlevelconfiglogic.go @@ -0,0 +1,26 @@ +package config + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type CreateLevelConfigLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateLevelConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateLevelConfigLogic { + return &CreateLevelConfigLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *CreateLevelConfigLogic) CreateLevelConfig(req *types.CreateLevelConfigReq) error { + _, err := l.svcCtx.PlantRpc.CreateLevelConfig(l.ctx, &plantPb.CreateLevelConfigReq{ + Level: int32(req.Level), Title: req.Title, MinSunlight: req.MinSunlight, Perks: req.Perks, + }) + return err +} diff --git a/app/plant/api/internal/logic/config/deletebadgeconfiglogic.go b/app/plant/api/internal/logic/config/deletebadgeconfiglogic.go new file mode 100644 index 0000000..2bfa943 --- /dev/null +++ b/app/plant/api/internal/logic/config/deletebadgeconfiglogic.go @@ -0,0 +1,24 @@ +package config + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteBadgeConfigLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteBadgeConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteBadgeConfigLogic { + return &DeleteBadgeConfigLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *DeleteBadgeConfigLogic) DeleteBadgeConfig(req *types.IdsReq) error { + _, err := l.svcCtx.PlantRpc.DeleteBadgeConfig(l.ctx, &plantPb.IdsReq{Ids: req.Ids}) + return err +} diff --git a/app/plant/api/internal/logic/config/deletelevelconfiglogic.go b/app/plant/api/internal/logic/config/deletelevelconfiglogic.go new file mode 100644 index 0000000..a8bdde1 --- /dev/null +++ b/app/plant/api/internal/logic/config/deletelevelconfiglogic.go @@ -0,0 +1,24 @@ +package config + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteLevelConfigLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteLevelConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteLevelConfigLogic { + return &DeleteLevelConfigLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *DeleteLevelConfigLogic) DeleteLevelConfig(req *types.IdsReq) error { + _, err := l.svcCtx.PlantRpc.DeleteLevelConfig(l.ctx, &plantPb.IdsReq{Ids: req.Ids}) + return err +} diff --git a/app/plant/api/internal/logic/config/getBadgeConfigListLogic.go b/app/plant/api/internal/logic/config/getBadgeConfigListLogic.go index b5cfea9..e7cbe14 100644 --- a/app/plant/api/internal/logic/config/getBadgeConfigListLogic.go +++ b/app/plant/api/internal/logic/config/getBadgeConfigListLogic.go @@ -8,6 +8,7 @@ import ( "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -27,8 +28,17 @@ func NewGetBadgeConfigListLogic(ctx context.Context, svcCtx *svc.ServiceContext) } } -func (l *GetBadgeConfigListLogic) GetBadgeConfigList(req *types.BadgeConfigListReq) error { - // todo: add your logic here and delete this line - - return nil +func (l *GetBadgeConfigListLogic) GetBadgeConfigList(req *types.BadgeConfigListReq) (interface{}, error) { + result, err := l.svcCtx.PlantRpc.GetBadgeConfigList(l.ctx, &plant.BadgeConfigListReq{ + Current: int32(req.Current), + PageSize: int32(req.PageSize), + Dimension: req.Dimension, + }) + if err != nil { + return nil, err + } + return map[string]interface{}{ + "list": result.List, + "total": result.Total, + }, nil } diff --git a/app/plant/api/internal/logic/config/getLevelConfigListLogic.go b/app/plant/api/internal/logic/config/getLevelConfigListLogic.go index 6e13c4d..bd00053 100644 --- a/app/plant/api/internal/logic/config/getLevelConfigListLogic.go +++ b/app/plant/api/internal/logic/config/getLevelConfigListLogic.go @@ -8,6 +8,7 @@ import ( "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -27,8 +28,15 @@ func NewGetLevelConfigListLogic(ctx context.Context, svcCtx *svc.ServiceContext) } } -func (l *GetLevelConfigListLogic) GetLevelConfigList(req *types.LevelConfigListReq) error { - // todo: add your logic here and delete this line - - return nil +func (l *GetLevelConfigListLogic) GetLevelConfigList(req *types.LevelConfigListReq) (interface{}, error) { + result, err := l.svcCtx.PlantRpc.GetLevelConfigList(l.ctx, &plant.PageReq{ + Current: int32(req.Current), + PageSize: int32(req.PageSize), + }) + if err != nil { + return nil, err + } + return map[string]interface{}{ + "list": result.List, + }, nil } diff --git a/app/plant/api/internal/logic/config/updatebadgeconfiglogic.go b/app/plant/api/internal/logic/config/updatebadgeconfiglogic.go new file mode 100644 index 0000000..55c5591 --- /dev/null +++ b/app/plant/api/internal/logic/config/updatebadgeconfiglogic.go @@ -0,0 +1,28 @@ +package config + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type UpdateBadgeConfigLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateBadgeConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateBadgeConfigLogic { + return &UpdateBadgeConfigLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *UpdateBadgeConfigLogic) UpdateBadgeConfig(req *types.UpdateBadgeConfigReq) error { + _, err := l.svcCtx.PlantRpc.UpdateBadgeConfig(l.ctx, &plantPb.UpdateBadgeConfigReq{ + Id: req.Id, Name: req.Name, Description: req.Description, Dimension: req.Dimension, + GroupId: req.GroupId, Tier: int32(req.Tier), TargetAction: req.TargetAction, + Threshold: req.Threshold, RewardSunlight: req.RewardSunlight, IconId: req.IconId, Sort: int32(req.Sort), + }) + return err +} diff --git a/app/plant/api/internal/logic/config/updatelevelconfiglogic.go b/app/plant/api/internal/logic/config/updatelevelconfiglogic.go new file mode 100644 index 0000000..eec8950 --- /dev/null +++ b/app/plant/api/internal/logic/config/updatelevelconfiglogic.go @@ -0,0 +1,26 @@ +package config + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type UpdateLevelConfigLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateLevelConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateLevelConfigLogic { + return &UpdateLevelConfigLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *UpdateLevelConfigLogic) UpdateLevelConfig(req *types.UpdateLevelConfigReq) error { + _, err := l.svcCtx.PlantRpc.UpdateLevelConfig(l.ctx, &plantPb.UpdateLevelConfigReq{ + Id: req.Id, Level: int32(req.Level), Title: req.Title, MinSunlight: req.MinSunlight, Perks: req.Perks, + }) + return err +} diff --git a/app/plant/api/internal/logic/exchange/createExchangeOrderLogic.go b/app/plant/api/internal/logic/exchange/createExchangeOrderLogic.go index 097a860..06be8b1 100644 --- a/app/plant/api/internal/logic/exchange/createExchangeOrderLogic.go +++ b/app/plant/api/internal/logic/exchange/createExchangeOrderLogic.go @@ -5,9 +5,11 @@ package exchange import ( "context" + "fmt" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -28,7 +30,14 @@ func NewCreateExchangeOrderLogic(ctx context.Context, svcCtx *svc.ServiceContext } func (l *CreateExchangeOrderLogic) CreateExchangeOrder(req *types.ExchangeOrderReq) error { - // todo: add your logic here and delete this line - - return nil + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + _, err := l.svcCtx.PlantRpc.CreateExchangeOrder(l.ctx, &plant.CreateExchangeOrderReq{ + UserId: userId, + ItemId: req.ItemId, + Quantity: int32(req.Quantity), + RecipientName: req.RecipientName, + Phone: req.Phone, + Address: req.Address, + }) + return err } diff --git a/app/plant/api/internal/logic/exchange/createexchangeitemlogic.go b/app/plant/api/internal/logic/exchange/createexchangeitemlogic.go new file mode 100644 index 0000000..edd505f --- /dev/null +++ b/app/plant/api/internal/logic/exchange/createexchangeitemlogic.go @@ -0,0 +1,40 @@ +package exchange + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type CreateExchangeItemLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateExchangeItemLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateExchangeItemLogic { + return &CreateExchangeItemLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *CreateExchangeItemLogic) CreateExchangeItem(req *types.CreateExchangeItemReq) error { + desc := req.Desc + if desc == "" { + desc = req.Description + } + imgID := req.ImgId + if imgID == "" { + imgID = req.ImageId + } + cost := req.Cost + if cost == 0 { + cost = req.CostSunlight + } + _, err := l.svcCtx.PlantRpc.CreateExchangeItem(l.ctx, &plantPb.CreateExchangeItemReq{ + Name: req.Name, Desc: desc, ImgId: imgID, Cost: cost, Stock: int32(req.Stock), + Type: req.Type, CostSunlight: req.CostSunlight, LimitPerUser: int32(req.LimitPerUser), + Sort: int32(req.Sort), StartTime: req.StartTime, EndTime: req.EndTime, ImageId: req.ImageId, + }) + return err +} diff --git a/app/plant/api/internal/logic/exchange/deleteexchangeitemlogic.go b/app/plant/api/internal/logic/exchange/deleteexchangeitemlogic.go new file mode 100644 index 0000000..9eef33f --- /dev/null +++ b/app/plant/api/internal/logic/exchange/deleteexchangeitemlogic.go @@ -0,0 +1,24 @@ +package exchange + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteExchangeItemLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteExchangeItemLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteExchangeItemLogic { + return &DeleteExchangeItemLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *DeleteExchangeItemLogic) DeleteExchangeItem(req *types.IdsReq) error { + _, err := l.svcCtx.PlantRpc.DeleteExchangeItem(l.ctx, &plantPb.IdsReq{Ids: req.Ids}) + return err +} diff --git a/app/plant/api/internal/logic/exchange/getExchangeItemListLogic.go b/app/plant/api/internal/logic/exchange/getExchangeItemListLogic.go index 757ae33..0d745d4 100644 --- a/app/plant/api/internal/logic/exchange/getExchangeItemListLogic.go +++ b/app/plant/api/internal/logic/exchange/getExchangeItemListLogic.go @@ -8,6 +8,7 @@ import ( "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -27,8 +28,16 @@ func NewGetExchangeItemListLogic(ctx context.Context, svcCtx *svc.ServiceContext } } -func (l *GetExchangeItemListLogic) GetExchangeItemList(req *types.ExchangeItemListReq) error { - // todo: add your logic here and delete this line - - return nil +func (l *GetExchangeItemListLogic) GetExchangeItemList(req *types.ExchangeItemListReq) (interface{}, error) { + result, err := l.svcCtx.PlantRpc.GetExchangeItemList(l.ctx, &plant.ExchangeItemListReq{ + Current: int32(req.Current), + PageSize: int32(req.PageSize), + }) + if err != nil { + return nil, err + } + return map[string]interface{}{ + "list": result.List, + "total": result.Total, + }, nil } diff --git a/app/plant/api/internal/logic/exchange/getexchangeorderlistlogic.go b/app/plant/api/internal/logic/exchange/getexchangeorderlistlogic.go new file mode 100644 index 0000000..659a8ac --- /dev/null +++ b/app/plant/api/internal/logic/exchange/getexchangeorderlistlogic.go @@ -0,0 +1,25 @@ +package exchange + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetExchangeOrderListLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetExchangeOrderListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetExchangeOrderListLogic { + return &GetExchangeOrderListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetExchangeOrderListLogic) GetExchangeOrderList(req *types.ExchangeOrderListReq) (*plantPb.ExchangeOrderListResp, error) { + return l.svcCtx.PlantRpc.GetExchangeOrderList(l.ctx, &plantPb.ExchangeOrderListReq{ + UserId: req.UserId, Current: int32(req.Current), PageSize: int32(req.PageSize), Status: int32(req.Status), + }) +} diff --git a/app/plant/api/internal/logic/exchange/getmyexchangeorderslogic.go b/app/plant/api/internal/logic/exchange/getmyexchangeorderslogic.go new file mode 100644 index 0000000..3010ee7 --- /dev/null +++ b/app/plant/api/internal/logic/exchange/getmyexchangeorderslogic.go @@ -0,0 +1,27 @@ +package exchange + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetMyExchangeOrdersLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetMyExchangeOrdersLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMyExchangeOrdersLogic { + return &GetMyExchangeOrdersLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetMyExchangeOrdersLogic) GetMyExchangeOrders(req *types.ExchangeOrderListReq) (*plantPb.ExchangeOrderListResp, error) { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + return l.svcCtx.PlantRpc.GetMyExchangeOrders(l.ctx, &plantPb.ExchangeOrderListReq{ + UserId: userId, Current: int32(req.Current), PageSize: int32(req.PageSize), Status: int32(req.Status), + }) +} diff --git a/app/plant/api/internal/logic/exchange/updateexchangeitemlogic.go b/app/plant/api/internal/logic/exchange/updateexchangeitemlogic.go new file mode 100644 index 0000000..12e96a0 --- /dev/null +++ b/app/plant/api/internal/logic/exchange/updateexchangeitemlogic.go @@ -0,0 +1,41 @@ +package exchange + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type UpdateExchangeItemLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateExchangeItemLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateExchangeItemLogic { + return &UpdateExchangeItemLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *UpdateExchangeItemLogic) UpdateExchangeItem(req *types.UpdateExchangeItemReq) error { + desc := req.Desc + if desc == "" { + desc = req.Description + } + imgID := req.ImgId + if imgID == "" { + imgID = req.ImageId + } + cost := req.Cost + if cost == 0 { + cost = req.CostSunlight + } + _, err := l.svcCtx.PlantRpc.UpdateExchangeItem(l.ctx, &plantPb.UpdateExchangeItemReq{ + Id: req.Id, Name: req.Name, Desc: desc, ImgId: imgID, + Cost: cost, Stock: int32(req.Stock), Status: int32(req.Status), + Type: req.Type, CostSunlight: req.CostSunlight, LimitPerUser: int32(req.LimitPerUser), + Sort: int32(req.Sort), StartTime: req.StartTime, EndTime: req.EndTime, ImageId: req.ImageId, + }) + return err +} diff --git a/app/plant/api/internal/logic/exchange/updateexchangeorderlogic.go b/app/plant/api/internal/logic/exchange/updateexchangeorderlogic.go new file mode 100644 index 0000000..18b6d61 --- /dev/null +++ b/app/plant/api/internal/logic/exchange/updateexchangeorderlogic.go @@ -0,0 +1,26 @@ +package exchange + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type UpdateExchangeOrderLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateExchangeOrderLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateExchangeOrderLogic { + return &UpdateExchangeOrderLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *UpdateExchangeOrderLogic) UpdateExchangeOrder(req *types.UpdateExchangeOrderReq) error { + _, err := l.svcCtx.PlantRpc.UpdateExchangeOrder(l.ctx, &plantPb.UpdateExchangeOrderReq{ + Id: req.Id, Status: int32(req.Status), TrackingNo: req.TrackingNo, Remark: req.Remark, + }) + return err +} diff --git a/app/plant/api/internal/logic/myPlant/createPlantLogic.go b/app/plant/api/internal/logic/myPlant/createPlantLogic.go index 7ba5dce..df9a989 100644 --- a/app/plant/api/internal/logic/myPlant/createPlantLogic.go +++ b/app/plant/api/internal/logic/myPlant/createPlantLogic.go @@ -21,10 +21,35 @@ func NewCreatePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Creat func (l *CreatePlantLogic) CreatePlant(req *types.CreatePlantReq) error { userId := fmt.Sprintf("%v", l.ctx.Value("userId")) - _, err := l.svcCtx.PlantRpc.CreatePlant(l.ctx, &plant.CreatePlantReq{ + imgIds := req.ImgIds + if len(imgIds) == 0 { + imgIds = req.OssIds + } + resp, err := l.svcCtx.PlantRpc.CreatePlant(l.ctx, &plant.CreatePlantReq{ UserId: userId, Name: req.Name, PlantTime: req.PlantTime, Placement: req.Placement, PotMaterial: req.PotMaterial, PotSize: req.PotSize, Sunlight: req.Sunlight, - PlantingMaterial: req.PlantingMaterial, ImgIds: req.ImgIds, + PlantingMaterial: req.PlantingMaterial, ImgIds: imgIds, }) - return err + if err != nil { + return err + } + if resp == nil || resp.Msg == "" || resp.Msg == "ok" { + return nil + } + for _, planReq := range req.CarePlans { + if planReq.Name == "" || planReq.Period <= 0 { + continue + } + if _, err = l.svcCtx.PlantRpc.AddCarePlan(l.ctx, &plant.AddCarePlanReq{ + UserId: userId, + PlantId: resp.Msg, + Name: planReq.Name, + Icon: planReq.Icon, + TargetAction: planReq.TargetAction, + Period: int32(planReq.Period), + }); err != nil { + return err + } + } + return nil } diff --git a/app/plant/api/internal/logic/myPlant/deletecareplanlogic.go b/app/plant/api/internal/logic/myPlant/deletecareplanlogic.go new file mode 100644 index 0000000..ee807dc --- /dev/null +++ b/app/plant/api/internal/logic/myPlant/deletecareplanlogic.go @@ -0,0 +1,24 @@ +package myPlant + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteCarePlanLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteCarePlanLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteCarePlanLogic { + return &DeleteCarePlanLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *DeleteCarePlanLogic) DeleteCarePlan(req *types.IdsReq) error { + _, err := l.svcCtx.PlantRpc.DeleteCarePlan(l.ctx, &plantPb.IdsReq{Ids: req.Ids}) + return err +} diff --git a/app/plant/api/internal/logic/myPlant/getMyPlantListLogic.go b/app/plant/api/internal/logic/myPlant/getMyPlantListLogic.go index e3dd59a..edda406 100644 --- a/app/plant/api/internal/logic/myPlant/getMyPlantListLogic.go +++ b/app/plant/api/internal/logic/myPlant/getMyPlantListLogic.go @@ -3,10 +3,12 @@ package myPlant import ( "context" "fmt" - "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" - "sundynix-micro-go/app/plant/rpc/plant" + plantModel "sundynix-micro-go/app/plant/model" + + "github.com/zeromicro/go-zero/core/logx" ) type GetMyPlantListLogic struct { @@ -19,13 +21,130 @@ func NewGetMyPlantListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge return &GetMyPlantListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} } +type plantListResp struct { + List interface{} `json:"list"` + Total int64 `json:"total"` + Page int `json:"page"` + PageSize int `json:"pageSize"` +} + +type PlantItem struct { + ID string `json:"id"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` + CreatedAtStr string `json:"createdAtStr"` + UserID string `json:"userId"` + Name string `json:"name"` + PlantTime string `json:"plantTime"` + Status int `json:"status"` + Placement string `json:"placement"` + PotMaterial string `json:"potMaterial"` + PotSize string `json:"potSize"` + Sunlight string `json:"sunlight"` + PlantingMaterial string `json:"plantingMaterial"` + ImgList []ImageInfo `json:"imgList"` + CarePlans interface{} `json:"carePlans"` + CareTasks interface{} `json:"careTasks"` + CareRecords interface{} `json:"careRecords"` + GrowthRecords interface{} `json:"growthRecords"` +} + func (l *GetMyPlantListLogic) GetMyPlantList(req *types.PlantListReq) (resp interface{}, err error) { userId := fmt.Sprintf("%v", l.ctx.Value("userId")) - result, err := l.svcCtx.PlantRpc.GetPlantList(l.ctx, &plant.PlantListReq{ - UserId: userId, Current: int32(req.Current), PageSize: int32(req.PageSize), Name: req.Name, - }) - if err != nil { + + db := l.svcCtx.DB.Model(&plantModel.MyPlant{}).Where("user_id = ?", userId) + if req.Name != "" { + db = db.Where("name like ?", "%"+req.Name+"%") + } + + var total int64 + db.Count(&total) + + pageSize := req.PageSize + if pageSize <= 0 { + pageSize = 20 + } + page := req.Current + if page <= 0 { + page = 1 + } + offset := (page - 1) * pageSize + + var plants []plantModel.MyPlant + if err := db.Limit(pageSize).Offset(offset).Order("created_at desc").Find(&plants).Error; err != nil { return nil, err } - return map[string]interface{}{"list": result.List, "total": result.Total}, nil + + // 查本地关联表获取图片 ID,再通过 FileRpc 获取完整信息 + imgMap := resolvePlantImages(l.ctx, l.svcCtx, plants) + + var list []PlantItem + for _, p := range plants { + list = append(list, PlantItem{ + ID: p.ID, + CreatedAt: FormatTime(p.CreatedAt), + UpdatedAt: FormatTime(p.UpdatedAt), + CreatedAtStr: FormatTimeShort(p.CreatedAt), + UserID: p.UserID, + Name: p.Name, + PlantTime: FormatTime(p.PlantTime), + Status: p.Status, + Placement: p.Placement, + PotMaterial: p.PotMaterial, + PotSize: p.PotSize, + Sunlight: p.Sunlight, + PlantingMaterial: p.PlantingMaterial, + ImgList: imgMap[p.ID], + CarePlans: nil, + CareTasks: nil, + CareRecords: nil, + GrowthRecords: nil, + }) + } + + return &plantListResp{List: list, Total: total, Page: page, PageSize: pageSize}, nil +} + +// resolvePlantImages 批量查询植物图片 +func resolvePlantImages(ctx context.Context, svcCtx *svc.ServiceContext, plants []plantModel.MyPlant) map[string][]ImageInfo { + var plantIds []string + for _, p := range plants { + plantIds = append(plantIds, p.ID) + } + if len(plantIds) == 0 { + return nil + } + + type rel struct { + MyPlantID string `gorm:"column:sundynix_my_plant_id"` + OssID string `gorm:"column:sundynix_oss_id"` + } + var rels []rel + svcCtx.DB.Table("sundynix_plant_my_plant_oss"). + Where("sundynix_my_plant_id IN ?", plantIds). + Order("sundynix_oss_id asc"). + Find(&rels) + + var allOssIds []string + pidMap := make(map[string][]string) + for _, r := range rels { + pidMap[r.MyPlantID] = append(pidMap[r.MyPlantID], r.OssID) + allOssIds = append(allOssIds, r.OssID) + } + + fileInfos := FetchFilesByIds(ctx, svcCtx, allOssIds) + result := make(map[string][]ImageInfo) + for pid, ids := range pidMap { + var imgs []ImageInfo + for _, oid := range ids { + if f, ok := fileInfos[oid]; ok { + imgs = append(imgs, f) + } + } + if imgs == nil { + imgs = []ImageInfo{} + } + result[pid] = imgs + } + return result } diff --git a/app/plant/api/internal/logic/myPlant/getPlantDetailLogic.go b/app/plant/api/internal/logic/myPlant/getPlantDetailLogic.go index cf5ae9e..1f83472 100644 --- a/app/plant/api/internal/logic/myPlant/getPlantDetailLogic.go +++ b/app/plant/api/internal/logic/myPlant/getPlantDetailLogic.go @@ -2,10 +2,12 @@ package myPlant import ( "context" + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" - "sundynix-micro-go/app/plant/rpc/plant" + plantModel "sundynix-micro-go/app/plant/model" ) type GetPlantDetailLogic struct { @@ -18,10 +20,226 @@ func NewGetPlantDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge return &GetPlantDetailLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} } +// PlantDetailItem 植物详情 DTO +type PlantDetailItem struct { + ID string `json:"id"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` + CreatedAtStr string `json:"createdAtStr"` + UserID string `json:"userId"` + Name string `json:"name"` + PlantTime string `json:"plantTime"` + Status int `json:"status"` + Placement string `json:"placement"` + PotMaterial string `json:"potMaterial"` + PotSize string `json:"potSize"` + Sunlight string `json:"sunlight"` + PlantingMaterial string `json:"plantingMaterial"` + ImgList []ImageInfo `json:"imgList"` + CarePlans []CarePlanItem `json:"carePlans"` + CareTasks interface{} `json:"careTasks"` + CareRecords []CareRecordItem `json:"careRecords"` + GrowthRecords []GrowthRecordItem `json:"growthRecords"` +} + +type CarePlanItem struct { + ID string `json:"id"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` + CreatedAtStr string `json:"createdAtStr"` + UserID string `json:"userId"` + PlantID string `json:"plantId"` + Icon string `json:"icon"` + Name string `json:"name"` + Period int `json:"period"` + TargetAction string `json:"targetAction"` +} + +type CareRecordItem struct { + ID string `json:"id"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` + CreatedAtStr string `json:"createdAtStr"` + UserID string `json:"userId"` + PlantID string `json:"plantId"` + PlanID string `json:"planId"` + Name string `json:"name"` + Remark string `json:"remark"` + Icon string `json:"icon"` +} + +type GrowthRecordItem struct { + ID string `json:"id"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` + CreatedAtStr string `json:"createdAtStr"` + PlantID string `json:"plantId"` + UserID string `json:"userId"` + Name string `json:"name"` + Tag string `json:"tag"` + Desc string `json:"desc"` + Content string `json:"content"` + ImgList []ImageInfo `json:"imgList"` +} + func (l *GetPlantDetailLogic) GetPlantDetail(req *types.IdPathReq) (resp interface{}, err error) { - result, err := l.svcCtx.PlantRpc.GetPlantDetail(l.ctx, &plant.IdReq{Id: req.Id}) + var myPlant plantModel.MyPlant + err = l.svcCtx.DB. + Preload("CarePlans"). + Preload("CareRecords", func(db *gorm.DB) *gorm.DB { + return db.Order("created_at desc") + }). + Preload("GrowthRecords", func(db *gorm.DB) *gorm.DB { + return db.Order("created_at desc") + }). + Where("id = ?", req.Id).First(&myPlant).Error if err != nil { return nil, err } - return result, nil + + // 查图片(本地关联表 + FileRpc) + imgList := queryPlantImages(l.ctx, l.svcCtx, req.Id) + + // 成长记录图片 + growthImgMap := resolveGrowthRecordImages(l.ctx, l.svcCtx, myPlant.GrowthRecords) + + return &PlantDetailItem{ + ID: myPlant.ID, + CreatedAt: FormatTime(myPlant.CreatedAt), + UpdatedAt: FormatTime(myPlant.UpdatedAt), + CreatedAtStr: FormatTimeShort(myPlant.CreatedAt), + UserID: myPlant.UserID, + Name: myPlant.Name, + PlantTime: FormatTime(myPlant.PlantTime), + Status: myPlant.Status, + Placement: myPlant.Placement, + PotMaterial: myPlant.PotMaterial, + PotSize: myPlant.PotSize, + Sunlight: myPlant.Sunlight, + PlantingMaterial: myPlant.PlantingMaterial, + ImgList: imgList, + CarePlans: toCarePlanItems(myPlant.CarePlans), + CareTasks: nil, + CareRecords: toCareRecordItems(myPlant.CareRecords), + GrowthRecords: toGrowthRecordItems(myPlant.GrowthRecords, growthImgMap), + }, nil +} + +func queryPlantImages(ctx context.Context, svcCtx *svc.ServiceContext, plantID string) []ImageInfo { + type rel struct { + OssID string `gorm:"column:sundynix_oss_id"` + } + var rels []rel + svcCtx.DB.Table("sundynix_plant_my_plant_oss"). + Where("sundynix_my_plant_id = ?", plantID). + Order("sundynix_oss_id asc"). + Find(&rels) + + var ids []string + for _, r := range rels { + ids = append(ids, r.OssID) + } + infos := FetchFilesByIds(ctx, svcCtx, ids) + var result []ImageInfo + for _, id := range ids { + if f, ok := infos[id]; ok { + result = append(result, f) + } + } + if result == nil { + result = []ImageInfo{} + } + return result +} + +func resolveGrowthRecordImages(ctx context.Context, svcCtx *svc.ServiceContext, records []*plantModel.GrowthRecord) map[string][]ImageInfo { + var ids []string + for _, gr := range records { + ids = append(ids, gr.ID) + } + if len(ids) == 0 { + return nil + } + + type rel struct { + GrowthRecordID string `gorm:"column:growth_record_id"` + OssID string `gorm:"column:oss_id"` + } + var rels []rel + svcCtx.DB.Table("sundynix_plant_growth_record_oss"). + Where("growth_record_id IN ?", ids). + Find(&rels) + + var allOssIds []string + gidMap := make(map[string][]string) + for _, r := range rels { + gidMap[r.GrowthRecordID] = append(gidMap[r.GrowthRecordID], r.OssID) + allOssIds = append(allOssIds, r.OssID) + } + + infos := FetchFilesByIds(ctx, svcCtx, allOssIds) + result := make(map[string][]ImageInfo) + for gid, ossIds := range gidMap { + var imgs []ImageInfo + for _, oid := range ossIds { + if f, ok := infos[oid]; ok { + imgs = append(imgs, f) + } + } + result[gid] = imgs + } + return result +} + +func toCarePlanItems(plans []*plantModel.CarePlan) []CarePlanItem { + var items []CarePlanItem + for _, p := range plans { + items = append(items, CarePlanItem{ + ID: p.ID, CreatedAt: FormatTime(p.CreatedAt), + UpdatedAt: FormatTime(p.UpdatedAt), CreatedAtStr: FormatTimeShort(p.CreatedAt), + UserID: p.UserID, PlantID: p.PlantID, Icon: p.Icon, Name: p.Name, + Period: p.Period, TargetAction: p.TargetAction, + }) + } + if items == nil { + items = []CarePlanItem{} + } + return items +} + +func toCareRecordItems(records []*plantModel.CareRecord) []CareRecordItem { + var items []CareRecordItem + for _, r := range records { + items = append(items, CareRecordItem{ + ID: r.ID, CreatedAt: FormatTime(r.CreatedAt), + UpdatedAt: FormatTime(r.UpdatedAt), CreatedAtStr: FormatTimeShort(r.CreatedAt), + UserID: r.UserID, PlantID: r.PlantID, PlanID: r.PlanID, + Name: r.Name, Remark: r.Remark, Icon: r.Icon, + }) + } + if items == nil { + items = []CareRecordItem{} + } + return items +} + +func toGrowthRecordItems(records []*plantModel.GrowthRecord, imgMap map[string][]ImageInfo) []GrowthRecordItem { + var items []GrowthRecordItem + for _, gr := range records { + item := GrowthRecordItem{ + ID: gr.ID, CreatedAt: FormatTime(gr.CreatedAt), + UpdatedAt: FormatTime(gr.UpdatedAt), CreatedAtStr: FormatTimeShort(gr.CreatedAt), + PlantID: gr.PlantID, UserID: gr.UserID, Name: gr.Name, + Tag: gr.Tag, Desc: gr.Desc, Content: gr.Content, + ImgList: imgMap[gr.ID], + } + if item.ImgList == nil { + item.ImgList = []ImageInfo{} + } + items = append(items, item) + } + if items == nil { + items = []GrowthRecordItem{} + } + return items } diff --git a/app/plant/api/internal/logic/myPlant/gettodaytasklistlogic.go b/app/plant/api/internal/logic/myPlant/gettodaytasklistlogic.go new file mode 100644 index 0000000..0a5a4e6 --- /dev/null +++ b/app/plant/api/internal/logic/myPlant/gettodaytasklistlogic.go @@ -0,0 +1,24 @@ +package myPlant + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetTodayTaskListLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetTodayTaskListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetTodayTaskListLogic { + return &GetTodayTaskListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetTodayTaskListLogic) GetTodayTaskList() (*plantPb.CareTaskListResp, error) { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + return l.svcCtx.PlantRpc.GetTodayTaskList(l.ctx, &plantPb.GetProfileReq{UserId: userId}) +} diff --git a/app/plant/api/internal/logic/myPlant/plantCommon.go b/app/plant/api/internal/logic/myPlant/plantCommon.go new file mode 100644 index 0000000..72ded31 --- /dev/null +++ b/app/plant/api/internal/logic/myPlant/plantCommon.go @@ -0,0 +1,84 @@ +package myPlant + +import ( + "context" + "time" + + filePb "sundynix-micro-go/app/file/rpc/file" + "sundynix-micro-go/app/plant/api/internal/svc" +) + +// ========== 图片 DTO ========== + +// ImageInfo 图片信息 DTO,匹配旧单体 Oss 结构 +type ImageInfo struct { + ID string `json:"id"` + Name string `json:"name"` + Url string `json:"url"` + Tag string `json:"tag"` + Key string `json:"key"` + Suffix string `json:"suffix"` + MD5 string `json:"md5"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` + CreatedAtStr string `json:"createdAtStr"` +} + +// ========== 时间格式化 ========== + +func FormatTime(t time.Time) string { + if t.IsZero() { + return "" + } + return t.Format(time.RFC3339) +} + +func FormatTimeShort(t time.Time) string { + if t.IsZero() { + return "" + } + return t.Format("2006-01-02 15:04:05") +} + +func UnixToTimeStr(ts int64) string { + if ts == 0 { + return "" + } + return time.Unix(ts, 0).Format(time.RFC3339) +} + +func UnixToTimeStrShort(ts int64) string { + if ts == 0 { + return "" + } + return time.Unix(ts, 0).Format("2006-01-02 15:04:05") +} + +// ========== 文件服务 RPC 封装 ========== + +// FetchFilesByIds 通过 FileRpc 批量获取文件信息,返回 id->ImageInfo 映射 +func FetchFilesByIds(ctx context.Context, svcCtx *svc.ServiceContext, ids []string) map[string]ImageInfo { + result := make(map[string]ImageInfo) + if len(ids) == 0 { + return result + } + resp, err := svcCtx.FileRpc.GetFilesByIds(ctx, &filePb.GetFilesByIdsReq{Ids: ids}) + if err != nil || resp == nil { + return result + } + for _, f := range resp.Files { + result[f.Id] = ImageInfo{ + ID: f.Id, + Name: f.Name, + Url: f.Url, + Tag: f.Tag, + Key: f.Key, + Suffix: f.Suffix, + MD5: f.Md5, + CreatedAt: UnixToTimeStr(f.CreatedAt), + UpdatedAt: UnixToTimeStr(f.CreatedAt), + CreatedAtStr: UnixToTimeStrShort(f.CreatedAt), + } + } + return result +} diff --git a/app/plant/api/internal/logic/myPlant/quickCareLogic.go b/app/plant/api/internal/logic/myPlant/quickCareLogic.go new file mode 100644 index 0000000..5c5a5ce --- /dev/null +++ b/app/plant/api/internal/logic/myPlant/quickCareLogic.go @@ -0,0 +1,76 @@ +package myPlant + +import ( + "context" + "errors" + "fmt" + "strings" + + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantModel "sundynix-micro-go/app/plant/model" + + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" +) + +type QuickCareLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewQuickCareLogic(ctx context.Context, svcCtx *svc.ServiceContext) *QuickCareLogic { + return &QuickCareLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *QuickCareLogic) QuickCare(req *types.QuickCareReq) error { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + + return l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + // 1. Validate plant exists and belongs to user + var myPlant plantModel.MyPlant + if err := tx.Where("id = ? AND user_id = ?", req.PlantId, userId).First(&myPlant).Error; err != nil { + return errors.New("植物不存在") + } + + // 2. Create care record + record := plantModel.CareRecord{ + UserID: userId, + PlantID: req.PlantId, + Name: req.Name, + Icon: req.Icon, + Remark: req.Remark, + } + if err := tx.Create(&record).Error; err != nil { + return err + } + + // 3. Update user profile counter + column := "care_count" + if req.Icon != "" || req.Name != "" { + nameMap := map[string]string{ + "浇水": "water_count", + "施肥": "fertilize_count", + "修剪": "prune_count", + "换盆": "repot_count", + } + if col, ok := nameMap[req.Name]; ok { + column = col + } else if req.Icon != "" { + actionMap := map[string]string{ + "water": "water_count", "fertilize": "fertilize_count", + "prune": "prune_count", "repot": "repot_count", + } + for key, col := range actionMap { + if strings.Contains(req.Icon, key) { + column = col + break + } + } + } + } + return tx.Model(&plantModel.UserProfile{}).Where("user_id = ?", userId). + Update(column, gorm.Expr(column+" + 1")).Error + }) +} diff --git a/app/plant/api/internal/logic/ocr/deleteclassifyloglogic.go b/app/plant/api/internal/logic/ocr/deleteclassifyloglogic.go new file mode 100644 index 0000000..774c652 --- /dev/null +++ b/app/plant/api/internal/logic/ocr/deleteclassifyloglogic.go @@ -0,0 +1,24 @@ +package ocr + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteClassifyLogLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteClassifyLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteClassifyLogLogic { + return &DeleteClassifyLogLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *DeleteClassifyLogLogic) DeleteClassifyLog(req *types.IdsReq) error { + _, err := l.svcCtx.PlantRpc.DeleteClassifyLog(l.ctx, &plantPb.IdsReq{Ids: req.Ids}) + return err +} diff --git a/app/plant/api/internal/logic/ocr/getmyclassifyloglogic.go b/app/plant/api/internal/logic/ocr/getmyclassifyloglogic.go new file mode 100644 index 0000000..0f6bc5d --- /dev/null +++ b/app/plant/api/internal/logic/ocr/getmyclassifyloglogic.go @@ -0,0 +1,24 @@ +package ocr + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetMyClassifyLogLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetMyClassifyLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMyClassifyLogLogic { + return &GetMyClassifyLogLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetMyClassifyLogLogic) GetMyClassifyLog() (*plantPb.ClassifyLogListResp, error) { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + return l.svcCtx.PlantRpc.GetMyClassifyLog(l.ctx, &plantPb.GetProfileReq{UserId: userId}) +} diff --git a/app/plant/api/internal/logic/ocr/ocrClassifyLogic.go b/app/plant/api/internal/logic/ocr/ocrClassifyLogic.go index 13e6792..702a41c 100644 --- a/app/plant/api/internal/logic/ocr/ocrClassifyLogic.go +++ b/app/plant/api/internal/logic/ocr/ocrClassifyLogic.go @@ -5,6 +5,12 @@ package ocr import ( "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strings" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" @@ -27,8 +33,60 @@ func NewOcrClassifyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OcrCl } } -func (l *OcrClassifyLogic) OcrClassify(req *types.OcrReq) error { - // todo: add your logic here and delete this line - - return nil +// baiduTokenResp 百度 token 响应 +type baiduTokenResp struct { + AccessToken string `json:"access_token"` +} + +// OcrClassify 调用百度 AI 植物识别接口 +func (l *OcrClassifyLogic) OcrClassify(req *types.OcrReq) (interface{}, error) { + // 1. 获取百度 access_token + apiKey := l.svcCtx.Config.BaiduOcr.ApiKey + secretKey := l.svcCtx.Config.BaiduOcr.SecretKey + if apiKey == "" || secretKey == "" { + return nil, fmt.Errorf("百度 OCR 未配置 ApiKey/SecretKey") + } + + tokenURL := fmt.Sprintf( + "https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=%s&client_secret=%s", + apiKey, secretKey, + ) + tokenResp, err := http.Post(tokenURL, "application/x-www-form-urlencoded", nil) + if err != nil { + return nil, fmt.Errorf("获取百度 token 失败: %w", err) + } + defer tokenResp.Body.Close() + tokenBody, _ := io.ReadAll(tokenResp.Body) + var tokenObj baiduTokenResp + if err = json.Unmarshal(tokenBody, &tokenObj); err != nil || tokenObj.AccessToken == "" { + return nil, fmt.Errorf("解析百度 token 失败") + } + + // 2. 调用植物识别接口(传入图片 URL) + apiURL := "https://aip.baidubce.com/rest/2.0/image-classify/v1/plant?access_token=" + tokenObj.AccessToken + payload := strings.NewReader("url=" + url.QueryEscape(req.ImageUrl) + "&baike_num=1") + classifyReq, err := http.NewRequest("POST", apiURL, payload) + if err != nil { + return nil, fmt.Errorf("创建请求失败: %w", err) + } + classifyReq.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + client := &http.Client{} + classifyResp, err := client.Do(classifyReq) + if err != nil { + return nil, fmt.Errorf("调用百度植物识别接口失败: %w", err) + } + defer classifyResp.Body.Close() + + body, err := io.ReadAll(classifyResp.Body) + if err != nil { + return nil, fmt.Errorf("读取识别结果失败: %w", err) + } + + // 3. 直接返回百度原始结果(前端自行解析 result 字段) + var result interface{} + if err = json.Unmarshal(body, &result); err != nil { + return nil, fmt.Errorf("解析识别结果失败: %w", err) + } + return result, nil } diff --git a/app/plant/api/internal/logic/post/commentPostLogic.go b/app/plant/api/internal/logic/post/commentPostLogic.go index 6eb462b..7b0b4e8 100644 --- a/app/plant/api/internal/logic/post/commentPostLogic.go +++ b/app/plant/api/internal/logic/post/commentPostLogic.go @@ -5,9 +5,11 @@ package post import ( "context" + "fmt" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -28,7 +30,12 @@ func NewCommentPostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Comme } func (l *CommentPostLogic) CommentPost(req *types.PostCommentReq) error { - // todo: add your logic here and delete this line - - return nil + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + _, err := l.svcCtx.PlantRpc.CommentPost(l.ctx, &plant.CommentPostReq{ + PostId: req.PostId, + UserId: userId, + Content: req.Content, + ParentId: req.ParentId, + }) + return err } diff --git a/app/plant/api/internal/logic/post/createPostLogic.go b/app/plant/api/internal/logic/post/createPostLogic.go index f36e9ec..c8b83db 100644 --- a/app/plant/api/internal/logic/post/createPostLogic.go +++ b/app/plant/api/internal/logic/post/createPostLogic.go @@ -5,9 +5,11 @@ package post import ( "context" + "fmt" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -28,7 +30,14 @@ func NewCreatePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create } func (l *CreatePostLogic) CreatePost(req *types.CreatePostReq) error { - // todo: add your logic here and delete this line - - return nil + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + _, err := l.svcCtx.PlantRpc.CreatePost(l.ctx, &plant.CreatePostReq{ + UserId: userId, + Title: req.Title, + Content: req.Content, + Location: req.Location, + ImgIds: req.ImgIds, + TopicId: req.TopicId, + }) + return err } diff --git a/app/plant/api/internal/logic/post/deletePostLogic.go b/app/plant/api/internal/logic/post/deletePostLogic.go index b890e91..8c24ef1 100644 --- a/app/plant/api/internal/logic/post/deletePostLogic.go +++ b/app/plant/api/internal/logic/post/deletePostLogic.go @@ -8,6 +8,7 @@ import ( "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -28,7 +29,6 @@ func NewDeletePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delete } func (l *DeletePostLogic) DeletePost(req *types.IdsReq) error { - // todo: add your logic here and delete this line - - return nil + _, err := l.svcCtx.PlantRpc.DeletePost(l.ctx, &plant.IdsReq{Ids: req.Ids}) + return err } diff --git a/app/plant/api/internal/logic/post/getPostDetailLogic.go b/app/plant/api/internal/logic/post/getPostDetailLogic.go index f5540ec..570424e 100644 --- a/app/plant/api/internal/logic/post/getPostDetailLogic.go +++ b/app/plant/api/internal/logic/post/getPostDetailLogic.go @@ -8,6 +8,7 @@ import ( "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -27,8 +28,10 @@ func NewGetPostDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Get } } -func (l *GetPostDetailLogic) GetPostDetail(req *types.IdPathReq) error { - // todo: add your logic here and delete this line - - return nil +func (l *GetPostDetailLogic) GetPostDetail(req *types.IdPathReq) (interface{}, error) { + result, err := l.svcCtx.PlantRpc.GetPostDetail(l.ctx, &plant.IdReq{Id: req.Id}) + if err != nil { + return nil, err + } + return result, nil } diff --git a/app/plant/api/internal/logic/post/getPostListLogic.go b/app/plant/api/internal/logic/post/getPostListLogic.go index 1ed7697..9927ee9 100644 --- a/app/plant/api/internal/logic/post/getPostListLogic.go +++ b/app/plant/api/internal/logic/post/getPostListLogic.go @@ -8,6 +8,7 @@ import ( "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -27,8 +28,15 @@ func NewGetPostListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetPo } } -func (l *GetPostListLogic) GetPostList(req *types.PostListReq) error { - // todo: add your logic here and delete this line - - return nil +func (l *GetPostListLogic) GetPostList(req *types.PostListReq) (interface{}, error) { + result, err := l.svcCtx.PlantRpc.GetPostList(l.ctx, &plant.PostListReq{ + Current: int32(req.Current), + PageSize: int32(req.PageSize), + Keyword: req.Keyword, + TopicId: req.TopicId, + }) + if err != nil { + return nil, err + } + return map[string]interface{}{"list": result.List, "total": result.Total}, nil } diff --git a/app/plant/api/internal/logic/post/getmypostlistlogic.go b/app/plant/api/internal/logic/post/getmypostlistlogic.go new file mode 100644 index 0000000..069fb97 --- /dev/null +++ b/app/plant/api/internal/logic/post/getmypostlistlogic.go @@ -0,0 +1,27 @@ +package post + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetMyPostListLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetMyPostListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMyPostListLogic { + return &GetMyPostListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetMyPostListLogic) GetMyPostList(req *types.PostListReq) (*plantPb.PostListResp, error) { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + return l.svcCtx.PlantRpc.GetPostList(l.ctx, &plantPb.PostListReq{ + UserId: userId, Current: int32(req.Current), PageSize: int32(req.PageSize), + }) +} diff --git a/app/plant/api/internal/logic/post/likePostLogic.go b/app/plant/api/internal/logic/post/likePostLogic.go index 5eb1cf6..fbe572b 100644 --- a/app/plant/api/internal/logic/post/likePostLogic.go +++ b/app/plant/api/internal/logic/post/likePostLogic.go @@ -5,9 +5,11 @@ package post import ( "context" + "fmt" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -18,7 +20,7 @@ type LikePostLogic struct { svcCtx *svc.ServiceContext } -// 点赞帖子 +// 点赞/取消点赞帖子 func NewLikePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LikePostLogic { return &LikePostLogic{ Logger: logx.WithContext(ctx), @@ -28,7 +30,10 @@ func NewLikePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LikePost } func (l *LikePostLogic) LikePost(req *types.IdReq) error { - // todo: add your logic here and delete this line - - return nil + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + _, err := l.svcCtx.PlantRpc.LikePost(l.ctx, &plant.LikePostReq{ + PostId: req.Id, + UserId: userId, + }) + return err } diff --git a/app/plant/api/internal/logic/post/starpostlogic.go b/app/plant/api/internal/logic/post/starpostlogic.go new file mode 100644 index 0000000..8418cf0 --- /dev/null +++ b/app/plant/api/internal/logic/post/starpostlogic.go @@ -0,0 +1,26 @@ +package post + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type StarPostLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewStarPostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StarPostLogic { + return &StarPostLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *StarPostLogic) StarPost(req *types.IdReq) error { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + _, err := l.svcCtx.PlantRpc.StarPost(l.ctx, &plantPb.LikePostReq{UserId: userId, PostId: req.Id}) + return err +} diff --git a/app/plant/api/internal/logic/topic/createTopicLogic.go b/app/plant/api/internal/logic/topic/createTopicLogic.go index b0b9f6f..67371aa 100644 --- a/app/plant/api/internal/logic/topic/createTopicLogic.go +++ b/app/plant/api/internal/logic/topic/createTopicLogic.go @@ -8,6 +8,7 @@ import ( "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -28,7 +29,13 @@ func NewCreateTopicLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Creat } func (l *CreateTopicLogic) CreateTopic(req *types.TopicReq) error { - // todo: add your logic here and delete this line - - return nil + name := req.Name + if name == "" { + name = req.Title + } + _, err := l.svcCtx.PlantRpc.CreateTopic(l.ctx, &plant.CreateTopicReq{ + Name: name, Icon: req.Icon, Desc: req.Desc, + Title: req.Title, Remark: req.Remark, StartTime: req.StartTime, EndTime: req.EndTime, + }) + return err } diff --git a/app/plant/api/internal/logic/topic/deleteTopicLogic.go b/app/plant/api/internal/logic/topic/deleteTopicLogic.go index 3440080..de795df 100644 --- a/app/plant/api/internal/logic/topic/deleteTopicLogic.go +++ b/app/plant/api/internal/logic/topic/deleteTopicLogic.go @@ -8,6 +8,7 @@ import ( "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -28,7 +29,6 @@ func NewDeleteTopicLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delet } func (l *DeleteTopicLogic) DeleteTopic(req *types.IdsReq) error { - // todo: add your logic here and delete this line - - return nil + _, err := l.svcCtx.PlantRpc.DeleteTopic(l.ctx, &plant.IdsReq{Ids: req.Ids}) + return err } diff --git a/app/plant/api/internal/logic/topic/getTopicListLogic.go b/app/plant/api/internal/logic/topic/getTopicListLogic.go index ccb86ac..5b28153 100644 --- a/app/plant/api/internal/logic/topic/getTopicListLogic.go +++ b/app/plant/api/internal/logic/topic/getTopicListLogic.go @@ -8,6 +8,7 @@ import ( "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" ) type GetTopicListLogic struct { @@ -25,8 +26,10 @@ func NewGetTopicListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetT } } -func (l *GetTopicListLogic) GetTopicList() error { - // todo: add your logic here and delete this line - - return nil +func (l *GetTopicListLogic) GetTopicList() (interface{}, error) { + result, err := l.svcCtx.PlantRpc.GetTopicList(l.ctx, &plant.IdReq{}) + if err != nil { + return nil, err + } + return map[string]interface{}{"list": result.List}, nil } diff --git a/app/plant/api/internal/logic/topic/gettopicdetaillogic.go b/app/plant/api/internal/logic/topic/gettopicdetaillogic.go new file mode 100644 index 0000000..496bd02 --- /dev/null +++ b/app/plant/api/internal/logic/topic/gettopicdetaillogic.go @@ -0,0 +1,23 @@ +package topic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetTopicDetailLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetTopicDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetTopicDetailLogic { + return &GetTopicDetailLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetTopicDetailLogic) GetTopicDetail(req *types.IdPathReq) (*plantPb.TopicInfo, error) { + return l.svcCtx.PlantRpc.GetTopicDetail(l.ctx, &plantPb.IdReq{Id: req.Id}) +} diff --git a/app/plant/api/internal/logic/topic/updatetopiclogic.go b/app/plant/api/internal/logic/topic/updatetopiclogic.go new file mode 100644 index 0000000..6affb29 --- /dev/null +++ b/app/plant/api/internal/logic/topic/updatetopiclogic.go @@ -0,0 +1,31 @@ +package topic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type UpdateTopicLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateTopicLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateTopicLogic { + return &UpdateTopicLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *UpdateTopicLogic) UpdateTopic(req *types.UpdateTopicReq) error { + name := req.Name + if name == "" { + name = req.Title + } + _, err := l.svcCtx.PlantRpc.UpdateTopic(l.ctx, &plantPb.UpdateTopicReq{ + Id: req.Id, Name: name, Icon: req.Icon, Desc: req.Desc, + Title: req.Title, Remark: req.Remark, StartTime: req.StartTime, EndTime: req.EndTime, + }) + return err +} diff --git a/app/plant/api/internal/logic/userProfile/getUserProfileLogic.go b/app/plant/api/internal/logic/userProfile/getUserProfileLogic.go index 045a19e..aae1079 100644 --- a/app/plant/api/internal/logic/userProfile/getUserProfileLogic.go +++ b/app/plant/api/internal/logic/userProfile/getUserProfileLogic.go @@ -5,9 +5,11 @@ package userProfile import ( "context" + "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" ) type GetUserProfileLogic struct { @@ -25,8 +27,11 @@ func NewGetUserProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge } } -func (l *GetUserProfileLogic) GetUserProfile() error { - // todo: add your logic here and delete this line - - return nil +func (l *GetUserProfileLogic) GetUserProfile() (interface{}, error) { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + result, err := l.svcCtx.PlantRpc.GetUserProfile(l.ctx, &plant.GetProfileReq{UserId: userId}) + if err != nil { + return nil, err + } + return result, nil } diff --git a/app/plant/api/internal/logic/userProfile/getmybadgeslogic.go b/app/plant/api/internal/logic/userProfile/getmybadgeslogic.go new file mode 100644 index 0000000..36fd3c4 --- /dev/null +++ b/app/plant/api/internal/logic/userProfile/getmybadgeslogic.go @@ -0,0 +1,24 @@ +package userProfile + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetMyBadgesLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetMyBadgesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMyBadgesLogic { + return &GetMyBadgesLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetMyBadgesLogic) GetMyBadges() (*plantPb.UserBadgeListResp, error) { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + return l.svcCtx.PlantRpc.GetMyBadges(l.ctx, &plantPb.GetProfileReq{UserId: userId}) +} diff --git a/app/plant/api/internal/logic/userProfile/getmystarslogic.go b/app/plant/api/internal/logic/userProfile/getmystarslogic.go new file mode 100644 index 0000000..98dec63 --- /dev/null +++ b/app/plant/api/internal/logic/userProfile/getmystarslogic.go @@ -0,0 +1,25 @@ +package userProfile + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetMyStarsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetMyStarsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMyStarsLogic { + return &GetMyStarsLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetMyStarsLogic) GetMyStars(req *types.PageReq) (*plantPb.UserStarListResp, error) { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + return l.svcCtx.PlantRpc.GetMyStars(l.ctx, &plantPb.GetProfileReq{UserId: userId}) +} diff --git a/app/plant/api/internal/logic/userProfile/updateUserProfileLogic.go b/app/plant/api/internal/logic/userProfile/updateUserProfileLogic.go index 5d13c75..9f5d525 100644 --- a/app/plant/api/internal/logic/userProfile/updateUserProfileLogic.go +++ b/app/plant/api/internal/logic/userProfile/updateUserProfileLogic.go @@ -5,9 +5,12 @@ package userProfile import ( "context" + "fmt" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" + systemPb "sundynix-micro-go/app/system/rpc/system" "github.com/zeromicro/go-zero/core/logx" ) @@ -28,7 +31,27 @@ func NewUpdateUserProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) } func (l *UpdateUserProfileLogic) UpdateUserProfile(req *types.UpdateProfileReq) error { - // todo: add your logic here and delete this line + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + // 1. 更新植物用户资料(昵称、头像) + if _, err := l.svcCtx.PlantRpc.UpdateUserProfile(l.ctx, &plant.UpdateProfileReq{ + UserId: userId, + NickName: req.Nickname, + AvatarId: req.AvatarId, + }); err != nil { + return err + } + + // 2. 同步更新系统 user 表(与旧项目保持一致:name + avatar_id 双写) + if req.Nickname != "" || req.AvatarId != "" { + if _, err := l.svcCtx.UserRpc.UpdateUser(l.ctx, &systemPb.UpdateUserReq{ + Id: userId, + NickName: req.Nickname, + AvatarId: req.AvatarId, + }); err != nil { + // 非致命错误,记录日志但不回滚(植物资料已更新) + l.Logger.Errorf("sync system user failed: %v", err) + } + } return nil } diff --git a/app/plant/api/internal/logic/wiki/createWikiClassLogic.go b/app/plant/api/internal/logic/wiki/createWikiClassLogic.go index e5a91aa..1e4d683 100644 --- a/app/plant/api/internal/logic/wiki/createWikiClassLogic.go +++ b/app/plant/api/internal/logic/wiki/createWikiClassLogic.go @@ -8,6 +8,7 @@ import ( "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -28,7 +29,9 @@ func NewCreateWikiClassLogic(ctx context.Context, svcCtx *svc.ServiceContext) *C } func (l *CreateWikiClassLogic) CreateWikiClass(req *types.WikiClassReq) error { - // todo: add your logic here and delete this line - - return nil + _, err := l.svcCtx.PlantRpc.CreateWikiClass(l.ctx, &plant.CreateWikiClassReq{ + Name: req.Name, + Icon: req.Icon, + }) + return err } diff --git a/app/plant/api/internal/logic/wiki/createwikilogic.go b/app/plant/api/internal/logic/wiki/createwikilogic.go new file mode 100644 index 0000000..5d16ade --- /dev/null +++ b/app/plant/api/internal/logic/wiki/createwikilogic.go @@ -0,0 +1,67 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.10.1 + +package wiki + +import ( + "context" + + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" + + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateWikiLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +// 创建百科 +func NewCreateWikiLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateWikiLogic { + return &CreateWikiLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *CreateWikiLogic) CreateWiki(req *types.CreateWikiReq) error { + classID := req.ClassId + if classID == "" && len(req.ClassIds) > 0 { + classID = req.ClassIds[0] + } + _, err := l.svcCtx.PlantRpc.CreateWiki(l.ctx, &plantPb.CreateWikiReq{ + Name: req.Name, + LatinName: req.LatinName, + Aliases: req.Aliases, + Genus: req.Genus, + Difficulty: int32(req.Difficulty), + IsHot: int32(req.IsHot), + GrowthHabit: req.GrowthHabit, + LightIntensity: req.LightIntensity, + OptimalTempPeriod: req.OptimalTempPeriod, + ClassId: classID, + DistributionArea: req.DistributionArea, + LifeCycle: req.LifeCycle, + ClassIds: req.ClassIds, + OssIds: req.OssIds, + RelatedWikiIds: req.RelatedWikiIds, + ReproductionMethod: req.ReproductionMethod, + PestsDiseases: req.PestsDiseases, + LightType: req.LightType, + Stem: req.Stem, + Fruit: req.Fruit, + FoliageType: req.FoliageType, + FoliageColor: req.FoliageColor, + FoliageShape: req.FoliageShape, + Height: int32(req.Height), + FloweringPeriod: req.FloweringPeriod, + FloweringColor: req.FloweringColor, + FloweringShape: req.FloweringShape, + FloweringDiameter: int32(req.FlowerDiameter), + }) + return err +} diff --git a/app/plant/api/internal/logic/wiki/deletewikiclasslogic.go b/app/plant/api/internal/logic/wiki/deletewikiclasslogic.go new file mode 100644 index 0000000..bdf915c --- /dev/null +++ b/app/plant/api/internal/logic/wiki/deletewikiclasslogic.go @@ -0,0 +1,24 @@ +package wiki + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteWikiClassLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteWikiClassLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteWikiClassLogic { + return &DeleteWikiClassLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *DeleteWikiClassLogic) DeleteWikiClass(req *types.IdsReq) error { + _, err := l.svcCtx.PlantRpc.DeleteWikiClass(l.ctx, &plantPb.IdsReq{Ids: req.Ids}) + return err +} diff --git a/app/plant/api/internal/logic/wiki/deletewikilogic.go b/app/plant/api/internal/logic/wiki/deletewikilogic.go new file mode 100644 index 0000000..f869813 --- /dev/null +++ b/app/plant/api/internal/logic/wiki/deletewikilogic.go @@ -0,0 +1,24 @@ +package wiki + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteWikiLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteWikiLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteWikiLogic { + return &DeleteWikiLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *DeleteWikiLogic) DeleteWiki(req *types.IdsReq) error { + _, err := l.svcCtx.PlantRpc.DeleteWiki(l.ctx, &plantPb.IdsReq{Ids: req.Ids}) + return err +} diff --git a/app/plant/api/internal/logic/wiki/getWikiClassListLogic.go b/app/plant/api/internal/logic/wiki/getWikiClassListLogic.go index 54b7bc0..aca01cc 100644 --- a/app/plant/api/internal/logic/wiki/getWikiClassListLogic.go +++ b/app/plant/api/internal/logic/wiki/getWikiClassListLogic.go @@ -8,6 +8,7 @@ import ( "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" ) type GetWikiClassListLogic struct { @@ -25,8 +26,10 @@ func NewGetWikiClassListLogic(ctx context.Context, svcCtx *svc.ServiceContext) * } } -func (l *GetWikiClassListLogic) GetWikiClassList() error { - // todo: add your logic here and delete this line - - return nil +func (l *GetWikiClassListLogic) GetWikiClassList() (interface{}, error) { + result, err := l.svcCtx.PlantRpc.GetWikiClassList(l.ctx, &plant.IdReq{}) + if err != nil { + return nil, err + } + return map[string]interface{}{"list": result.List}, nil } diff --git a/app/plant/api/internal/logic/wiki/getWikiDetailLogic.go b/app/plant/api/internal/logic/wiki/getWikiDetailLogic.go index ec8131e..1df5d62 100644 --- a/app/plant/api/internal/logic/wiki/getWikiDetailLogic.go +++ b/app/plant/api/internal/logic/wiki/getWikiDetailLogic.go @@ -1,13 +1,14 @@ -// Code scaffolded by goctl. Safe to edit. -// goctl 1.10.1 - package wiki import ( "context" + "fmt" + "time" + filePb "sundynix-micro-go/app/file/rpc/file" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -27,8 +28,66 @@ func NewGetWikiDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Get } } -func (l *GetWikiDetailLogic) GetWikiDetail(req *types.IdPathReq) error { - // todo: add your logic here and delete this line +func (l *GetWikiDetailLogic) GetWikiDetail(req *types.IdPathReq) (interface{}, error) { + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + result, err := l.svcCtx.PlantRpc.GetWikiDetail(l.ctx, &plantPb.IdReq{Id: req.Id}) + if err != nil { + return nil, err + } + if result == nil || result.Wiki == nil { + return nil, nil + } - return nil + // 通过 FileRpc 获取图片 + imgList := fetchWikiImages(l.ctx, l.svcCtx, result.Wiki.OssIds) + + _ = userId + return map[string]interface{}{ + "wiki": result.Wiki, + "imgList": imgList, + "classIds": result.Wiki.ClassIds, + "relatedWikiIds": result.Wiki.RelatedWikiIds, + }, nil +} + +func fetchWikiImages(ctx context.Context, svcCtx *svc.ServiceContext, ossIds []string) []map[string]interface{} { + if len(ossIds) == 0 { + return []map[string]interface{}{} + } + resp, err := svcCtx.FileRpc.GetFilesByIds(ctx, &filePb.GetFilesByIdsReq{Ids: ossIds}) + if err != nil || resp == nil { + return []map[string]interface{}{} + } + // 按 ossIds 顺序排列 + fileMap := make(map[string]*filePb.FileInfo) + for _, f := range resp.Files { + fileMap[f.Id] = f + } + var list []map[string]interface{} + for _, id := range ossIds { + if f, ok := fileMap[id]; ok { + list = append(list, map[string]interface{}{ + "id": f.Id, "name": f.Name, "url": f.Url, "tag": f.Tag, + "key": f.Key, "suffix": f.Suffix, "md5": f.Md5, + "createdAt": unixToRFC3339(f.CreatedAt), + "updatedAt": unixToRFC3339(f.CreatedAt), + "createdAtStr": unixToShort(f.CreatedAt), + }) + } + } + return list +} + +func unixToRFC3339(ts int64) string { + if ts == 0 { + return "" + } + return time.Unix(ts, 0).Format(time.RFC3339) +} + +func unixToShort(ts int64) string { + if ts == 0 { + return "" + } + return time.Unix(ts, 0).Format("2006-01-02 15:04:05") } diff --git a/app/plant/api/internal/logic/wiki/getWikiListLogic.go b/app/plant/api/internal/logic/wiki/getWikiListLogic.go index 1dd4602..da66967 100644 --- a/app/plant/api/internal/logic/wiki/getWikiListLogic.go +++ b/app/plant/api/internal/logic/wiki/getWikiListLogic.go @@ -8,6 +8,7 @@ import ( "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -27,8 +28,16 @@ func NewGetWikiListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetWi } } -func (l *GetWikiListLogic) GetWikiList(req *types.WikiListReq) error { - // todo: add your logic here and delete this line - - return nil +func (l *GetWikiListLogic) GetWikiList(req *types.WikiListReq) (interface{}, error) { + result, err := l.svcCtx.PlantRpc.GetWikiList(l.ctx, &plant.WikiListReq{ + Current: int32(req.Current), + PageSize: int32(req.PageSize), + Name: req.Name, + ClassId: req.ClassId, + IsHot: int32(req.IsHot), + }) + if err != nil { + return nil, err + } + return map[string]interface{}{"list": result.List, "total": result.Total}, nil } diff --git a/app/plant/api/internal/logic/wiki/toggleWikiStarLogic.go b/app/plant/api/internal/logic/wiki/toggleWikiStarLogic.go index 5e21447..e8c82d9 100644 --- a/app/plant/api/internal/logic/wiki/toggleWikiStarLogic.go +++ b/app/plant/api/internal/logic/wiki/toggleWikiStarLogic.go @@ -5,9 +5,11 @@ package wiki import ( "context" + "fmt" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" + "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" ) @@ -28,7 +30,11 @@ func NewToggleWikiStarLogic(ctx context.Context, svcCtx *svc.ServiceContext) *To } func (l *ToggleWikiStarLogic) ToggleWikiStar(req *types.IdReq) error { - // todo: add your logic here and delete this line - - return nil + userId := fmt.Sprintf("%v", l.ctx.Value("userId")) + _, err := l.svcCtx.PlantRpc.ToggleWikiStar(l.ctx, &plant.ToggleStarReq{ + UserId: userId, + TargetId: req.Id, + Type: "wiki", + }) + return err } diff --git a/app/plant/api/internal/logic/wiki/updatewikiclasslogic.go b/app/plant/api/internal/logic/wiki/updatewikiclasslogic.go new file mode 100644 index 0000000..7842a51 --- /dev/null +++ b/app/plant/api/internal/logic/wiki/updatewikiclasslogic.go @@ -0,0 +1,26 @@ +package wiki + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type UpdateWikiClassLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateWikiClassLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateWikiClassLogic { + return &UpdateWikiClassLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *UpdateWikiClassLogic) UpdateWikiClass(req *types.UpdateWikiClassReq) error { + _, err := l.svcCtx.PlantRpc.UpdateWikiClass(l.ctx, &plantPb.UpdateWikiClassReq{ + Id: req.Id, Name: req.Name, Icon: req.Icon, + }) + return err +} diff --git a/app/plant/api/internal/logic/wiki/updatewikilogic.go b/app/plant/api/internal/logic/wiki/updatewikilogic.go new file mode 100644 index 0000000..49f1dfa --- /dev/null +++ b/app/plant/api/internal/logic/wiki/updatewikilogic.go @@ -0,0 +1,37 @@ +package wiki + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/plant/api/internal/svc" + "sundynix-micro-go/app/plant/api/internal/types" + plantPb "sundynix-micro-go/app/plant/rpc/plant" +) + +type UpdateWikiLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateWikiLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateWikiLogic { + return &UpdateWikiLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *UpdateWikiLogic) UpdateWiki(req *types.UpdateWikiReq) error { + _, err := l.svcCtx.PlantRpc.UpdateWiki(l.ctx, &plantPb.UpdateWikiReq{ + Id: req.Id, Name: req.Name, LatinName: req.LatinName, Aliases: req.Aliases, + Genus: req.Genus, Difficulty: int32(req.Difficulty), IsHot: int32(req.IsHot), + GrowthHabit: req.GrowthHabit, LightIntensity: req.LightIntensity, + OptimalTempPeriod: req.OptimalTempPeriod, ClassId: req.ClassId, + DistributionArea: req.DistributionArea, LifeCycle: req.LifeCycle, + ClassIds: req.ClassIds, OssIds: req.OssIds, RelatedWikiIds: req.RelatedWikiIds, + ReproductionMethod: req.ReproductionMethod, PestsDiseases: req.PestsDiseases, + LightType: req.LightType, Stem: req.Stem, Fruit: req.Fruit, + FoliageType: req.FoliageType, FoliageColor: req.FoliageColor, + FoliageShape: req.FoliageShape, Height: int32(req.Height), + FloweringPeriod: req.FloweringPeriod, FloweringColor: req.FloweringColor, + FloweringShape: req.FloweringShape, FloweringDiameter: int32(req.FlowerDiameter), + }) + return err +} diff --git a/app/plant/api/internal/svc/serviceContext.go b/app/plant/api/internal/svc/serviceContext.go index 5824465..58d23bc 100644 --- a/app/plant/api/internal/svc/serviceContext.go +++ b/app/plant/api/internal/svc/serviceContext.go @@ -1,6 +1,3 @@ -// Code scaffolded by goctl. Safe to edit. -// goctl 1.10.1 - package svc import ( @@ -9,7 +6,10 @@ import ( "sundynix-micro-go/app/plant/rpc/plantservice" "sundynix-micro-go/app/system/rpc/systemservice" + "github.com/zeromicro/go-zero/core/logx" "github.com/zeromicro/go-zero/zrpc" + "gorm.io/driver/mysql" + "gorm.io/gorm" ) type ServiceContext struct { @@ -17,13 +17,20 @@ type ServiceContext struct { PlantRpc plantservice.PlantService UserRpc systemservice.SystemService FileRpc fileservice.FileService + DB *gorm.DB } func NewServiceContext(c config.Config) *ServiceContext { + db, err := gorm.Open(mysql.Open(c.DB.DataSource), &gorm.Config{}) + if err != nil { + logx.Errorf("连接数据库失败: %v", err) + } + return &ServiceContext{ Config: c, PlantRpc: plantservice.NewPlantService(zrpc.MustNewClient(c.PlantRpc)), UserRpc: systemservice.NewSystemService(zrpc.MustNewClient(c.UserRpc)), FileRpc: fileservice.NewFileService(zrpc.MustNewClient(c.FileRpc)), + DB: db, } } diff --git a/app/plant/api/internal/types/types.go b/app/plant/api/internal/types/types.go index 1c972ce..0cc8c94 100644 --- a/app/plant/api/internal/types/types.go +++ b/app/plant/api/internal/types/types.go @@ -14,11 +14,11 @@ type BadgeConfigListReq struct { } type CarePlanReq struct { - PlantId string `json:"plantId"` - Name string `json:"name"` + PlantId string `json:"plantId,optional"` + Name string `json:"name,optional"` Icon string `json:"icon,optional"` - TargetAction string `json:"targetAction"` - Period int `json:"period"` + TargetAction string `json:"targetAction,optional"` + Period int `json:"period,optional"` } type CareRecordReq struct { @@ -28,16 +28,59 @@ type CareRecordReq struct { Note string `json:"note,optional"` } +type CompleteTaskApiReq struct { + TaskId string `json:"taskId"` + Remark string `json:"remark,optional"` +} + +type CreateBadgeConfigReq struct { + 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"` +} + +type CreateExchangeItemReq struct { + Name string `json:"name"` + Desc string `json:"desc,optional"` + Description string `json:"description,optional"` + ImgId string `json:"imgId,optional"` + ImageId string `json:"imageId,optional"` + Type string `json:"type,optional"` + Cost int64 `json:"cost,optional"` + CostSunlight int64 `json:"costSunlight,optional"` + Stock int `json:"stock,optional"` + LimitPerUser int `json:"limitPerUser,optional"` + Sort int `json:"sort,optional"` + StartTime string `json:"startTime,optional"` + EndTime string `json:"endTime,optional"` +} + +type CreateLevelConfigReq struct { + Level int `json:"level"` + Title string `json:"title"` + MinSunlight int64 `json:"minSunlight"` + Perks string `json:"perks,optional"` +} + type CreatePlantReq struct { - Name string `json:"name"` - PlantTime string `json:"plantTime"` - Status int `json:"status,optional"` - Placement string `json:"placement,optional"` - PotMaterial string `json:"potMaterial,optional"` - PotSize string `json:"potSize,optional"` - Sunlight string `json:"sunlight,optional"` - PlantingMaterial string `json:"plantingMaterial,optional"` - ImgIds []string `json:"imgIds,optional"` + Name string `json:"name"` + PlantTime string `json:"plantTime"` + Status int `json:"status,optional"` + Placement string `json:"placement,optional"` + PotMaterial string `json:"potMaterial,optional"` + PotSize string `json:"potSize,optional"` + Sunlight string `json:"sunlight,optional"` + PlantingMaterial string `json:"plantingMaterial,optional"` + ImgIds []string `json:"imgIds,optional"` + OssIds []string `json:"ossIds,optional"` + CarePlans []CarePlanReq `json:"carePlans,optional"` } type CreatePostReq struct { @@ -48,19 +91,68 @@ type CreatePostReq struct { TopicId string `json:"topicId,optional"` } +type CreateWikiReq struct { + 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"` + LightType string `json:"lightType,optional"` + OptimalTempPeriod string `json:"optimalTempPeriod,optional"` + ClassId string `json:"classId,optional"` + ClassIds []string `json:"classIds,optional"` + RelatedWikiIds []string `json:"relatedWikiIds,optional"` + OssIds []string `json:"ossIds,optional"` + DistributionArea string `json:"distributionArea,optional"` + LifeCycle string `json:"lifeCycle,optional"` + ReproductionMethod string `json:"reproductionMethod,optional"` + PestsDiseases string `json:"pestsDiseases,optional"` + Stem string `json:"stem,optional"` + Fruit string `json:"fruit,optional"` + FoliageType string `json:"foliageType,optional"` + FoliageColor string `json:"foliageColor,optional"` + FoliageShape string `json:"foliageShape,optional"` + Height int `json:"height,optional"` + FloweringPeriod string `json:"floweringPeriod,optional"` + FloweringColor string `json:"floweringColor,optional"` + FloweringShape string `json:"floweringShape,optional"` + FlowerDiameter int `json:"flowerDiameter,optional"` +} + type ExchangeItemListReq struct { - Current int `json:"current,optional"` - PageSize int `json:"pageSize,optional"` + Current int `json:"current,optional"` + PageSize int `json:"pageSize,optional"` + Keyword string `json:"keyword,optional"` + Type string `json:"type,optional"` + Status int `json:"status,optional"` +} + +type ExchangeOrderListReq struct { + Current int `json:"current,optional"` + PageSize int `json:"pageSize,optional"` + UserId string `json:"userId,optional"` + Status int `json:"status,optional"` } type ExchangeOrderReq struct { - ItemId string `json:"itemId"` + ItemId string `json:"itemId"` + Quantity int `json:"quantity,optional"` + RecipientName string `json:"recipientName,optional"` + Phone string `json:"phone,optional"` + Address string `json:"address,optional"` } type GrowthRecordReq struct { PlantId string `json:"plantId"` + Name string `json:"name,optional"` + Tag string `json:"tag,optional"` + Desc string `json:"desc,optional"` Content string `json:"content,optional"` ImgIds []string `json:"imgIds,optional"` + OssIds []string `json:"ossIds,optional"` } type IdPathReq struct { @@ -110,21 +202,74 @@ type PostListReq struct { } type TopicReq struct { - Name string `json:"name"` - Icon string `json:"icon,optional"` - Desc string `json:"desc,optional"` + Name string `json:"name"` + Title string `json:"title,optional"` + Icon string `json:"icon,optional"` + Desc string `json:"desc,optional"` + Remark string `json:"remark,optional"` + StartTime string `json:"startTime,optional"` + EndTime string `json:"endTime,optional"` +} + +type UpdateBadgeConfigReq struct { + 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"` +} + +type UpdateExchangeItemReq struct { + Id string `json:"id"` + Name string `json:"name,optional"` + Desc string `json:"desc,optional"` + Description string `json:"description,optional"` + ImgId string `json:"imgId,optional"` + ImageId string `json:"imageId,optional"` + Type string `json:"type,optional"` + Cost int64 `json:"cost,optional"` + CostSunlight int64 `json:"costSunlight,optional"` + Stock int `json:"stock,optional"` + LimitPerUser int `json:"limitPerUser,optional"` + Status int `json:"status,optional"` + Sort int `json:"sort,optional"` + StartTime string `json:"startTime,optional"` + EndTime string `json:"endTime,optional"` +} + +type UpdateExchangeOrderReq struct { + Id string `json:"id"` + Status int `json:"status"` + TrackingNo string `json:"trackingNo,optional"` + Remark string `json:"remark,optional"` +} + +type UpdateLevelConfigReq struct { + Id string `json:"id"` + Level int `json:"level,optional"` + Title string `json:"title,optional"` + MinSunlight int64 `json:"minSunlight,optional"` + Perks string `json:"perks,optional"` } type UpdatePlantReq struct { - Id string `json:"id"` - Name string `json:"name,optional"` - Status int `json:"status,optional"` - Placement string `json:"placement,optional"` - PotMaterial string `json:"potMaterial,optional"` - PotSize string `json:"potSize,optional"` - Sunlight string `json:"sunlight,optional"` - PlantingMaterial string `json:"plantingMaterial,optional"` - ImgIds []string `json:"imgIds,optional"` + Id string `json:"id"` + Name string `json:"name,optional"` + Status int `json:"status,optional"` + Placement string `json:"placement,optional"` + PotMaterial string `json:"potMaterial,optional"` + PotSize string `json:"potSize,optional"` + Sunlight string `json:"sunlight,optional"` + PlantingMaterial string `json:"plantingMaterial,optional"` + ImgIds []string `json:"imgIds,optional"` + OssIds []string `json:"ossIds,optional"` + CarePlans []UpdatePlanReq `json:"carePlans,optional"` } type UpdateProfileReq struct { @@ -132,11 +277,101 @@ type UpdateProfileReq struct { AvatarId string `json:"avatarId,optional"` } +type UpdateTopicReq struct { + Id string `json:"id"` + Name string `json:"name,optional"` + Title string `json:"title,optional"` + Icon string `json:"icon,optional"` + Desc string `json:"desc,optional"` + Remark string `json:"remark,optional"` + StartTime string `json:"startTime,optional"` + EndTime string `json:"endTime,optional"` +} + +type UpdateWikiClassReq struct { + Id string `json:"id"` + Name string `json:"name,optional"` + Icon string `json:"icon,optional"` +} + +type UpdateWikiReq struct { + 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"` + LightType string `json:"lightType,optional"` + OptimalTempPeriod string `json:"optimalTempPeriod,optional"` + ClassId string `json:"classId,optional"` + ClassIds []string `json:"classIds,optional"` + RelatedWikiIds []string `json:"relatedWikiIds,optional"` + OssIds []string `json:"ossIds,optional"` + DistributionArea string `json:"distributionArea,optional"` + LifeCycle string `json:"lifeCycle,optional"` + ReproductionMethod string `json:"reproductionMethod,optional"` + PestsDiseases string `json:"pestsDiseases,optional"` + Stem string `json:"stem,optional"` + Fruit string `json:"fruit,optional"` + FoliageType string `json:"foliageType,optional"` + FoliageColor string `json:"foliageColor,optional"` + FoliageShape string `json:"foliageShape,optional"` + Height int `json:"height,optional"` + FloweringPeriod string `json:"floweringPeriod,optional"` + FloweringColor string `json:"floweringColor,optional"` + FloweringShape string `json:"floweringShape,optional"` + FlowerDiameter int `json:"flowerDiameter,optional"` +} + +type UpdatePlanReq struct { + Id string `json:"id"` + Name string `json:"name,optional"` + Icon string `json:"icon,optional"` + TargetAction string `json:"targetAction,optional"` + Period int `json:"period,optional"` +} + type WikiClassReq struct { Name string `json:"name"` Icon string `json:"icon,optional"` } +// ========== Banner ========== + +type CreateBannerReq struct { + Title string `json:"title"` + ImageId string `json:"imageId"` + Sort int `json:"sort,optional"` + IsActive int `json:"isActive,optional"` + TargetUrl string `json:"targetUrl,optional"` +} + +type UpdateBannerReq struct { + Id string `json:"id"` + Title string `json:"title,optional"` + ImageId string `json:"imageId,optional"` + Sort int `json:"sort,optional"` + IsActive int `json:"isActive,optional"` + TargetUrl string `json:"targetUrl,optional"` +} + +type BannerListReq struct { + Current int `json:"current,optional"` + PageSize int `json:"pageSize,optional"` + Title string `json:"title,optional"` + IsActive int `json:"isActive,optional"` +} + +type QuickCareReq struct { + PlantId string `json:"plantId"` + Name string `json:"name"` + Icon string `json:"icon,optional"` + Remark string `json:"remark,optional"` +} + type WikiListReq struct { Current int `json:"current,optional"` PageSize int `json:"pageSize,optional"` diff --git a/app/plant/api/plant.api b/app/plant/api/plant.api index c4b3e35..b746c78 100644 --- a/app/plant/api/plant.api +++ b/app/plant/api/plant.api @@ -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) } diff --git a/app/plant/model/plant_model.go b/app/plant/model/plant_model.go index 168824b..58828c0 100644 --- a/app/plant/model/plant_model.go +++ b/app/plant/model/plant_model.go @@ -5,12 +5,12 @@ import ( "time" ) -// ========== 用户扩展表(plant业务特有字段) ========== +// ========== 用户扩展表 ========== -// SundynixPlantUserProfile 植物服务用户扩展表 -type SundynixPlantUserProfile struct { +type UserProfile struct { model.BaseModel UserID string `gorm:"size:50;uniqueIndex;column:user_id" json:"userId"` + MiniOpenID string `gorm:"size:80;column:mini_open_id" json:"miniOpenId"` NickName string `gorm:"size:100;column:nick_name" json:"nickName"` AvatarID string `gorm:"size:50;column:avatar_id" json:"avatarId"` LevelID string `gorm:"size:50;column:level_id" json:"levelId"` @@ -26,14 +26,11 @@ type SundynixPlantUserProfile struct { PhotoCount int64 `gorm:"not null;default:0;column:photo_count" json:"photoCount"` } -func (SundynixPlantUserProfile) TableName() string { - return "sundynix_plant_user_profile" -} +func (UserProfile) TableName() string { return "sundynix_plant_user_profile" } // ========== 我的植物 ========== -// SundynixMyPlant 我的植物 -type SundynixMyPlant struct { +type MyPlant struct { model.BaseModel UserID string `gorm:"size:50;index;column:user_id" json:"userId"` Name string `gorm:"size:20;column:name" json:"name"` @@ -44,26 +41,26 @@ type SundynixMyPlant struct { PotSize string `gorm:"size:50;column:pot_size" json:"potSize"` Sunlight string `gorm:"size:50;column:sunlight" json:"sunlight"` PlantingMaterial string `gorm:"size:50;column:planting_material" json:"plantingMaterial"` + + // 关联(使用 Preload 加载,仅限本地 sundynix_plant_* 表) + CarePlans []*CarePlan `gorm:"foreignKey:PlantID" json:"carePlans"` + CareRecords []*CareRecord `gorm:"foreignKey:PlantID" json:"careRecords"` + GrowthRecords []*GrowthRecord `gorm:"foreignKey:PlantID" json:"growthRecords"` + CareTasks []*CareTask `gorm:"foreignKey:PlantID" json:"careTasks"` } -func (SundynixMyPlant) TableName() string { - return "sundynix_my_plant" -} +func (MyPlant) TableName() string { return "sundynix_plant_my_plant" } -// SundynixMyPlantOss 植物图片关联表 -type SundynixMyPlantOss struct { +type MyPlantOss struct { MyPlantID string `gorm:"size:50;primaryKey;column:sundynix_my_plant_id" json:"myPlantId"` OssID string `gorm:"size:50;primaryKey;column:sundynix_oss_id" json:"ossId"` } -func (SundynixMyPlantOss) TableName() string { - return "sundynix_my_plant_oss" -} +func (MyPlantOss) TableName() string { return "sundynix_plant_my_plant_oss" } -// ========== 养护计划/记录 ========== +// ========== 养护计划/记录/任务 ========== -// SundynixCarePlan 养护计划 -type SundynixCarePlan struct { +type CarePlan struct { model.BaseModel UserID string `gorm:"size:50;column:user_id" json:"userId"` PlantID string `gorm:"size:50;index;column:plant_id" json:"plantId"` @@ -73,12 +70,9 @@ type SundynixCarePlan struct { TargetAction string `gorm:"size:32;index;column:target_action" json:"targetAction"` } -func (SundynixCarePlan) TableName() string { - return "sundynix_care_plan" -} +func (CarePlan) TableName() string { return "sundynix_plant_care_plan" } -// SundynixCareRecord 养护记录 -type SundynixCareRecord struct { +type CareRecord struct { model.BaseModel UserID string `gorm:"size:50;column:user_id" json:"userId"` PlantID string `gorm:"size:50;index;column:plant_id" json:"plantId"` @@ -88,29 +82,27 @@ type SundynixCareRecord struct { Icon string `gorm:"type:text;column:icon" json:"icon"` } -func (SundynixCareRecord) TableName() string { - return "sundynix_care_record" -} +func (CareRecord) TableName() string { return "sundynix_plant_care_record" } -// SundynixCareTask 养护任务 -type SundynixCareTask struct { +// CareTask 养护任务 status: 1=待完成 2=已完成 3=已过期 +type CareTask struct { model.BaseModel - UserID string `gorm:"size:50;column:user_id" json:"userId"` - PlantID string `gorm:"size:50;index;column:plant_id" json:"plantId"` - PlanID string `gorm:"size:50;index;column:plan_id" json:"planId"` - Name string `gorm:"size:50;column:name" json:"name"` - Icon string `gorm:"type:text;column:icon" json:"icon"` - TargetAction string `gorm:"size:32;column:target_action" json:"targetAction"` - DueDate time.Time `gorm:"column:due_date" json:"dueDate"` - Status int `gorm:"default:1;column:status" json:"status"` + UserID string `gorm:"size:50;column:user_id" json:"userId"` + PlantID string `gorm:"size:50;index;column:plant_id" json:"plantId"` + PlanID string `gorm:"size:50;index;column:plan_id" json:"planId"` + Name string `gorm:"size:50;column:name" json:"name"` + Icon string `gorm:"type:text;column:icon" json:"icon"` + TargetAction string `gorm:"size:32;column:target_action" json:"targetAction"` + DueDate time.Time `gorm:"column:due_date" json:"dueDate"` + CompletedAt *time.Time `gorm:"column:completed_at" json:"completedAt"` + Status int `gorm:"default:1;column:status" json:"status"` } -func (SundynixCareTask) TableName() string { - return "sundynix_care_task" -} +func (CareTask) TableName() string { return "sundynix_plant_care_task" } -// SundynixGrowthRecord 成长记录 -type SundynixGrowthRecord struct { +// ========== 成长记录 ========== + +type GrowthRecord struct { model.BaseModel PlantID string `gorm:"size:50;index;column:plant_id" json:"plantId"` UserID string `gorm:"size:50;index;column:user_id" json:"userId"` @@ -120,16 +112,14 @@ type SundynixGrowthRecord struct { Content string `gorm:"size:200;column:content" json:"content"` } -func (SundynixGrowthRecord) TableName() string { - return "sundynix_growth_record" -} +func (GrowthRecord) TableName() string { return "sundynix_plant_growth_record" } // ========== 百科 ========== -// SundynixWiki 植物百科 -type SundynixWiki struct { +type Wiki struct { model.BaseModel IsHot int `gorm:"column:is_hot" json:"isHot"` + IsVectorSynced int `gorm:"column:is_vector_synced;type:tinyint;default:0" json:"isVectorSynced"` Name string `gorm:"size:50;column:name" json:"name"` LatinName string `gorm:"size:100;column:latin_name" json:"latinName"` Aliases string `gorm:"size:100;column:aliases" json:"aliases"` @@ -153,39 +143,52 @@ type SundynixWiki struct { FloweringShape string `gorm:"size:100;column:flowering_shape" json:"floweringShape"` FlowerDiameter int `gorm:"column:flower_diameter" json:"flowerDiameter"` Fruit string `gorm:"size:200;column:fruit" json:"fruit"` + ClassID string `gorm:"size:50;index;column:class_id" json:"classId"` } -func (SundynixWiki) TableName() string { - return "sundynix_wiki" -} +func (Wiki) TableName() string { return "sundynix_plant_wiki" } -// SundynixWikiClass 百科分类 -type SundynixWikiClass struct { +type WikiClass struct { model.BaseModel Name string `gorm:"size:50;column:name" json:"name"` OssID string `gorm:"size:50;column:oss_id" json:"ossId"` } -func (SundynixWikiClass) TableName() string { - return "sundynix_wiki_class" +func (WikiClass) TableName() string { return "sundynix_plant_wiki_class" } + +type WikiOss struct { + WikiID string `gorm:"size:50;primaryKey;column:wiki_id" json:"wikiId"` + OssID string `gorm:"size:50;primaryKey;column:oss_id" json:"ossId"` } -// SundynixUserStar 用户收藏 -type SundynixUserStar struct { +func (WikiOss) TableName() string { return "sundynix_plant_wiki_oss" } + +type WikiClassRelation struct { + WikiID string `gorm:"size:50;primaryKey;column:wiki_id" json:"wikiId"` + ClassID string `gorm:"size:50;primaryKey;column:class_id" json:"classId"` +} + +func (WikiClassRelation) TableName() string { return "sundynix_plant_wiki_class_rel" } + +type WikiRelated struct { + WikiID string `gorm:"size:50;primaryKey;column:wiki_id" json:"wikiId"` + RelatedWikiID string `gorm:"size:50;primaryKey;column:related_wiki_id" json:"relatedWikiId"` +} + +func (WikiRelated) TableName() string { return "sundynix_plant_wiki_related" } + +type UserStar struct { model.BaseModel UserID string `gorm:"size:50;index;column:user_id" json:"userId"` TargetID string `gorm:"size:50;index;column:target_id" json:"targetId"` Type string `gorm:"size:20;column:type" json:"type"` // wiki/post } -func (SundynixUserStar) TableName() string { - return "sundynix_user_star" -} +func (UserStar) TableName() string { return "sundynix_plant_user_star" } // ========== 社区 ========== -// SundynixPost 社区帖子 -type SundynixPost struct { +type Post struct { model.BaseModel UserID string `gorm:"size:50;index;column:user_id" json:"userId"` Title string `gorm:"size:100;column:title" json:"title"` @@ -196,14 +199,18 @@ type SundynixPost struct { StarCount int `gorm:"default:0;column:star_count" json:"starCount"` Location string `gorm:"size:100;column:location" json:"location"` HasReviewed int `gorm:"default:0;column:has_reviewed" json:"hasReviewed"` + TopicID string `gorm:"size:50;index;column:topic_id" json:"topicId"` + + // 关联(使用 Preload 加载,仅限本地 sundynix_plant_* 表) + CommentList []*PostComment `gorm:"foreignKey:PostID" json:"commentList"` + LikeList []*PostLike `gorm:"foreignKey:PostID" json:"likeList"` + HasLiked int `gorm:"-" json:"hasLiked"` + HasStar int `gorm:"-" json:"hasStar"` } -func (SundynixPost) TableName() string { - return "sundynix_post" -} +func (Post) TableName() string { return "sundynix_plant_post" } -// SundynixPostComment 帖子评论 -type SundynixPostComment struct { +type PostComment struct { model.BaseModel PostID string `gorm:"size:50;index;column:post_id" json:"postId"` UserID string `gorm:"size:50;column:user_id" json:"userId"` @@ -211,67 +218,95 @@ type SundynixPostComment struct { ParentID string `gorm:"size:50;column:parent_id" json:"parentId"` } -func (SundynixPostComment) TableName() string { - return "sundynix_post_comment" -} +func (PostComment) TableName() string { return "sundynix_plant_post_comment" } -// SundynixPostLike 帖子点赞 -type SundynixPostLike struct { +type PostLike struct { model.BaseModel PostID string `gorm:"size:50;index;column:post_id" json:"postId"` UserID string `gorm:"size:50;index;column:user_id" json:"userId"` } -func (SundynixPostLike) TableName() string { - return "sundynix_post_like" +type PostOss struct { + PostID string `gorm:"size:50;primaryKey;column:post_id" json:"postId"` + OssID string `gorm:"size:50;primaryKey;column:oss_id" json:"ossId"` } -// SundynixPostTopic 话题 -type SundynixPostTopic struct { +func (PostOss) TableName() string { return "sundynix_plant_post_oss" } + +type Topic struct { model.BaseModel - Name string `gorm:"size:50;column:name" json:"name"` - PostCount int `gorm:"default:0;column:post_count" json:"postCount"` + Name string `gorm:"size:50;column:name" json:"name"` + Title string `gorm:"size:100;column:title" json:"title"` + Icon string `gorm:"type:text;column:icon" json:"icon"` + Desc string `gorm:"size:200;column:desc" json:"desc"` + Remark string `gorm:"size:500;column:remark" json:"remark"` + StartTime *time.Time `gorm:"column:start_time" json:"startTime"` + EndTime *time.Time `gorm:"column:end_time" json:"endTime"` + PostCount int `gorm:"default:0;column:post_count" json:"postCount"` } -func (SundynixPostTopic) TableName() string { - return "sundynix_post_topic" +func (Topic) TableName() string { return "sundynix_plant_topic" } + +// ========== OCR ========== + +// OcrLog OCR识别记录 +type OcrLog struct { + model.BaseModel + UserID string `gorm:"size:50;index;column:user_id" json:"userId"` + ImageUrl string `gorm:"size:500;column:image_url" json:"imageUrl"` + Result string `gorm:"type:text;column:result" json:"result"` + LogID uint64 `gorm:"column:log_id;index" json:"logId"` } +func (OcrLog) TableName() string { return "sundynix_plant_ocr_log" } + // ========== 积分商城 ========== -// SundynixExchangeItem 兑换商品 -type SundynixExchangeItem struct { +// ExchangeItem status: 1=上架 2=下架 +type ExchangeItem struct { model.BaseModel - Name string `gorm:"size:100;column:name" json:"name"` - Desc string `gorm:"size:200;column:desc" json:"desc"` - ImgID string `gorm:"size:50;column:img_id" json:"imgId"` - Cost int64 `gorm:"column:cost" json:"cost"` - Stock int `gorm:"column:stock" json:"stock"` - Status int `gorm:"default:1;column:status" json:"status"` + Name string `gorm:"size:100;column:name" json:"name"` + Desc string `gorm:"size:200;column:desc" json:"desc"` + Description string `gorm:"type:text;column:description" json:"description"` + ImgID string `gorm:"size:50;column:img_id" json:"imgId"` + ImageID string `gorm:"size:50;column:image_id" json:"imageId"` + Type string `gorm:"size:20;default:'PHYSICAL';column:type" json:"type"` + Cost int64 `gorm:"column:cost" json:"cost"` + CostSunlight int64 `gorm:"column:cost_sunlight" json:"costSunlight"` + Stock int `gorm:"column:stock;default:-1" json:"stock"` + LimitPerUser int `gorm:"column:limit_per_user;default:0" json:"limitPerUser"` + Status int `gorm:"default:1;column:status" json:"status"` + Sort int `gorm:"default:0;column:sort" json:"sort"` + StartTime *time.Time `gorm:"column:start_time" json:"startTime"` + EndTime *time.Time `gorm:"column:end_time" json:"endTime"` } -func (SundynixExchangeItem) TableName() string { - return "sundynix_exchange_item" -} +func (ExchangeItem) TableName() string { return "sundynix_plant_exchange_item" } -// SundynixExchangeOrder 兑换订单 -type SundynixExchangeOrder struct { +// ExchangeOrder status: 0=待处理 1=已完成 2=已取消 +type ExchangeOrder struct { model.BaseModel - UserID string `gorm:"size:50;index;column:user_id" json:"userId"` - ItemID string `gorm:"size:50;column:item_id" json:"itemId"` - Cost int64 `gorm:"column:cost" json:"cost"` - Status int `gorm:"default:0;column:status" json:"status"` - Address string `gorm:"size:200;column:address" json:"address"` + UserID string `gorm:"size:50;index;column:user_id" json:"userId"` + ItemID string `gorm:"size:50;column:item_id" json:"itemId"` + ItemName string `gorm:"size:100;column:item_name" json:"itemName"` + Cost int64 `gorm:"column:cost" json:"cost"` + CostSunlight int64 `gorm:"column:cost_sunlight" json:"costSunlight"` + Quantity int `gorm:"column:quantity;default:1" json:"quantity"` + Status int `gorm:"default:1;column:status" json:"status"` + ItemType string `gorm:"size:20;column:item_type" json:"itemType"` + RecipientName string `gorm:"size:50;column:recipient_name" json:"recipientName"` + Phone string `gorm:"size:20;column:phone" json:"phone"` + Address string `gorm:"size:255;column:address" json:"address"` + TrackingNo string `gorm:"size:100;column:tracking_no" json:"trackingNo"` + Remark string `gorm:"size:255;column:remark" json:"remark"` + CompletedAt *time.Time `gorm:"column:completed_at" json:"completedAt"` } -func (SundynixExchangeOrder) TableName() string { - return "sundynix_exchange_order" -} +func (ExchangeOrder) TableName() string { return "sundynix_plant_exchange_order" } // ========== 等级/徽章配置 ========== -// SundynixLevelConfig 等级配置 -type SundynixLevelConfig struct { +type LevelConfig struct { model.BaseModel Level int `gorm:"column:level" json:"level"` Title string `gorm:"size:50;column:title" json:"title"` @@ -279,12 +314,9 @@ type SundynixLevelConfig struct { Perks string `gorm:"size:200;column:perks" json:"perks"` } -func (SundynixLevelConfig) TableName() string { - return "sundynix_level_config" -} +func (LevelConfig) TableName() string { return "sundynix_plant_level_config" } -// SundynixBadgeConfig 徽章配置 -type SundynixBadgeConfig struct { +type BadgeConfig struct { model.BaseModel Name string `gorm:"size:64;column:name" json:"name"` Description string `gorm:"size:255;column:description" json:"description"` @@ -299,29 +331,63 @@ type SundynixBadgeConfig struct { Sort int `gorm:"default:1;column:sort" json:"sort"` } -func (SundynixBadgeConfig) TableName() string { - return "sundynix_badge_config" -} +func (BadgeConfig) TableName() string { return "sundynix_plant_badge_config" } -// SundynixUserBadge 用户徽章 -type SundynixUserBadge struct { +type UserBadge struct { model.BaseModel - UserID string `gorm:"size:50;index;column:user_id" json:"userId"` - BadgeID string `gorm:"size:50;index;column:badge_id" json:"badgeId"` + UserID string `gorm:"size:50;index;column:user_id" json:"userId"` + BadgeID string `gorm:"size:50;index;column:badge_id" json:"badgeId"` + AcquiredAt time.Time `gorm:"autoCreateTime;column:acquired_at" json:"acquiredAt"` } -func (SundynixUserBadge) TableName() string { - return "sundynix_user_badge" -} +func (UserBadge) TableName() string { return "sundynix_plant_user_badge" } -// SundynixAiChatHistory AI聊天历史 -type SundynixAiChatHistory struct { +// ========== AI ========== + +// AiChatHistory 匹配旧项目 question/answer 字段 +type AiChatHistory struct { model.BaseModel - UserID string `gorm:"size:50;index;column:user_id" json:"userId"` - Role string `gorm:"size:20;column:role" json:"role"` - Content string `gorm:"type:text;column:content" json:"content"` + UserID string `gorm:"size:50;index;column:user_id" json:"userId"` + Question string `gorm:"type:text;column:question" json:"question"` + Answer string `gorm:"type:text;column:answer" json:"answer"` + Role string `gorm:"size:20;column:role" json:"role"` + Content string `gorm:"type:text;column:content" json:"content"` } -func (SundynixAiChatHistory) TableName() string { - return "sundynix_ai_chat_history" +func (AiChatHistory) TableName() string { return "sundynix_plant_ai_chat_history" } + +// ========== 成长记录图片关联 ========== + +// GrowthRecordOss 成长记录与图片关联表 +type GrowthRecordOss struct { + GrowthRecordID string `gorm:"size:50;index;column:growth_record_id" json:"growthRecordId"` + OssID string `gorm:"size:50;index;column:oss_id" json:"ossId"` } + +func (GrowthRecordOss) TableName() string { return "sundynix_plant_growth_record_oss" } + +// ========== Banner ========== + +type Banner struct { + model.BaseModel + Title string `gorm:"size:100;column:title" json:"title"` + ImageID string `gorm:"size:50;column:image_id" json:"imageId"` + Sort int `gorm:"default:0;column:sort" json:"sort"` + IsActive int `gorm:"default:1;column:is_active" json:"isActive"` + TargetURL string `gorm:"size:255;column:target_url" json:"targetUrl"` +} + +func (Banner) TableName() string { return "sundynix_plant_banner" } + +type MediaCheckResult struct { + model.BaseModel + TraceID string `gorm:"size:100;uniqueIndex;column:trace_id" json:"traceId"` + PostID string `gorm:"size:50;index;column:post_id" json:"postId"` + OssID string `gorm:"size:50;column:oss_id" json:"ossId"` + UserID string `gorm:"size:50;column:user_id" json:"userId"` + Status int `gorm:"column:status;default:0" json:"status"` + Type int `gorm:"column:type" json:"type"` + ErrMsg string `gorm:"size:255;column:err_msg" json:"errMsg"` +} + +func (MediaCheckResult) TableName() string { return "sundynix_plant_media_check_result" } diff --git a/app/plant/rpc/etc/plant.yaml b/app/plant/rpc/etc/plant.yaml index 853eea7..94c85ba 100644 --- a/app/plant/rpc/etc/plant.yaml +++ b/app/plant/rpc/etc/plant.yaml @@ -10,3 +10,13 @@ Etcd: DB: DataSource: root:root@tcp(192.168.100.127:3307)/sundynix_micro_go?charset=utf8mb4&parseTime=True&loc=Local + +Ai: + EmbeddingApiUrl: + EmbeddingApiKey: + EmbeddingModelName: + QdrantUrl: + QdrantApiKey: + QdrantCollection: + VectorDimension: 0 + DailyQuota: 20 diff --git a/app/plant/rpc/internal/config/config.go b/app/plant/rpc/internal/config/config.go index 897b703..3a0e1e3 100755 --- a/app/plant/rpc/internal/config/config.go +++ b/app/plant/rpc/internal/config/config.go @@ -7,4 +7,14 @@ type Config struct { DB struct { DataSource string } + Ai struct { + EmbeddingApiUrl string + EmbeddingApiKey string + EmbeddingModelName string + QdrantUrl string + QdrantApiKey string + QdrantCollection string + VectorDimension int + DailyQuota int64 + } } diff --git a/app/plant/rpc/internal/logic/addCarePlanLogic.go b/app/plant/rpc/internal/logic/addCarePlanLogic.go index aef9672..05e0e83 100644 --- a/app/plant/rpc/internal/logic/addCarePlanLogic.go +++ b/app/plant/rpc/internal/logic/addCarePlanLogic.go @@ -2,11 +2,14 @@ package logic import ( "context" + "time" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" ) type AddCarePlanLogic struct { @@ -23,9 +26,38 @@ func NewAddCarePlanLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddCa } } -// 养护 +// 添加魏护计划 func (l *AddCarePlanLogic) AddCarePlan(in *plant.AddCarePlanReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line - - return &plant.CommonResp{}, nil + txErr := l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + // 1. 创建计划 + carePlan := plantModel.CarePlan{ + UserID: in.UserId, + PlantID: in.PlantId, + Name: in.Name, + Icon: in.Icon, + Period: int(in.Period), + TargetAction: in.TargetAction, + } + if err := tx.Create(&carePlan).Error; err != nil { + return err + } + // 2. 创建第一个魏护任务 + today := time.Now().Truncate(24 * time.Hour) + dueDate := today.AddDate(0, 0, int(in.Period)) + task := plantModel.CareTask{ + UserID: in.UserId, + PlantID: in.PlantId, + PlanID: carePlan.ID, + Name: in.Name, + Icon: in.Icon, + TargetAction: in.TargetAction, + DueDate: dueDate, + Status: 1, + } + return tx.Create(&task).Error + }) + if txErr != nil { + return nil, txErr + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil } diff --git a/app/plant/rpc/internal/logic/addCareRecordLogic.go b/app/plant/rpc/internal/logic/addCareRecordLogic.go index f4816a9..1cf5f9c 100644 --- a/app/plant/rpc/internal/logic/addCareRecordLogic.go +++ b/app/plant/rpc/internal/logic/addCareRecordLogic.go @@ -2,11 +2,14 @@ package logic import ( "context" + "time" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" ) type AddCareRecordLogic struct { @@ -23,8 +26,74 @@ func NewAddCareRecordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Add } } +// AddCareRecord 添加养护记录:完成当前任务 + 生成下一期任务 + 更新统计 func (l *AddCareRecordLogic) AddCareRecord(in *plant.AddCareRecordReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line + txErr := l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + // 1. 查找计划信息(获取 period 和图标用于生成下一任务) + var plan plantModel.CarePlan + if err := tx.Where("id = ?", in.PlanId).First(&plan).Error; err != nil { + return err + } - return &plant.CommonResp{}, nil + // 2. 保存养护记录 + record := plantModel.CareRecord{ + UserID: in.UserId, + PlantID: in.PlantId, + PlanID: in.PlanId, + Name: plan.Name, + Icon: plan.Icon, + Remark: in.Note, + } + if err := tx.Create(&record).Error; err != nil { + return err + } + + // 3. 把该计划当前最旧的 pending 任务标记为已完成 + tx.Model(&plantModel.CareTask{}). + Where("plan_id = ? AND status = 1", in.PlanId). + Order("due_date asc"). + Limit(1). + Update("status", 2) + + // 4. 生成下一期任务(以今天为基准,+period 天) + nextDue := time.Now().Truncate(24*time.Hour).AddDate(0, 0, plan.Period) + nextTask := plantModel.CareTask{ + UserID: in.UserId, + PlantID: in.PlantId, + PlanID: in.PlanId, + Name: plan.Name, + Icon: plan.Icon, + TargetAction: plan.TargetAction, + DueDate: nextDue, + Status: 1, + } + if err := tx.Create(&nextTask).Error; err != nil { + return err + } + + // 5. 更新用户 care_count 统计 + actionMap := map[string]string{ + "water": "water_count", + "fertilize": "fertilize_count", + "repot": "repot_count", + "prune": "prune_count", + "photo": "photo_count", + } + colName := "care_count" + if col, ok := actionMap[plan.TargetAction]; ok { + colName = col + } + tx.Model(&plantModel.UserProfile{}). + Where("user_id = ?", in.UserId). + Updates(map[string]interface{}{ + "care_count": gorm.Expr("care_count + 1"), + colName: gorm.Expr(colName + " + 1"), + }) + + return nil + }) + if txErr != nil { + return nil, txErr + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil } diff --git a/app/plant/rpc/internal/logic/addGrowthRecordLogic.go b/app/plant/rpc/internal/logic/addGrowthRecordLogic.go index 04ba6f9..440c811 100644 --- a/app/plant/rpc/internal/logic/addGrowthRecordLogic.go +++ b/app/plant/rpc/internal/logic/addGrowthRecordLogic.go @@ -2,11 +2,11 @@ package logic import ( "context" - + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" - - "github.com/zeromicro/go-zero/core/logx" ) type AddGrowthRecordLogic struct { @@ -16,15 +16,33 @@ type AddGrowthRecordLogic struct { } func NewAddGrowthRecordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddGrowthRecordLogic { - return &AddGrowthRecordLogic{ - ctx: ctx, - svcCtx: svcCtx, - Logger: logx.WithContext(ctx), - } + return &AddGrowthRecordLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} } func (l *AddGrowthRecordLogic) AddGrowthRecord(in *plant.AddGrowthRecordReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line - - return &plant.CommonResp{}, nil + err := l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + record := plantModel.GrowthRecord{ + UserID: in.UserId, PlantID: in.PlantId, Content: in.Content, + } + if err := tx.Create(&record).Error; err != nil { + return err + } + // 保存图片关联 + if len(in.ImgIds) > 0 { + relations := make([]plantModel.GrowthRecordOss, 0, len(in.ImgIds)) + for _, ossId := range in.ImgIds { + relations = append(relations, plantModel.GrowthRecordOss{ + GrowthRecordID: record.ID, OssID: ossId, + }) + } + if err := tx.Create(&relations).Error; err != nil { + return err + } + } + return nil + }) + if err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil } diff --git a/app/plant/rpc/internal/logic/clearAiChatHistoryLogic.go b/app/plant/rpc/internal/logic/clearAiChatHistoryLogic.go new file mode 100644 index 0000000..ee31460 --- /dev/null +++ b/app/plant/rpc/internal/logic/clearAiChatHistoryLogic.go @@ -0,0 +1,26 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type ClearAiChatHistoryLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewClearAiChatHistoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ClearAiChatHistoryLogic { + return &ClearAiChatHistoryLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *ClearAiChatHistoryLogic) ClearAiChatHistory(in *plant.GetProfileReq) (*plant.CommonResp, error) { + if err := l.svcCtx.DB.Where("user_id = ?", in.UserId).Delete(&plantModel.AiChatHistory{}).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/commentPostLogic.go b/app/plant/rpc/internal/logic/commentPostLogic.go index 1d68d6a..f77408f 100644 --- a/app/plant/rpc/internal/logic/commentPostLogic.go +++ b/app/plant/rpc/internal/logic/commentPostLogic.go @@ -3,10 +3,12 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" ) type CommentPostLogic struct { @@ -23,8 +25,23 @@ func NewCommentPostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Comme } } +// 评论帖子 func (l *CommentPostLogic) CommentPost(in *plant.CommentPostReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line - - return &plant.CommonResp{}, nil + err := l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + comment := plantModel.PostComment{ + PostID: in.PostId, + UserID: in.UserId, + Content: in.Content, + ParentID: in.ParentId, + } + if err := tx.Create(&comment).Error; err != nil { + return err + } + return tx.Model(&plantModel.Post{}).Where("id = ?", in.PostId). + Update("comment_count", gorm.Expr("comment_count + 1")).Error + }) + if err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil } diff --git a/app/plant/rpc/internal/logic/completeTaskLogic.go b/app/plant/rpc/internal/logic/completeTaskLogic.go new file mode 100644 index 0000000..bd0d1db --- /dev/null +++ b/app/plant/rpc/internal/logic/completeTaskLogic.go @@ -0,0 +1,164 @@ +package logic + +import ( + "context" + "errors" + "time" + + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type CompleteTaskLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewCompleteTaskLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CompleteTaskLogic { + return &CompleteTaskLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +const taskReward = int64(50) + +func (l *CompleteTaskLogic) CompleteTask(in *plant.CompleteTaskReq) (*plant.TaskCompletionResult, error) { + var result plant.TaskCompletionResult + err := l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + // 1. 查任务 + var task plantModel.CareTask + if err := tx.Set("gorm:query_option", "FOR UPDATE"). + Where("id = ? AND user_id = ?", in.TaskId, in.UserId).First(&task).Error; err != nil { + return err + } + if task.Status != 1 { + return errors.New("任务已完成或已过期,不能重复完成") + } + // 2. 标记完成 + now := time.Now() + if err := tx.Model(&task).Updates(map[string]interface{}{ + "status": 2, "completed_at": now, + }).Error; err != nil { + return err + } + // 3. 查计划,生成下个周期任务 + var plan plantModel.CarePlan + if err := tx.Where("id = ?", task.PlanID).First(&plan).Error; err != nil { + return err + } + today := time.Now() + todayZero := time.Date(today.Year(), today.Month(), today.Day(), 0, 0, 0, 0, today.Location()) + nextDue := todayZero.AddDate(0, 0, plan.Period) + newTask := plantModel.CareTask{ + UserID: plan.UserID, PlantID: plan.PlantID, PlanID: plan.ID, + Name: plan.Name, Icon: plan.Icon, TargetAction: plan.TargetAction, + DueDate: nextDue, Status: 1, + } + if err := tx.Create(&newTask).Error; err != nil { + return err + } + // 4. 保存养护记录 + record := plantModel.CareRecord{ + UserID: plan.UserID, PlantID: plan.PlantID, PlanID: plan.ID, + Name: plan.Name, Icon: plan.Icon, Remark: in.Remark, + } + if err := tx.Create(&record).Error; err != nil { + return err + } + // 5. 查用户 profile(加锁) + var profile plantModel.UserProfile + if err := tx.Set("gorm:query_option", "FOR UPDATE"). + Where("user_id = ?", in.UserId).First(&profile).Error; err != nil { + return err + } + fieldMap := map[string]string{ + "ACT_WATER": "water_count", "ACT_FERTILIZE": "fertilize_count", + "ACT_REPOT": "repot_count", "ACT_PRUNE": "prune_count", + } + col, ok := fieldMap[task.TargetAction] + if !ok { + col = "care_count" + } + newTotal := profile.TotalSunlight + taskReward + // 5.1 等级判定 + var latestLevel plantModel.LevelConfig + levelErr := tx.Where("min_sunlight <= ?", newTotal). + Order("min_sunlight DESC").First(&latestLevel).Error + if levelErr != nil { + if errors.Is(levelErr, gorm.ErrRecordNotFound) { + // 没有等级配置,跳过等级相关逻辑 + result.IsLevelUp = false + result.RewardSunlight = taskReward + // 仍要更新阳光值 + profileData := map[string]interface{}{ + col: gorm.Expr(col + " + 1"), + "current_sunlight": profile.CurrentSunlight + taskReward, + "total_sunlight": newTotal, + } + if err := tx.Model(&plantModel.UserProfile{}). + Where("user_id = ?", in.UserId).Updates(profileData).Error; err != nil { + return err + } + return nil // 跳过后续等级/徽章逻辑 + } + return errors.New("等级配置异常") + } + result.IsLevelUp = (latestLevel.ID != profile.LevelID) + result.CurrentLevel = &plant.LevelConfigInfo{ + Id: latestLevel.ID, Level: int32(latestLevel.Level), + Title: latestLevel.Title, MinSunlight: latestLevel.MinSunlight, + } + result.RewardSunlight = taskReward + // 5.2 更新 profile + profileData := map[string]interface{}{ + col: gorm.Expr(col + " + 1"), + "current_sunlight": profile.CurrentSunlight + taskReward, + "total_sunlight": newTotal, + "level_id": latestLevel.ID, + } + if err := tx.Model(&plantModel.UserProfile{}). + Where("user_id = ?", in.UserId).Updates(profileData).Error; err != nil { + return err + } + // 6. 徽章判定 + actionValMap := map[string]int64{ + "ACT_WATER": profile.WaterCount + 1, "ACT_FERTILIZE": profile.FertilizeCount + 1, + "ACT_REPOT": profile.RepotCount + 1, "ACT_PRUNE": profile.PruneCount + 1, + } + currentVal := actionValMap[task.TargetAction] + var ownedIds []string + tx.Model(&plantModel.UserBadge{}).Where("user_id = ?", in.UserId).Pluck("badge_id", &ownedIds) + ownedMap := make(map[string]bool) + for _, id := range ownedIds { + ownedMap[id] = true + } + var badgeConfigs []plantModel.BadgeConfig + tx.Where("target_action = ?", task.TargetAction).Find(&badgeConfigs) + var bestBadge *plantModel.BadgeConfig + for i := range badgeConfigs { + bc := &badgeConfigs[i] + if !ownedMap[bc.ID] && currentVal >= bc.Threshold { + if bestBadge == nil || bc.Tier > bestBadge.Tier { + bestBadge = bc + } + } + } + if bestBadge != nil { + ub := plantModel.UserBadge{UserID: in.UserId, BadgeID: bestBadge.ID} + if err := tx.Create(&ub).Error; err != nil { + return err + } + tx.Model(&plantModel.UserProfile{}).Where("user_id = ?", in.UserId). + UpdateColumn("current_sunlight", gorm.Expr("current_sunlight + ?", bestBadge.RewardSunlight)) + result.IsGetBadge = true + result.NewBadge = &plant.BadgeConfigInfo{ + Id: bestBadge.ID, Name: bestBadge.Name, Dimension: bestBadge.Dimension, + Tier: int32(bestBadge.Tier), RewardSunlight: bestBadge.RewardSunlight, + } + } + return nil + }) + return &result, err +} diff --git a/app/plant/rpc/internal/logic/createBadgeConfigLogic.go b/app/plant/rpc/internal/logic/createBadgeConfigLogic.go new file mode 100644 index 0000000..b107d0c --- /dev/null +++ b/app/plant/rpc/internal/logic/createBadgeConfigLogic.go @@ -0,0 +1,32 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type CreateBadgeConfigLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewCreateBadgeConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateBadgeConfigLogic { + return &CreateBadgeConfigLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *CreateBadgeConfigLogic) CreateBadgeConfig(in *plant.CreateBadgeConfigReq) (*plant.CommonResp, error) { + cfg := plantModel.BadgeConfig{ + Name: in.Name, Description: in.Description, Dimension: in.Dimension, + GroupID: in.GroupId, Tier: int(in.Tier), TargetAction: in.TargetAction, + Threshold: in.Threshold, RewardSunlight: in.RewardSunlight, + IconID: in.IconId, Sort: int(in.Sort), + } + if err := l.svcCtx.DB.Create(&cfg).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/createExchangeItemLogic.go b/app/plant/rpc/internal/logic/createExchangeItemLogic.go new file mode 100644 index 0000000..45969f5 --- /dev/null +++ b/app/plant/rpc/internal/logic/createExchangeItemLogic.go @@ -0,0 +1,56 @@ +package logic + +import ( + "context" + "time" + + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type CreateExchangeItemLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewCreateExchangeItemLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateExchangeItemLogic { + return &CreateExchangeItemLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *CreateExchangeItemLogic) CreateExchangeItem(in *plant.CreateExchangeItemReq) (*plant.CommonResp, error) { + cost := in.Cost + if in.CostSunlight > 0 { + cost = in.CostSunlight + } + itemType := in.Type + if itemType == "" { + itemType = "PHYSICAL" + } + imgID := in.ImgId + if imgID == "" { + imgID = in.ImageId + } + var startTime, endTime *time.Time + if in.StartTime != "" { + if t, err := time.Parse(time.DateTime, in.StartTime); err == nil { + startTime = &t + } + } + if in.EndTime != "" { + if t, err := time.Parse(time.DateTime, in.EndTime); err == nil { + endTime = &t + } + } + item := plantModel.ExchangeItem{ + Name: in.Name, Desc: in.Desc, Description: in.Desc, ImgID: imgID, ImageID: imgID, + Type: itemType, Cost: cost, CostSunlight: cost, Stock: int(in.Stock), Status: 1, + LimitPerUser: int(in.LimitPerUser), Sort: int(in.Sort), StartTime: startTime, EndTime: endTime, + } + if err := l.svcCtx.DB.Create(&item).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/createExchangeOrderLogic.go b/app/plant/rpc/internal/logic/createExchangeOrderLogic.go index f8215b3..a7476ae 100644 --- a/app/plant/rpc/internal/logic/createExchangeOrderLogic.go +++ b/app/plant/rpc/internal/logic/createExchangeOrderLogic.go @@ -2,11 +2,15 @@ package logic import ( "context" + "errors" + "time" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" ) type CreateExchangeOrderLogic struct { @@ -23,8 +27,92 @@ func NewCreateExchangeOrderLogic(ctx context.Context, svcCtx *svc.ServiceContext } } +// 创建兑换订单(阳光值扣减+库存扣减事务) func (l *CreateExchangeOrderLogic) CreateExchangeOrder(in *plant.CreateExchangeOrderReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line + txErr := l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + // 1. 查询并锁定商品 + var item plantModel.ExchangeItem + if err := tx.Set("gorm:query_option", "FOR UPDATE"). + Where("id = ? AND status = 1", in.ItemId).First(&item).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return errors.New("商品不存在或已下架") + } + return err + } - return &plant.CommonResp{}, nil + quantity := int(in.Quantity) + if quantity <= 0 { + quantity = 1 + } + cost := item.CostSunlight + if cost == 0 { + cost = item.Cost + } + totalCost := cost * int64(quantity) + now := time.Now() + if item.StartTime != nil && now.Before(*item.StartTime) { + return errors.New("兑换尚未开始") + } + if item.EndTime != nil && now.After(*item.EndTime) { + return errors.New("兑换已结束") + } + if item.LimitPerUser > 0 { + var count int64 + tx.Model(&plantModel.ExchangeOrder{}). + Where("user_id = ? AND item_id = ? AND status <> ?", in.UserId, in.ItemId, 5). + Count(&count) + if int(count)+quantity > item.LimitPerUser { + return errors.New("已达到兑换上限") + } + } + + // 2. 检查库存(-1 表示无限库存) + if item.Stock >= 0 && item.Stock < quantity { + return errors.New("库存不足") + } + + // 3. 扣减阳光值(原子操作,RowsAffected==0 说明阳光不足) + result := tx.Model(&plantModel.UserProfile{}). + Where("user_id = ? AND current_sunlight >= ?", in.UserId, totalCost). + Update("current_sunlight", gorm.Expr("current_sunlight - ?", totalCost)) + if result.Error != nil { + return result.Error + } + if result.RowsAffected == 0 { + return errors.New("阳光值不足") + } + + // 4. 扣减库存(-1无限库存时跳过) + if item.Stock >= 0 { + if err := tx.Model(&plantModel.ExchangeItem{}). + Where("id = ? AND stock >= ?", in.ItemId, quantity). + Update("stock", gorm.Expr("stock - ?", quantity)).Error; err != nil { + return err + } + } + + // 5. 创建订单 + order := plantModel.ExchangeOrder{ + UserID: in.UserId, + ItemID: in.ItemId, + ItemName: item.Name, + Cost: totalCost, + CostSunlight: totalCost, + Quantity: quantity, + ItemType: item.Type, + RecipientName: in.RecipientName, + Phone: in.Phone, + Address: in.Address, + Status: 1, + } + if item.Type == "VIRTUAL" { + order.Status = 4 + order.CompletedAt = &now + } + return tx.Create(&order).Error + }) + if txErr != nil { + return nil, txErr + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil } diff --git a/app/plant/rpc/internal/logic/createLevelConfigLogic.go b/app/plant/rpc/internal/logic/createLevelConfigLogic.go new file mode 100644 index 0000000..6943999 --- /dev/null +++ b/app/plant/rpc/internal/logic/createLevelConfigLogic.go @@ -0,0 +1,27 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type CreateLevelConfigLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewCreateLevelConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateLevelConfigLogic { + return &CreateLevelConfigLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *CreateLevelConfigLogic) CreateLevelConfig(in *plant.CreateLevelConfigReq) (*plant.CommonResp, error) { + cfg := plantModel.LevelConfig{Level: int(in.Level), Title: in.Title, MinSunlight: in.MinSunlight, Perks: in.Perks} + if err := l.svcCtx.DB.Create(&cfg).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/createPlantLogic.go b/app/plant/rpc/internal/logic/createPlantLogic.go index 1ac29c1..fde2973 100644 --- a/app/plant/rpc/internal/logic/createPlantLogic.go +++ b/app/plant/rpc/internal/logic/createPlantLogic.go @@ -2,11 +2,14 @@ package logic import ( "context" + "time" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" ) type CreatePlantLogic struct { @@ -23,9 +26,50 @@ func NewCreatePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Creat } } -// 我的植物 +// 创建植物 func (l *CreatePlantLogic) CreatePlant(in *plant.CreatePlantReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line + // 解析植时间 + plantTime, err := time.Parse("2006-01-02", in.PlantTime) + if err != nil { + plantTime = time.Now() + } - return &plant.CommonResp{}, nil + var myPlantID string + txErr := l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + myPlant := plantModel.MyPlant{ + UserID: in.UserId, + Name: in.Name, + PlantTime: plantTime, + Status: 1, + Placement: in.Placement, + PotMaterial: in.PotMaterial, + PotSize: in.PotSize, + Sunlight: in.Sunlight, + PlantingMaterial: in.PlantingMaterial, + } + if err := tx.Create(&myPlant).Error; err != nil { + return err + } + myPlantID = myPlant.ID + // 处理图片关联 + if len(in.ImgIds) > 0 { + var relations []map[string]interface{} + for _, id := range in.ImgIds { + relations = append(relations, map[string]interface{}{ + "sundynix_my_plant_id": myPlant.ID, + "sundynix_oss_id": id, + }) + } + if err := tx.Table("sundynix_plant_my_plant_oss").Create(relations).Error; err != nil { + return err + } + } + // 更新用户 plant_count + return tx.Model(&plantModel.UserProfile{}).Where("user_id = ?", in.UserId). + Update("plant_count", gorm.Expr("plant_count + 1")).Error + }) + if txErr != nil { + return nil, txErr + } + return &plant.CommonResp{Code: 0, Msg: myPlantID}, nil } diff --git a/app/plant/rpc/internal/logic/createPostLogic.go b/app/plant/rpc/internal/logic/createPostLogic.go index 50996e6..107ea67 100644 --- a/app/plant/rpc/internal/logic/createPostLogic.go +++ b/app/plant/rpc/internal/logic/createPostLogic.go @@ -3,10 +3,12 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" ) type CreatePostLogic struct { @@ -23,9 +25,34 @@ func NewCreatePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create } } -// 社区 +// 发布帖子 func (l *CreatePostLogic) CreatePost(in *plant.CreatePostReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line - - return &plant.CommonResp{}, nil + err := l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + post := plantModel.Post{ + UserID: in.UserId, + Title: in.Title, + Content: in.Content, + Location: in.Location, + } + if err := tx.Create(&post).Error; err != nil { + return err + } + if len(in.ImgIds) > 0 { + var relations []map[string]interface{} + for _, id := range in.ImgIds { + relations = append(relations, map[string]interface{}{ + "post_id": post.ID, + "oss_id": id, + }) + } + if err := tx.Table("sundynix_post_oss").Create(relations).Error; err != nil { + return err + } + } + return nil + }) + if err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil } diff --git a/app/plant/rpc/internal/logic/createTopicLogic.go b/app/plant/rpc/internal/logic/createTopicLogic.go index 4726698..50ca95a 100644 --- a/app/plant/rpc/internal/logic/createTopicLogic.go +++ b/app/plant/rpc/internal/logic/createTopicLogic.go @@ -2,11 +2,15 @@ package logic import ( "context" + "errors" + "time" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" ) type CreateTopicLogic struct { @@ -23,8 +27,29 @@ func NewCreateTopicLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Creat } } +// 创建话题 func (l *CreateTopicLogic) CreateTopic(in *plant.CreateTopicReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line - - return &plant.CommonResp{}, nil + name := in.Name + if name == "" { + name = in.Title + } + if !errors.Is(l.svcCtx.DB.Where("name = ? OR title = ?", name, in.Title).First(&plantModel.Topic{}).Error, gorm.ErrRecordNotFound) { + return nil, errors.New("存在重复话题") + } + var start, end *time.Time + if in.StartTime != "" { + if t, err := time.Parse(time.DateTime, in.StartTime); err == nil { + start = &t + } + } + if in.EndTime != "" { + if t, err := time.Parse(time.DateTime, in.EndTime); err == nil { + end = &t + } + } + topic := plantModel.Topic{Name: name, Title: in.Title, Icon: in.Icon, Desc: in.Desc, Remark: in.Remark, StartTime: start, EndTime: end} + if err := l.svcCtx.DB.Create(&topic).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil } diff --git a/app/plant/rpc/internal/logic/createWikiClassLogic.go b/app/plant/rpc/internal/logic/createWikiClassLogic.go index dbcb0b1..9e45185 100644 --- a/app/plant/rpc/internal/logic/createWikiClassLogic.go +++ b/app/plant/rpc/internal/logic/createWikiClassLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,8 +24,14 @@ func NewCreateWikiClassLogic(ctx context.Context, svcCtx *svc.ServiceContext) *C } } +// 创建百科分类 func (l *CreateWikiClassLogic) CreateWikiClass(in *plant.CreateWikiClassReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line - - return &plant.CommonResp{}, nil + wikiClass := plantModel.WikiClass{ + Name: in.Name, + OssID: in.Icon, + } + if err := l.svcCtx.DB.Create(&wikiClass).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil } diff --git a/app/plant/rpc/internal/logic/createWikiLogic.go b/app/plant/rpc/internal/logic/createWikiLogic.go new file mode 100644 index 0000000..c3bb8c4 --- /dev/null +++ b/app/plant/rpc/internal/logic/createWikiLogic.go @@ -0,0 +1,56 @@ +package logic + +import ( + "context" + "errors" + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type CreateWikiLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewCreateWikiLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateWikiLogic { + return &CreateWikiLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *CreateWikiLogic) CreateWiki(in *plant.CreateWikiReq) (*plant.CommonResp, error) { + if !errors.Is(l.svcCtx.DB.Where("name LIKE ?", "%"+in.Name+"%").First(&plantModel.Wiki{}).Error, gorm.ErrRecordNotFound) { + return nil, errors.New("植物已经存在") + } + classID := in.ClassId + if classID == "" && len(in.ClassIds) > 0 { + classID = in.ClassIds[0] + } + w := plantModel.Wiki{ + Name: in.Name, LatinName: in.LatinName, Aliases: in.Aliases, + Genus: in.Genus, Difficulty: int(in.Difficulty), IsHot: int(in.IsHot), + GrowthHabit: in.GrowthHabit, LightIntensity: in.LightIntensity, + OptimalTempPeriod: in.OptimalTempPeriod, ClassID: classID, + DistributionArea: in.DistributionArea, LifeCycle: in.LifeCycle, + ReproductionMethod: in.ReproductionMethod, PestsDiseases: in.PestsDiseases, + LightType: in.LightType, Stem: in.Stem, Fruit: in.Fruit, + FoliageType: in.FoliageType, FoliageColor: in.FoliageColor, + FoliageShape: in.FoliageShape, Height: int(in.Height), + FloweringPeriod: in.FloweringPeriod, FloweringColor: in.FloweringColor, + FloweringShape: in.FloweringShape, FlowerDiameter: int(in.FloweringDiameter), + } + if err := l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + if err := tx.Create(&w).Error; err != nil { + return err + } + return replaceWikiRelations(tx, w.ID, in.ClassIds, in.OssIds, in.RelatedWikiIds) + }); err != nil { + return nil, err + } + go func() { + _, _ = NewSyncWikiVectorLogic(context.Background(), l.svcCtx).SyncWikiVector(&plant.SyncWikiVectorReq{WikiId: w.ID}) + }() + return &plant.CommonResp{Code: 0, Msg: w.ID}, nil +} diff --git a/app/plant/rpc/internal/logic/deleteAiChatHistoryLogic.go b/app/plant/rpc/internal/logic/deleteAiChatHistoryLogic.go new file mode 100644 index 0000000..5a29888 --- /dev/null +++ b/app/plant/rpc/internal/logic/deleteAiChatHistoryLogic.go @@ -0,0 +1,26 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteAiChatHistoryLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewDeleteAiChatHistoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteAiChatHistoryLogic { + return &DeleteAiChatHistoryLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *DeleteAiChatHistoryLogic) DeleteAiChatHistory(in *plant.IdsReq) (*plant.CommonResp, error) { + if err := l.svcCtx.DB.Where("id IN ?", in.Ids).Delete(&plantModel.AiChatHistory{}).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/deleteBadgeConfigLogic.go b/app/plant/rpc/internal/logic/deleteBadgeConfigLogic.go new file mode 100644 index 0000000..9fe97ce --- /dev/null +++ b/app/plant/rpc/internal/logic/deleteBadgeConfigLogic.go @@ -0,0 +1,26 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteBadgeConfigLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewDeleteBadgeConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteBadgeConfigLogic { + return &DeleteBadgeConfigLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *DeleteBadgeConfigLogic) DeleteBadgeConfig(in *plant.IdsReq) (*plant.CommonResp, error) { + if err := l.svcCtx.DB.Where("id IN ?", in.Ids).Delete(&plantModel.BadgeConfig{}).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/deleteCarePlanLogic.go b/app/plant/rpc/internal/logic/deleteCarePlanLogic.go new file mode 100644 index 0000000..1a81f84 --- /dev/null +++ b/app/plant/rpc/internal/logic/deleteCarePlanLogic.go @@ -0,0 +1,28 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteCarePlanLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewDeleteCarePlanLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteCarePlanLogic { + return &DeleteCarePlanLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *DeleteCarePlanLogic) DeleteCarePlan(in *plant.IdsReq) (*plant.CommonResp, error) { + if err := l.svcCtx.DB.Where("id IN ?", in.Ids).Delete(&plantModel.CarePlan{}).Error; err != nil { + return nil, err + } + // 同步删除关联任务 + l.svcCtx.DB.Where("plan_id IN ?", in.Ids).Delete(&plantModel.CareTask{}) + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/deleteClassifyLogLogic.go b/app/plant/rpc/internal/logic/deleteClassifyLogLogic.go new file mode 100644 index 0000000..da4dba6 --- /dev/null +++ b/app/plant/rpc/internal/logic/deleteClassifyLogLogic.go @@ -0,0 +1,26 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteClassifyLogLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewDeleteClassifyLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteClassifyLogLogic { + return &DeleteClassifyLogLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *DeleteClassifyLogLogic) DeleteClassifyLog(in *plant.IdsReq) (*plant.CommonResp, error) { + if err := l.svcCtx.DB.Where("id IN ?", in.Ids).Delete(&plantModel.OcrLog{}).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/deleteExchangeItemLogic.go b/app/plant/rpc/internal/logic/deleteExchangeItemLogic.go new file mode 100644 index 0000000..e845a4c --- /dev/null +++ b/app/plant/rpc/internal/logic/deleteExchangeItemLogic.go @@ -0,0 +1,26 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteExchangeItemLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewDeleteExchangeItemLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteExchangeItemLogic { + return &DeleteExchangeItemLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *DeleteExchangeItemLogic) DeleteExchangeItem(in *plant.IdsReq) (*plant.CommonResp, error) { + if err := l.svcCtx.DB.Where("id IN ?", in.Ids).Delete(&plantModel.ExchangeItem{}).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/deleteLevelConfigLogic.go b/app/plant/rpc/internal/logic/deleteLevelConfigLogic.go new file mode 100644 index 0000000..2303bd2 --- /dev/null +++ b/app/plant/rpc/internal/logic/deleteLevelConfigLogic.go @@ -0,0 +1,26 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteLevelConfigLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewDeleteLevelConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteLevelConfigLogic { + return &DeleteLevelConfigLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *DeleteLevelConfigLogic) DeleteLevelConfig(in *plant.IdsReq) (*plant.CommonResp, error) { + if err := l.svcCtx.DB.Where("id IN ?", in.Ids).Delete(&plantModel.LevelConfig{}).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/deletePlantLogic.go b/app/plant/rpc/internal/logic/deletePlantLogic.go index f1d4553..d2b03cc 100644 --- a/app/plant/rpc/internal/logic/deletePlantLogic.go +++ b/app/plant/rpc/internal/logic/deletePlantLogic.go @@ -3,10 +3,12 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" ) type DeletePlantLogic struct { @@ -23,8 +25,32 @@ func NewDeletePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delet } } +// 删除植物 (级联删除魏护计划/任务/记录/图片) func (l *DeletePlantLogic) DeletePlant(in *plant.IdsReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line - - return &plant.CommonResp{}, nil + txErr := l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + // 1. 清理图片中间表 + tx.Exec("DELETE FROM sundynix_my_plant_oss WHERE sundynix_my_plant_id IN ?", in.Ids) + // 2. 删除魏护计划 + if err := tx.Unscoped().Where("plant_id IN ?", in.Ids).Delete(&plantModel.CarePlan{}).Error; err != nil { + return err + } + // 3. 删除魏护任务 + if err := tx.Unscoped().Where("plant_id IN ?", in.Ids).Delete(&plantModel.CareTask{}).Error; err != nil { + return err + } + // 4. 删除魏护记录 + if err := tx.Unscoped().Where("plant_id IN ?", in.Ids).Delete(&plantModel.CareRecord{}).Error; err != nil { + return err + } + // 5. 删除成长记录 + if err := tx.Unscoped().Where("plant_id IN ?", in.Ids).Delete(&plantModel.GrowthRecord{}).Error; err != nil { + return err + } + // 6. 删除植物本身 + return tx.Unscoped().Where("id IN ?", in.Ids).Delete(&plantModel.MyPlant{}).Error + }) + if txErr != nil { + return nil, txErr + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil } diff --git a/app/plant/rpc/internal/logic/deletePostLogic.go b/app/plant/rpc/internal/logic/deletePostLogic.go index 71ad852..113a72a 100644 --- a/app/plant/rpc/internal/logic/deletePostLogic.go +++ b/app/plant/rpc/internal/logic/deletePostLogic.go @@ -3,10 +3,12 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" ) type DeletePostLogic struct { @@ -23,8 +25,23 @@ func NewDeletePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delete } } +// 删除帖子 (级联删除评论/点赞/图片关联) func (l *DeletePostLogic) DeletePost(in *plant.IdsReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line - - return &plant.CommonResp{}, nil + err := l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + tx.Exec("DELETE FROM sundynix_post_oss WHERE post_id IN ?", in.Ids) + if err := tx.Unscoped().Where("post_id IN ?", in.Ids).Delete(&plantModel.PostLike{}).Error; err != nil { + return err + } + if err := tx.Unscoped().Where("post_id IN ?", in.Ids).Delete(&plantModel.PostComment{}).Error; err != nil { + return err + } + if err := tx.Unscoped().Where("id IN ?", in.Ids).Delete(&plantModel.Post{}).Error; err != nil { + return err + } + return nil + }) + if err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil } diff --git a/app/plant/rpc/internal/logic/deleteTopicLogic.go b/app/plant/rpc/internal/logic/deleteTopicLogic.go index 4b74af7..cf0c986 100644 --- a/app/plant/rpc/internal/logic/deleteTopicLogic.go +++ b/app/plant/rpc/internal/logic/deleteTopicLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,8 +24,10 @@ func NewDeleteTopicLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delet } } +// 删除话题 func (l *DeleteTopicLogic) DeleteTopic(in *plant.IdsReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line - - return &plant.CommonResp{}, nil + if err := l.svcCtx.DB.Where("id in ?", in.Ids).Delete(&plantModel.Topic{}).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil } diff --git a/app/plant/rpc/internal/logic/deleteWikiClassLogic.go b/app/plant/rpc/internal/logic/deleteWikiClassLogic.go new file mode 100644 index 0000000..464889c --- /dev/null +++ b/app/plant/rpc/internal/logic/deleteWikiClassLogic.go @@ -0,0 +1,26 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteWikiClassLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewDeleteWikiClassLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteWikiClassLogic { + return &DeleteWikiClassLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *DeleteWikiClassLogic) DeleteWikiClass(in *plant.IdsReq) (*plant.CommonResp, error) { + if err := l.svcCtx.DB.Where("id IN ?", in.Ids).Delete(&plantModel.WikiClass{}).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/deleteWikiLogic.go b/app/plant/rpc/internal/logic/deleteWikiLogic.go new file mode 100644 index 0000000..1eef661 --- /dev/null +++ b/app/plant/rpc/internal/logic/deleteWikiLogic.go @@ -0,0 +1,38 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type DeleteWikiLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewDeleteWikiLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteWikiLogic { + return &DeleteWikiLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *DeleteWikiLogic) DeleteWiki(in *plant.IdsReq) (*plant.CommonResp, error) { + if err := l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + if err := tx.Where("id IN ?", in.Ids).Delete(&plantModel.Wiki{}).Error; err != nil { + return err + } + if err := tx.Where("wiki_id IN ?", in.Ids).Delete(&plantModel.WikiClassRelation{}).Error; err != nil { + return err + } + if err := tx.Where("wiki_id IN ?", in.Ids).Delete(&plantModel.WikiOss{}).Error; err != nil { + return err + } + return tx.Where("wiki_id IN ? OR related_wiki_id IN ?", in.Ids, in.Ids).Delete(&plantModel.WikiRelated{}).Error + }); err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/deleteWikiVectorLogic.go b/app/plant/rpc/internal/logic/deleteWikiVectorLogic.go new file mode 100644 index 0000000..bd1e9bc --- /dev/null +++ b/app/plant/rpc/internal/logic/deleteWikiVectorLogic.go @@ -0,0 +1,35 @@ +package logic + +import ( + "context" + "errors" + + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" + + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteWikiVectorLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewDeleteWikiVectorLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteWikiVectorLogic { + return &DeleteWikiVectorLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *DeleteWikiVectorLogic) DeleteWikiVector(in *plant.SyncWikiVectorReq) (*plant.CommonResp, error) { + if l.svcCtx.Config.Ai.QdrantUrl == "" || l.svcCtx.Config.Ai.QdrantCollection == "" { + return nil, errors.New("AI/RAG 未配置 QdrantUrl 或 QdrantCollection") + } + if err := deleteWikiVector(l.ctx, l.svcCtx.Config, in.WikiId); err != nil { + return nil, err + } + if err := l.svcCtx.DB.Model(&plantModel.Wiki{}).Where("id = ?", in.WikiId).Update("is_vector_synced", false).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/exchangeView.go b/app/plant/rpc/internal/logic/exchangeView.go new file mode 100644 index 0000000..59cdcfe --- /dev/null +++ b/app/plant/rpc/internal/logic/exchangeView.go @@ -0,0 +1,35 @@ +package logic + +import ( + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/plant" +) + +func exchangeItemInfo(item plantModel.ExchangeItem) *plant.ExchangeItemInfo { + cost := item.CostSunlight + if cost == 0 { + cost = item.Cost + } + imgID := item.ImageID + if imgID == "" { + imgID = item.ImgID + } + return &plant.ExchangeItemInfo{ + Id: item.ID, Name: item.Name, Desc: item.Desc, + ImgId: imgID, Cost: cost, Stock: int32(item.Stock), Status: int32(item.Status), + } +} + +func exchangeOrderInfo(o plantModel.ExchangeOrder) *plant.ExchangeOrderInfo { + completedAt := "" + if o.CompletedAt != nil { + completedAt = o.CompletedAt.Format("2006-01-02 15:04:05") + } + return &plant.ExchangeOrderInfo{ + Id: o.ID, UserId: o.UserID, ItemId: o.ItemID, ItemName: o.ItemName, + Cost: o.Cost, Status: int32(o.Status), Address: o.Address, + CreatedAt: o.CreatedAt.Format("2006-01-02 15:04:05"), + Quantity: int32(o.Quantity), ItemType: o.ItemType, RecipientName: o.RecipientName, + Phone: o.Phone, TrackingNo: o.TrackingNo, Remark: o.Remark, CompletedAt: completedAt, + } +} diff --git a/app/plant/rpc/internal/logic/getAiChatHistoryLogic.go b/app/plant/rpc/internal/logic/getAiChatHistoryLogic.go new file mode 100644 index 0000000..b7b6454 --- /dev/null +++ b/app/plant/rpc/internal/logic/getAiChatHistoryLogic.go @@ -0,0 +1,42 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetAiChatHistoryLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetAiChatHistoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetAiChatHistoryLogic { + return &GetAiChatHistoryLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetAiChatHistoryLogic) GetAiChatHistory(in *plant.AiChatHistoryReq) (*plant.AiChatHistoryResp, error) { + var histories []plantModel.AiChatHistory + var total int64 + db := l.svcCtx.DB.Model(&plantModel.AiChatHistory{}).Where("user_id = ?", in.UserId) + db.Count(&total) + page, size := in.Current, in.PageSize + if page < 1 { + page = 1 + } + if size < 1 || size > 50 { + size = 20 + } + db.Order("created_at desc").Offset(int((page - 1) * size)).Limit(int(size)).Find(&histories) + list := make([]*plant.AiChatHistoryInfo, 0, len(histories)) + for _, h := range histories { + list = append(list, &plant.AiChatHistoryInfo{ + Id: h.ID, UserId: h.UserID, Question: h.Question, Answer: h.Answer, + CreatedAt: h.CreatedAt.Format("2006-01-02 15:04:05"), + }) + } + return &plant.AiChatHistoryResp{List: list, Total: total}, nil +} diff --git a/app/plant/rpc/internal/logic/getAiChatQuotaLogic.go b/app/plant/rpc/internal/logic/getAiChatQuotaLogic.go new file mode 100644 index 0000000..ddc5729 --- /dev/null +++ b/app/plant/rpc/internal/logic/getAiChatQuotaLogic.go @@ -0,0 +1,38 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" + "time" +) + +type GetAiChatQuotaLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetAiChatQuotaLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetAiChatQuotaLogic { + return &GetAiChatQuotaLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetAiChatQuotaLogic) GetAiChatQuota(in *plant.GetProfileReq) (*plant.AiQuotaResp, error) { + now := time.Now() + todayStart := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()) + var used int64 + l.svcCtx.DB.Model(&plantModel.AiChatHistory{}). + Where("user_id = ? AND created_at >= ?", in.UserId, todayStart). + Count(&used) + limit := l.svcCtx.Config.Ai.DailyQuota + if limit <= 0 { + limit = 20 + } + remaining := limit - used + if remaining < 0 { + remaining = 0 + } + return &plant.AiQuotaResp{Remaining: remaining, Total: limit, Used: used, Limit: limit}, nil +} diff --git a/app/plant/rpc/internal/logic/getBadgeConfigDetailLogic.go b/app/plant/rpc/internal/logic/getBadgeConfigDetailLogic.go new file mode 100644 index 0000000..392d498 --- /dev/null +++ b/app/plant/rpc/internal/logic/getBadgeConfigDetailLogic.go @@ -0,0 +1,33 @@ +package logic + +import ( + "context" + + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetBadgeConfigDetailLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetBadgeConfigDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetBadgeConfigDetailLogic { + return &GetBadgeConfigDetailLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetBadgeConfigDetailLogic) GetBadgeConfigDetail(in *plant.IdReq) (*plant.BadgeConfigInfo, error) { + var badge plantModel.BadgeConfig + if err := l.svcCtx.DB.Where("id = ?", in.Id).First(&badge).Error; err != nil { + return nil, err + } + return &plant.BadgeConfigInfo{ + Id: badge.ID, Name: badge.Name, Description: badge.Description, Dimension: badge.Dimension, + GroupId: badge.GroupID, Tier: int32(badge.Tier), TargetAction: badge.TargetAction, + Threshold: badge.Threshold, RewardSunlight: badge.RewardSunlight, IconId: badge.IconID, Sort: int32(badge.Sort), + }, nil +} diff --git a/app/plant/rpc/internal/logic/getBadgeConfigListLogic.go b/app/plant/rpc/internal/logic/getBadgeConfigListLogic.go index f4da87f..1490030 100644 --- a/app/plant/rpc/internal/logic/getBadgeConfigListLogic.go +++ b/app/plant/rpc/internal/logic/getBadgeConfigListLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,8 +24,45 @@ func NewGetBadgeConfigListLogic(ctx context.Context, svcCtx *svc.ServiceContext) } } +// 配置 - 徽章配置列表 func (l *GetBadgeConfigListLogic) GetBadgeConfigList(in *plant.BadgeConfigListReq) (*plant.BadgeConfigListResp, error) { - // todo: add your logic here and delete this line + db := l.svcCtx.DB.Model(&plantModel.BadgeConfig{}) + if in.Dimension != "" { + db = db.Where("dimension = ?", in.Dimension) + } - return &plant.BadgeConfigListResp{}, nil + var total int64 + db.Count(&total) + + pageSize := int(in.PageSize) + if pageSize <= 0 { + pageSize = 20 + } + offset := (int(in.Current) - 1) * pageSize + if offset < 0 { + offset = 0 + } + + var list []plantModel.BadgeConfig + if err := db.Order("dimension asc, group_id asc, tier asc"). + Limit(pageSize).Offset(offset).Find(&list).Error; err != nil { + return nil, err + } + + var result []*plant.BadgeConfigInfo + for _, item := range list { + result = append(result, &plant.BadgeConfigInfo{ + Id: item.ID, + Name: item.Name, + Description: item.Description, + Dimension: item.Dimension, + GroupId: item.GroupID, + Tier: int32(item.Tier), + TargetAction: item.TargetAction, + Threshold: item.Threshold, + RewardSunlight: item.RewardSunlight, + }) + } + + return &plant.BadgeConfigListResp{List: result, Total: total}, nil } diff --git a/app/plant/rpc/internal/logic/getBadgeConfigTreeLogic.go b/app/plant/rpc/internal/logic/getBadgeConfigTreeLogic.go new file mode 100644 index 0000000..f4aa8b9 --- /dev/null +++ b/app/plant/rpc/internal/logic/getBadgeConfigTreeLogic.go @@ -0,0 +1,49 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetBadgeConfigTreeLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetBadgeConfigTreeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetBadgeConfigTreeLogic { + return &GetBadgeConfigTreeLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetBadgeConfigTreeLogic) GetBadgeConfigTree(in *plant.IdReq) (*plant.BadgeConfigTreeResp, error) { + var badges []plantModel.BadgeConfig + if err := l.svcCtx.DB.Order("dimension, group_id, tier asc").Find(&badges).Error; err != nil { + return nil, err + } + // 按 groupId 分组 + groupMap := make(map[string]*plant.BadgeGroupInfo) + groupOrder := []string{} + for _, b := range badges { + key := b.GroupID + if key == "" { + key = b.Dimension + } + if _, ok := groupMap[key]; !ok { + groupMap[key] = &plant.BadgeGroupInfo{GroupId: key, Dimension: b.Dimension} + groupOrder = append(groupOrder, key) + } + groupMap[key].Badges = append(groupMap[key].Badges, &plant.BadgeConfigInfo{ + Id: b.ID, Name: b.Name, Description: b.Description, Dimension: b.Dimension, + GroupId: b.GroupID, Tier: int32(b.Tier), TargetAction: b.TargetAction, + Threshold: b.Threshold, RewardSunlight: b.RewardSunlight, IconId: b.IconID, Sort: int32(b.Sort), + }) + } + groups := make([]*plant.BadgeGroupInfo, 0, len(groupOrder)) + for _, k := range groupOrder { + groups = append(groups, groupMap[k]) + } + return &plant.BadgeConfigTreeResp{Groups: groups}, nil +} diff --git a/app/plant/rpc/internal/logic/getExchangeItemDetailLogic.go b/app/plant/rpc/internal/logic/getExchangeItemDetailLogic.go new file mode 100644 index 0000000..d5f5185 --- /dev/null +++ b/app/plant/rpc/internal/logic/getExchangeItemDetailLogic.go @@ -0,0 +1,27 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetExchangeItemDetailLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetExchangeItemDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetExchangeItemDetailLogic { + return &GetExchangeItemDetailLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetExchangeItemDetailLogic) GetExchangeItemDetail(in *plant.IdReq) (*plant.ExchangeItemInfo, error) { + var item plantModel.ExchangeItem + if err := l.svcCtx.DB.First(&item, "id = ?", in.Id).Error; err != nil { + return nil, err + } + return exchangeItemInfo(item), nil +} diff --git a/app/plant/rpc/internal/logic/getExchangeItemListLogic.go b/app/plant/rpc/internal/logic/getExchangeItemListLogic.go index ea4d82c..b50a98a 100644 --- a/app/plant/rpc/internal/logic/getExchangeItemListLogic.go +++ b/app/plant/rpc/internal/logic/getExchangeItemListLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,9 +24,30 @@ func NewGetExchangeItemListLogic(ctx context.Context, svcCtx *svc.ServiceContext } } -// 兑换 +// 商品列表(仅上架商品) func (l *GetExchangeItemListLogic) GetExchangeItemList(in *plant.ExchangeItemListReq) (*plant.ExchangeItemListResp, error) { - // todo: add your logic here and delete this line + db := l.svcCtx.DB.Model(&plantModel.ExchangeItem{}).Where("status = 1") - return &plant.ExchangeItemListResp{}, nil + var total int64 + db.Count(&total) + + pageSize := int(in.PageSize) + if pageSize <= 0 { + pageSize = 20 + } + offset := (int(in.Current) - 1) * pageSize + if offset < 0 { + offset = 0 + } + + var list []plantModel.ExchangeItem + if err := db.Limit(pageSize).Offset(offset).Order("created_at desc").Find(&list).Error; err != nil { + return nil, err + } + + var result []*plant.ExchangeItemInfo + for _, item := range list { + result = append(result, exchangeItemInfo(item)) + } + return &plant.ExchangeItemListResp{List: result, Total: total}, nil } diff --git a/app/plant/rpc/internal/logic/getExchangeOrderListLogic.go b/app/plant/rpc/internal/logic/getExchangeOrderListLogic.go new file mode 100644 index 0000000..fe572d3 --- /dev/null +++ b/app/plant/rpc/internal/logic/getExchangeOrderListLogic.go @@ -0,0 +1,45 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetExchangeOrderListLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetExchangeOrderListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetExchangeOrderListLogic { + return &GetExchangeOrderListLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetExchangeOrderListLogic) GetExchangeOrderList(in *plant.ExchangeOrderListReq) (*plant.ExchangeOrderListResp, error) { + var orders []plantModel.ExchangeOrder + var total int64 + db := l.svcCtx.DB.Model(&plantModel.ExchangeOrder{}) + if in.UserId != "" { + db = db.Where("user_id = ?", in.UserId) + } + if in.Status > 0 { + db = db.Where("status = ?", in.Status) + } + db.Count(&total) + page, size := in.Current, in.PageSize + if page < 1 { + page = 1 + } + if size < 1 { + size = 10 + } + db.Offset(int((page - 1) * size)).Limit(int(size)).Order("created_at desc").Find(&orders) + list := make([]*plant.ExchangeOrderInfo, 0, len(orders)) + for _, o := range orders { + list = append(list, exchangeOrderInfo(o)) + } + return &plant.ExchangeOrderListResp{List: list, Total: total}, nil +} diff --git a/app/plant/rpc/internal/logic/getLevelConfigDetailLogic.go b/app/plant/rpc/internal/logic/getLevelConfigDetailLogic.go new file mode 100644 index 0000000..76a9c05 --- /dev/null +++ b/app/plant/rpc/internal/logic/getLevelConfigDetailLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetLevelConfigDetailLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetLevelConfigDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetLevelConfigDetailLogic { + return &GetLevelConfigDetailLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetLevelConfigDetailLogic) GetLevelConfigDetail(in *plant.IdReq) (*plant.LevelConfigInfo, error) { + var lc plantModel.LevelConfig + if err := l.svcCtx.DB.First(&lc, "id = ?", in.Id).Error; err != nil { + return nil, err + } + return &plant.LevelConfigInfo{ + Id: lc.ID, Level: int32(lc.Level), Title: lc.Title, + MinSunlight: lc.MinSunlight, Perks: lc.Perks, + }, nil +} diff --git a/app/plant/rpc/internal/logic/getLevelConfigListLogic.go b/app/plant/rpc/internal/logic/getLevelConfigListLogic.go index 7068585..3df739c 100644 --- a/app/plant/rpc/internal/logic/getLevelConfigListLogic.go +++ b/app/plant/rpc/internal/logic/getLevelConfigListLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,9 +24,23 @@ func NewGetLevelConfigListLogic(ctx context.Context, svcCtx *svc.ServiceContext) } } -// 配置 +// 配置 - 等级配置列表 func (l *GetLevelConfigListLogic) GetLevelConfigList(in *plant.PageReq) (*plant.LevelConfigListResp, error) { - // todo: add your logic here and delete this line + var list []plantModel.LevelConfig + if err := l.svcCtx.DB.Order("level asc").Find(&list).Error; err != nil { + return nil, err + } - return &plant.LevelConfigListResp{}, nil + var result []*plant.LevelConfigInfo + for _, item := range list { + result = append(result, &plant.LevelConfigInfo{ + Id: item.ID, + Level: int32(item.Level), + Title: item.Title, + MinSunlight: item.MinSunlight, + Perks: item.Perks, + }) + } + + return &plant.LevelConfigListResp{List: result}, nil } diff --git a/app/plant/rpc/internal/logic/getMyBadgesLogic.go b/app/plant/rpc/internal/logic/getMyBadgesLogic.go new file mode 100644 index 0000000..149bc39 --- /dev/null +++ b/app/plant/rpc/internal/logic/getMyBadgesLogic.go @@ -0,0 +1,37 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetMyBadgesLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetMyBadgesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMyBadgesLogic { + return &GetMyBadgesLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetMyBadgesLogic) GetMyBadges(in *plant.GetProfileReq) (*plant.UserBadgeListResp, error) { + var userBadges []plantModel.UserBadge + if err := l.svcCtx.DB.Where("user_id = ?", in.UserId).Find(&userBadges).Error; err != nil { + return nil, err + } + list := make([]*plant.UserBadgeInfo, 0, len(userBadges)) + for _, ub := range userBadges { + var badge plantModel.BadgeConfig + l.svcCtx.DB.First(&badge, "id = ?", ub.BadgeID) + list = append(list, &plant.UserBadgeInfo{ + Id: ub.ID, BadgeId: ub.BadgeID, BadgeName: badge.Name, + Dimension: badge.Dimension, Tier: int32(badge.Tier), + AwardedAt: ub.CreatedAt.Format("2006-01-02 15:04:05"), + }) + } + return &plant.UserBadgeListResp{List: list}, nil +} diff --git a/app/plant/rpc/internal/logic/getMyClassifyLogLogic.go b/app/plant/rpc/internal/logic/getMyClassifyLogLogic.go new file mode 100644 index 0000000..db5f92f --- /dev/null +++ b/app/plant/rpc/internal/logic/getMyClassifyLogLogic.go @@ -0,0 +1,34 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetMyClassifyLogLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetMyClassifyLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMyClassifyLogLogic { + return &GetMyClassifyLogLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetMyClassifyLogLogic) GetMyClassifyLog(in *plant.GetProfileReq) (*plant.ClassifyLogListResp, error) { + var logs []plantModel.OcrLog + if err := l.svcCtx.DB.Where("user_id = ?", in.UserId).Order("created_at desc").Limit(50).Find(&logs).Error; err != nil { + return nil, err + } + list := make([]*plant.ClassifyLogInfo, 0, len(logs)) + for _, og := range logs { + list = append(list, &plant.ClassifyLogInfo{ + Id: og.ID, UserId: og.UserID, ImageUrl: og.ImageUrl, Result: og.Result, + CreatedAt: og.CreatedAt.Format("2006-01-02 15:04:05"), + }) + } + return &plant.ClassifyLogListResp{List: list, Total: int64(len(list))}, nil +} diff --git a/app/plant/rpc/internal/logic/getMyExchangeOrdersLogic.go b/app/plant/rpc/internal/logic/getMyExchangeOrdersLogic.go new file mode 100644 index 0000000..fe0b926 --- /dev/null +++ b/app/plant/rpc/internal/logic/getMyExchangeOrdersLogic.go @@ -0,0 +1,42 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetMyExchangeOrdersLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetMyExchangeOrdersLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMyExchangeOrdersLogic { + return &GetMyExchangeOrdersLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetMyExchangeOrdersLogic) GetMyExchangeOrders(in *plant.ExchangeOrderListReq) (*plant.ExchangeOrderListResp, error) { + var orders []plantModel.ExchangeOrder + var total int64 + db := l.svcCtx.DB.Model(&plantModel.ExchangeOrder{}).Where("user_id = ?", in.UserId) + if in.Status > 0 { + db = db.Where("status = ?", in.Status) + } + db.Count(&total) + page, size := in.Current, in.PageSize + if page < 1 { + page = 1 + } + if size < 1 { + size = 10 + } + db.Offset(int((page - 1) * size)).Limit(int(size)).Order("created_at desc").Find(&orders) + list := make([]*plant.ExchangeOrderInfo, 0, len(orders)) + for _, o := range orders { + list = append(list, exchangeOrderInfo(o)) + } + return &plant.ExchangeOrderListResp{List: list, Total: total}, nil +} diff --git a/app/plant/rpc/internal/logic/getMyStarsLogic.go b/app/plant/rpc/internal/logic/getMyStarsLogic.go new file mode 100644 index 0000000..e6e85f1 --- /dev/null +++ b/app/plant/rpc/internal/logic/getMyStarsLogic.go @@ -0,0 +1,34 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetMyStarsLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetMyStarsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMyStarsLogic { + return &GetMyStarsLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetMyStarsLogic) GetMyStars(in *plant.GetProfileReq) (*plant.UserStarListResp, error) { + var stars []plantModel.UserStar + if err := l.svcCtx.DB.Where("user_id = ?", in.UserId).Order("created_at desc").Find(&stars).Error; err != nil { + return nil, err + } + list := make([]*plant.UserStarInfo, 0, len(stars)) + for _, s := range stars { + list = append(list, &plant.UserStarInfo{ + Id: s.ID, TargetId: s.TargetID, Type: s.Type, + CreatedAt: s.CreatedAt.Format("2006-01-02 15:04:05"), + }) + } + return &plant.UserStarListResp{List: list, Total: int64(len(list))}, nil +} diff --git a/app/plant/rpc/internal/logic/getPlantDetailLogic.go b/app/plant/rpc/internal/logic/getPlantDetailLogic.go index f5875e4..dbf607e 100644 --- a/app/plant/rpc/internal/logic/getPlantDetailLogic.go +++ b/app/plant/rpc/internal/logic/getPlantDetailLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,8 +24,56 @@ func NewGetPlantDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge } } +// 植物详情 func (l *GetPlantDetailLogic) GetPlantDetail(in *plant.IdReq) (*plant.PlantDetailResp, error) { - // todo: add your logic here and delete this line + var myPlant plantModel.MyPlant + if err := l.svcCtx.DB.Where("id = ?", in.Id).First(&myPlant).Error; err != nil { + return nil, err + } - return &plant.PlantDetailResp{}, nil + // 魏护计划 + var carePlans []plantModel.CarePlan + l.svcCtx.DB.Where("plant_id = ?", in.Id).Find(&carePlans) + var planInfos []*plant.CarePlanInfo + for _, cp := range carePlans { + planInfos = append(planInfos, &plant.CarePlanInfo{ + Id: cp.ID, + PlantId: cp.PlantID, + Name: cp.Name, + Icon: cp.Icon, + TargetAction: cp.TargetAction, + Period: int32(cp.Period), + }) + } + + // 成长记录 + var growthRecords []plantModel.GrowthRecord + l.svcCtx.DB.Where("plant_id = ?", in.Id).Order("created_at desc").Find(&growthRecords) + var growthInfos []*plant.GrowthRecordInfo + for _, gr := range growthRecords { + growthInfos = append(growthInfos, &plant.GrowthRecordInfo{ + Id: gr.ID, + PlantId: gr.PlantID, + Content: gr.Content, + CreatedAt: gr.CreatedAt.Unix(), + }) + } + + return &plant.PlantDetailResp{ + Plant: &plant.PlantInfo{ + Id: myPlant.ID, + UserId: myPlant.UserID, + Name: myPlant.Name, + PlantTime: myPlant.PlantTime.Format("2006-01-02"), + Status: int32(myPlant.Status), + Placement: myPlant.Placement, + PotMaterial: myPlant.PotMaterial, + PotSize: myPlant.PotSize, + Sunlight: myPlant.Sunlight, + PlantingMaterial: myPlant.PlantingMaterial, + CreatedAt: myPlant.CreatedAt.Unix(), + }, + CarePlans: planInfos, + GrowthRecords: growthInfos, + }, nil } diff --git a/app/plant/rpc/internal/logic/getPlantListLogic.go b/app/plant/rpc/internal/logic/getPlantListLogic.go index 0d5431f..cfce082 100644 --- a/app/plant/rpc/internal/logic/getPlantListLogic.go +++ b/app/plant/rpc/internal/logic/getPlantListLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,8 +24,46 @@ func NewGetPlantListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetP } } +// 我的植物列表 func (l *GetPlantListLogic) GetPlantList(in *plant.PlantListReq) (*plant.PlantListResp, error) { - // todo: add your logic here and delete this line + db := l.svcCtx.DB.Model(&plantModel.MyPlant{}).Where("user_id = ?", in.UserId) + if in.Name != "" { + db = db.Where("name like ?", "%"+in.Name+"%") + } - return &plant.PlantListResp{}, nil + var total int64 + db.Count(&total) + + pageSize := int(in.PageSize) + if pageSize <= 0 { + pageSize = 20 + } + offset := (int(in.Current) - 1) * pageSize + if offset < 0 { + offset = 0 + } + + var list []plantModel.MyPlant + if err := db.Limit(pageSize).Offset(offset).Order("created_at desc").Find(&list).Error; err != nil { + return nil, err + } + + var result []*plant.PlantInfo + for _, item := range list { + result = append(result, &plant.PlantInfo{ + Id: item.ID, + UserId: item.UserID, + Name: item.Name, + PlantTime: item.PlantTime.Format("2006-01-02"), + Status: int32(item.Status), + Placement: item.Placement, + PotMaterial: item.PotMaterial, + PotSize: item.PotSize, + Sunlight: item.Sunlight, + PlantingMaterial: item.PlantingMaterial, + CreatedAt: item.CreatedAt.Unix(), + }) + } + + return &plant.PlantListResp{List: result, Total: total}, nil } diff --git a/app/plant/rpc/internal/logic/getPostDetailLogic.go b/app/plant/rpc/internal/logic/getPostDetailLogic.go index e821072..42287bd 100644 --- a/app/plant/rpc/internal/logic/getPostDetailLogic.go +++ b/app/plant/rpc/internal/logic/getPostDetailLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,8 +24,37 @@ func NewGetPostDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Get } } +// 帖子详情 func (l *GetPostDetailLogic) GetPostDetail(in *plant.IdReq) (*plant.PostDetailResp, error) { - // todo: add your logic here and delete this line + var post plantModel.Post + if err := l.svcCtx.DB.Where("id = ?", in.Id).First(&post).Error; err != nil { + return nil, err + } + var comments []plantModel.PostComment + l.svcCtx.DB.Where("post_id = ?", in.Id).Order("created_at asc").Find(&comments) - return &plant.PostDetailResp{}, nil + var commentInfos []*plant.PostCommentInfo + for _, c := range comments { + commentInfos = append(commentInfos, &plant.PostCommentInfo{ + Id: c.ID, + UserId: c.UserID, + Content: c.Content, + ParentId: c.ParentID, + CreatedAt: c.CreatedAt.Unix(), + }) + } + return &plant.PostDetailResp{ + Post: &plant.PostInfo{ + Id: post.ID, + UserId: post.UserID, + Title: post.Title, + Content: post.Content, + ViewCount: int32(post.ViewCount), + CommentCount: int32(post.CommentCount), + LikeCount: int32(post.LikeCount), + Location: post.Location, + CreatedAt: post.CreatedAt.Unix(), + }, + Comments: commentInfos, + }, nil } diff --git a/app/plant/rpc/internal/logic/getPostListLogic.go b/app/plant/rpc/internal/logic/getPostListLogic.go index c59d326..47d1074 100644 --- a/app/plant/rpc/internal/logic/getPostListLogic.go +++ b/app/plant/rpc/internal/logic/getPostListLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,8 +24,48 @@ func NewGetPostListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetPo } } +// 帖子列表 func (l *GetPostListLogic) GetPostList(in *plant.PostListReq) (*plant.PostListResp, error) { - // todo: add your logic here and delete this line + db := l.svcCtx.DB.Model(&plantModel.Post{}) + if in.Keyword != "" { + db = db.Where("title like ? OR content like ?", "%"+in.Keyword+"%", "%"+in.Keyword+"%") + } + if in.UserId != "" { + db = db.Where("user_id = ?", in.UserId) + } - return &plant.PostListResp{}, nil + var total int64 + db.Count(&total) + + pageSize := int(in.PageSize) + if pageSize <= 0 { + pageSize = 20 + } + offset := (int(in.Current) - 1) * pageSize + if offset < 0 { + offset = 0 + } + + var list []plantModel.Post + if err := db.Limit(pageSize).Offset(offset).Order("created_at desc").Find(&list).Error; err != nil { + return nil, err + } + + var result []*plant.PostInfo + for _, item := range list { + result = append(result, &plant.PostInfo{ + Id: item.ID, + UserId: item.UserID, + Title: item.Title, + Content: item.Content, + ViewCount: int32(item.ViewCount), + CommentCount: int32(item.CommentCount), + LikeCount: int32(item.LikeCount), + StarCount: int32(item.StarCount), + Location: item.Location, + CreatedAt: item.CreatedAt.Unix(), + }) + } + + return &plant.PostListResp{List: result, Total: total}, nil } diff --git a/app/plant/rpc/internal/logic/getTodayTaskListLogic.go b/app/plant/rpc/internal/logic/getTodayTaskListLogic.go new file mode 100644 index 0000000..4473f43 --- /dev/null +++ b/app/plant/rpc/internal/logic/getTodayTaskListLogic.go @@ -0,0 +1,43 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" + "time" +) + +type GetTodayTaskListLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetTodayTaskListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetTodayTaskListLogic { + return &GetTodayTaskListLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetTodayTaskListLogic) GetTodayTaskList(in *plant.GetProfileReq) (*plant.CareTaskListResp, error) { + now := time.Now() + todayStart := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()) + todayEnd := todayStart.Add(24 * time.Hour) + + var tasks []plantModel.CareTask + if err := l.svcCtx.DB.Where( + "user_id = ? AND ((status = 1 AND due_date < ?) OR (status = 2 AND completed_at >= ? AND completed_at < ?))", + in.UserId, todayEnd, todayStart, todayEnd, + ).Order("due_date asc").Find(&tasks).Error; err != nil { + return nil, err + } + list := make([]*plant.CareTaskInfo, 0, len(tasks)) + for _, t := range tasks { + list = append(list, &plant.CareTaskInfo{ + Id: t.ID, PlantId: t.PlantID, PlanId: t.PlanID, + Name: t.Name, Icon: t.Icon, TargetAction: t.TargetAction, + DueDate: t.DueDate.Format("2006-01-02"), Status: int32(t.Status), + }) + } + return &plant.CareTaskListResp{List: list, Total: int64(len(list))}, nil +} diff --git a/app/plant/rpc/internal/logic/getTopicDetailLogic.go b/app/plant/rpc/internal/logic/getTopicDetailLogic.go new file mode 100644 index 0000000..e19a990 --- /dev/null +++ b/app/plant/rpc/internal/logic/getTopicDetailLogic.go @@ -0,0 +1,27 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetTopicDetailLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetTopicDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetTopicDetailLogic { + return &GetTopicDetailLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetTopicDetailLogic) GetTopicDetail(in *plant.IdReq) (*plant.TopicInfo, error) { + var t plantModel.Topic + if err := l.svcCtx.DB.First(&t, "id = ?", in.Id).Error; err != nil { + return nil, err + } + return &plant.TopicInfo{Id: t.ID, Name: t.Name, Icon: t.Icon, Desc: t.Desc, PostCount: int32(t.PostCount)}, nil +} diff --git a/app/plant/rpc/internal/logic/getTopicListLogic.go b/app/plant/rpc/internal/logic/getTopicListLogic.go index 1ebe813..aded7fd 100644 --- a/app/plant/rpc/internal/logic/getTopicListLogic.go +++ b/app/plant/rpc/internal/logic/getTopicListLogic.go @@ -2,7 +2,9 @@ package logic import ( "context" + "time" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,9 +25,32 @@ func NewGetTopicListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetT } } -// 话题 +// 话题列表 func (l *GetTopicListLogic) GetTopicList(in *plant.IdReq) (*plant.TopicListResp, error) { - // todo: add your logic here and delete this line - - return &plant.TopicListResp{}, nil + var list []plantModel.Topic + if err := l.svcCtx.DB.Order("post_count desc").Find(&list).Error; err != nil { + return nil, err + } + var result []*plant.TopicInfo + for _, item := range list { + start, end := "", "" + if item.StartTime != nil { + start = item.StartTime.Format(time.DateTime) + } + if item.EndTime != nil { + end = item.EndTime.Format(time.DateTime) + } + result = append(result, &plant.TopicInfo{ + Id: item.ID, + Name: item.Name, + PostCount: int32(item.PostCount), + Icon: item.Icon, + Desc: item.Desc, + Title: item.Title, + Remark: item.Remark, + StartTime: start, + EndTime: end, + }) + } + return &plant.TopicListResp{List: result}, nil } diff --git a/app/plant/rpc/internal/logic/getUserProfileLogic.go b/app/plant/rpc/internal/logic/getUserProfileLogic.go index adcbb44..e4907d8 100644 --- a/app/plant/rpc/internal/logic/getUserProfileLogic.go +++ b/app/plant/rpc/internal/logic/getUserProfileLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,9 +24,30 @@ func NewGetUserProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge } } -// 用户Profile +// 获取用户资料 (首次访问自动初始化) func (l *GetUserProfileLogic) GetUserProfile(in *plant.GetProfileReq) (*plant.PlantUserProfile, error) { - // todo: add your logic here and delete this line - - return &plant.PlantUserProfile{}, nil + var profile plantModel.UserProfile + err := l.svcCtx.DB.Where("user_id = ?", in.UserId).FirstOrCreate(&profile, plantModel.UserProfile{ + UserID: in.UserId, + }).Error + if err != nil { + return nil, err + } + return &plant.PlantUserProfile{ + Id: profile.ID, + UserId: profile.UserID, + NickName: profile.NickName, + AvatarId: profile.AvatarID, + LevelId: profile.LevelID, + CurrentSunlight: profile.CurrentSunlight, + TotalSunlight: profile.TotalSunlight, + PlantCount: profile.PlantCount, + CareCount: profile.CareCount, + PostCount: profile.PostCount, + WaterCount: profile.WaterCount, + FertilizeCount: profile.FertilizeCount, + RepotCount: profile.RepotCount, + PruneCount: profile.PruneCount, + PhotoCount: profile.PhotoCount, + }, nil } diff --git a/app/plant/rpc/internal/logic/getWikiClassDetailLogic.go b/app/plant/rpc/internal/logic/getWikiClassDetailLogic.go new file mode 100644 index 0000000..48309a5 --- /dev/null +++ b/app/plant/rpc/internal/logic/getWikiClassDetailLogic.go @@ -0,0 +1,27 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type GetWikiClassDetailLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetWikiClassDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetWikiClassDetailLogic { + return &GetWikiClassDetailLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetWikiClassDetailLogic) GetWikiClassDetail(in *plant.IdReq) (*plant.WikiClassInfo, error) { + var wc plantModel.WikiClass + if err := l.svcCtx.DB.First(&wc, "id = ?", in.Id).Error; err != nil { + return nil, err + } + return &plant.WikiClassInfo{Id: wc.ID, Name: wc.Name, OssId: wc.OssID}, nil +} diff --git a/app/plant/rpc/internal/logic/getWikiClassListLogic.go b/app/plant/rpc/internal/logic/getWikiClassListLogic.go index eb05ef9..bfc0148 100644 --- a/app/plant/rpc/internal/logic/getWikiClassListLogic.go +++ b/app/plant/rpc/internal/logic/getWikiClassListLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,8 +24,19 @@ func NewGetWikiClassListLogic(ctx context.Context, svcCtx *svc.ServiceContext) * } } +// 百科分类列表 func (l *GetWikiClassListLogic) GetWikiClassList(in *plant.IdReq) (*plant.WikiClassListResp, error) { - // todo: add your logic here and delete this line - - return &plant.WikiClassListResp{}, nil + var list []plantModel.WikiClass + if err := l.svcCtx.DB.Order("created_at asc").Find(&list).Error; err != nil { + return nil, err + } + var result []*plant.WikiClassInfo + for _, item := range list { + result = append(result, &plant.WikiClassInfo{ + Id: item.ID, + Name: item.Name, + OssId: item.OssID, + }) + } + return &plant.WikiClassListResp{List: result}, nil } diff --git a/app/plant/rpc/internal/logic/getWikiDetailLogic.go b/app/plant/rpc/internal/logic/getWikiDetailLogic.go index 3d94000..9992426 100644 --- a/app/plant/rpc/internal/logic/getWikiDetailLogic.go +++ b/app/plant/rpc/internal/logic/getWikiDetailLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,8 +24,13 @@ func NewGetWikiDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Get } } +// 百科详情 func (l *GetWikiDetailLogic) GetWikiDetail(in *plant.IdReq) (*plant.WikiDetailResp, error) { - // todo: add your logic here and delete this line - - return &plant.WikiDetailResp{}, nil + var wiki plantModel.Wiki + if err := l.svcCtx.DB.Where("id = ?", in.Id).First(&wiki).Error; err != nil { + return nil, err + } + return &plant.WikiDetailResp{ + Wiki: wikiInfoFromModel(l.svcCtx.DB, wiki), + }, nil } diff --git a/app/plant/rpc/internal/logic/getWikiListLogic.go b/app/plant/rpc/internal/logic/getWikiListLogic.go index 9315054..1f50ed4 100644 --- a/app/plant/rpc/internal/logic/getWikiListLogic.go +++ b/app/plant/rpc/internal/logic/getWikiListLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,9 +24,37 @@ func NewGetWikiListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetWi } } -// 百科 +// 百科列表 func (l *GetWikiListLogic) GetWikiList(in *plant.WikiListReq) (*plant.WikiListResp, error) { - // todo: add your logic here and delete this line + db := l.svcCtx.DB.Model(&plantModel.Wiki{}) + if in.Name != "" { + db = db.Where("name like ?", "%"+in.Name+"%") + } + if in.IsHot > 0 { + db = db.Where("is_hot = ?", in.IsHot) + } - return &plant.WikiListResp{}, nil + var total int64 + db.Count(&total) + + pageSize := int(in.PageSize) + if pageSize <= 0 { + pageSize = 20 + } + offset := (int(in.Current) - 1) * pageSize + if offset < 0 { + offset = 0 + } + + var list []plantModel.Wiki + if err := db.Limit(pageSize).Offset(offset).Order("created_at desc").Find(&list).Error; err != nil { + return nil, err + } + + var result []*plant.WikiInfo + for _, item := range list { + result = append(result, wikiInfoFromModel(l.svcCtx.DB, item)) + } + + return &plant.WikiListResp{List: result, Total: total}, nil } diff --git a/app/plant/rpc/internal/logic/likePostLogic.go b/app/plant/rpc/internal/logic/likePostLogic.go index d088241..2ccc9ec 100644 --- a/app/plant/rpc/internal/logic/likePostLogic.go +++ b/app/plant/rpc/internal/logic/likePostLogic.go @@ -2,11 +2,12 @@ package logic import ( "context" - + "errors" + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" - - "github.com/zeromicro/go-zero/core/logx" ) type LikePostLogic struct { @@ -16,15 +17,21 @@ type LikePostLogic struct { } func NewLikePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LikePostLogic { - return &LikePostLogic{ - ctx: ctx, - svcCtx: svcCtx, - Logger: logx.WithContext(ctx), - } + return &LikePostLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} } func (l *LikePostLogic) LikePost(in *plant.LikePostReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line - - return &plant.CommonResp{}, nil + var existing plantModel.PostLike + err := l.svcCtx.DB.Where("user_id = ? AND post_id = ?", in.UserId, in.PostId).First(&existing).Error + if errors.Is(err, gorm.ErrRecordNotFound) { + like := plantModel.PostLike{UserID: in.UserId, PostID: in.PostId} + if err2 := l.svcCtx.DB.Create(&like).Error; err2 != nil { + return nil, err2 + } + l.svcCtx.DB.Model(&plantModel.Post{}).Where("id = ?", in.PostId).UpdateColumn("like_count", gorm.Expr("like_count + 1")) + } else { + l.svcCtx.DB.Delete(&existing) + l.svcCtx.DB.Model(&plantModel.Post{}).Where("id = ?", in.PostId).UpdateColumn("like_count", gorm.Expr("GREATEST(like_count - 1, 0)")) + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil } diff --git a/app/plant/rpc/internal/logic/mediaCheckCallbackLogic.go b/app/plant/rpc/internal/logic/mediaCheckCallbackLogic.go new file mode 100644 index 0000000..f11362a --- /dev/null +++ b/app/plant/rpc/internal/logic/mediaCheckCallbackLogic.go @@ -0,0 +1,48 @@ +package logic + +import ( + "context" + + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" + + "github.com/zeromicro/go-zero/core/logx" +) + +type MediaCheckCallbackLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewMediaCheckCallbackLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MediaCheckCallbackLogic { + return &MediaCheckCallbackLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *MediaCheckCallbackLogic) MediaCheckCallback(in *plant.MediaCheckCallbackReq) (*plant.CommonResp, error) { + result := plantModel.MediaCheckResult{ + TraceID: in.TraceId, + PostID: in.PostId, + OssID: in.OssId, + UserID: in.UserId, + Status: int(in.Status), + Type: int(in.Type), + ErrMsg: in.ErrMsg, + } + if err := l.svcCtx.DB.Where(plantModel.MediaCheckResult{TraceID: in.TraceId}). + Assign(result). + FirstOrCreate(&plantModel.MediaCheckResult{}).Error; err != nil { + return nil, err + } + + if in.PostId != "" { + auditStatus := 1 + if in.Status != 0 { + auditStatus = 2 + } + _ = l.svcCtx.DB.Model(&plantModel.Post{}).Where("id = ?", in.PostId).Update("has_reviewed", auditStatus).Error + } + + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/qdrantVector.go b/app/plant/rpc/internal/logic/qdrantVector.go new file mode 100644 index 0000000..516a371 --- /dev/null +++ b/app/plant/rpc/internal/logic/qdrantVector.go @@ -0,0 +1,160 @@ +package logic + +import ( + "bytes" + "context" + "crypto/md5" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "strings" + + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/config" +) + +func wikiVectorID(wikiID string) string { + sum := md5.Sum([]byte("sundynix-plant-wiki:" + wikiID)) + return hex.EncodeToString(sum[:]) +} + +func buildWikiVectorText(w plantModel.Wiki) string { + return fmt.Sprintf("植物名字:%s. 拉丁名:%s. 别名:%s. 科属:%s. 分布区域:%s. 生命周期:%s. 生长习性:%s. 繁殖方法:%s. 病虫害:%s. 光照强度:%s. 光照类型:%s. 最佳温度:%s. 茎:%s. 叶型:%s. 叶色:%s. 叶形:%s. 高度:%d厘米. 开花期:%s. 花色:%s. 花形:%s. 花直径:%d厘米. 果实:%s.", + w.Name, w.LatinName, w.Aliases, w.Genus, w.DistributionArea, w.LifeCycle, + w.GrowthHabit, w.ReproductionMethod, w.PestsDiseases, w.LightIntensity, + w.LightType, w.OptimalTempPeriod, w.Stem, w.FoliageType, w.FoliageColor, + w.FoliageShape, w.Height, w.FloweringPeriod, w.FloweringColor, + w.FloweringShape, w.FlowerDiameter, w.Fruit) +} + +func embeddingModel(c config.Config) string { + if c.Ai.EmbeddingModelName != "" { + return c.Ai.EmbeddingModelName + } + return "text-embedding-3-small" +} + +func createEmbedding(ctx context.Context, c config.Config, text string) ([]float32, error) { + body, _ := json.Marshal(map[string]interface{}{ + "model": embeddingModel(c), + "input": text, + }) + req, err := http.NewRequestWithContext(ctx, http.MethodPost, c.Ai.EmbeddingApiUrl, bytes.NewReader(body)) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Authorization", "Bearer "+c.Ai.EmbeddingApiKey) + resp, err := http.DefaultClient.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + raw, _ := io.ReadAll(io.LimitReader(resp.Body, 4096)) + return nil, fmt.Errorf("embedding 请求失败: %s %s", resp.Status, strings.TrimSpace(string(raw))) + } + var parsed struct { + Data []struct { + Embedding []float32 `json:"embedding"` + } `json:"data"` + } + if err := json.NewDecoder(resp.Body).Decode(&parsed); err != nil { + return nil, err + } + if len(parsed.Data) == 0 || len(parsed.Data[0].Embedding) == 0 { + return nil, errors.New("embedding 响应为空") + } + return parsed.Data[0].Embedding, nil +} + +func qdrantURL(c config.Config, path string) string { + return strings.TrimRight(c.Ai.QdrantUrl, "/") + path +} + +func doQdrant(ctx context.Context, c config.Config, method, path string, body interface{}) error { + var reader io.Reader + if body != nil { + raw, _ := json.Marshal(body) + reader = bytes.NewReader(raw) + } + req, err := http.NewRequestWithContext(ctx, method, qdrantURL(c, path), reader) + if err != nil { + return err + } + req.Header.Set("Content-Type", "application/json") + if c.Ai.QdrantApiKey != "" { + req.Header.Set("api-key", c.Ai.QdrantApiKey) + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + raw, _ := io.ReadAll(io.LimitReader(resp.Body, 4096)) + return fmt.Errorf("qdrant 请求失败: %s %s", resp.Status, strings.TrimSpace(string(raw))) + } + return nil +} + +func ensureQdrantCollection(ctx context.Context, c config.Config, dim int) error { + getReq, err := http.NewRequestWithContext(ctx, http.MethodGet, qdrantURL(c, "/collections/"+c.Ai.QdrantCollection), nil) + if err != nil { + return err + } + if c.Ai.QdrantApiKey != "" { + getReq.Header.Set("api-key", c.Ai.QdrantApiKey) + } + if resp, err := http.DefaultClient.Do(getReq); err == nil { + _ = resp.Body.Close() + if resp.StatusCode >= 200 && resp.StatusCode < 300 { + return nil + } + } + if dim <= 0 { + dim = c.Ai.VectorDimension + } + if dim <= 0 { + dim = 1536 + } + return doQdrant(ctx, c, http.MethodPut, "/collections/"+c.Ai.QdrantCollection, map[string]interface{}{ + "vectors": map[string]interface{}{ + "size": dim, + "distance": "Cosine", + }, + }) +} + +func upsertWikiVector(ctx context.Context, c config.Config, w plantModel.Wiki) error { + text := buildWikiVectorText(w) + vector, err := createEmbedding(ctx, c, text) + if err != nil { + return err + } + if err := ensureQdrantCollection(ctx, c, len(vector)); err != nil { + return err + } + return doQdrant(ctx, c, http.MethodPut, "/collections/"+c.Ai.QdrantCollection+"/points?wait=true", map[string]interface{}{ + "points": []map[string]interface{}{ + { + "id": wikiVectorID(w.ID), + "vector": vector, + "payload": map[string]interface{}{ + "wiki_id": w.ID, + "name": w.Name, + "full_text": text, + }, + }, + }, + }) +} + +func deleteWikiVector(ctx context.Context, c config.Config, wikiID string) error { + return doQdrant(ctx, c, http.MethodPost, "/collections/"+c.Ai.QdrantCollection+"/points/delete?wait=true", map[string]interface{}{ + "points": []string{wikiVectorID(wikiID)}, + }) +} diff --git a/app/plant/rpc/internal/logic/saveAiChatHistoryLogic.go b/app/plant/rpc/internal/logic/saveAiChatHistoryLogic.go new file mode 100644 index 0000000..3130d20 --- /dev/null +++ b/app/plant/rpc/internal/logic/saveAiChatHistoryLogic.go @@ -0,0 +1,35 @@ +package logic + +import ( + "context" + + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" + + "github.com/zeromicro/go-zero/core/logx" +) + +type SaveAiChatHistoryLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewSaveAiChatHistoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SaveAiChatHistoryLogic { + return &SaveAiChatHistoryLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *SaveAiChatHistoryLogic) SaveAiChatHistory(in *plant.SaveAiChatHistoryReq) (*plant.CommonResp, error) { + history := plantModel.AiChatHistory{ + UserID: in.UserId, + Question: in.Question, + Answer: in.Answer, + Role: "assistant", + Content: in.Answer, + } + if err := l.svcCtx.DB.Create(&history).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: history.ID}, nil +} diff --git a/app/plant/rpc/internal/logic/starPostLogic.go b/app/plant/rpc/internal/logic/starPostLogic.go new file mode 100644 index 0000000..d2631a5 --- /dev/null +++ b/app/plant/rpc/internal/logic/starPostLogic.go @@ -0,0 +1,39 @@ +package logic + +import ( + "context" + "errors" + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type StarPostLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewStarPostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StarPostLogic { + return &StarPostLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *StarPostLogic) StarPost(in *plant.LikePostReq) (*plant.CommonResp, error) { + var existing plantModel.UserStar + err := l.svcCtx.DB.Where("user_id = ? AND target_id = ? AND type = ?", in.UserId, in.PostId, "post").First(&existing).Error + if errors.Is(err, gorm.ErrRecordNotFound) { + // 新增收藏 + star := plantModel.UserStar{UserID: in.UserId, TargetID: in.PostId, Type: "post"} + if err2 := l.svcCtx.DB.Create(&star).Error; err2 != nil { + return nil, err2 + } + l.svcCtx.DB.Model(&plantModel.Post{}).Where("id = ?", in.PostId).UpdateColumn("star_count", gorm.Expr("star_count + 1")) + } else { + // 取消收藏 + l.svcCtx.DB.Delete(&existing) + l.svcCtx.DB.Model(&plantModel.Post{}).Where("id = ?", in.PostId).UpdateColumn("star_count", gorm.Expr("GREATEST(star_count - 1, 0)")) + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/syncAllWikiVectorLogic.go b/app/plant/rpc/internal/logic/syncAllWikiVectorLogic.go new file mode 100644 index 0000000..7254a58 --- /dev/null +++ b/app/plant/rpc/internal/logic/syncAllWikiVectorLogic.go @@ -0,0 +1,43 @@ +package logic + +import ( + "context" + "errors" + "fmt" + + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" + + "github.com/zeromicro/go-zero/core/logx" +) + +type SyncAllWikiVectorLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewSyncAllWikiVectorLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SyncAllWikiVectorLogic { + return &SyncAllWikiVectorLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *SyncAllWikiVectorLogic) SyncAllWikiVector(in *plant.PageReq) (*plant.CommonResp, error) { + if l.svcCtx.Config.Ai.EmbeddingApiUrl == "" || l.svcCtx.Config.Ai.QdrantUrl == "" || l.svcCtx.Config.Ai.QdrantCollection == "" { + return nil, errors.New("AI/RAG 未配置 EmbeddingApiUrl、QdrantUrl 或 QdrantCollection") + } + var wikis []plantModel.Wiki + if err := l.svcCtx.DB.Find(&wikis).Error; err != nil { + return nil, err + } + success := 0 + for _, wiki := range wikis { + if err := upsertWikiVector(l.ctx, l.svcCtx.Config, wiki); err != nil { + l.Logger.Errorf("sync wiki vector failed, wiki_id=%s, err=%v", wiki.ID, err) + continue + } + success++ + _ = l.svcCtx.DB.Model(&plantModel.Wiki{}).Where("id = ?", wiki.ID).Update("is_vector_synced", true).Error + } + return &plant.CommonResp{Code: 0, Msg: fmt.Sprintf("同步完成: %d/%d", success, len(wikis))}, nil +} diff --git a/app/plant/rpc/internal/logic/syncWikiVectorLogic.go b/app/plant/rpc/internal/logic/syncWikiVectorLogic.go new file mode 100644 index 0000000..c985635 --- /dev/null +++ b/app/plant/rpc/internal/logic/syncWikiVectorLogic.go @@ -0,0 +1,42 @@ +package logic + +import ( + "context" + "errors" + + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" + + "github.com/zeromicro/go-zero/core/logx" +) + +type SyncWikiVectorLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewSyncWikiVectorLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SyncWikiVectorLogic { + return &SyncWikiVectorLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *SyncWikiVectorLogic) SyncWikiVector(in *plant.SyncWikiVectorReq) (*plant.CommonResp, error) { + if in.WikiId == "" { + return nil, errors.New("wikiId 不能为空") + } + if l.svcCtx.Config.Ai.EmbeddingApiUrl == "" || l.svcCtx.Config.Ai.QdrantUrl == "" || l.svcCtx.Config.Ai.QdrantCollection == "" { + return nil, errors.New("AI/RAG 未配置 EmbeddingApiUrl、QdrantUrl 或 QdrantCollection") + } + var wiki plantModel.Wiki + if err := l.svcCtx.DB.Where("id = ?", in.WikiId).First(&wiki).Error; err != nil { + return nil, err + } + if err := upsertWikiVector(l.ctx, l.svcCtx.Config, wiki); err != nil { + return nil, err + } + if err := l.svcCtx.DB.Model(&plantModel.Wiki{}).Where("id = ?", in.WikiId).Update("is_vector_synced", true).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/toggleWikiStarLogic.go b/app/plant/rpc/internal/logic/toggleWikiStarLogic.go index 53eaf62..d1bbf81 100644 --- a/app/plant/rpc/internal/logic/toggleWikiStarLogic.go +++ b/app/plant/rpc/internal/logic/toggleWikiStarLogic.go @@ -2,11 +2,14 @@ package logic import ( "context" + "errors" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" ) type ToggleWikiStarLogic struct { @@ -23,8 +26,28 @@ func NewToggleWikiStarLogic(ctx context.Context, svcCtx *svc.ServiceContext) *To } } +// 收藏/取消收藏百科 func (l *ToggleWikiStarLogic) ToggleWikiStar(in *plant.ToggleStarReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line - - return &plant.CommonResp{}, nil + var star plantModel.UserStar + err := l.svcCtx.DB.Where("user_id = ? AND target_id = ? AND type = ?", in.UserId, in.TargetId, in.Type).First(&star).Error + if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { + return nil, err + } + if errors.Is(err, gorm.ErrRecordNotFound) { + // 未收藏 → 创建 + newStar := plantModel.UserStar{ + UserID: in.UserId, + TargetID: in.TargetId, + Type: in.Type, + } + if err := l.svcCtx.DB.Create(&newStar).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "starred"}, nil + } + // 已收藏 → 取消 + if err := l.svcCtx.DB.Unscoped().Delete(&star).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "unstarred"}, nil } diff --git a/app/plant/rpc/internal/logic/updateBadgeConfigLogic.go b/app/plant/rpc/internal/logic/updateBadgeConfigLogic.go new file mode 100644 index 0000000..d0d4e47 --- /dev/null +++ b/app/plant/rpc/internal/logic/updateBadgeConfigLogic.go @@ -0,0 +1,32 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type UpdateBadgeConfigLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateBadgeConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateBadgeConfigLogic { + return &UpdateBadgeConfigLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *UpdateBadgeConfigLogic) UpdateBadgeConfig(in *plant.UpdateBadgeConfigReq) (*plant.CommonResp, error) { + updates := map[string]interface{}{ + "name": in.Name, "description": in.Description, "dimension": in.Dimension, + "group_id": in.GroupId, "tier": in.Tier, "target_action": in.TargetAction, + "threshold": in.Threshold, "reward_sunlight": in.RewardSunlight, + "icon_id": in.IconId, "sort": in.Sort, + } + if err := l.svcCtx.DB.Model(&plantModel.BadgeConfig{}).Where("id = ?", in.Id).Updates(updates).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/updateExchangeItemLogic.go b/app/plant/rpc/internal/logic/updateExchangeItemLogic.go new file mode 100644 index 0000000..e7c1625 --- /dev/null +++ b/app/plant/rpc/internal/logic/updateExchangeItemLogic.go @@ -0,0 +1,51 @@ +package logic + +import ( + "context" + "time" + + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type UpdateExchangeItemLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateExchangeItemLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateExchangeItemLogic { + return &UpdateExchangeItemLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *UpdateExchangeItemLogic) UpdateExchangeItem(in *plant.UpdateExchangeItemReq) (*plant.CommonResp, error) { + cost := in.Cost + if in.CostSunlight > 0 { + cost = in.CostSunlight + } + imgID := in.ImgId + if imgID == "" { + imgID = in.ImageId + } + updates := map[string]interface{}{ + "name": in.Name, "desc": in.Desc, "description": in.Desc, "img_id": imgID, "image_id": imgID, + "cost": cost, "cost_sunlight": cost, "stock": in.Stock, "status": in.Status, + "type": in.Type, "limit_per_user": in.LimitPerUser, "sort": in.Sort, + } + if in.StartTime != "" { + if t, err := time.Parse(time.DateTime, in.StartTime); err == nil { + updates["start_time"] = &t + } + } + if in.EndTime != "" { + if t, err := time.Parse(time.DateTime, in.EndTime); err == nil { + updates["end_time"] = &t + } + } + if err := l.svcCtx.DB.Model(&plantModel.ExchangeItem{}).Where("id = ?", in.Id).Updates(updates).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/updateExchangeOrderLogic.go b/app/plant/rpc/internal/logic/updateExchangeOrderLogic.go new file mode 100644 index 0000000..8e8ac1c --- /dev/null +++ b/app/plant/rpc/internal/logic/updateExchangeOrderLogic.go @@ -0,0 +1,65 @@ +package logic + +import ( + "context" + "errors" + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" + "time" +) + +type UpdateExchangeOrderLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateExchangeOrderLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateExchangeOrderLogic { + return &UpdateExchangeOrderLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *UpdateExchangeOrderLogic) UpdateExchangeOrder(in *plant.UpdateExchangeOrderReq) (*plant.CommonResp, error) { + updateMap := map[string]interface{}{"status": int(in.Status), "tracking_no": in.TrackingNo, "remark": in.Remark} + if in.Status == 4 { + now := time.Now() + updateMap["completed_at"] = &now + } + if in.Status == 5 { + err := l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + var order plantModel.ExchangeOrder + if err := tx.Set("gorm:query_option", "FOR UPDATE").Where("id = ?", in.Id).First(&order).Error; err != nil { + return err + } + if order.Status == 5 { + return errors.New("订单已取消") + } + cost := order.CostSunlight + if cost == 0 { + cost = order.Cost + } + if err := tx.Model(&plantModel.UserProfile{}).Where("user_id = ?", order.UserID). + Update("current_sunlight", gorm.Expr("current_sunlight + ?", cost)).Error; err != nil { + return err + } + if order.Quantity <= 0 { + order.Quantity = 1 + } + if err := tx.Model(&plantModel.ExchangeItem{}).Where("id = ? AND stock >= 0", order.ItemID). + Update("stock", gorm.Expr("stock + ?", order.Quantity)).Error; err != nil { + return err + } + return tx.Model(&plantModel.ExchangeOrder{}).Where("id = ?", in.Id).Updates(updateMap).Error + }) + if err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil + } + if err := l.svcCtx.DB.Model(&plantModel.ExchangeOrder{}).Where("id = ?", in.Id).Updates(updateMap).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/updateLevelConfigLogic.go b/app/plant/rpc/internal/logic/updateLevelConfigLogic.go new file mode 100644 index 0000000..5cad929 --- /dev/null +++ b/app/plant/rpc/internal/logic/updateLevelConfigLogic.go @@ -0,0 +1,27 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type UpdateLevelConfigLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateLevelConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateLevelConfigLogic { + return &UpdateLevelConfigLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *UpdateLevelConfigLogic) UpdateLevelConfig(in *plant.UpdateLevelConfigReq) (*plant.CommonResp, error) { + updates := map[string]interface{}{"level": in.Level, "title": in.Title, "min_sunlight": in.MinSunlight, "perks": in.Perks} + if err := l.svcCtx.DB.Model(&plantModel.LevelConfig{}).Where("id = ?", in.Id).Updates(updates).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/updatePlantLogic.go b/app/plant/rpc/internal/logic/updatePlantLogic.go index 1e59a24..164a5dc 100644 --- a/app/plant/rpc/internal/logic/updatePlantLogic.go +++ b/app/plant/rpc/internal/logic/updatePlantLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,8 +24,18 @@ func NewUpdatePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Updat } } +// 更新植物 func (l *UpdatePlantLogic) UpdatePlant(in *plant.UpdatePlantReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line - - return &plant.CommonResp{}, nil + updateMap := map[string]interface{}{ + "name": in.Name, + "placement": in.Placement, + "pot_material": in.PotMaterial, + "pot_size": in.PotSize, + "sunlight": in.Sunlight, + "planting_material": in.PlantingMaterial, + } + if err := l.svcCtx.DB.Model(&plantModel.MyPlant{}).Where("id = ?", in.Id).Updates(updateMap).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil } diff --git a/app/plant/rpc/internal/logic/updateTopicLogic.go b/app/plant/rpc/internal/logic/updateTopicLogic.go new file mode 100644 index 0000000..a87f2d4 --- /dev/null +++ b/app/plant/rpc/internal/logic/updateTopicLogic.go @@ -0,0 +1,43 @@ +package logic + +import ( + "context" + "time" + + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type UpdateTopicLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateTopicLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateTopicLogic { + return &UpdateTopicLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *UpdateTopicLogic) UpdateTopic(in *plant.UpdateTopicReq) (*plant.CommonResp, error) { + name := in.Name + if name == "" { + name = in.Title + } + updates := map[string]interface{}{"name": name, "title": in.Title, "icon": in.Icon, "desc": in.Desc, "remark": in.Remark} + if in.StartTime != "" { + if t, err := time.Parse(time.DateTime, in.StartTime); err == nil { + updates["start_time"] = &t + } + } + if in.EndTime != "" { + if t, err := time.Parse(time.DateTime, in.EndTime); err == nil { + updates["end_time"] = &t + } + } + if err := l.svcCtx.DB.Model(&plantModel.Topic{}).Where("id = ?", in.Id).Updates(updates).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/updateUserProfileLogic.go b/app/plant/rpc/internal/logic/updateUserProfileLogic.go index 9efd918..ffb7063 100644 --- a/app/plant/rpc/internal/logic/updateUserProfileLogic.go +++ b/app/plant/rpc/internal/logic/updateUserProfileLogic.go @@ -3,6 +3,7 @@ package logic import ( "context" + plantModel "sundynix-micro-go/app/plant/model" "sundynix-micro-go/app/plant/rpc/internal/svc" "sundynix-micro-go/app/plant/rpc/plant" @@ -23,8 +24,21 @@ func NewUpdateUserProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) } } +// 更新用户资料 func (l *UpdateUserProfileLogic) UpdateUserProfile(in *plant.UpdateProfileReq) (*plant.CommonResp, error) { - // todo: add your logic here and delete this line - - return &plant.CommonResp{}, nil + updateMap := map[string]interface{}{} + if in.NickName != "" { + updateMap["nick_name"] = in.NickName + } + if in.AvatarId != "" { + updateMap["avatar_id"] = in.AvatarId + } + if len(updateMap) == 0 { + return &plant.CommonResp{Code: 0, Msg: "nothing to update"}, nil + } + if err := l.svcCtx.DB.Model(&plantModel.UserProfile{}).Where("user_id = ?", in.UserId). + Updates(updateMap).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil } diff --git a/app/plant/rpc/internal/logic/updateWikiClassLogic.go b/app/plant/rpc/internal/logic/updateWikiClassLogic.go new file mode 100644 index 0000000..c0d7eb4 --- /dev/null +++ b/app/plant/rpc/internal/logic/updateWikiClassLogic.go @@ -0,0 +1,27 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type UpdateWikiClassLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateWikiClassLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateWikiClassLogic { + return &UpdateWikiClassLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *UpdateWikiClassLogic) UpdateWikiClass(in *plant.UpdateWikiClassReq) (*plant.CommonResp, error) { + updates := map[string]interface{}{"name": in.Name, "oss_id": in.Icon} + if err := l.svcCtx.DB.Model(&plantModel.WikiClass{}).Where("id = ?", in.Id).Updates(updates).Error; err != nil { + return nil, err + } + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/updateWikiLogic.go b/app/plant/rpc/internal/logic/updateWikiLogic.go new file mode 100644 index 0000000..08f9ec2 --- /dev/null +++ b/app/plant/rpc/internal/logic/updateWikiLogic.go @@ -0,0 +1,53 @@ +package logic + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/plant" +) + +type UpdateWikiLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateWikiLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateWikiLogic { + return &UpdateWikiLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *UpdateWikiLogic) UpdateWiki(in *plant.UpdateWikiReq) (*plant.CommonResp, error) { + classID := in.ClassId + if classID == "" && len(in.ClassIds) > 0 { + classID = in.ClassIds[0] + } + updates := map[string]interface{}{ + "name": in.Name, "latin_name": in.LatinName, "aliases": in.Aliases, + "genus": in.Genus, "difficulty": in.Difficulty, "is_hot": in.IsHot, + "growth_habit": in.GrowthHabit, "light_intensity": in.LightIntensity, + "optimal_temp_period": in.OptimalTempPeriod, "class_id": classID, + "distribution_area": in.DistributionArea, "life_cycle": in.LifeCycle, + "reproduction_method": in.ReproductionMethod, "pests_diseases": in.PestsDiseases, + "light_type": in.LightType, "stem": in.Stem, "fruit": in.Fruit, + "foliage_type": in.FoliageType, "foliage_color": in.FoliageColor, + "foliage_shape": in.FoliageShape, "height": in.Height, + "flowering_period": in.FloweringPeriod, "flowering_color": in.FloweringColor, + "flowering_shape": in.FloweringShape, "flower_diameter": in.FloweringDiameter, + "is_vector_synced": false, + } + if err := l.svcCtx.DB.Transaction(func(tx *gorm.DB) error { + if err := tx.Model(&plantModel.Wiki{}).Where("id = ?", in.Id).Updates(updates).Error; err != nil { + return err + } + return replaceWikiRelations(tx, in.Id, in.ClassIds, in.OssIds, in.RelatedWikiIds) + }); err != nil { + return nil, err + } + go func() { + _, _ = NewSyncWikiVectorLogic(context.Background(), l.svcCtx).SyncWikiVector(&plant.SyncWikiVectorReq{WikiId: in.Id}) + }() + return &plant.CommonResp{Code: 0, Msg: "ok"}, nil +} diff --git a/app/plant/rpc/internal/logic/wikiRelations.go b/app/plant/rpc/internal/logic/wikiRelations.go new file mode 100644 index 0000000..3fa6daa --- /dev/null +++ b/app/plant/rpc/internal/logic/wikiRelations.go @@ -0,0 +1,104 @@ +package logic + +import ( + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/plant" + + "gorm.io/gorm" +) + +func wikiRelationIDs(db *gorm.DB, wikiID string) (classIDs, ossIDs, relatedWikiIDs []string) { + var classes []plantModel.WikiClassRelation + _ = db.Where("wiki_id = ?", wikiID).Find(&classes).Error + for _, item := range classes { + classIDs = append(classIDs, item.ClassID) + } + + var ossList []plantModel.WikiOss + _ = db.Where("wiki_id = ?", wikiID).Find(&ossList).Error + for _, item := range ossList { + ossIDs = append(ossIDs, item.OssID) + } + + var related []plantModel.WikiRelated + _ = db.Where("wiki_id = ?", wikiID).Find(&related).Error + for _, item := range related { + relatedWikiIDs = append(relatedWikiIDs, item.RelatedWikiID) + } + return +} + +func wikiInfoFromModel(db *gorm.DB, item plantModel.Wiki) *plant.WikiInfo { + classIDs, ossIDs, relatedWikiIDs := wikiRelationIDs(db, item.ID) + return &plant.WikiInfo{ + Id: item.ID, + Name: item.Name, + LatinName: item.LatinName, + Aliases: item.Aliases, + Genus: item.Genus, + Difficulty: int32(item.Difficulty), + IsHot: int32(item.IsHot), + GrowthHabit: item.GrowthHabit, + LightIntensity: item.LightIntensity, + OptimalTempPeriod: item.OptimalTempPeriod, + CreatedAt: item.CreatedAt.Unix(), + ClassId: item.ClassID, + DistributionArea: item.DistributionArea, + LifeCycle: item.LifeCycle, + ClassIds: classIDs, + OssIds: ossIDs, + RelatedWikiIds: relatedWikiIDs, + IsVectorSynced: item.IsVectorSynced == 1, + ReproductionMethod: item.ReproductionMethod, + PestsDiseases: item.PestsDiseases, + LightType: item.LightType, + Stem: item.Stem, + Fruit: item.Fruit, + FoliageType: item.FoliageType, + FoliageColor: item.FoliageColor, + FoliageShape: item.FoliageShape, + Height: int32(item.Height), + FloweringPeriod: item.FloweringPeriod, + FloweringColor: item.FloweringColor, + FloweringShape: item.FloweringShape, + FloweringDiameter: int32(item.FlowerDiameter), + } +} + +func replaceWikiRelations(tx *gorm.DB, wikiID string, classIDs, ossIDs, relatedWikiIDs []string) error { + if err := tx.Where("wiki_id = ?", wikiID).Delete(&plantModel.WikiClassRelation{}).Error; err != nil { + return err + } + if err := tx.Where("wiki_id = ?", wikiID).Delete(&plantModel.WikiOss{}).Error; err != nil { + return err + } + if err := tx.Where("wiki_id = ?", wikiID).Delete(&plantModel.WikiRelated{}).Error; err != nil { + return err + } + + for _, classID := range classIDs { + if classID == "" { + continue + } + if err := tx.Create(&plantModel.WikiClassRelation{WikiID: wikiID, ClassID: classID}).Error; err != nil { + return err + } + } + for _, ossID := range ossIDs { + if ossID == "" { + continue + } + if err := tx.Create(&plantModel.WikiOss{WikiID: wikiID, OssID: ossID}).Error; err != nil { + return err + } + } + for _, relatedID := range relatedWikiIDs { + if relatedID == "" || relatedID == wikiID { + continue + } + if err := tx.Create(&plantModel.WikiRelated{WikiID: wikiID, RelatedWikiID: relatedID}).Error; err != nil { + return err + } + } + return nil +} diff --git a/app/plant/rpc/internal/server/plantServiceServer.go b/app/plant/rpc/internal/server/plantServiceServer.go index 2ea1edf..9dfc531 100644 --- a/app/plant/rpc/internal/server/plantServiceServer.go +++ b/app/plant/rpc/internal/server/plantServiceServer.go @@ -18,155 +18,244 @@ type PlantServiceServer struct { } func NewPlantServiceServer(svcCtx *svc.ServiceContext) *PlantServiceServer { - return &PlantServiceServer{ - svcCtx: svcCtx, - } + return &PlantServiceServer{svcCtx: svcCtx} } -// 用户Profile +// ---- 用户Profile ---- func (s *PlantServiceServer) GetUserProfile(ctx context.Context, in *plant.GetProfileReq) (*plant.PlantUserProfile, error) { - l := logic.NewGetUserProfileLogic(ctx, s.svcCtx) - return l.GetUserProfile(in) + return logic.NewGetUserProfileLogic(ctx, s.svcCtx).GetUserProfile(in) } - func (s *PlantServiceServer) UpdateUserProfile(ctx context.Context, in *plant.UpdateProfileReq) (*plant.CommonResp, error) { - l := logic.NewUpdateUserProfileLogic(ctx, s.svcCtx) - return l.UpdateUserProfile(in) + return logic.NewUpdateUserProfileLogic(ctx, s.svcCtx).UpdateUserProfile(in) +} +func (s *PlantServiceServer) GetMyBadges(ctx context.Context, in *plant.GetProfileReq) (*plant.UserBadgeListResp, error) { + return logic.NewGetMyBadgesLogic(ctx, s.svcCtx).GetMyBadges(in) +} +func (s *PlantServiceServer) GetMyStars(ctx context.Context, in *plant.GetProfileReq) (*plant.UserStarListResp, error) { + return logic.NewGetMyStarsLogic(ctx, s.svcCtx).GetMyStars(in) } -// 我的植物 +// ---- 我的植物 ---- func (s *PlantServiceServer) CreatePlant(ctx context.Context, in *plant.CreatePlantReq) (*plant.CommonResp, error) { - l := logic.NewCreatePlantLogic(ctx, s.svcCtx) - return l.CreatePlant(in) + return logic.NewCreatePlantLogic(ctx, s.svcCtx).CreatePlant(in) } - func (s *PlantServiceServer) UpdatePlant(ctx context.Context, in *plant.UpdatePlantReq) (*plant.CommonResp, error) { - l := logic.NewUpdatePlantLogic(ctx, s.svcCtx) - return l.UpdatePlant(in) + return logic.NewUpdatePlantLogic(ctx, s.svcCtx).UpdatePlant(in) } - func (s *PlantServiceServer) DeletePlant(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) { - l := logic.NewDeletePlantLogic(ctx, s.svcCtx) - return l.DeletePlant(in) + return logic.NewDeletePlantLogic(ctx, s.svcCtx).DeletePlant(in) } - func (s *PlantServiceServer) GetPlantList(ctx context.Context, in *plant.PlantListReq) (*plant.PlantListResp, error) { - l := logic.NewGetPlantListLogic(ctx, s.svcCtx) - return l.GetPlantList(in) + return logic.NewGetPlantListLogic(ctx, s.svcCtx).GetPlantList(in) } - func (s *PlantServiceServer) GetPlantDetail(ctx context.Context, in *plant.IdReq) (*plant.PlantDetailResp, error) { - l := logic.NewGetPlantDetailLogic(ctx, s.svcCtx) - return l.GetPlantDetail(in) + return logic.NewGetPlantDetailLogic(ctx, s.svcCtx).GetPlantDetail(in) } -// 养护 +// ---- 养护 ---- func (s *PlantServiceServer) AddCarePlan(ctx context.Context, in *plant.AddCarePlanReq) (*plant.CommonResp, error) { - l := logic.NewAddCarePlanLogic(ctx, s.svcCtx) - return l.AddCarePlan(in) + return logic.NewAddCarePlanLogic(ctx, s.svcCtx).AddCarePlan(in) +} +func (s *PlantServiceServer) DeleteCarePlan(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) { + return logic.NewDeleteCarePlanLogic(ctx, s.svcCtx).DeleteCarePlan(in) +} +func (s *PlantServiceServer) GetTodayTaskList(ctx context.Context, in *plant.GetProfileReq) (*plant.CareTaskListResp, error) { + return logic.NewGetTodayTaskListLogic(ctx, s.svcCtx).GetTodayTaskList(in) } - func (s *PlantServiceServer) AddCareRecord(ctx context.Context, in *plant.AddCareRecordReq) (*plant.CommonResp, error) { - l := logic.NewAddCareRecordLogic(ctx, s.svcCtx) - return l.AddCareRecord(in) + return logic.NewAddCareRecordLogic(ctx, s.svcCtx).AddCareRecord(in) } - func (s *PlantServiceServer) AddGrowthRecord(ctx context.Context, in *plant.AddGrowthRecordReq) (*plant.CommonResp, error) { - l := logic.NewAddGrowthRecordLogic(ctx, s.svcCtx) - return l.AddGrowthRecord(in) + return logic.NewAddGrowthRecordLogic(ctx, s.svcCtx).AddGrowthRecord(in) } -// 百科 +// ---- 百科 ---- func (s *PlantServiceServer) GetWikiList(ctx context.Context, in *plant.WikiListReq) (*plant.WikiListResp, error) { - l := logic.NewGetWikiListLogic(ctx, s.svcCtx) - return l.GetWikiList(in) + return logic.NewGetWikiListLogic(ctx, s.svcCtx).GetWikiList(in) } - func (s *PlantServiceServer) GetWikiDetail(ctx context.Context, in *plant.IdReq) (*plant.WikiDetailResp, error) { - l := logic.NewGetWikiDetailLogic(ctx, s.svcCtx) - return l.GetWikiDetail(in) + return logic.NewGetWikiDetailLogic(ctx, s.svcCtx).GetWikiDetail(in) +} +func (s *PlantServiceServer) CreateWiki(ctx context.Context, in *plant.CreateWikiReq) (*plant.CommonResp, error) { + return logic.NewCreateWikiLogic(ctx, s.svcCtx).CreateWiki(in) +} +func (s *PlantServiceServer) UpdateWiki(ctx context.Context, in *plant.UpdateWikiReq) (*plant.CommonResp, error) { + return logic.NewUpdateWikiLogic(ctx, s.svcCtx).UpdateWiki(in) +} +func (s *PlantServiceServer) DeleteWiki(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) { + return logic.NewDeleteWikiLogic(ctx, s.svcCtx).DeleteWiki(in) +} +func (s *PlantServiceServer) SyncWikiVector(ctx context.Context, in *plant.SyncWikiVectorReq) (*plant.CommonResp, error) { + return logic.NewSyncWikiVectorLogic(ctx, s.svcCtx).SyncWikiVector(in) +} +func (s *PlantServiceServer) DeleteWikiVector(ctx context.Context, in *plant.SyncWikiVectorReq) (*plant.CommonResp, error) { + return logic.NewDeleteWikiVectorLogic(ctx, s.svcCtx).DeleteWikiVector(in) +} +func (s *PlantServiceServer) SyncAllWikiVector(ctx context.Context, in *plant.PageReq) (*plant.CommonResp, error) { + return logic.NewSyncAllWikiVectorLogic(ctx, s.svcCtx).SyncAllWikiVector(in) } - func (s *PlantServiceServer) GetWikiClassList(ctx context.Context, in *plant.IdReq) (*plant.WikiClassListResp, error) { - l := logic.NewGetWikiClassListLogic(ctx, s.svcCtx) - return l.GetWikiClassList(in) + return logic.NewGetWikiClassListLogic(ctx, s.svcCtx).GetWikiClassList(in) } - func (s *PlantServiceServer) CreateWikiClass(ctx context.Context, in *plant.CreateWikiClassReq) (*plant.CommonResp, error) { - l := logic.NewCreateWikiClassLogic(ctx, s.svcCtx) - return l.CreateWikiClass(in) + return logic.NewCreateWikiClassLogic(ctx, s.svcCtx).CreateWikiClass(in) +} +func (s *PlantServiceServer) UpdateWikiClass(ctx context.Context, in *plant.UpdateWikiClassReq) (*plant.CommonResp, error) { + return logic.NewUpdateWikiClassLogic(ctx, s.svcCtx).UpdateWikiClass(in) +} +func (s *PlantServiceServer) DeleteWikiClass(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) { + return logic.NewDeleteWikiClassLogic(ctx, s.svcCtx).DeleteWikiClass(in) } - func (s *PlantServiceServer) ToggleWikiStar(ctx context.Context, in *plant.ToggleStarReq) (*plant.CommonResp, error) { - l := logic.NewToggleWikiStarLogic(ctx, s.svcCtx) - return l.ToggleWikiStar(in) + return logic.NewToggleWikiStarLogic(ctx, s.svcCtx).ToggleWikiStar(in) } -// 社区 +// ---- OCR ---- +func (s *PlantServiceServer) GetMyClassifyLog(ctx context.Context, in *plant.GetProfileReq) (*plant.ClassifyLogListResp, error) { + return logic.NewGetMyClassifyLogLogic(ctx, s.svcCtx).GetMyClassifyLog(in) +} +func (s *PlantServiceServer) DeleteClassifyLog(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) { + return logic.NewDeleteClassifyLogLogic(ctx, s.svcCtx).DeleteClassifyLog(in) +} + +// ---- 社区 ---- func (s *PlantServiceServer) CreatePost(ctx context.Context, in *plant.CreatePostReq) (*plant.CommonResp, error) { - l := logic.NewCreatePostLogic(ctx, s.svcCtx) - return l.CreatePost(in) + return logic.NewCreatePostLogic(ctx, s.svcCtx).CreatePost(in) } - func (s *PlantServiceServer) DeletePost(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) { - l := logic.NewDeletePostLogic(ctx, s.svcCtx) - return l.DeletePost(in) + return logic.NewDeletePostLogic(ctx, s.svcCtx).DeletePost(in) } - func (s *PlantServiceServer) GetPostList(ctx context.Context, in *plant.PostListReq) (*plant.PostListResp, error) { - l := logic.NewGetPostListLogic(ctx, s.svcCtx) - return l.GetPostList(in) + return logic.NewGetPostListLogic(ctx, s.svcCtx).GetPostList(in) } - func (s *PlantServiceServer) GetPostDetail(ctx context.Context, in *plant.IdReq) (*plant.PostDetailResp, error) { - l := logic.NewGetPostDetailLogic(ctx, s.svcCtx) - return l.GetPostDetail(in) + return logic.NewGetPostDetailLogic(ctx, s.svcCtx).GetPostDetail(in) } - func (s *PlantServiceServer) CommentPost(ctx context.Context, in *plant.CommentPostReq) (*plant.CommonResp, error) { - l := logic.NewCommentPostLogic(ctx, s.svcCtx) - return l.CommentPost(in) + return logic.NewCommentPostLogic(ctx, s.svcCtx).CommentPost(in) } - func (s *PlantServiceServer) LikePost(ctx context.Context, in *plant.LikePostReq) (*plant.CommonResp, error) { - l := logic.NewLikePostLogic(ctx, s.svcCtx) - return l.LikePost(in) + return logic.NewLikePostLogic(ctx, s.svcCtx).LikePost(in) +} +func (s *PlantServiceServer) StarPost(ctx context.Context, in *plant.LikePostReq) (*plant.CommonResp, error) { + return logic.NewStarPostLogic(ctx, s.svcCtx).StarPost(in) +} +func (s *PlantServiceServer) MediaCheckCallback(ctx context.Context, in *plant.MediaCheckCallbackReq) (*plant.CommonResp, error) { + return logic.NewMediaCheckCallbackLogic(ctx, s.svcCtx).MediaCheckCallback(in) } -// 话题 +// ---- 话题 ---- func (s *PlantServiceServer) GetTopicList(ctx context.Context, in *plant.IdReq) (*plant.TopicListResp, error) { - l := logic.NewGetTopicListLogic(ctx, s.svcCtx) - return l.GetTopicList(in) + return logic.NewGetTopicListLogic(ctx, s.svcCtx).GetTopicList(in) +} +func (s *PlantServiceServer) GetTopicDetail(ctx context.Context, in *plant.IdReq) (*plant.TopicInfo, error) { + return logic.NewGetTopicDetailLogic(ctx, s.svcCtx).GetTopicDetail(in) } - func (s *PlantServiceServer) CreateTopic(ctx context.Context, in *plant.CreateTopicReq) (*plant.CommonResp, error) { - l := logic.NewCreateTopicLogic(ctx, s.svcCtx) - return l.CreateTopic(in) + return logic.NewCreateTopicLogic(ctx, s.svcCtx).CreateTopic(in) +} +func (s *PlantServiceServer) UpdateTopic(ctx context.Context, in *plant.UpdateTopicReq) (*plant.CommonResp, error) { + return logic.NewUpdateTopicLogic(ctx, s.svcCtx).UpdateTopic(in) } - func (s *PlantServiceServer) DeleteTopic(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) { - l := logic.NewDeleteTopicLogic(ctx, s.svcCtx) - return l.DeleteTopic(in) + return logic.NewDeleteTopicLogic(ctx, s.svcCtx).DeleteTopic(in) } -// 兑换 +// ---- 兑换 ---- func (s *PlantServiceServer) GetExchangeItemList(ctx context.Context, in *plant.ExchangeItemListReq) (*plant.ExchangeItemListResp, error) { - l := logic.NewGetExchangeItemListLogic(ctx, s.svcCtx) - return l.GetExchangeItemList(in) + return logic.NewGetExchangeItemListLogic(ctx, s.svcCtx).GetExchangeItemList(in) +} +func (s *PlantServiceServer) CreateExchangeItem(ctx context.Context, in *plant.CreateExchangeItemReq) (*plant.CommonResp, error) { + return logic.NewCreateExchangeItemLogic(ctx, s.svcCtx).CreateExchangeItem(in) +} +func (s *PlantServiceServer) UpdateExchangeItem(ctx context.Context, in *plant.UpdateExchangeItemReq) (*plant.CommonResp, error) { + return logic.NewUpdateExchangeItemLogic(ctx, s.svcCtx).UpdateExchangeItem(in) +} +func (s *PlantServiceServer) DeleteExchangeItem(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) { + return logic.NewDeleteExchangeItemLogic(ctx, s.svcCtx).DeleteExchangeItem(in) } - func (s *PlantServiceServer) CreateExchangeOrder(ctx context.Context, in *plant.CreateExchangeOrderReq) (*plant.CommonResp, error) { - l := logic.NewCreateExchangeOrderLogic(ctx, s.svcCtx) - return l.CreateExchangeOrder(in) + return logic.NewCreateExchangeOrderLogic(ctx, s.svcCtx).CreateExchangeOrder(in) +} +func (s *PlantServiceServer) GetMyExchangeOrders(ctx context.Context, in *plant.ExchangeOrderListReq) (*plant.ExchangeOrderListResp, error) { + return logic.NewGetMyExchangeOrdersLogic(ctx, s.svcCtx).GetMyExchangeOrders(in) +} +func (s *PlantServiceServer) GetExchangeOrderList(ctx context.Context, in *plant.ExchangeOrderListReq) (*plant.ExchangeOrderListResp, error) { + return logic.NewGetExchangeOrderListLogic(ctx, s.svcCtx).GetExchangeOrderList(in) +} +func (s *PlantServiceServer) UpdateExchangeOrder(ctx context.Context, in *plant.UpdateExchangeOrderReq) (*plant.CommonResp, error) { + return logic.NewUpdateExchangeOrderLogic(ctx, s.svcCtx).UpdateExchangeOrder(in) } -// 配置 +// ---- 配置 ---- func (s *PlantServiceServer) GetLevelConfigList(ctx context.Context, in *plant.PageReq) (*plant.LevelConfigListResp, error) { - l := logic.NewGetLevelConfigListLogic(ctx, s.svcCtx) - return l.GetLevelConfigList(in) + return logic.NewGetLevelConfigListLogic(ctx, s.svcCtx).GetLevelConfigList(in) +} +func (s *PlantServiceServer) CreateLevelConfig(ctx context.Context, in *plant.CreateLevelConfigReq) (*plant.CommonResp, error) { + return logic.NewCreateLevelConfigLogic(ctx, s.svcCtx).CreateLevelConfig(in) +} +func (s *PlantServiceServer) UpdateLevelConfig(ctx context.Context, in *plant.UpdateLevelConfigReq) (*plant.CommonResp, error) { + return logic.NewUpdateLevelConfigLogic(ctx, s.svcCtx).UpdateLevelConfig(in) +} +func (s *PlantServiceServer) DeleteLevelConfig(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) { + return logic.NewDeleteLevelConfigLogic(ctx, s.svcCtx).DeleteLevelConfig(in) +} +func (s *PlantServiceServer) GetBadgeConfigList(ctx context.Context, in *plant.BadgeConfigListReq) (*plant.BadgeConfigListResp, error) { + return logic.NewGetBadgeConfigListLogic(ctx, s.svcCtx).GetBadgeConfigList(in) +} +func (s *PlantServiceServer) GetBadgeConfigDetail(ctx context.Context, in *plant.IdReq) (*plant.BadgeConfigInfo, error) { + return logic.NewGetBadgeConfigDetailLogic(ctx, s.svcCtx).GetBadgeConfigDetail(in) +} +func (s *PlantServiceServer) CreateBadgeConfig(ctx context.Context, in *plant.CreateBadgeConfigReq) (*plant.CommonResp, error) { + return logic.NewCreateBadgeConfigLogic(ctx, s.svcCtx).CreateBadgeConfig(in) +} +func (s *PlantServiceServer) UpdateBadgeConfig(ctx context.Context, in *plant.UpdateBadgeConfigReq) (*plant.CommonResp, error) { + return logic.NewUpdateBadgeConfigLogic(ctx, s.svcCtx).UpdateBadgeConfig(in) +} +func (s *PlantServiceServer) DeleteBadgeConfig(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) { + return logic.NewDeleteBadgeConfigLogic(ctx, s.svcCtx).DeleteBadgeConfig(in) } -func (s *PlantServiceServer) GetBadgeConfigList(ctx context.Context, in *plant.BadgeConfigListReq) (*plant.BadgeConfigListResp, error) { - l := logic.NewGetBadgeConfigListLogic(ctx, s.svcCtx) - return l.GetBadgeConfigList(in) +// ---- AI ---- +func (s *PlantServiceServer) DeleteAiChatHistory(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) { + return logic.NewDeleteAiChatHistoryLogic(ctx, s.svcCtx).DeleteAiChatHistory(in) +} +func (s *PlantServiceServer) SaveAiChatHistory(ctx context.Context, in *plant.SaveAiChatHistoryReq) (*plant.CommonResp, error) { + return logic.NewSaveAiChatHistoryLogic(ctx, s.svcCtx).SaveAiChatHistory(in) +} +func (s *PlantServiceServer) ClearAiChatHistory(ctx context.Context, in *plant.GetProfileReq) (*plant.CommonResp, error) { + return logic.NewClearAiChatHistoryLogic(ctx, s.svcCtx).ClearAiChatHistory(in) +} +func (s *PlantServiceServer) GetAiChatQuota(ctx context.Context, in *plant.GetProfileReq) (*plant.AiQuotaResp, error) { + return logic.NewGetAiChatQuotaLogic(ctx, s.svcCtx).GetAiChatQuota(in) +} + +// ---- 完成任务 ---- +func (s *PlantServiceServer) CompleteTask(ctx context.Context, in *plant.CompleteTaskReq) (*plant.TaskCompletionResult, error) { + return logic.NewCompleteTaskLogic(ctx, s.svcCtx).CompleteTask(in) +} + +// ---- 兑换详情 ---- +func (s *PlantServiceServer) GetExchangeItemDetail(ctx context.Context, in *plant.IdReq) (*plant.ExchangeItemInfo, error) { + return logic.NewGetExchangeItemDetailLogic(ctx, s.svcCtx).GetExchangeItemDetail(in) +} + +// ---- 百科分类详情 ---- +func (s *PlantServiceServer) GetWikiClassDetail(ctx context.Context, in *plant.IdReq) (*plant.WikiClassInfo, error) { + return logic.NewGetWikiClassDetailLogic(ctx, s.svcCtx).GetWikiClassDetail(in) +} + +// ---- 等级配置详情 ---- +func (s *PlantServiceServer) GetLevelConfigDetail(ctx context.Context, in *plant.IdReq) (*plant.LevelConfigInfo, error) { + return logic.NewGetLevelConfigDetailLogic(ctx, s.svcCtx).GetLevelConfigDetail(in) +} + +// ---- 徽章配置树 ---- +func (s *PlantServiceServer) GetBadgeConfigTree(ctx context.Context, in *plant.IdReq) (*plant.BadgeConfigTreeResp, error) { + return logic.NewGetBadgeConfigTreeLogic(ctx, s.svcCtx).GetBadgeConfigTree(in) +} + +// ---- AI 历史 ---- +func (s *PlantServiceServer) GetAiChatHistory(ctx context.Context, in *plant.AiChatHistoryReq) (*plant.AiChatHistoryResp, error) { + return logic.NewGetAiChatHistoryLogic(ctx, s.svcCtx).GetAiChatHistory(in) } diff --git a/app/plant/rpc/internal/svc/serviceContext.go b/app/plant/rpc/internal/svc/serviceContext.go index d95c586..fa98489 100644 --- a/app/plant/rpc/internal/svc/serviceContext.go +++ b/app/plant/rpc/internal/svc/serviceContext.go @@ -22,25 +22,34 @@ func NewServiceContext(c config.Config) *ServiceContext { } if err := db.AutoMigrate( - &plantModel.SundynixPlantUserProfile{}, - &plantModel.SundynixMyPlant{}, - &plantModel.SundynixCarePlan{}, - &plantModel.SundynixCareRecord{}, - &plantModel.SundynixCareTask{}, - &plantModel.SundynixGrowthRecord{}, - &plantModel.SundynixWiki{}, - &plantModel.SundynixWikiClass{}, - &plantModel.SundynixPost{}, - &plantModel.SundynixPostComment{}, - &plantModel.SundynixPostLike{}, - &plantModel.SundynixPostTopic{}, - &plantModel.SundynixUserStar{}, - &plantModel.SundynixExchangeItem{}, - &plantModel.SundynixExchangeOrder{}, - &plantModel.SundynixLevelConfig{}, - &plantModel.SundynixBadgeConfig{}, - &plantModel.SundynixUserBadge{}, - &plantModel.SundynixAiChatHistory{}, + &plantModel.UserProfile{}, + &plantModel.MyPlant{}, + &plantModel.MyPlantOss{}, + &plantModel.CarePlan{}, + &plantModel.CareRecord{}, + &plantModel.CareTask{}, + &plantModel.GrowthRecord{}, + &plantModel.Wiki{}, + &plantModel.WikiClass{}, + &plantModel.WikiOss{}, + &plantModel.WikiClassRelation{}, + &plantModel.WikiRelated{}, + &plantModel.UserStar{}, + &plantModel.Post{}, + &plantModel.PostComment{}, + &plantModel.PostLike{}, + &plantModel.PostOss{}, + &plantModel.Topic{}, + &plantModel.OcrLog{}, + &plantModel.MediaCheckResult{}, + &plantModel.ExchangeItem{}, + &plantModel.ExchangeOrder{}, + &plantModel.LevelConfig{}, + &plantModel.BadgeConfig{}, + &plantModel.UserBadge{}, + &plantModel.AiChatHistory{}, + &plantModel.GrowthRecordOss{}, + &plantModel.Banner{}, ); err != nil { logx.Errorf("数据库迁移失败: %v", err) } diff --git a/app/plant/rpc/internal/task/expire_care_task.go b/app/plant/rpc/internal/task/expire_care_task.go new file mode 100644 index 0000000..2631788 --- /dev/null +++ b/app/plant/rpc/internal/task/expire_care_task.go @@ -0,0 +1,38 @@ +package task + +import ( + "context" + "time" + + "github.com/zeromicro/go-zero/core/logx" + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/svc" +) + +// ExpireCareTaskJob 每日检查过期养护任务(status=1 且 due_date < 今天 → 标记为 status=3) +type ExpireCareTaskJob struct { + svcCtx *svc.ServiceContext +} + +func NewExpireCareTaskJob(svcCtx *svc.ServiceContext) *ExpireCareTaskJob { + return &ExpireCareTaskJob{svcCtx: svcCtx} +} + +func (j *ExpireCareTaskJob) Run() { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) + defer cancel() + + today := time.Now().Truncate(24 * time.Hour) + logx.WithContext(ctx).Infof("[CRON] 开始执行养护任务过期检查, 基准时间: %v", today) + + res := j.svcCtx.DB.WithContext(ctx). + Model(&plantModel.CareTask{}). + Where("status = 1 AND due_date < ?", today). + Update("status", 3) + + if res.Error != nil { + logx.WithContext(ctx).Errorf("[CRON] 养护任务过期检查失败: %v", res.Error) + return + } + logx.WithContext(ctx).Infof("[CRON] 养护任务过期检查完成,共标记 %d 条任务为过期", res.RowsAffected) +} diff --git a/app/plant/rpc/pb/plant.pb.go b/app/plant/rpc/pb/plant.pb.go new file mode 100644 index 0000000..d171d95 --- /dev/null +++ b/app/plant/rpc/pb/plant.pb.go @@ -0,0 +1,7385 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v7.34.1 +// source: pb/plant.proto + +package plant + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CommonResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CommonResp) Reset() { + *x = CommonResp{} + mi := &file_pb_plant_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CommonResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommonResp) ProtoMessage() {} + +func (x *CommonResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommonResp.ProtoReflect.Descriptor instead. +func (*CommonResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{0} +} + +func (x *CommonResp) GetCode() int64 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *CommonResp) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +type IdReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IdReq) Reset() { + *x = IdReq{} + mi := &file_pb_plant_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IdReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdReq) ProtoMessage() {} + +func (x *IdReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdReq.ProtoReflect.Descriptor instead. +func (*IdReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{1} +} + +func (x *IdReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type IdsReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IdsReq) Reset() { + *x = IdsReq{} + mi := &file_pb_plant_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IdsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdsReq) ProtoMessage() {} + +func (x *IdsReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdsReq.ProtoReflect.Descriptor instead. +func (*IdsReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{2} +} + +func (x *IdsReq) GetIds() []string { + if x != nil { + return x.Ids + } + return nil +} + +type PageReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PageReq) Reset() { + *x = PageReq{} + mi := &file_pb_plant_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PageReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PageReq) ProtoMessage() {} + +func (x *PageReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PageReq.ProtoReflect.Descriptor instead. +func (*PageReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{3} +} + +func (x *PageReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *PageReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type PlantUserProfile struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` + NickName string `protobuf:"bytes,3,opt,name=nickName,proto3" json:"nickName,omitempty"` + AvatarId string `protobuf:"bytes,4,opt,name=avatarId,proto3" json:"avatarId,omitempty"` + LevelId string `protobuf:"bytes,5,opt,name=levelId,proto3" json:"levelId,omitempty"` + CurrentSunlight int64 `protobuf:"varint,6,opt,name=currentSunlight,proto3" json:"currentSunlight,omitempty"` + TotalSunlight int64 `protobuf:"varint,7,opt,name=totalSunlight,proto3" json:"totalSunlight,omitempty"` + PlantCount int64 `protobuf:"varint,8,opt,name=plantCount,proto3" json:"plantCount,omitempty"` + CareCount int64 `protobuf:"varint,9,opt,name=careCount,proto3" json:"careCount,omitempty"` + PostCount int64 `protobuf:"varint,10,opt,name=postCount,proto3" json:"postCount,omitempty"` + WaterCount int64 `protobuf:"varint,11,opt,name=waterCount,proto3" json:"waterCount,omitempty"` + FertilizeCount int64 `protobuf:"varint,12,opt,name=fertilizeCount,proto3" json:"fertilizeCount,omitempty"` + RepotCount int64 `protobuf:"varint,13,opt,name=repotCount,proto3" json:"repotCount,omitempty"` + PruneCount int64 `protobuf:"varint,14,opt,name=pruneCount,proto3" json:"pruneCount,omitempty"` + PhotoCount int64 `protobuf:"varint,15,opt,name=photoCount,proto3" json:"photoCount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PlantUserProfile) Reset() { + *x = PlantUserProfile{} + mi := &file_pb_plant_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PlantUserProfile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlantUserProfile) ProtoMessage() {} + +func (x *PlantUserProfile) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlantUserProfile.ProtoReflect.Descriptor instead. +func (*PlantUserProfile) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{4} +} + +func (x *PlantUserProfile) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *PlantUserProfile) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *PlantUserProfile) GetNickName() string { + if x != nil { + return x.NickName + } + return "" +} + +func (x *PlantUserProfile) GetAvatarId() string { + if x != nil { + return x.AvatarId + } + return "" +} + +func (x *PlantUserProfile) GetLevelId() string { + if x != nil { + return x.LevelId + } + return "" +} + +func (x *PlantUserProfile) GetCurrentSunlight() int64 { + if x != nil { + return x.CurrentSunlight + } + return 0 +} + +func (x *PlantUserProfile) GetTotalSunlight() int64 { + if x != nil { + return x.TotalSunlight + } + return 0 +} + +func (x *PlantUserProfile) GetPlantCount() int64 { + if x != nil { + return x.PlantCount + } + return 0 +} + +func (x *PlantUserProfile) GetCareCount() int64 { + if x != nil { + return x.CareCount + } + return 0 +} + +func (x *PlantUserProfile) GetPostCount() int64 { + if x != nil { + return x.PostCount + } + return 0 +} + +func (x *PlantUserProfile) GetWaterCount() int64 { + if x != nil { + return x.WaterCount + } + return 0 +} + +func (x *PlantUserProfile) GetFertilizeCount() int64 { + if x != nil { + return x.FertilizeCount + } + return 0 +} + +func (x *PlantUserProfile) GetRepotCount() int64 { + if x != nil { + return x.RepotCount + } + return 0 +} + +func (x *PlantUserProfile) GetPruneCount() int64 { + if x != nil { + return x.PruneCount + } + return 0 +} + +func (x *PlantUserProfile) GetPhotoCount() int64 { + if x != nil { + return x.PhotoCount + } + return 0 +} + +type GetProfileReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProfileReq) Reset() { + *x = GetProfileReq{} + mi := &file_pb_plant_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProfileReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProfileReq) ProtoMessage() {} + +func (x *GetProfileReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProfileReq.ProtoReflect.Descriptor instead. +func (*GetProfileReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{5} +} + +func (x *GetProfileReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type UpdateProfileReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + NickName string `protobuf:"bytes,2,opt,name=nickName,proto3" json:"nickName,omitempty"` + AvatarId string `protobuf:"bytes,3,opt,name=avatarId,proto3" json:"avatarId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateProfileReq) Reset() { + *x = UpdateProfileReq{} + mi := &file_pb_plant_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateProfileReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateProfileReq) ProtoMessage() {} + +func (x *UpdateProfileReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateProfileReq.ProtoReflect.Descriptor instead. +func (*UpdateProfileReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{6} +} + +func (x *UpdateProfileReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UpdateProfileReq) GetNickName() string { + if x != nil { + return x.NickName + } + return "" +} + +func (x *UpdateProfileReq) GetAvatarId() string { + if x != nil { + return x.AvatarId + } + return "" +} + +// 我的徽章 +type UserBadgeInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + BadgeId string `protobuf:"bytes,2,opt,name=badgeId,proto3" json:"badgeId,omitempty"` + BadgeName string `protobuf:"bytes,3,opt,name=badgeName,proto3" json:"badgeName,omitempty"` + Dimension string `protobuf:"bytes,4,opt,name=dimension,proto3" json:"dimension,omitempty"` + Tier int32 `protobuf:"varint,5,opt,name=tier,proto3" json:"tier,omitempty"` + AwardedAt string `protobuf:"bytes,6,opt,name=awardedAt,proto3" json:"awardedAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserBadgeInfo) Reset() { + *x = UserBadgeInfo{} + mi := &file_pb_plant_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserBadgeInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserBadgeInfo) ProtoMessage() {} + +func (x *UserBadgeInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserBadgeInfo.ProtoReflect.Descriptor instead. +func (*UserBadgeInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{7} +} + +func (x *UserBadgeInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UserBadgeInfo) GetBadgeId() string { + if x != nil { + return x.BadgeId + } + return "" +} + +func (x *UserBadgeInfo) GetBadgeName() string { + if x != nil { + return x.BadgeName + } + return "" +} + +func (x *UserBadgeInfo) GetDimension() string { + if x != nil { + return x.Dimension + } + return "" +} + +func (x *UserBadgeInfo) GetTier() int32 { + if x != nil { + return x.Tier + } + return 0 +} + +func (x *UserBadgeInfo) GetAwardedAt() string { + if x != nil { + return x.AwardedAt + } + return "" +} + +type UserBadgeListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*UserBadgeInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserBadgeListResp) Reset() { + *x = UserBadgeListResp{} + mi := &file_pb_plant_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserBadgeListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserBadgeListResp) ProtoMessage() {} + +func (x *UserBadgeListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserBadgeListResp.ProtoReflect.Descriptor instead. +func (*UserBadgeListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{8} +} + +func (x *UserBadgeListResp) GetList() []*UserBadgeInfo { + if x != nil { + return x.List + } + return nil +} + +// 我的收藏 +type UserStarInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + TargetId string `protobuf:"bytes,2,opt,name=targetId,proto3" json:"targetId,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + CreatedAt string `protobuf:"bytes,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserStarInfo) Reset() { + *x = UserStarInfo{} + mi := &file_pb_plant_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserStarInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserStarInfo) ProtoMessage() {} + +func (x *UserStarInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserStarInfo.ProtoReflect.Descriptor instead. +func (*UserStarInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{9} +} + +func (x *UserStarInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UserStarInfo) GetTargetId() string { + if x != nil { + return x.TargetId + } + return "" +} + +func (x *UserStarInfo) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *UserStarInfo) GetCreatedAt() string { + if x != nil { + return x.CreatedAt + } + return "" +} + +type UserStarListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*UserStarInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserStarListResp) Reset() { + *x = UserStarListResp{} + mi := &file_pb_plant_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserStarListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserStarListResp) ProtoMessage() {} + +func (x *UserStarListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserStarListResp.ProtoReflect.Descriptor instead. +func (*UserStarListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{10} +} + +func (x *UserStarListResp) GetList() []*UserStarInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *UserStarListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type PlantInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + PlantTime string `protobuf:"bytes,4,opt,name=plantTime,proto3" json:"plantTime,omitempty"` + Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` + Placement string `protobuf:"bytes,6,opt,name=placement,proto3" json:"placement,omitempty"` + PotMaterial string `protobuf:"bytes,7,opt,name=potMaterial,proto3" json:"potMaterial,omitempty"` + PotSize string `protobuf:"bytes,8,opt,name=potSize,proto3" json:"potSize,omitempty"` + Sunlight string `protobuf:"bytes,9,opt,name=sunlight,proto3" json:"sunlight,omitempty"` + PlantingMaterial string `protobuf:"bytes,10,opt,name=plantingMaterial,proto3" json:"plantingMaterial,omitempty"` + ImgIds []string `protobuf:"bytes,11,rep,name=imgIds,proto3" json:"imgIds,omitempty"` + CreatedAt int64 `protobuf:"varint,12,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PlantInfo) Reset() { + *x = PlantInfo{} + mi := &file_pb_plant_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PlantInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlantInfo) ProtoMessage() {} + +func (x *PlantInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlantInfo.ProtoReflect.Descriptor instead. +func (*PlantInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{11} +} + +func (x *PlantInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *PlantInfo) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *PlantInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PlantInfo) GetPlantTime() string { + if x != nil { + return x.PlantTime + } + return "" +} + +func (x *PlantInfo) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *PlantInfo) GetPlacement() string { + if x != nil { + return x.Placement + } + return "" +} + +func (x *PlantInfo) GetPotMaterial() string { + if x != nil { + return x.PotMaterial + } + return "" +} + +func (x *PlantInfo) GetPotSize() string { + if x != nil { + return x.PotSize + } + return "" +} + +func (x *PlantInfo) GetSunlight() string { + if x != nil { + return x.Sunlight + } + return "" +} + +func (x *PlantInfo) GetPlantingMaterial() string { + if x != nil { + return x.PlantingMaterial + } + return "" +} + +func (x *PlantInfo) GetImgIds() []string { + if x != nil { + return x.ImgIds + } + return nil +} + +func (x *PlantInfo) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +type CreatePlantReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + PlantTime string `protobuf:"bytes,3,opt,name=plantTime,proto3" json:"plantTime,omitempty"` + Placement string `protobuf:"bytes,4,opt,name=placement,proto3" json:"placement,omitempty"` + PotMaterial string `protobuf:"bytes,5,opt,name=potMaterial,proto3" json:"potMaterial,omitempty"` + PotSize string `protobuf:"bytes,6,opt,name=potSize,proto3" json:"potSize,omitempty"` + Sunlight string `protobuf:"bytes,7,opt,name=sunlight,proto3" json:"sunlight,omitempty"` + PlantingMaterial string `protobuf:"bytes,8,opt,name=plantingMaterial,proto3" json:"plantingMaterial,omitempty"` + ImgIds []string `protobuf:"bytes,9,rep,name=imgIds,proto3" json:"imgIds,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreatePlantReq) Reset() { + *x = CreatePlantReq{} + mi := &file_pb_plant_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreatePlantReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePlantReq) ProtoMessage() {} + +func (x *CreatePlantReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreatePlantReq.ProtoReflect.Descriptor instead. +func (*CreatePlantReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{12} +} + +func (x *CreatePlantReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *CreatePlantReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreatePlantReq) GetPlantTime() string { + if x != nil { + return x.PlantTime + } + return "" +} + +func (x *CreatePlantReq) GetPlacement() string { + if x != nil { + return x.Placement + } + return "" +} + +func (x *CreatePlantReq) GetPotMaterial() string { + if x != nil { + return x.PotMaterial + } + return "" +} + +func (x *CreatePlantReq) GetPotSize() string { + if x != nil { + return x.PotSize + } + return "" +} + +func (x *CreatePlantReq) GetSunlight() string { + if x != nil { + return x.Sunlight + } + return "" +} + +func (x *CreatePlantReq) GetPlantingMaterial() string { + if x != nil { + return x.PlantingMaterial + } + return "" +} + +func (x *CreatePlantReq) GetImgIds() []string { + if x != nil { + return x.ImgIds + } + return nil +} + +type UpdatePlantReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` + Placement string `protobuf:"bytes,4,opt,name=placement,proto3" json:"placement,omitempty"` + PotMaterial string `protobuf:"bytes,5,opt,name=potMaterial,proto3" json:"potMaterial,omitempty"` + PotSize string `protobuf:"bytes,6,opt,name=potSize,proto3" json:"potSize,omitempty"` + Sunlight string `protobuf:"bytes,7,opt,name=sunlight,proto3" json:"sunlight,omitempty"` + PlantingMaterial string `protobuf:"bytes,8,opt,name=plantingMaterial,proto3" json:"plantingMaterial,omitempty"` + ImgIds []string `protobuf:"bytes,9,rep,name=imgIds,proto3" json:"imgIds,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdatePlantReq) Reset() { + *x = UpdatePlantReq{} + mi := &file_pb_plant_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdatePlantReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePlantReq) ProtoMessage() {} + +func (x *UpdatePlantReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdatePlantReq.ProtoReflect.Descriptor instead. +func (*UpdatePlantReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{13} +} + +func (x *UpdatePlantReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdatePlantReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdatePlantReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *UpdatePlantReq) GetPlacement() string { + if x != nil { + return x.Placement + } + return "" +} + +func (x *UpdatePlantReq) GetPotMaterial() string { + if x != nil { + return x.PotMaterial + } + return "" +} + +func (x *UpdatePlantReq) GetPotSize() string { + if x != nil { + return x.PotSize + } + return "" +} + +func (x *UpdatePlantReq) GetSunlight() string { + if x != nil { + return x.Sunlight + } + return "" +} + +func (x *UpdatePlantReq) GetPlantingMaterial() string { + if x != nil { + return x.PlantingMaterial + } + return "" +} + +func (x *UpdatePlantReq) GetImgIds() []string { + if x != nil { + return x.ImgIds + } + return nil +} + +type PlantListReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + Current int32 `protobuf:"varint,2,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PlantListReq) Reset() { + *x = PlantListReq{} + mi := &file_pb_plant_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PlantListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlantListReq) ProtoMessage() {} + +func (x *PlantListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlantListReq.ProtoReflect.Descriptor instead. +func (*PlantListReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{14} +} + +func (x *PlantListReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *PlantListReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *PlantListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *PlantListReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type PlantListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*PlantInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PlantListResp) Reset() { + *x = PlantListResp{} + mi := &file_pb_plant_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PlantListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlantListResp) ProtoMessage() {} + +func (x *PlantListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlantListResp.ProtoReflect.Descriptor instead. +func (*PlantListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{15} +} + +func (x *PlantListResp) GetList() []*PlantInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *PlantListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type PlantDetailResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Plant *PlantInfo `protobuf:"bytes,1,opt,name=plant,proto3" json:"plant,omitempty"` + CarePlans []*CarePlanInfo `protobuf:"bytes,2,rep,name=carePlans,proto3" json:"carePlans,omitempty"` + GrowthRecords []*GrowthRecordInfo `protobuf:"bytes,3,rep,name=growthRecords,proto3" json:"growthRecords,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PlantDetailResp) Reset() { + *x = PlantDetailResp{} + mi := &file_pb_plant_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PlantDetailResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlantDetailResp) ProtoMessage() {} + +func (x *PlantDetailResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlantDetailResp.ProtoReflect.Descriptor instead. +func (*PlantDetailResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{16} +} + +func (x *PlantDetailResp) GetPlant() *PlantInfo { + if x != nil { + return x.Plant + } + return nil +} + +func (x *PlantDetailResp) GetCarePlans() []*CarePlanInfo { + if x != nil { + return x.CarePlans + } + return nil +} + +func (x *PlantDetailResp) GetGrowthRecords() []*GrowthRecordInfo { + if x != nil { + return x.GrowthRecords + } + return nil +} + +type CarePlanInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + PlantId string `protobuf:"bytes,2,opt,name=plantId,proto3" json:"plantId,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,4,opt,name=icon,proto3" json:"icon,omitempty"` + TargetAction string `protobuf:"bytes,5,opt,name=targetAction,proto3" json:"targetAction,omitempty"` + Period int32 `protobuf:"varint,6,opt,name=period,proto3" json:"period,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CarePlanInfo) Reset() { + *x = CarePlanInfo{} + mi := &file_pb_plant_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CarePlanInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CarePlanInfo) ProtoMessage() {} + +func (x *CarePlanInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CarePlanInfo.ProtoReflect.Descriptor instead. +func (*CarePlanInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{17} +} + +func (x *CarePlanInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *CarePlanInfo) GetPlantId() string { + if x != nil { + return x.PlantId + } + return "" +} + +func (x *CarePlanInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CarePlanInfo) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *CarePlanInfo) GetTargetAction() string { + if x != nil { + return x.TargetAction + } + return "" +} + +func (x *CarePlanInfo) GetPeriod() int32 { + if x != nil { + return x.Period + } + return 0 +} + +type AddCarePlanReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + PlantId string `protobuf:"bytes,2,opt,name=plantId,proto3" json:"plantId,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,4,opt,name=icon,proto3" json:"icon,omitempty"` + TargetAction string `protobuf:"bytes,5,opt,name=targetAction,proto3" json:"targetAction,omitempty"` + Period int32 `protobuf:"varint,6,opt,name=period,proto3" json:"period,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddCarePlanReq) Reset() { + *x = AddCarePlanReq{} + mi := &file_pb_plant_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddCarePlanReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddCarePlanReq) ProtoMessage() {} + +func (x *AddCarePlanReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddCarePlanReq.ProtoReflect.Descriptor instead. +func (*AddCarePlanReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{18} +} + +func (x *AddCarePlanReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *AddCarePlanReq) GetPlantId() string { + if x != nil { + return x.PlantId + } + return "" +} + +func (x *AddCarePlanReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AddCarePlanReq) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *AddCarePlanReq) GetTargetAction() string { + if x != nil { + return x.TargetAction + } + return "" +} + +func (x *AddCarePlanReq) GetPeriod() int32 { + if x != nil { + return x.Period + } + return 0 +} + +// 养护任务 status: 1=待完成 2=已完成 3=已过期 +type CareTaskInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + PlantId string `protobuf:"bytes,2,opt,name=plantId,proto3" json:"plantId,omitempty"` + PlanId string `protobuf:"bytes,3,opt,name=planId,proto3" json:"planId,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,5,opt,name=icon,proto3" json:"icon,omitempty"` + TargetAction string `protobuf:"bytes,6,opt,name=targetAction,proto3" json:"targetAction,omitempty"` + DueDate string `protobuf:"bytes,7,opt,name=dueDate,proto3" json:"dueDate,omitempty"` + Status int32 `protobuf:"varint,8,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CareTaskInfo) Reset() { + *x = CareTaskInfo{} + mi := &file_pb_plant_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CareTaskInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CareTaskInfo) ProtoMessage() {} + +func (x *CareTaskInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CareTaskInfo.ProtoReflect.Descriptor instead. +func (*CareTaskInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{19} +} + +func (x *CareTaskInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *CareTaskInfo) GetPlantId() string { + if x != nil { + return x.PlantId + } + return "" +} + +func (x *CareTaskInfo) GetPlanId() string { + if x != nil { + return x.PlanId + } + return "" +} + +func (x *CareTaskInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CareTaskInfo) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *CareTaskInfo) GetTargetAction() string { + if x != nil { + return x.TargetAction + } + return "" +} + +func (x *CareTaskInfo) GetDueDate() string { + if x != nil { + return x.DueDate + } + return "" +} + +func (x *CareTaskInfo) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type CareTaskListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*CareTaskInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CareTaskListResp) Reset() { + *x = CareTaskListResp{} + mi := &file_pb_plant_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CareTaskListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CareTaskListResp) ProtoMessage() {} + +func (x *CareTaskListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CareTaskListResp.ProtoReflect.Descriptor instead. +func (*CareTaskListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{20} +} + +func (x *CareTaskListResp) GetList() []*CareTaskInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *CareTaskListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type AddCareRecordReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + PlantId string `protobuf:"bytes,2,opt,name=plantId,proto3" json:"plantId,omitempty"` + PlanId string `protobuf:"bytes,3,opt,name=planId,proto3" json:"planId,omitempty"` + Action string `protobuf:"bytes,4,opt,name=action,proto3" json:"action,omitempty"` + Note string `protobuf:"bytes,5,opt,name=note,proto3" json:"note,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddCareRecordReq) Reset() { + *x = AddCareRecordReq{} + mi := &file_pb_plant_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddCareRecordReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddCareRecordReq) ProtoMessage() {} + +func (x *AddCareRecordReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddCareRecordReq.ProtoReflect.Descriptor instead. +func (*AddCareRecordReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{21} +} + +func (x *AddCareRecordReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *AddCareRecordReq) GetPlantId() string { + if x != nil { + return x.PlantId + } + return "" +} + +func (x *AddCareRecordReq) GetPlanId() string { + if x != nil { + return x.PlanId + } + return "" +} + +func (x *AddCareRecordReq) GetAction() string { + if x != nil { + return x.Action + } + return "" +} + +func (x *AddCareRecordReq) GetNote() string { + if x != nil { + return x.Note + } + return "" +} + +type GrowthRecordInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + PlantId string `protobuf:"bytes,2,opt,name=plantId,proto3" json:"plantId,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` + CreatedAt int64 `protobuf:"varint,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GrowthRecordInfo) Reset() { + *x = GrowthRecordInfo{} + mi := &file_pb_plant_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GrowthRecordInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrowthRecordInfo) ProtoMessage() {} + +func (x *GrowthRecordInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GrowthRecordInfo.ProtoReflect.Descriptor instead. +func (*GrowthRecordInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{22} +} + +func (x *GrowthRecordInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GrowthRecordInfo) GetPlantId() string { + if x != nil { + return x.PlantId + } + return "" +} + +func (x *GrowthRecordInfo) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *GrowthRecordInfo) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +type AddGrowthRecordReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + PlantId string `protobuf:"bytes,2,opt,name=plantId,proto3" json:"plantId,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` + ImgIds []string `protobuf:"bytes,4,rep,name=imgIds,proto3" json:"imgIds,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddGrowthRecordReq) Reset() { + *x = AddGrowthRecordReq{} + mi := &file_pb_plant_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddGrowthRecordReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddGrowthRecordReq) ProtoMessage() {} + +func (x *AddGrowthRecordReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddGrowthRecordReq.ProtoReflect.Descriptor instead. +func (*AddGrowthRecordReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{23} +} + +func (x *AddGrowthRecordReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *AddGrowthRecordReq) GetPlantId() string { + if x != nil { + return x.PlantId + } + return "" +} + +func (x *AddGrowthRecordReq) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *AddGrowthRecordReq) GetImgIds() []string { + if x != nil { + return x.ImgIds + } + return nil +} + +type WikiInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + LatinName string `protobuf:"bytes,3,opt,name=latinName,proto3" json:"latinName,omitempty"` + Aliases string `protobuf:"bytes,4,opt,name=aliases,proto3" json:"aliases,omitempty"` + Genus string `protobuf:"bytes,5,opt,name=genus,proto3" json:"genus,omitempty"` + Difficulty int32 `protobuf:"varint,6,opt,name=difficulty,proto3" json:"difficulty,omitempty"` + IsHot int32 `protobuf:"varint,7,opt,name=isHot,proto3" json:"isHot,omitempty"` + GrowthHabit string `protobuf:"bytes,8,opt,name=growthHabit,proto3" json:"growthHabit,omitempty"` + LightIntensity string `protobuf:"bytes,9,opt,name=lightIntensity,proto3" json:"lightIntensity,omitempty"` + OptimalTempPeriod string `protobuf:"bytes,10,opt,name=optimalTempPeriod,proto3" json:"optimalTempPeriod,omitempty"` + CreatedAt int64 `protobuf:"varint,11,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + ClassId string `protobuf:"bytes,12,opt,name=classId,proto3" json:"classId,omitempty"` + DistributionArea string `protobuf:"bytes,13,opt,name=distributionArea,proto3" json:"distributionArea,omitempty"` + LifeCycle string `protobuf:"bytes,14,opt,name=lifeCycle,proto3" json:"lifeCycle,omitempty"` + ClassIds []string `protobuf:"bytes,15,rep,name=classIds,proto3" json:"classIds,omitempty"` + OssIds []string `protobuf:"bytes,16,rep,name=ossIds,proto3" json:"ossIds,omitempty"` + RelatedWikiIds []string `protobuf:"bytes,17,rep,name=relatedWikiIds,proto3" json:"relatedWikiIds,omitempty"` + IsVectorSynced bool `protobuf:"varint,18,opt,name=isVectorSynced,proto3" json:"isVectorSynced,omitempty"` + IsStar bool `protobuf:"varint,19,opt,name=isStar,proto3" json:"isStar,omitempty"` + ReproductionMethod string `protobuf:"bytes,20,opt,name=reproductionMethod,proto3" json:"reproductionMethod,omitempty"` + PestsDiseases string `protobuf:"bytes,21,opt,name=pestsDiseases,proto3" json:"pestsDiseases,omitempty"` + LightType string `protobuf:"bytes,22,opt,name=lightType,proto3" json:"lightType,omitempty"` + Stem string `protobuf:"bytes,23,opt,name=stem,proto3" json:"stem,omitempty"` + Fruit string `protobuf:"bytes,24,opt,name=fruit,proto3" json:"fruit,omitempty"` + FoliageType string `protobuf:"bytes,25,opt,name=foliageType,proto3" json:"foliageType,omitempty"` + FoliageColor string `protobuf:"bytes,26,opt,name=foliageColor,proto3" json:"foliageColor,omitempty"` + FoliageShape string `protobuf:"bytes,27,opt,name=foliageShape,proto3" json:"foliageShape,omitempty"` + Height int32 `protobuf:"varint,28,opt,name=height,proto3" json:"height,omitempty"` + FloweringPeriod string `protobuf:"bytes,29,opt,name=floweringPeriod,proto3" json:"floweringPeriod,omitempty"` + FloweringColor string `protobuf:"bytes,30,opt,name=floweringColor,proto3" json:"floweringColor,omitempty"` + FloweringShape string `protobuf:"bytes,31,opt,name=floweringShape,proto3" json:"floweringShape,omitempty"` + FloweringDiameter int32 `protobuf:"varint,32,opt,name=floweringDiameter,proto3" json:"floweringDiameter,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WikiInfo) Reset() { + *x = WikiInfo{} + mi := &file_pb_plant_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WikiInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WikiInfo) ProtoMessage() {} + +func (x *WikiInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WikiInfo.ProtoReflect.Descriptor instead. +func (*WikiInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{24} +} + +func (x *WikiInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *WikiInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *WikiInfo) GetLatinName() string { + if x != nil { + return x.LatinName + } + return "" +} + +func (x *WikiInfo) GetAliases() string { + if x != nil { + return x.Aliases + } + return "" +} + +func (x *WikiInfo) GetGenus() string { + if x != nil { + return x.Genus + } + return "" +} + +func (x *WikiInfo) GetDifficulty() int32 { + if x != nil { + return x.Difficulty + } + return 0 +} + +func (x *WikiInfo) GetIsHot() int32 { + if x != nil { + return x.IsHot + } + return 0 +} + +func (x *WikiInfo) GetGrowthHabit() string { + if x != nil { + return x.GrowthHabit + } + return "" +} + +func (x *WikiInfo) GetLightIntensity() string { + if x != nil { + return x.LightIntensity + } + return "" +} + +func (x *WikiInfo) GetOptimalTempPeriod() string { + if x != nil { + return x.OptimalTempPeriod + } + return "" +} + +func (x *WikiInfo) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *WikiInfo) GetClassId() string { + if x != nil { + return x.ClassId + } + return "" +} + +func (x *WikiInfo) GetDistributionArea() string { + if x != nil { + return x.DistributionArea + } + return "" +} + +func (x *WikiInfo) GetLifeCycle() string { + if x != nil { + return x.LifeCycle + } + return "" +} + +func (x *WikiInfo) GetClassIds() []string { + if x != nil { + return x.ClassIds + } + return nil +} + +func (x *WikiInfo) GetOssIds() []string { + if x != nil { + return x.OssIds + } + return nil +} + +func (x *WikiInfo) GetRelatedWikiIds() []string { + if x != nil { + return x.RelatedWikiIds + } + return nil +} + +func (x *WikiInfo) GetIsVectorSynced() bool { + if x != nil { + return x.IsVectorSynced + } + return false +} + +func (x *WikiInfo) GetIsStar() bool { + if x != nil { + return x.IsStar + } + return false +} + +func (x *WikiInfo) GetReproductionMethod() string { + if x != nil { + return x.ReproductionMethod + } + return "" +} + +func (x *WikiInfo) GetPestsDiseases() string { + if x != nil { + return x.PestsDiseases + } + return "" +} + +func (x *WikiInfo) GetLightType() string { + if x != nil { + return x.LightType + } + return "" +} + +func (x *WikiInfo) GetStem() string { + if x != nil { + return x.Stem + } + return "" +} + +func (x *WikiInfo) GetFruit() string { + if x != nil { + return x.Fruit + } + return "" +} + +func (x *WikiInfo) GetFoliageType() string { + if x != nil { + return x.FoliageType + } + return "" +} + +func (x *WikiInfo) GetFoliageColor() string { + if x != nil { + return x.FoliageColor + } + return "" +} + +func (x *WikiInfo) GetFoliageShape() string { + if x != nil { + return x.FoliageShape + } + return "" +} + +func (x *WikiInfo) GetHeight() int32 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *WikiInfo) GetFloweringPeriod() string { + if x != nil { + return x.FloweringPeriod + } + return "" +} + +func (x *WikiInfo) GetFloweringColor() string { + if x != nil { + return x.FloweringColor + } + return "" +} + +func (x *WikiInfo) GetFloweringShape() string { + if x != nil { + return x.FloweringShape + } + return "" +} + +func (x *WikiInfo) GetFloweringDiameter() int32 { + if x != nil { + return x.FloweringDiameter + } + return 0 +} + +type WikiListReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + ClassId string `protobuf:"bytes,4,opt,name=classId,proto3" json:"classId,omitempty"` + IsHot int32 `protobuf:"varint,5,opt,name=isHot,proto3" json:"isHot,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WikiListReq) Reset() { + *x = WikiListReq{} + mi := &file_pb_plant_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WikiListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WikiListReq) ProtoMessage() {} + +func (x *WikiListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WikiListReq.ProtoReflect.Descriptor instead. +func (*WikiListReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{25} +} + +func (x *WikiListReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *WikiListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *WikiListReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *WikiListReq) GetClassId() string { + if x != nil { + return x.ClassId + } + return "" +} + +func (x *WikiListReq) GetIsHot() int32 { + if x != nil { + return x.IsHot + } + return 0 +} + +type WikiListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*WikiInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WikiListResp) Reset() { + *x = WikiListResp{} + mi := &file_pb_plant_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WikiListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WikiListResp) ProtoMessage() {} + +func (x *WikiListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WikiListResp.ProtoReflect.Descriptor instead. +func (*WikiListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{26} +} + +func (x *WikiListResp) GetList() []*WikiInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *WikiListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type WikiDetailResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Wiki *WikiInfo `protobuf:"bytes,1,opt,name=wiki,proto3" json:"wiki,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WikiDetailResp) Reset() { + *x = WikiDetailResp{} + mi := &file_pb_plant_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WikiDetailResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WikiDetailResp) ProtoMessage() {} + +func (x *WikiDetailResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WikiDetailResp.ProtoReflect.Descriptor instead. +func (*WikiDetailResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{27} +} + +func (x *WikiDetailResp) GetWiki() *WikiInfo { + if x != nil { + return x.Wiki + } + return nil +} + +type CreateWikiReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + LatinName string `protobuf:"bytes,2,opt,name=latinName,proto3" json:"latinName,omitempty"` + Aliases string `protobuf:"bytes,3,opt,name=aliases,proto3" json:"aliases,omitempty"` + Genus string `protobuf:"bytes,4,opt,name=genus,proto3" json:"genus,omitempty"` + Difficulty int32 `protobuf:"varint,5,opt,name=difficulty,proto3" json:"difficulty,omitempty"` + IsHot int32 `protobuf:"varint,6,opt,name=isHot,proto3" json:"isHot,omitempty"` + GrowthHabit string `protobuf:"bytes,7,opt,name=growthHabit,proto3" json:"growthHabit,omitempty"` + LightIntensity string `protobuf:"bytes,8,opt,name=lightIntensity,proto3" json:"lightIntensity,omitempty"` + OptimalTempPeriod string `protobuf:"bytes,9,opt,name=optimalTempPeriod,proto3" json:"optimalTempPeriod,omitempty"` + ClassId string `protobuf:"bytes,10,opt,name=classId,proto3" json:"classId,omitempty"` + DistributionArea string `protobuf:"bytes,11,opt,name=distributionArea,proto3" json:"distributionArea,omitempty"` + LifeCycle string `protobuf:"bytes,12,opt,name=lifeCycle,proto3" json:"lifeCycle,omitempty"` + ClassIds []string `protobuf:"bytes,13,rep,name=classIds,proto3" json:"classIds,omitempty"` + OssIds []string `protobuf:"bytes,14,rep,name=ossIds,proto3" json:"ossIds,omitempty"` + RelatedWikiIds []string `protobuf:"bytes,15,rep,name=relatedWikiIds,proto3" json:"relatedWikiIds,omitempty"` + ReproductionMethod string `protobuf:"bytes,16,opt,name=reproductionMethod,proto3" json:"reproductionMethod,omitempty"` + PestsDiseases string `protobuf:"bytes,17,opt,name=pestsDiseases,proto3" json:"pestsDiseases,omitempty"` + LightType string `protobuf:"bytes,18,opt,name=lightType,proto3" json:"lightType,omitempty"` + Stem string `protobuf:"bytes,19,opt,name=stem,proto3" json:"stem,omitempty"` + Fruit string `protobuf:"bytes,20,opt,name=fruit,proto3" json:"fruit,omitempty"` + FoliageType string `protobuf:"bytes,21,opt,name=foliageType,proto3" json:"foliageType,omitempty"` + FoliageColor string `protobuf:"bytes,22,opt,name=foliageColor,proto3" json:"foliageColor,omitempty"` + FoliageShape string `protobuf:"bytes,23,opt,name=foliageShape,proto3" json:"foliageShape,omitempty"` + Height int32 `protobuf:"varint,24,opt,name=height,proto3" json:"height,omitempty"` + FloweringPeriod string `protobuf:"bytes,25,opt,name=floweringPeriod,proto3" json:"floweringPeriod,omitempty"` + FloweringColor string `protobuf:"bytes,26,opt,name=floweringColor,proto3" json:"floweringColor,omitempty"` + FloweringShape string `protobuf:"bytes,27,opt,name=floweringShape,proto3" json:"floweringShape,omitempty"` + FloweringDiameter int32 `protobuf:"varint,28,opt,name=floweringDiameter,proto3" json:"floweringDiameter,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateWikiReq) Reset() { + *x = CreateWikiReq{} + mi := &file_pb_plant_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateWikiReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateWikiReq) ProtoMessage() {} + +func (x *CreateWikiReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateWikiReq.ProtoReflect.Descriptor instead. +func (*CreateWikiReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{28} +} + +func (x *CreateWikiReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateWikiReq) GetLatinName() string { + if x != nil { + return x.LatinName + } + return "" +} + +func (x *CreateWikiReq) GetAliases() string { + if x != nil { + return x.Aliases + } + return "" +} + +func (x *CreateWikiReq) GetGenus() string { + if x != nil { + return x.Genus + } + return "" +} + +func (x *CreateWikiReq) GetDifficulty() int32 { + if x != nil { + return x.Difficulty + } + return 0 +} + +func (x *CreateWikiReq) GetIsHot() int32 { + if x != nil { + return x.IsHot + } + return 0 +} + +func (x *CreateWikiReq) GetGrowthHabit() string { + if x != nil { + return x.GrowthHabit + } + return "" +} + +func (x *CreateWikiReq) GetLightIntensity() string { + if x != nil { + return x.LightIntensity + } + return "" +} + +func (x *CreateWikiReq) GetOptimalTempPeriod() string { + if x != nil { + return x.OptimalTempPeriod + } + return "" +} + +func (x *CreateWikiReq) GetClassId() string { + if x != nil { + return x.ClassId + } + return "" +} + +func (x *CreateWikiReq) GetDistributionArea() string { + if x != nil { + return x.DistributionArea + } + return "" +} + +func (x *CreateWikiReq) GetLifeCycle() string { + if x != nil { + return x.LifeCycle + } + return "" +} + +func (x *CreateWikiReq) GetClassIds() []string { + if x != nil { + return x.ClassIds + } + return nil +} + +func (x *CreateWikiReq) GetOssIds() []string { + if x != nil { + return x.OssIds + } + return nil +} + +func (x *CreateWikiReq) GetRelatedWikiIds() []string { + if x != nil { + return x.RelatedWikiIds + } + return nil +} + +func (x *CreateWikiReq) GetReproductionMethod() string { + if x != nil { + return x.ReproductionMethod + } + return "" +} + +func (x *CreateWikiReq) GetPestsDiseases() string { + if x != nil { + return x.PestsDiseases + } + return "" +} + +func (x *CreateWikiReq) GetLightType() string { + if x != nil { + return x.LightType + } + return "" +} + +func (x *CreateWikiReq) GetStem() string { + if x != nil { + return x.Stem + } + return "" +} + +func (x *CreateWikiReq) GetFruit() string { + if x != nil { + return x.Fruit + } + return "" +} + +func (x *CreateWikiReq) GetFoliageType() string { + if x != nil { + return x.FoliageType + } + return "" +} + +func (x *CreateWikiReq) GetFoliageColor() string { + if x != nil { + return x.FoliageColor + } + return "" +} + +func (x *CreateWikiReq) GetFoliageShape() string { + if x != nil { + return x.FoliageShape + } + return "" +} + +func (x *CreateWikiReq) GetHeight() int32 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *CreateWikiReq) GetFloweringPeriod() string { + if x != nil { + return x.FloweringPeriod + } + return "" +} + +func (x *CreateWikiReq) GetFloweringColor() string { + if x != nil { + return x.FloweringColor + } + return "" +} + +func (x *CreateWikiReq) GetFloweringShape() string { + if x != nil { + return x.FloweringShape + } + return "" +} + +func (x *CreateWikiReq) GetFloweringDiameter() int32 { + if x != nil { + return x.FloweringDiameter + } + return 0 +} + +type UpdateWikiReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + LatinName string `protobuf:"bytes,3,opt,name=latinName,proto3" json:"latinName,omitempty"` + Aliases string `protobuf:"bytes,4,opt,name=aliases,proto3" json:"aliases,omitempty"` + Genus string `protobuf:"bytes,5,opt,name=genus,proto3" json:"genus,omitempty"` + Difficulty int32 `protobuf:"varint,6,opt,name=difficulty,proto3" json:"difficulty,omitempty"` + IsHot int32 `protobuf:"varint,7,opt,name=isHot,proto3" json:"isHot,omitempty"` + GrowthHabit string `protobuf:"bytes,8,opt,name=growthHabit,proto3" json:"growthHabit,omitempty"` + LightIntensity string `protobuf:"bytes,9,opt,name=lightIntensity,proto3" json:"lightIntensity,omitempty"` + OptimalTempPeriod string `protobuf:"bytes,10,opt,name=optimalTempPeriod,proto3" json:"optimalTempPeriod,omitempty"` + ClassId string `protobuf:"bytes,11,opt,name=classId,proto3" json:"classId,omitempty"` + DistributionArea string `protobuf:"bytes,12,opt,name=distributionArea,proto3" json:"distributionArea,omitempty"` + LifeCycle string `protobuf:"bytes,13,opt,name=lifeCycle,proto3" json:"lifeCycle,omitempty"` + ClassIds []string `protobuf:"bytes,14,rep,name=classIds,proto3" json:"classIds,omitempty"` + OssIds []string `protobuf:"bytes,15,rep,name=ossIds,proto3" json:"ossIds,omitempty"` + RelatedWikiIds []string `protobuf:"bytes,16,rep,name=relatedWikiIds,proto3" json:"relatedWikiIds,omitempty"` + ReproductionMethod string `protobuf:"bytes,17,opt,name=reproductionMethod,proto3" json:"reproductionMethod,omitempty"` + PestsDiseases string `protobuf:"bytes,18,opt,name=pestsDiseases,proto3" json:"pestsDiseases,omitempty"` + LightType string `protobuf:"bytes,19,opt,name=lightType,proto3" json:"lightType,omitempty"` + Stem string `protobuf:"bytes,20,opt,name=stem,proto3" json:"stem,omitempty"` + Fruit string `protobuf:"bytes,21,opt,name=fruit,proto3" json:"fruit,omitempty"` + FoliageType string `protobuf:"bytes,22,opt,name=foliageType,proto3" json:"foliageType,omitempty"` + FoliageColor string `protobuf:"bytes,23,opt,name=foliageColor,proto3" json:"foliageColor,omitempty"` + FoliageShape string `protobuf:"bytes,24,opt,name=foliageShape,proto3" json:"foliageShape,omitempty"` + Height int32 `protobuf:"varint,25,opt,name=height,proto3" json:"height,omitempty"` + FloweringPeriod string `protobuf:"bytes,26,opt,name=floweringPeriod,proto3" json:"floweringPeriod,omitempty"` + FloweringColor string `protobuf:"bytes,27,opt,name=floweringColor,proto3" json:"floweringColor,omitempty"` + FloweringShape string `protobuf:"bytes,28,opt,name=floweringShape,proto3" json:"floweringShape,omitempty"` + FloweringDiameter int32 `protobuf:"varint,29,opt,name=floweringDiameter,proto3" json:"floweringDiameter,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateWikiReq) Reset() { + *x = UpdateWikiReq{} + mi := &file_pb_plant_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateWikiReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateWikiReq) ProtoMessage() {} + +func (x *UpdateWikiReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateWikiReq.ProtoReflect.Descriptor instead. +func (*UpdateWikiReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{29} +} + +func (x *UpdateWikiReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateWikiReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateWikiReq) GetLatinName() string { + if x != nil { + return x.LatinName + } + return "" +} + +func (x *UpdateWikiReq) GetAliases() string { + if x != nil { + return x.Aliases + } + return "" +} + +func (x *UpdateWikiReq) GetGenus() string { + if x != nil { + return x.Genus + } + return "" +} + +func (x *UpdateWikiReq) GetDifficulty() int32 { + if x != nil { + return x.Difficulty + } + return 0 +} + +func (x *UpdateWikiReq) GetIsHot() int32 { + if x != nil { + return x.IsHot + } + return 0 +} + +func (x *UpdateWikiReq) GetGrowthHabit() string { + if x != nil { + return x.GrowthHabit + } + return "" +} + +func (x *UpdateWikiReq) GetLightIntensity() string { + if x != nil { + return x.LightIntensity + } + return "" +} + +func (x *UpdateWikiReq) GetOptimalTempPeriod() string { + if x != nil { + return x.OptimalTempPeriod + } + return "" +} + +func (x *UpdateWikiReq) GetClassId() string { + if x != nil { + return x.ClassId + } + return "" +} + +func (x *UpdateWikiReq) GetDistributionArea() string { + if x != nil { + return x.DistributionArea + } + return "" +} + +func (x *UpdateWikiReq) GetLifeCycle() string { + if x != nil { + return x.LifeCycle + } + return "" +} + +func (x *UpdateWikiReq) GetClassIds() []string { + if x != nil { + return x.ClassIds + } + return nil +} + +func (x *UpdateWikiReq) GetOssIds() []string { + if x != nil { + return x.OssIds + } + return nil +} + +func (x *UpdateWikiReq) GetRelatedWikiIds() []string { + if x != nil { + return x.RelatedWikiIds + } + return nil +} + +func (x *UpdateWikiReq) GetReproductionMethod() string { + if x != nil { + return x.ReproductionMethod + } + return "" +} + +func (x *UpdateWikiReq) GetPestsDiseases() string { + if x != nil { + return x.PestsDiseases + } + return "" +} + +func (x *UpdateWikiReq) GetLightType() string { + if x != nil { + return x.LightType + } + return "" +} + +func (x *UpdateWikiReq) GetStem() string { + if x != nil { + return x.Stem + } + return "" +} + +func (x *UpdateWikiReq) GetFruit() string { + if x != nil { + return x.Fruit + } + return "" +} + +func (x *UpdateWikiReq) GetFoliageType() string { + if x != nil { + return x.FoliageType + } + return "" +} + +func (x *UpdateWikiReq) GetFoliageColor() string { + if x != nil { + return x.FoliageColor + } + return "" +} + +func (x *UpdateWikiReq) GetFoliageShape() string { + if x != nil { + return x.FoliageShape + } + return "" +} + +func (x *UpdateWikiReq) GetHeight() int32 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *UpdateWikiReq) GetFloweringPeriod() string { + if x != nil { + return x.FloweringPeriod + } + return "" +} + +func (x *UpdateWikiReq) GetFloweringColor() string { + if x != nil { + return x.FloweringColor + } + return "" +} + +func (x *UpdateWikiReq) GetFloweringShape() string { + if x != nil { + return x.FloweringShape + } + return "" +} + +func (x *UpdateWikiReq) GetFloweringDiameter() int32 { + if x != nil { + return x.FloweringDiameter + } + return 0 +} + +type WikiClassInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + OssId string `protobuf:"bytes,3,opt,name=ossId,proto3" json:"ossId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WikiClassInfo) Reset() { + *x = WikiClassInfo{} + mi := &file_pb_plant_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WikiClassInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WikiClassInfo) ProtoMessage() {} + +func (x *WikiClassInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WikiClassInfo.ProtoReflect.Descriptor instead. +func (*WikiClassInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{30} +} + +func (x *WikiClassInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *WikiClassInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *WikiClassInfo) GetOssId() string { + if x != nil { + return x.OssId + } + return "" +} + +type WikiClassListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*WikiClassInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WikiClassListResp) Reset() { + *x = WikiClassListResp{} + mi := &file_pb_plant_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WikiClassListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WikiClassListResp) ProtoMessage() {} + +func (x *WikiClassListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WikiClassListResp.ProtoReflect.Descriptor instead. +func (*WikiClassListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{31} +} + +func (x *WikiClassListResp) GetList() []*WikiClassInfo { + if x != nil { + return x.List + } + return nil +} + +type CreateWikiClassReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateWikiClassReq) Reset() { + *x = CreateWikiClassReq{} + mi := &file_pb_plant_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateWikiClassReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateWikiClassReq) ProtoMessage() {} + +func (x *CreateWikiClassReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateWikiClassReq.ProtoReflect.Descriptor instead. +func (*CreateWikiClassReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{32} +} + +func (x *CreateWikiClassReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateWikiClassReq) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +type UpdateWikiClassReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateWikiClassReq) Reset() { + *x = UpdateWikiClassReq{} + mi := &file_pb_plant_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateWikiClassReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateWikiClassReq) ProtoMessage() {} + +func (x *UpdateWikiClassReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateWikiClassReq.ProtoReflect.Descriptor instead. +func (*UpdateWikiClassReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{33} +} + +func (x *UpdateWikiClassReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateWikiClassReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateWikiClassReq) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +type ToggleStarReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + TargetId string `protobuf:"bytes,2,opt,name=targetId,proto3" json:"targetId,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ToggleStarReq) Reset() { + *x = ToggleStarReq{} + mi := &file_pb_plant_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ToggleStarReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ToggleStarReq) ProtoMessage() {} + +func (x *ToggleStarReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ToggleStarReq.ProtoReflect.Descriptor instead. +func (*ToggleStarReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{34} +} + +func (x *ToggleStarReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ToggleStarReq) GetTargetId() string { + if x != nil { + return x.TargetId + } + return "" +} + +func (x *ToggleStarReq) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +type ClassifyLogInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` + ImageUrl string `protobuf:"bytes,3,opt,name=imageUrl,proto3" json:"imageUrl,omitempty"` + Result string `protobuf:"bytes,4,opt,name=result,proto3" json:"result,omitempty"` + CreatedAt string `protobuf:"bytes,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClassifyLogInfo) Reset() { + *x = ClassifyLogInfo{} + mi := &file_pb_plant_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClassifyLogInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClassifyLogInfo) ProtoMessage() {} + +func (x *ClassifyLogInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClassifyLogInfo.ProtoReflect.Descriptor instead. +func (*ClassifyLogInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{35} +} + +func (x *ClassifyLogInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ClassifyLogInfo) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ClassifyLogInfo) GetImageUrl() string { + if x != nil { + return x.ImageUrl + } + return "" +} + +func (x *ClassifyLogInfo) GetResult() string { + if x != nil { + return x.Result + } + return "" +} + +func (x *ClassifyLogInfo) GetCreatedAt() string { + if x != nil { + return x.CreatedAt + } + return "" +} + +type ClassifyLogListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*ClassifyLogInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClassifyLogListResp) Reset() { + *x = ClassifyLogListResp{} + mi := &file_pb_plant_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClassifyLogListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClassifyLogListResp) ProtoMessage() {} + +func (x *ClassifyLogListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClassifyLogListResp.ProtoReflect.Descriptor instead. +func (*ClassifyLogListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{36} +} + +func (x *ClassifyLogListResp) GetList() []*ClassifyLogInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *ClassifyLogListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type PostInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` + ViewCount int32 `protobuf:"varint,5,opt,name=viewCount,proto3" json:"viewCount,omitempty"` + CommentCount int32 `protobuf:"varint,6,opt,name=commentCount,proto3" json:"commentCount,omitempty"` + LikeCount int32 `protobuf:"varint,7,opt,name=likeCount,proto3" json:"likeCount,omitempty"` + StarCount int32 `protobuf:"varint,8,opt,name=starCount,proto3" json:"starCount,omitempty"` + Location string `protobuf:"bytes,9,opt,name=location,proto3" json:"location,omitempty"` + CreatedAt int64 `protobuf:"varint,10,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + TopicId string `protobuf:"bytes,11,opt,name=topicId,proto3" json:"topicId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PostInfo) Reset() { + *x = PostInfo{} + mi := &file_pb_plant_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PostInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostInfo) ProtoMessage() {} + +func (x *PostInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PostInfo.ProtoReflect.Descriptor instead. +func (*PostInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{37} +} + +func (x *PostInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *PostInfo) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *PostInfo) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *PostInfo) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *PostInfo) GetViewCount() int32 { + if x != nil { + return x.ViewCount + } + return 0 +} + +func (x *PostInfo) GetCommentCount() int32 { + if x != nil { + return x.CommentCount + } + return 0 +} + +func (x *PostInfo) GetLikeCount() int32 { + if x != nil { + return x.LikeCount + } + return 0 +} + +func (x *PostInfo) GetStarCount() int32 { + if x != nil { + return x.StarCount + } + return 0 +} + +func (x *PostInfo) GetLocation() string { + if x != nil { + return x.Location + } + return "" +} + +func (x *PostInfo) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *PostInfo) GetTopicId() string { + if x != nil { + return x.TopicId + } + return "" +} + +type CreatePostReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` + Location string `protobuf:"bytes,4,opt,name=location,proto3" json:"location,omitempty"` + ImgIds []string `protobuf:"bytes,5,rep,name=imgIds,proto3" json:"imgIds,omitempty"` + TopicId string `protobuf:"bytes,6,opt,name=topicId,proto3" json:"topicId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreatePostReq) Reset() { + *x = CreatePostReq{} + mi := &file_pb_plant_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreatePostReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePostReq) ProtoMessage() {} + +func (x *CreatePostReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreatePostReq.ProtoReflect.Descriptor instead. +func (*CreatePostReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{38} +} + +func (x *CreatePostReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *CreatePostReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *CreatePostReq) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *CreatePostReq) GetLocation() string { + if x != nil { + return x.Location + } + return "" +} + +func (x *CreatePostReq) GetImgIds() []string { + if x != nil { + return x.ImgIds + } + return nil +} + +func (x *CreatePostReq) GetTopicId() string { + if x != nil { + return x.TopicId + } + return "" +} + +type PostListReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + Keyword string `protobuf:"bytes,3,opt,name=keyword,proto3" json:"keyword,omitempty"` + TopicId string `protobuf:"bytes,4,opt,name=topicId,proto3" json:"topicId,omitempty"` + UserId string `protobuf:"bytes,5,opt,name=userId,proto3" json:"userId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PostListReq) Reset() { + *x = PostListReq{} + mi := &file_pb_plant_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PostListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostListReq) ProtoMessage() {} + +func (x *PostListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PostListReq.ProtoReflect.Descriptor instead. +func (*PostListReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{39} +} + +func (x *PostListReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *PostListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *PostListReq) GetKeyword() string { + if x != nil { + return x.Keyword + } + return "" +} + +func (x *PostListReq) GetTopicId() string { + if x != nil { + return x.TopicId + } + return "" +} + +func (x *PostListReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type PostListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*PostInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PostListResp) Reset() { + *x = PostListResp{} + mi := &file_pb_plant_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PostListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostListResp) ProtoMessage() {} + +func (x *PostListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PostListResp.ProtoReflect.Descriptor instead. +func (*PostListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{40} +} + +func (x *PostListResp) GetList() []*PostInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *PostListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type PostDetailResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Post *PostInfo `protobuf:"bytes,1,opt,name=post,proto3" json:"post,omitempty"` + Comments []*PostCommentInfo `protobuf:"bytes,2,rep,name=comments,proto3" json:"comments,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PostDetailResp) Reset() { + *x = PostDetailResp{} + mi := &file_pb_plant_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PostDetailResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostDetailResp) ProtoMessage() {} + +func (x *PostDetailResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PostDetailResp.ProtoReflect.Descriptor instead. +func (*PostDetailResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{41} +} + +func (x *PostDetailResp) GetPost() *PostInfo { + if x != nil { + return x.Post + } + return nil +} + +func (x *PostDetailResp) GetComments() []*PostCommentInfo { + if x != nil { + return x.Comments + } + return nil +} + +type PostCommentInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` + ParentId string `protobuf:"bytes,4,opt,name=parentId,proto3" json:"parentId,omitempty"` + CreatedAt int64 `protobuf:"varint,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PostCommentInfo) Reset() { + *x = PostCommentInfo{} + mi := &file_pb_plant_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PostCommentInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostCommentInfo) ProtoMessage() {} + +func (x *PostCommentInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PostCommentInfo.ProtoReflect.Descriptor instead. +func (*PostCommentInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{42} +} + +func (x *PostCommentInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *PostCommentInfo) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *PostCommentInfo) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *PostCommentInfo) GetParentId() string { + if x != nil { + return x.ParentId + } + return "" +} + +func (x *PostCommentInfo) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +type CommentPostReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + PostId string `protobuf:"bytes,2,opt,name=postId,proto3" json:"postId,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` + ParentId string `protobuf:"bytes,4,opt,name=parentId,proto3" json:"parentId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CommentPostReq) Reset() { + *x = CommentPostReq{} + mi := &file_pb_plant_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CommentPostReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommentPostReq) ProtoMessage() {} + +func (x *CommentPostReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[43] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommentPostReq.ProtoReflect.Descriptor instead. +func (*CommentPostReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{43} +} + +func (x *CommentPostReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *CommentPostReq) GetPostId() string { + if x != nil { + return x.PostId + } + return "" +} + +func (x *CommentPostReq) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *CommentPostReq) GetParentId() string { + if x != nil { + return x.ParentId + } + return "" +} + +type LikePostReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + PostId string `protobuf:"bytes,2,opt,name=postId,proto3" json:"postId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LikePostReq) Reset() { + *x = LikePostReq{} + mi := &file_pb_plant_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LikePostReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LikePostReq) ProtoMessage() {} + +func (x *LikePostReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[44] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LikePostReq.ProtoReflect.Descriptor instead. +func (*LikePostReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{44} +} + +func (x *LikePostReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *LikePostReq) GetPostId() string { + if x != nil { + return x.PostId + } + return "" +} + +type TopicInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + PostCount int32 `protobuf:"varint,3,opt,name=postCount,proto3" json:"postCount,omitempty"` + Icon string `protobuf:"bytes,4,opt,name=icon,proto3" json:"icon,omitempty"` + Desc string `protobuf:"bytes,5,opt,name=desc,proto3" json:"desc,omitempty"` + Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"` + Remark string `protobuf:"bytes,7,opt,name=remark,proto3" json:"remark,omitempty"` + StartTime string `protobuf:"bytes,8,opt,name=startTime,proto3" json:"startTime,omitempty"` + EndTime string `protobuf:"bytes,9,opt,name=endTime,proto3" json:"endTime,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TopicInfo) Reset() { + *x = TopicInfo{} + mi := &file_pb_plant_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TopicInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopicInfo) ProtoMessage() {} + +func (x *TopicInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[45] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TopicInfo.ProtoReflect.Descriptor instead. +func (*TopicInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{45} +} + +func (x *TopicInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *TopicInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *TopicInfo) GetPostCount() int32 { + if x != nil { + return x.PostCount + } + return 0 +} + +func (x *TopicInfo) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *TopicInfo) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *TopicInfo) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *TopicInfo) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *TopicInfo) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *TopicInfo) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + +type TopicListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*TopicInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TopicListResp) Reset() { + *x = TopicListResp{} + mi := &file_pb_plant_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TopicListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopicListResp) ProtoMessage() {} + +func (x *TopicListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[46] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TopicListResp.ProtoReflect.Descriptor instead. +func (*TopicListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{46} +} + +func (x *TopicListResp) GetList() []*TopicInfo { + if x != nil { + return x.List + } + return nil +} + +type CreateTopicReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"` + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` + Remark string `protobuf:"bytes,5,opt,name=remark,proto3" json:"remark,omitempty"` + StartTime string `protobuf:"bytes,6,opt,name=startTime,proto3" json:"startTime,omitempty"` + EndTime string `protobuf:"bytes,7,opt,name=endTime,proto3" json:"endTime,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateTopicReq) Reset() { + *x = CreateTopicReq{} + mi := &file_pb_plant_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateTopicReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTopicReq) ProtoMessage() {} + +func (x *CreateTopicReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[47] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateTopicReq.ProtoReflect.Descriptor instead. +func (*CreateTopicReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{47} +} + +func (x *CreateTopicReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateTopicReq) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *CreateTopicReq) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *CreateTopicReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *CreateTopicReq) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *CreateTopicReq) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *CreateTopicReq) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + +type UpdateTopicReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` + Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` + Remark string `protobuf:"bytes,6,opt,name=remark,proto3" json:"remark,omitempty"` + StartTime string `protobuf:"bytes,7,opt,name=startTime,proto3" json:"startTime,omitempty"` + EndTime string `protobuf:"bytes,8,opt,name=endTime,proto3" json:"endTime,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateTopicReq) Reset() { + *x = UpdateTopicReq{} + mi := &file_pb_plant_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateTopicReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateTopicReq) ProtoMessage() {} + +func (x *UpdateTopicReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[48] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateTopicReq.ProtoReflect.Descriptor instead. +func (*UpdateTopicReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{48} +} + +func (x *UpdateTopicReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateTopicReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateTopicReq) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *UpdateTopicReq) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *UpdateTopicReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UpdateTopicReq) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *UpdateTopicReq) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *UpdateTopicReq) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + +type ExchangeItemInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` + ImgId string `protobuf:"bytes,4,opt,name=imgId,proto3" json:"imgId,omitempty"` + Cost int64 `protobuf:"varint,5,opt,name=cost,proto3" json:"cost,omitempty"` + Stock int32 `protobuf:"varint,6,opt,name=stock,proto3" json:"stock,omitempty"` + Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExchangeItemInfo) Reset() { + *x = ExchangeItemInfo{} + mi := &file_pb_plant_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExchangeItemInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeItemInfo) ProtoMessage() {} + +func (x *ExchangeItemInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[49] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExchangeItemInfo.ProtoReflect.Descriptor instead. +func (*ExchangeItemInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{49} +} + +func (x *ExchangeItemInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ExchangeItemInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ExchangeItemInfo) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *ExchangeItemInfo) GetImgId() string { + if x != nil { + return x.ImgId + } + return "" +} + +func (x *ExchangeItemInfo) GetCost() int64 { + if x != nil { + return x.Cost + } + return 0 +} + +func (x *ExchangeItemInfo) GetStock() int32 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *ExchangeItemInfo) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type ExchangeItemListReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExchangeItemListReq) Reset() { + *x = ExchangeItemListReq{} + mi := &file_pb_plant_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExchangeItemListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeItemListReq) ProtoMessage() {} + +func (x *ExchangeItemListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[50] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExchangeItemListReq.ProtoReflect.Descriptor instead. +func (*ExchangeItemListReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{50} +} + +func (x *ExchangeItemListReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *ExchangeItemListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ExchangeItemListReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type ExchangeItemListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*ExchangeItemInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExchangeItemListResp) Reset() { + *x = ExchangeItemListResp{} + mi := &file_pb_plant_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExchangeItemListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeItemListResp) ProtoMessage() {} + +func (x *ExchangeItemListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[51] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExchangeItemListResp.ProtoReflect.Descriptor instead. +func (*ExchangeItemListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{51} +} + +func (x *ExchangeItemListResp) GetList() []*ExchangeItemInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *ExchangeItemListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type CreateExchangeOrderReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + ItemId string `protobuf:"bytes,2,opt,name=itemId,proto3" json:"itemId,omitempty"` + Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` + RecipientName string `protobuf:"bytes,4,opt,name=recipientName,proto3" json:"recipientName,omitempty"` + Phone string `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"` + Address string `protobuf:"bytes,6,opt,name=address,proto3" json:"address,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateExchangeOrderReq) Reset() { + *x = CreateExchangeOrderReq{} + mi := &file_pb_plant_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateExchangeOrderReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateExchangeOrderReq) ProtoMessage() {} + +func (x *CreateExchangeOrderReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[52] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateExchangeOrderReq.ProtoReflect.Descriptor instead. +func (*CreateExchangeOrderReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{52} +} + +func (x *CreateExchangeOrderReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *CreateExchangeOrderReq) GetItemId() string { + if x != nil { + return x.ItemId + } + return "" +} + +func (x *CreateExchangeOrderReq) GetQuantity() int32 { + if x != nil { + return x.Quantity + } + return 0 +} + +func (x *CreateExchangeOrderReq) GetRecipientName() string { + if x != nil { + return x.RecipientName + } + return "" +} + +func (x *CreateExchangeOrderReq) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +func (x *CreateExchangeOrderReq) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +type CreateExchangeItemReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` + ImgId string `protobuf:"bytes,3,opt,name=imgId,proto3" json:"imgId,omitempty"` + Cost int64 `protobuf:"varint,4,opt,name=cost,proto3" json:"cost,omitempty"` + Stock int32 `protobuf:"varint,5,opt,name=stock,proto3" json:"stock,omitempty"` + Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` + CostSunlight int64 `protobuf:"varint,7,opt,name=costSunlight,proto3" json:"costSunlight,omitempty"` + LimitPerUser int32 `protobuf:"varint,8,opt,name=limitPerUser,proto3" json:"limitPerUser,omitempty"` + Sort int32 `protobuf:"varint,9,opt,name=sort,proto3" json:"sort,omitempty"` + StartTime string `protobuf:"bytes,10,opt,name=startTime,proto3" json:"startTime,omitempty"` + EndTime string `protobuf:"bytes,11,opt,name=endTime,proto3" json:"endTime,omitempty"` + ImageId string `protobuf:"bytes,12,opt,name=imageId,proto3" json:"imageId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateExchangeItemReq) Reset() { + *x = CreateExchangeItemReq{} + mi := &file_pb_plant_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateExchangeItemReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateExchangeItemReq) ProtoMessage() {} + +func (x *CreateExchangeItemReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[53] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateExchangeItemReq.ProtoReflect.Descriptor instead. +func (*CreateExchangeItemReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{53} +} + +func (x *CreateExchangeItemReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateExchangeItemReq) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *CreateExchangeItemReq) GetImgId() string { + if x != nil { + return x.ImgId + } + return "" +} + +func (x *CreateExchangeItemReq) GetCost() int64 { + if x != nil { + return x.Cost + } + return 0 +} + +func (x *CreateExchangeItemReq) GetStock() int32 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *CreateExchangeItemReq) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *CreateExchangeItemReq) GetCostSunlight() int64 { + if x != nil { + return x.CostSunlight + } + return 0 +} + +func (x *CreateExchangeItemReq) GetLimitPerUser() int32 { + if x != nil { + return x.LimitPerUser + } + return 0 +} + +func (x *CreateExchangeItemReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *CreateExchangeItemReq) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *CreateExchangeItemReq) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + +func (x *CreateExchangeItemReq) GetImageId() string { + if x != nil { + return x.ImageId + } + return "" +} + +type UpdateExchangeItemReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` + ImgId string `protobuf:"bytes,4,opt,name=imgId,proto3" json:"imgId,omitempty"` + Cost int64 `protobuf:"varint,5,opt,name=cost,proto3" json:"cost,omitempty"` + Stock int32 `protobuf:"varint,6,opt,name=stock,proto3" json:"stock,omitempty"` + Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` + Type string `protobuf:"bytes,8,opt,name=type,proto3" json:"type,omitempty"` + CostSunlight int64 `protobuf:"varint,9,opt,name=costSunlight,proto3" json:"costSunlight,omitempty"` + LimitPerUser int32 `protobuf:"varint,10,opt,name=limitPerUser,proto3" json:"limitPerUser,omitempty"` + Sort int32 `protobuf:"varint,11,opt,name=sort,proto3" json:"sort,omitempty"` + StartTime string `protobuf:"bytes,12,opt,name=startTime,proto3" json:"startTime,omitempty"` + EndTime string `protobuf:"bytes,13,opt,name=endTime,proto3" json:"endTime,omitempty"` + ImageId string `protobuf:"bytes,14,opt,name=imageId,proto3" json:"imageId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateExchangeItemReq) Reset() { + *x = UpdateExchangeItemReq{} + mi := &file_pb_plant_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateExchangeItemReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateExchangeItemReq) ProtoMessage() {} + +func (x *UpdateExchangeItemReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[54] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateExchangeItemReq.ProtoReflect.Descriptor instead. +func (*UpdateExchangeItemReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{54} +} + +func (x *UpdateExchangeItemReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateExchangeItemReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateExchangeItemReq) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *UpdateExchangeItemReq) GetImgId() string { + if x != nil { + return x.ImgId + } + return "" +} + +func (x *UpdateExchangeItemReq) GetCost() int64 { + if x != nil { + return x.Cost + } + return 0 +} + +func (x *UpdateExchangeItemReq) GetStock() int32 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *UpdateExchangeItemReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *UpdateExchangeItemReq) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *UpdateExchangeItemReq) GetCostSunlight() int64 { + if x != nil { + return x.CostSunlight + } + return 0 +} + +func (x *UpdateExchangeItemReq) GetLimitPerUser() int32 { + if x != nil { + return x.LimitPerUser + } + return 0 +} + +func (x *UpdateExchangeItemReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *UpdateExchangeItemReq) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *UpdateExchangeItemReq) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + +func (x *UpdateExchangeItemReq) GetImageId() string { + if x != nil { + return x.ImageId + } + return "" +} + +type ExchangeOrderInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` + ItemId string `protobuf:"bytes,3,opt,name=itemId,proto3" json:"itemId,omitempty"` + ItemName string `protobuf:"bytes,4,opt,name=itemName,proto3" json:"itemName,omitempty"` + Cost int64 `protobuf:"varint,5,opt,name=cost,proto3" json:"cost,omitempty"` + Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` + Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` + CreatedAt string `protobuf:"bytes,8,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + Quantity int32 `protobuf:"varint,9,opt,name=quantity,proto3" json:"quantity,omitempty"` + ItemType string `protobuf:"bytes,10,opt,name=itemType,proto3" json:"itemType,omitempty"` + RecipientName string `protobuf:"bytes,11,opt,name=recipientName,proto3" json:"recipientName,omitempty"` + Phone string `protobuf:"bytes,12,opt,name=phone,proto3" json:"phone,omitempty"` + TrackingNo string `protobuf:"bytes,13,opt,name=trackingNo,proto3" json:"trackingNo,omitempty"` + Remark string `protobuf:"bytes,14,opt,name=remark,proto3" json:"remark,omitempty"` + CompletedAt string `protobuf:"bytes,15,opt,name=completedAt,proto3" json:"completedAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExchangeOrderInfo) Reset() { + *x = ExchangeOrderInfo{} + mi := &file_pb_plant_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExchangeOrderInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeOrderInfo) ProtoMessage() {} + +func (x *ExchangeOrderInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[55] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExchangeOrderInfo.ProtoReflect.Descriptor instead. +func (*ExchangeOrderInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{55} +} + +func (x *ExchangeOrderInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ExchangeOrderInfo) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ExchangeOrderInfo) GetItemId() string { + if x != nil { + return x.ItemId + } + return "" +} + +func (x *ExchangeOrderInfo) GetItemName() string { + if x != nil { + return x.ItemName + } + return "" +} + +func (x *ExchangeOrderInfo) GetCost() int64 { + if x != nil { + return x.Cost + } + return 0 +} + +func (x *ExchangeOrderInfo) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ExchangeOrderInfo) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *ExchangeOrderInfo) GetCreatedAt() string { + if x != nil { + return x.CreatedAt + } + return "" +} + +func (x *ExchangeOrderInfo) GetQuantity() int32 { + if x != nil { + return x.Quantity + } + return 0 +} + +func (x *ExchangeOrderInfo) GetItemType() string { + if x != nil { + return x.ItemType + } + return "" +} + +func (x *ExchangeOrderInfo) GetRecipientName() string { + if x != nil { + return x.RecipientName + } + return "" +} + +func (x *ExchangeOrderInfo) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +func (x *ExchangeOrderInfo) GetTrackingNo() string { + if x != nil { + return x.TrackingNo + } + return "" +} + +func (x *ExchangeOrderInfo) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *ExchangeOrderInfo) GetCompletedAt() string { + if x != nil { + return x.CompletedAt + } + return "" +} + +type ExchangeOrderListReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + UserId string `protobuf:"bytes,3,opt,name=userId,proto3" json:"userId,omitempty"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExchangeOrderListReq) Reset() { + *x = ExchangeOrderListReq{} + mi := &file_pb_plant_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExchangeOrderListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeOrderListReq) ProtoMessage() {} + +func (x *ExchangeOrderListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[56] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExchangeOrderListReq.ProtoReflect.Descriptor instead. +func (*ExchangeOrderListReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{56} +} + +func (x *ExchangeOrderListReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *ExchangeOrderListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ExchangeOrderListReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ExchangeOrderListReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type ExchangeOrderListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*ExchangeOrderInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExchangeOrderListResp) Reset() { + *x = ExchangeOrderListResp{} + mi := &file_pb_plant_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExchangeOrderListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeOrderListResp) ProtoMessage() {} + +func (x *ExchangeOrderListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[57] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExchangeOrderListResp.ProtoReflect.Descriptor instead. +func (*ExchangeOrderListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{57} +} + +func (x *ExchangeOrderListResp) GetList() []*ExchangeOrderInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *ExchangeOrderListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type UpdateExchangeOrderReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` + TrackingNo string `protobuf:"bytes,3,opt,name=trackingNo,proto3" json:"trackingNo,omitempty"` + Remark string `protobuf:"bytes,4,opt,name=remark,proto3" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateExchangeOrderReq) Reset() { + *x = UpdateExchangeOrderReq{} + mi := &file_pb_plant_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateExchangeOrderReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateExchangeOrderReq) ProtoMessage() {} + +func (x *UpdateExchangeOrderReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[58] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateExchangeOrderReq.ProtoReflect.Descriptor instead. +func (*UpdateExchangeOrderReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{58} +} + +func (x *UpdateExchangeOrderReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateExchangeOrderReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *UpdateExchangeOrderReq) GetTrackingNo() string { + if x != nil { + return x.TrackingNo + } + return "" +} + +func (x *UpdateExchangeOrderReq) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +type MediaCheckCallbackReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + TraceId string `protobuf:"bytes,1,opt,name=traceId,proto3" json:"traceId,omitempty"` + PostId string `protobuf:"bytes,2,opt,name=postId,proto3" json:"postId,omitempty"` + OssId string `protobuf:"bytes,3,opt,name=ossId,proto3" json:"ossId,omitempty"` + UserId string `protobuf:"bytes,4,opt,name=userId,proto3" json:"userId,omitempty"` + Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` + Type int32 `protobuf:"varint,6,opt,name=type,proto3" json:"type,omitempty"` + ErrMsg string `protobuf:"bytes,7,opt,name=errMsg,proto3" json:"errMsg,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MediaCheckCallbackReq) Reset() { + *x = MediaCheckCallbackReq{} + mi := &file_pb_plant_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MediaCheckCallbackReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MediaCheckCallbackReq) ProtoMessage() {} + +func (x *MediaCheckCallbackReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[59] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MediaCheckCallbackReq.ProtoReflect.Descriptor instead. +func (*MediaCheckCallbackReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{59} +} + +func (x *MediaCheckCallbackReq) GetTraceId() string { + if x != nil { + return x.TraceId + } + return "" +} + +func (x *MediaCheckCallbackReq) GetPostId() string { + if x != nil { + return x.PostId + } + return "" +} + +func (x *MediaCheckCallbackReq) GetOssId() string { + if x != nil { + return x.OssId + } + return "" +} + +func (x *MediaCheckCallbackReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *MediaCheckCallbackReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *MediaCheckCallbackReq) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *MediaCheckCallbackReq) GetErrMsg() string { + if x != nil { + return x.ErrMsg + } + return "" +} + +type SaveAiChatHistoryReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + Question string `protobuf:"bytes,2,opt,name=question,proto3" json:"question,omitempty"` + Answer string `protobuf:"bytes,3,opt,name=answer,proto3" json:"answer,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SaveAiChatHistoryReq) Reset() { + *x = SaveAiChatHistoryReq{} + mi := &file_pb_plant_proto_msgTypes[60] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SaveAiChatHistoryReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveAiChatHistoryReq) ProtoMessage() {} + +func (x *SaveAiChatHistoryReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[60] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveAiChatHistoryReq.ProtoReflect.Descriptor instead. +func (*SaveAiChatHistoryReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{60} +} + +func (x *SaveAiChatHistoryReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *SaveAiChatHistoryReq) GetQuestion() string { + if x != nil { + return x.Question + } + return "" +} + +func (x *SaveAiChatHistoryReq) GetAnswer() string { + if x != nil { + return x.Answer + } + return "" +} + +type SyncWikiVectorReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + WikiId string `protobuf:"bytes,1,opt,name=wikiId,proto3" json:"wikiId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SyncWikiVectorReq) Reset() { + *x = SyncWikiVectorReq{} + mi := &file_pb_plant_proto_msgTypes[61] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SyncWikiVectorReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncWikiVectorReq) ProtoMessage() {} + +func (x *SyncWikiVectorReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[61] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncWikiVectorReq.ProtoReflect.Descriptor instead. +func (*SyncWikiVectorReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{61} +} + +func (x *SyncWikiVectorReq) GetWikiId() string { + if x != nil { + return x.WikiId + } + return "" +} + +type LevelConfigInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + MinSunlight int64 `protobuf:"varint,4,opt,name=minSunlight,proto3" json:"minSunlight,omitempty"` + Perks string `protobuf:"bytes,5,opt,name=perks,proto3" json:"perks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LevelConfigInfo) Reset() { + *x = LevelConfigInfo{} + mi := &file_pb_plant_proto_msgTypes[62] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LevelConfigInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LevelConfigInfo) ProtoMessage() {} + +func (x *LevelConfigInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[62] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LevelConfigInfo.ProtoReflect.Descriptor instead. +func (*LevelConfigInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{62} +} + +func (x *LevelConfigInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *LevelConfigInfo) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + +func (x *LevelConfigInfo) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LevelConfigInfo) GetMinSunlight() int64 { + if x != nil { + return x.MinSunlight + } + return 0 +} + +func (x *LevelConfigInfo) GetPerks() string { + if x != nil { + return x.Perks + } + return "" +} + +type LevelConfigListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*LevelConfigInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LevelConfigListResp) Reset() { + *x = LevelConfigListResp{} + mi := &file_pb_plant_proto_msgTypes[63] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LevelConfigListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LevelConfigListResp) ProtoMessage() {} + +func (x *LevelConfigListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[63] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LevelConfigListResp.ProtoReflect.Descriptor instead. +func (*LevelConfigListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{63} +} + +func (x *LevelConfigListResp) GetList() []*LevelConfigInfo { + if x != nil { + return x.List + } + return nil +} + +type CreateLevelConfigReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Level int32 `protobuf:"varint,1,opt,name=level,proto3" json:"level,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + MinSunlight int64 `protobuf:"varint,3,opt,name=minSunlight,proto3" json:"minSunlight,omitempty"` + Perks string `protobuf:"bytes,4,opt,name=perks,proto3" json:"perks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateLevelConfigReq) Reset() { + *x = CreateLevelConfigReq{} + mi := &file_pb_plant_proto_msgTypes[64] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateLevelConfigReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateLevelConfigReq) ProtoMessage() {} + +func (x *CreateLevelConfigReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[64] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateLevelConfigReq.ProtoReflect.Descriptor instead. +func (*CreateLevelConfigReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{64} +} + +func (x *CreateLevelConfigReq) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + +func (x *CreateLevelConfigReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *CreateLevelConfigReq) GetMinSunlight() int64 { + if x != nil { + return x.MinSunlight + } + return 0 +} + +func (x *CreateLevelConfigReq) GetPerks() string { + if x != nil { + return x.Perks + } + return "" +} + +type UpdateLevelConfigReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + MinSunlight int64 `protobuf:"varint,4,opt,name=minSunlight,proto3" json:"minSunlight,omitempty"` + Perks string `protobuf:"bytes,5,opt,name=perks,proto3" json:"perks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateLevelConfigReq) Reset() { + *x = UpdateLevelConfigReq{} + mi := &file_pb_plant_proto_msgTypes[65] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateLevelConfigReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateLevelConfigReq) ProtoMessage() {} + +func (x *UpdateLevelConfigReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[65] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateLevelConfigReq.ProtoReflect.Descriptor instead. +func (*UpdateLevelConfigReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{65} +} + +func (x *UpdateLevelConfigReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateLevelConfigReq) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + +func (x *UpdateLevelConfigReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UpdateLevelConfigReq) GetMinSunlight() int64 { + if x != nil { + return x.MinSunlight + } + return 0 +} + +func (x *UpdateLevelConfigReq) GetPerks() string { + if x != nil { + return x.Perks + } + return "" +} + +type BadgeConfigInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Dimension string `protobuf:"bytes,4,opt,name=dimension,proto3" json:"dimension,omitempty"` + GroupId string `protobuf:"bytes,5,opt,name=groupId,proto3" json:"groupId,omitempty"` + Tier int32 `protobuf:"varint,6,opt,name=tier,proto3" json:"tier,omitempty"` + TargetAction string `protobuf:"bytes,7,opt,name=targetAction,proto3" json:"targetAction,omitempty"` + Threshold int64 `protobuf:"varint,8,opt,name=threshold,proto3" json:"threshold,omitempty"` + RewardSunlight int64 `protobuf:"varint,9,opt,name=rewardSunlight,proto3" json:"rewardSunlight,omitempty"` + IconId string `protobuf:"bytes,10,opt,name=iconId,proto3" json:"iconId,omitempty"` + Sort int32 `protobuf:"varint,11,opt,name=sort,proto3" json:"sort,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BadgeConfigInfo) Reset() { + *x = BadgeConfigInfo{} + mi := &file_pb_plant_proto_msgTypes[66] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BadgeConfigInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BadgeConfigInfo) ProtoMessage() {} + +func (x *BadgeConfigInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[66] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BadgeConfigInfo.ProtoReflect.Descriptor instead. +func (*BadgeConfigInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{66} +} + +func (x *BadgeConfigInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *BadgeConfigInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *BadgeConfigInfo) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *BadgeConfigInfo) GetDimension() string { + if x != nil { + return x.Dimension + } + return "" +} + +func (x *BadgeConfigInfo) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *BadgeConfigInfo) GetTier() int32 { + if x != nil { + return x.Tier + } + return 0 +} + +func (x *BadgeConfigInfo) GetTargetAction() string { + if x != nil { + return x.TargetAction + } + return "" +} + +func (x *BadgeConfigInfo) GetThreshold() int64 { + if x != nil { + return x.Threshold + } + return 0 +} + +func (x *BadgeConfigInfo) GetRewardSunlight() int64 { + if x != nil { + return x.RewardSunlight + } + return 0 +} + +func (x *BadgeConfigInfo) GetIconId() string { + if x != nil { + return x.IconId + } + return "" +} + +func (x *BadgeConfigInfo) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +type BadgeConfigListReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + Dimension string `protobuf:"bytes,3,opt,name=dimension,proto3" json:"dimension,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BadgeConfigListReq) Reset() { + *x = BadgeConfigListReq{} + mi := &file_pb_plant_proto_msgTypes[67] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BadgeConfigListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BadgeConfigListReq) ProtoMessage() {} + +func (x *BadgeConfigListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[67] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BadgeConfigListReq.ProtoReflect.Descriptor instead. +func (*BadgeConfigListReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{67} +} + +func (x *BadgeConfigListReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *BadgeConfigListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *BadgeConfigListReq) GetDimension() string { + if x != nil { + return x.Dimension + } + return "" +} + +type BadgeConfigListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*BadgeConfigInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BadgeConfigListResp) Reset() { + *x = BadgeConfigListResp{} + mi := &file_pb_plant_proto_msgTypes[68] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BadgeConfigListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BadgeConfigListResp) ProtoMessage() {} + +func (x *BadgeConfigListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[68] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BadgeConfigListResp.ProtoReflect.Descriptor instead. +func (*BadgeConfigListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{68} +} + +func (x *BadgeConfigListResp) GetList() []*BadgeConfigInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *BadgeConfigListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type CreateBadgeConfigReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Dimension string `protobuf:"bytes,3,opt,name=dimension,proto3" json:"dimension,omitempty"` + GroupId string `protobuf:"bytes,4,opt,name=groupId,proto3" json:"groupId,omitempty"` + Tier int32 `protobuf:"varint,5,opt,name=tier,proto3" json:"tier,omitempty"` + TargetAction string `protobuf:"bytes,6,opt,name=targetAction,proto3" json:"targetAction,omitempty"` + Threshold int64 `protobuf:"varint,7,opt,name=threshold,proto3" json:"threshold,omitempty"` + RewardSunlight int64 `protobuf:"varint,8,opt,name=rewardSunlight,proto3" json:"rewardSunlight,omitempty"` + IconId string `protobuf:"bytes,9,opt,name=iconId,proto3" json:"iconId,omitempty"` + Sort int32 `protobuf:"varint,10,opt,name=sort,proto3" json:"sort,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateBadgeConfigReq) Reset() { + *x = CreateBadgeConfigReq{} + mi := &file_pb_plant_proto_msgTypes[69] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateBadgeConfigReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateBadgeConfigReq) ProtoMessage() {} + +func (x *CreateBadgeConfigReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[69] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateBadgeConfigReq.ProtoReflect.Descriptor instead. +func (*CreateBadgeConfigReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{69} +} + +func (x *CreateBadgeConfigReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateBadgeConfigReq) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *CreateBadgeConfigReq) GetDimension() string { + if x != nil { + return x.Dimension + } + return "" +} + +func (x *CreateBadgeConfigReq) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *CreateBadgeConfigReq) GetTier() int32 { + if x != nil { + return x.Tier + } + return 0 +} + +func (x *CreateBadgeConfigReq) GetTargetAction() string { + if x != nil { + return x.TargetAction + } + return "" +} + +func (x *CreateBadgeConfigReq) GetThreshold() int64 { + if x != nil { + return x.Threshold + } + return 0 +} + +func (x *CreateBadgeConfigReq) GetRewardSunlight() int64 { + if x != nil { + return x.RewardSunlight + } + return 0 +} + +func (x *CreateBadgeConfigReq) GetIconId() string { + if x != nil { + return x.IconId + } + return "" +} + +func (x *CreateBadgeConfigReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +type UpdateBadgeConfigReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Dimension string `protobuf:"bytes,4,opt,name=dimension,proto3" json:"dimension,omitempty"` + GroupId string `protobuf:"bytes,5,opt,name=groupId,proto3" json:"groupId,omitempty"` + Tier int32 `protobuf:"varint,6,opt,name=tier,proto3" json:"tier,omitempty"` + TargetAction string `protobuf:"bytes,7,opt,name=targetAction,proto3" json:"targetAction,omitempty"` + Threshold int64 `protobuf:"varint,8,opt,name=threshold,proto3" json:"threshold,omitempty"` + RewardSunlight int64 `protobuf:"varint,9,opt,name=rewardSunlight,proto3" json:"rewardSunlight,omitempty"` + IconId string `protobuf:"bytes,10,opt,name=iconId,proto3" json:"iconId,omitempty"` + Sort int32 `protobuf:"varint,11,opt,name=sort,proto3" json:"sort,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateBadgeConfigReq) Reset() { + *x = UpdateBadgeConfigReq{} + mi := &file_pb_plant_proto_msgTypes[70] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateBadgeConfigReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateBadgeConfigReq) ProtoMessage() {} + +func (x *UpdateBadgeConfigReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[70] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateBadgeConfigReq.ProtoReflect.Descriptor instead. +func (*UpdateBadgeConfigReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{70} +} + +func (x *UpdateBadgeConfigReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateBadgeConfigReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateBadgeConfigReq) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *UpdateBadgeConfigReq) GetDimension() string { + if x != nil { + return x.Dimension + } + return "" +} + +func (x *UpdateBadgeConfigReq) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *UpdateBadgeConfigReq) GetTier() int32 { + if x != nil { + return x.Tier + } + return 0 +} + +func (x *UpdateBadgeConfigReq) GetTargetAction() string { + if x != nil { + return x.TargetAction + } + return "" +} + +func (x *UpdateBadgeConfigReq) GetThreshold() int64 { + if x != nil { + return x.Threshold + } + return 0 +} + +func (x *UpdateBadgeConfigReq) GetRewardSunlight() int64 { + if x != nil { + return x.RewardSunlight + } + return 0 +} + +func (x *UpdateBadgeConfigReq) GetIconId() string { + if x != nil { + return x.IconId + } + return "" +} + +func (x *UpdateBadgeConfigReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +type CompleteTaskReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + TaskId string `protobuf:"bytes,2,opt,name=taskId,proto3" json:"taskId,omitempty"` + Remark string `protobuf:"bytes,3,opt,name=remark,proto3" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CompleteTaskReq) Reset() { + *x = CompleteTaskReq{} + mi := &file_pb_plant_proto_msgTypes[71] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CompleteTaskReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompleteTaskReq) ProtoMessage() {} + +func (x *CompleteTaskReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[71] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CompleteTaskReq.ProtoReflect.Descriptor instead. +func (*CompleteTaskReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{71} +} + +func (x *CompleteTaskReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *CompleteTaskReq) GetTaskId() string { + if x != nil { + return x.TaskId + } + return "" +} + +func (x *CompleteTaskReq) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +type TaskCompletionResult struct { + state protoimpl.MessageState `protogen:"open.v1"` + IsLevelUp bool `protobuf:"varint,1,opt,name=isLevelUp,proto3" json:"isLevelUp,omitempty"` + CurrentLevel *LevelConfigInfo `protobuf:"bytes,2,opt,name=currentLevel,proto3" json:"currentLevel,omitempty"` + IsGetBadge bool `protobuf:"varint,3,opt,name=isGetBadge,proto3" json:"isGetBadge,omitempty"` + NewBadge *BadgeConfigInfo `protobuf:"bytes,4,opt,name=newBadge,proto3" json:"newBadge,omitempty"` + RewardSunlight int64 `protobuf:"varint,5,opt,name=rewardSunlight,proto3" json:"rewardSunlight,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TaskCompletionResult) Reset() { + *x = TaskCompletionResult{} + mi := &file_pb_plant_proto_msgTypes[72] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TaskCompletionResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskCompletionResult) ProtoMessage() {} + +func (x *TaskCompletionResult) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[72] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TaskCompletionResult.ProtoReflect.Descriptor instead. +func (*TaskCompletionResult) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{72} +} + +func (x *TaskCompletionResult) GetIsLevelUp() bool { + if x != nil { + return x.IsLevelUp + } + return false +} + +func (x *TaskCompletionResult) GetCurrentLevel() *LevelConfigInfo { + if x != nil { + return x.CurrentLevel + } + return nil +} + +func (x *TaskCompletionResult) GetIsGetBadge() bool { + if x != nil { + return x.IsGetBadge + } + return false +} + +func (x *TaskCompletionResult) GetNewBadge() *BadgeConfigInfo { + if x != nil { + return x.NewBadge + } + return nil +} + +func (x *TaskCompletionResult) GetRewardSunlight() int64 { + if x != nil { + return x.RewardSunlight + } + return 0 +} + +type BadgeGroupInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + GroupId string `protobuf:"bytes,1,opt,name=groupId,proto3" json:"groupId,omitempty"` + Dimension string `protobuf:"bytes,2,opt,name=dimension,proto3" json:"dimension,omitempty"` + Badges []*BadgeConfigInfo `protobuf:"bytes,3,rep,name=badges,proto3" json:"badges,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BadgeGroupInfo) Reset() { + *x = BadgeGroupInfo{} + mi := &file_pb_plant_proto_msgTypes[73] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BadgeGroupInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BadgeGroupInfo) ProtoMessage() {} + +func (x *BadgeGroupInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[73] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BadgeGroupInfo.ProtoReflect.Descriptor instead. +func (*BadgeGroupInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{73} +} + +func (x *BadgeGroupInfo) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *BadgeGroupInfo) GetDimension() string { + if x != nil { + return x.Dimension + } + return "" +} + +func (x *BadgeGroupInfo) GetBadges() []*BadgeConfigInfo { + if x != nil { + return x.Badges + } + return nil +} + +type BadgeConfigTreeResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Groups []*BadgeGroupInfo `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BadgeConfigTreeResp) Reset() { + *x = BadgeConfigTreeResp{} + mi := &file_pb_plant_proto_msgTypes[74] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BadgeConfigTreeResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BadgeConfigTreeResp) ProtoMessage() {} + +func (x *BadgeConfigTreeResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[74] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BadgeConfigTreeResp.ProtoReflect.Descriptor instead. +func (*BadgeConfigTreeResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{74} +} + +func (x *BadgeConfigTreeResp) GetGroups() []*BadgeGroupInfo { + if x != nil { + return x.Groups + } + return nil +} + +type AiQuotaResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Remaining int64 `protobuf:"varint,1,opt,name=remaining,proto3" json:"remaining,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + Used int64 `protobuf:"varint,3,opt,name=used,proto3" json:"used,omitempty"` + Limit int64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AiQuotaResp) Reset() { + *x = AiQuotaResp{} + mi := &file_pb_plant_proto_msgTypes[75] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AiQuotaResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AiQuotaResp) ProtoMessage() {} + +func (x *AiQuotaResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[75] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AiQuotaResp.ProtoReflect.Descriptor instead. +func (*AiQuotaResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{75} +} + +func (x *AiQuotaResp) GetRemaining() int64 { + if x != nil { + return x.Remaining + } + return 0 +} + +func (x *AiQuotaResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *AiQuotaResp) GetUsed() int64 { + if x != nil { + return x.Used + } + return 0 +} + +func (x *AiQuotaResp) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +type AiChatHistoryInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` + Question string `protobuf:"bytes,3,opt,name=question,proto3" json:"question,omitempty"` + Answer string `protobuf:"bytes,4,opt,name=answer,proto3" json:"answer,omitempty"` + CreatedAt string `protobuf:"bytes,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AiChatHistoryInfo) Reset() { + *x = AiChatHistoryInfo{} + mi := &file_pb_plant_proto_msgTypes[76] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AiChatHistoryInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AiChatHistoryInfo) ProtoMessage() {} + +func (x *AiChatHistoryInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[76] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AiChatHistoryInfo.ProtoReflect.Descriptor instead. +func (*AiChatHistoryInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{76} +} + +func (x *AiChatHistoryInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *AiChatHistoryInfo) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *AiChatHistoryInfo) GetQuestion() string { + if x != nil { + return x.Question + } + return "" +} + +func (x *AiChatHistoryInfo) GetAnswer() string { + if x != nil { + return x.Answer + } + return "" +} + +func (x *AiChatHistoryInfo) GetCreatedAt() string { + if x != nil { + return x.CreatedAt + } + return "" +} + +type AiChatHistoryReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + Current int32 `protobuf:"varint,2,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AiChatHistoryReq) Reset() { + *x = AiChatHistoryReq{} + mi := &file_pb_plant_proto_msgTypes[77] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AiChatHistoryReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AiChatHistoryReq) ProtoMessage() {} + +func (x *AiChatHistoryReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[77] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AiChatHistoryReq.ProtoReflect.Descriptor instead. +func (*AiChatHistoryReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{77} +} + +func (x *AiChatHistoryReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *AiChatHistoryReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *AiChatHistoryReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type AiChatHistoryResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*AiChatHistoryInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AiChatHistoryResp) Reset() { + *x = AiChatHistoryResp{} + mi := &file_pb_plant_proto_msgTypes[78] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AiChatHistoryResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AiChatHistoryResp) ProtoMessage() {} + +func (x *AiChatHistoryResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[78] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AiChatHistoryResp.ProtoReflect.Descriptor instead. +func (*AiChatHistoryResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{78} +} + +func (x *AiChatHistoryResp) GetList() []*AiChatHistoryInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *AiChatHistoryResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +var File_pb_plant_proto protoreflect.FileDescriptor + +const file_pb_plant_proto_rawDesc = "" + + "\n" + + "\x0epb/plant.proto\x12\x05plant\"2\n" + + "\n" + + "CommonResp\x12\x12\n" + + "\x04code\x18\x01 \x01(\x03R\x04code\x12\x10\n" + + "\x03msg\x18\x02 \x01(\tR\x03msg\"\x17\n" + + "\x05IdReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"\x1a\n" + + "\x06IdsReq\x12\x10\n" + + "\x03ids\x18\x01 \x03(\tR\x03ids\"?\n" + + "\aPageReq\x12\x18\n" + + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\"\xe0\x03\n" + + "\x10PlantUserProfile\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x1a\n" + + "\bnickName\x18\x03 \x01(\tR\bnickName\x12\x1a\n" + + "\bavatarId\x18\x04 \x01(\tR\bavatarId\x12\x18\n" + + "\alevelId\x18\x05 \x01(\tR\alevelId\x12(\n" + + "\x0fcurrentSunlight\x18\x06 \x01(\x03R\x0fcurrentSunlight\x12$\n" + + "\rtotalSunlight\x18\a \x01(\x03R\rtotalSunlight\x12\x1e\n" + + "\n" + + "plantCount\x18\b \x01(\x03R\n" + + "plantCount\x12\x1c\n" + + "\tcareCount\x18\t \x01(\x03R\tcareCount\x12\x1c\n" + + "\tpostCount\x18\n" + + " \x01(\x03R\tpostCount\x12\x1e\n" + + "\n" + + "waterCount\x18\v \x01(\x03R\n" + + "waterCount\x12&\n" + + "\x0efertilizeCount\x18\f \x01(\x03R\x0efertilizeCount\x12\x1e\n" + + "\n" + + "repotCount\x18\r \x01(\x03R\n" + + "repotCount\x12\x1e\n" + + "\n" + + "pruneCount\x18\x0e \x01(\x03R\n" + + "pruneCount\x12\x1e\n" + + "\n" + + "photoCount\x18\x0f \x01(\x03R\n" + + "photoCount\"'\n" + + "\rGetProfileReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\"b\n" + + "\x10UpdateProfileReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x1a\n" + + "\bnickName\x18\x02 \x01(\tR\bnickName\x12\x1a\n" + + "\bavatarId\x18\x03 \x01(\tR\bavatarId\"\xa7\x01\n" + + "\rUserBadgeInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n" + + "\abadgeId\x18\x02 \x01(\tR\abadgeId\x12\x1c\n" + + "\tbadgeName\x18\x03 \x01(\tR\tbadgeName\x12\x1c\n" + + "\tdimension\x18\x04 \x01(\tR\tdimension\x12\x12\n" + + "\x04tier\x18\x05 \x01(\x05R\x04tier\x12\x1c\n" + + "\tawardedAt\x18\x06 \x01(\tR\tawardedAt\"=\n" + + "\x11UserBadgeListResp\x12(\n" + + "\x04list\x18\x01 \x03(\v2\x14.plant.UserBadgeInfoR\x04list\"l\n" + + "\fUserStarInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + + "\btargetId\x18\x02 \x01(\tR\btargetId\x12\x12\n" + + "\x04type\x18\x03 \x01(\tR\x04type\x12\x1c\n" + + "\tcreatedAt\x18\x04 \x01(\tR\tcreatedAt\"Q\n" + + "\x10UserStarListResp\x12'\n" + + "\x04list\x18\x01 \x03(\v2\x13.plant.UserStarInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\xd5\x02\n" + + "\tPlantInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x1c\n" + + "\tplantTime\x18\x04 \x01(\tR\tplantTime\x12\x16\n" + + "\x06status\x18\x05 \x01(\x05R\x06status\x12\x1c\n" + + "\tplacement\x18\x06 \x01(\tR\tplacement\x12 \n" + + "\vpotMaterial\x18\a \x01(\tR\vpotMaterial\x12\x18\n" + + "\apotSize\x18\b \x01(\tR\apotSize\x12\x1a\n" + + "\bsunlight\x18\t \x01(\tR\bsunlight\x12*\n" + + "\x10plantingMaterial\x18\n" + + " \x01(\tR\x10plantingMaterial\x12\x16\n" + + "\x06imgIds\x18\v \x03(\tR\x06imgIds\x12\x1c\n" + + "\tcreatedAt\x18\f \x01(\x03R\tcreatedAt\"\x94\x02\n" + + "\x0eCreatePlantReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1c\n" + + "\tplantTime\x18\x03 \x01(\tR\tplantTime\x12\x1c\n" + + "\tplacement\x18\x04 \x01(\tR\tplacement\x12 \n" + + "\vpotMaterial\x18\x05 \x01(\tR\vpotMaterial\x12\x18\n" + + "\apotSize\x18\x06 \x01(\tR\apotSize\x12\x1a\n" + + "\bsunlight\x18\a \x01(\tR\bsunlight\x12*\n" + + "\x10plantingMaterial\x18\b \x01(\tR\x10plantingMaterial\x12\x16\n" + + "\x06imgIds\x18\t \x03(\tR\x06imgIds\"\x86\x02\n" + + "\x0eUpdatePlantReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + + "\x06status\x18\x03 \x01(\x05R\x06status\x12\x1c\n" + + "\tplacement\x18\x04 \x01(\tR\tplacement\x12 \n" + + "\vpotMaterial\x18\x05 \x01(\tR\vpotMaterial\x12\x18\n" + + "\apotSize\x18\x06 \x01(\tR\apotSize\x12\x1a\n" + + "\bsunlight\x18\a \x01(\tR\bsunlight\x12*\n" + + "\x10plantingMaterial\x18\b \x01(\tR\x10plantingMaterial\x12\x16\n" + + "\x06imgIds\x18\t \x03(\tR\x06imgIds\"p\n" + + "\fPlantListReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x18\n" + + "\acurrent\x18\x02 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x03 \x01(\x05R\bpageSize\x12\x12\n" + + "\x04name\x18\x04 \x01(\tR\x04name\"K\n" + + "\rPlantListResp\x12$\n" + + "\x04list\x18\x01 \x03(\v2\x10.plant.PlantInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\xab\x01\n" + + "\x0fPlantDetailResp\x12&\n" + + "\x05plant\x18\x01 \x01(\v2\x10.plant.PlantInfoR\x05plant\x121\n" + + "\tcarePlans\x18\x02 \x03(\v2\x13.plant.CarePlanInfoR\tcarePlans\x12=\n" + + "\rgrowthRecords\x18\x03 \x03(\v2\x17.plant.GrowthRecordInfoR\rgrowthRecords\"\x9c\x01\n" + + "\fCarePlanInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n" + + "\aplantId\x18\x02 \x01(\tR\aplantId\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x12\n" + + "\x04icon\x18\x04 \x01(\tR\x04icon\x12\"\n" + + "\ftargetAction\x18\x05 \x01(\tR\ftargetAction\x12\x16\n" + + "\x06period\x18\x06 \x01(\x05R\x06period\"\xa6\x01\n" + + "\x0eAddCarePlanReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x18\n" + + "\aplantId\x18\x02 \x01(\tR\aplantId\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x12\n" + + "\x04icon\x18\x04 \x01(\tR\x04icon\x12\"\n" + + "\ftargetAction\x18\x05 \x01(\tR\ftargetAction\x12\x16\n" + + "\x06period\x18\x06 \x01(\x05R\x06period\"\xce\x01\n" + + "\fCareTaskInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n" + + "\aplantId\x18\x02 \x01(\tR\aplantId\x12\x16\n" + + "\x06planId\x18\x03 \x01(\tR\x06planId\x12\x12\n" + + "\x04name\x18\x04 \x01(\tR\x04name\x12\x12\n" + + "\x04icon\x18\x05 \x01(\tR\x04icon\x12\"\n" + + "\ftargetAction\x18\x06 \x01(\tR\ftargetAction\x12\x18\n" + + "\adueDate\x18\a \x01(\tR\adueDate\x12\x16\n" + + "\x06status\x18\b \x01(\x05R\x06status\"Q\n" + + "\x10CareTaskListResp\x12'\n" + + "\x04list\x18\x01 \x03(\v2\x13.plant.CareTaskInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\x88\x01\n" + + "\x10AddCareRecordReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x18\n" + + "\aplantId\x18\x02 \x01(\tR\aplantId\x12\x16\n" + + "\x06planId\x18\x03 \x01(\tR\x06planId\x12\x16\n" + + "\x06action\x18\x04 \x01(\tR\x06action\x12\x12\n" + + "\x04note\x18\x05 \x01(\tR\x04note\"t\n" + + "\x10GrowthRecordInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n" + + "\aplantId\x18\x02 \x01(\tR\aplantId\x12\x18\n" + + "\acontent\x18\x03 \x01(\tR\acontent\x12\x1c\n" + + "\tcreatedAt\x18\x04 \x01(\x03R\tcreatedAt\"x\n" + + "\x12AddGrowthRecordReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x18\n" + + "\aplantId\x18\x02 \x01(\tR\aplantId\x12\x18\n" + + "\acontent\x18\x03 \x01(\tR\acontent\x12\x16\n" + + "\x06imgIds\x18\x04 \x03(\tR\x06imgIds\"\x90\b\n" + + "\bWikiInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1c\n" + + "\tlatinName\x18\x03 \x01(\tR\tlatinName\x12\x18\n" + + "\aaliases\x18\x04 \x01(\tR\aaliases\x12\x14\n" + + "\x05genus\x18\x05 \x01(\tR\x05genus\x12\x1e\n" + + "\n" + + "difficulty\x18\x06 \x01(\x05R\n" + + "difficulty\x12\x14\n" + + "\x05isHot\x18\a \x01(\x05R\x05isHot\x12 \n" + + "\vgrowthHabit\x18\b \x01(\tR\vgrowthHabit\x12&\n" + + "\x0elightIntensity\x18\t \x01(\tR\x0elightIntensity\x12,\n" + + "\x11optimalTempPeriod\x18\n" + + " \x01(\tR\x11optimalTempPeriod\x12\x1c\n" + + "\tcreatedAt\x18\v \x01(\x03R\tcreatedAt\x12\x18\n" + + "\aclassId\x18\f \x01(\tR\aclassId\x12*\n" + + "\x10distributionArea\x18\r \x01(\tR\x10distributionArea\x12\x1c\n" + + "\tlifeCycle\x18\x0e \x01(\tR\tlifeCycle\x12\x1a\n" + + "\bclassIds\x18\x0f \x03(\tR\bclassIds\x12\x16\n" + + "\x06ossIds\x18\x10 \x03(\tR\x06ossIds\x12&\n" + + "\x0erelatedWikiIds\x18\x11 \x03(\tR\x0erelatedWikiIds\x12&\n" + + "\x0eisVectorSynced\x18\x12 \x01(\bR\x0eisVectorSynced\x12\x16\n" + + "\x06isStar\x18\x13 \x01(\bR\x06isStar\x12.\n" + + "\x12reproductionMethod\x18\x14 \x01(\tR\x12reproductionMethod\x12$\n" + + "\rpestsDiseases\x18\x15 \x01(\tR\rpestsDiseases\x12\x1c\n" + + "\tlightType\x18\x16 \x01(\tR\tlightType\x12\x12\n" + + "\x04stem\x18\x17 \x01(\tR\x04stem\x12\x14\n" + + "\x05fruit\x18\x18 \x01(\tR\x05fruit\x12 \n" + + "\vfoliageType\x18\x19 \x01(\tR\vfoliageType\x12\"\n" + + "\ffoliageColor\x18\x1a \x01(\tR\ffoliageColor\x12\"\n" + + "\ffoliageShape\x18\x1b \x01(\tR\ffoliageShape\x12\x16\n" + + "\x06height\x18\x1c \x01(\x05R\x06height\x12(\n" + + "\x0ffloweringPeriod\x18\x1d \x01(\tR\x0ffloweringPeriod\x12&\n" + + "\x0efloweringColor\x18\x1e \x01(\tR\x0efloweringColor\x12&\n" + + "\x0efloweringShape\x18\x1f \x01(\tR\x0efloweringShape\x12,\n" + + "\x11floweringDiameter\x18 \x01(\x05R\x11floweringDiameter\"\x87\x01\n" + + "\vWikiListReq\x12\x18\n" + + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x18\n" + + "\aclassId\x18\x04 \x01(\tR\aclassId\x12\x14\n" + + "\x05isHot\x18\x05 \x01(\x05R\x05isHot\"I\n" + + "\fWikiListResp\x12#\n" + + "\x04list\x18\x01 \x03(\v2\x0f.plant.WikiInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"5\n" + + "\x0eWikiDetailResp\x12#\n" + + "\x04wiki\x18\x01 \x01(\v2\x0f.plant.WikiInfoR\x04wiki\"\xa7\a\n" + + "\rCreateWikiReq\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x1c\n" + + "\tlatinName\x18\x02 \x01(\tR\tlatinName\x12\x18\n" + + "\aaliases\x18\x03 \x01(\tR\aaliases\x12\x14\n" + + "\x05genus\x18\x04 \x01(\tR\x05genus\x12\x1e\n" + + "\n" + + "difficulty\x18\x05 \x01(\x05R\n" + + "difficulty\x12\x14\n" + + "\x05isHot\x18\x06 \x01(\x05R\x05isHot\x12 \n" + + "\vgrowthHabit\x18\a \x01(\tR\vgrowthHabit\x12&\n" + + "\x0elightIntensity\x18\b \x01(\tR\x0elightIntensity\x12,\n" + + "\x11optimalTempPeriod\x18\t \x01(\tR\x11optimalTempPeriod\x12\x18\n" + + "\aclassId\x18\n" + + " \x01(\tR\aclassId\x12*\n" + + "\x10distributionArea\x18\v \x01(\tR\x10distributionArea\x12\x1c\n" + + "\tlifeCycle\x18\f \x01(\tR\tlifeCycle\x12\x1a\n" + + "\bclassIds\x18\r \x03(\tR\bclassIds\x12\x16\n" + + "\x06ossIds\x18\x0e \x03(\tR\x06ossIds\x12&\n" + + "\x0erelatedWikiIds\x18\x0f \x03(\tR\x0erelatedWikiIds\x12.\n" + + "\x12reproductionMethod\x18\x10 \x01(\tR\x12reproductionMethod\x12$\n" + + "\rpestsDiseases\x18\x11 \x01(\tR\rpestsDiseases\x12\x1c\n" + + "\tlightType\x18\x12 \x01(\tR\tlightType\x12\x12\n" + + "\x04stem\x18\x13 \x01(\tR\x04stem\x12\x14\n" + + "\x05fruit\x18\x14 \x01(\tR\x05fruit\x12 \n" + + "\vfoliageType\x18\x15 \x01(\tR\vfoliageType\x12\"\n" + + "\ffoliageColor\x18\x16 \x01(\tR\ffoliageColor\x12\"\n" + + "\ffoliageShape\x18\x17 \x01(\tR\ffoliageShape\x12\x16\n" + + "\x06height\x18\x18 \x01(\x05R\x06height\x12(\n" + + "\x0ffloweringPeriod\x18\x19 \x01(\tR\x0ffloweringPeriod\x12&\n" + + "\x0efloweringColor\x18\x1a \x01(\tR\x0efloweringColor\x12&\n" + + "\x0efloweringShape\x18\x1b \x01(\tR\x0efloweringShape\x12,\n" + + "\x11floweringDiameter\x18\x1c \x01(\x05R\x11floweringDiameter\"\xb7\a\n" + + "\rUpdateWikiReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1c\n" + + "\tlatinName\x18\x03 \x01(\tR\tlatinName\x12\x18\n" + + "\aaliases\x18\x04 \x01(\tR\aaliases\x12\x14\n" + + "\x05genus\x18\x05 \x01(\tR\x05genus\x12\x1e\n" + + "\n" + + "difficulty\x18\x06 \x01(\x05R\n" + + "difficulty\x12\x14\n" + + "\x05isHot\x18\a \x01(\x05R\x05isHot\x12 \n" + + "\vgrowthHabit\x18\b \x01(\tR\vgrowthHabit\x12&\n" + + "\x0elightIntensity\x18\t \x01(\tR\x0elightIntensity\x12,\n" + + "\x11optimalTempPeriod\x18\n" + + " \x01(\tR\x11optimalTempPeriod\x12\x18\n" + + "\aclassId\x18\v \x01(\tR\aclassId\x12*\n" + + "\x10distributionArea\x18\f \x01(\tR\x10distributionArea\x12\x1c\n" + + "\tlifeCycle\x18\r \x01(\tR\tlifeCycle\x12\x1a\n" + + "\bclassIds\x18\x0e \x03(\tR\bclassIds\x12\x16\n" + + "\x06ossIds\x18\x0f \x03(\tR\x06ossIds\x12&\n" + + "\x0erelatedWikiIds\x18\x10 \x03(\tR\x0erelatedWikiIds\x12.\n" + + "\x12reproductionMethod\x18\x11 \x01(\tR\x12reproductionMethod\x12$\n" + + "\rpestsDiseases\x18\x12 \x01(\tR\rpestsDiseases\x12\x1c\n" + + "\tlightType\x18\x13 \x01(\tR\tlightType\x12\x12\n" + + "\x04stem\x18\x14 \x01(\tR\x04stem\x12\x14\n" + + "\x05fruit\x18\x15 \x01(\tR\x05fruit\x12 \n" + + "\vfoliageType\x18\x16 \x01(\tR\vfoliageType\x12\"\n" + + "\ffoliageColor\x18\x17 \x01(\tR\ffoliageColor\x12\"\n" + + "\ffoliageShape\x18\x18 \x01(\tR\ffoliageShape\x12\x16\n" + + "\x06height\x18\x19 \x01(\x05R\x06height\x12(\n" + + "\x0ffloweringPeriod\x18\x1a \x01(\tR\x0ffloweringPeriod\x12&\n" + + "\x0efloweringColor\x18\x1b \x01(\tR\x0efloweringColor\x12&\n" + + "\x0efloweringShape\x18\x1c \x01(\tR\x0efloweringShape\x12,\n" + + "\x11floweringDiameter\x18\x1d \x01(\x05R\x11floweringDiameter\"I\n" + + "\rWikiClassInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + + "\x05ossId\x18\x03 \x01(\tR\x05ossId\"=\n" + + "\x11WikiClassListResp\x12(\n" + + "\x04list\x18\x01 \x03(\v2\x14.plant.WikiClassInfoR\x04list\"<\n" + + "\x12CreateWikiClassReq\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + + "\x04icon\x18\x02 \x01(\tR\x04icon\"L\n" + + "\x12UpdateWikiClassReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04icon\x18\x03 \x01(\tR\x04icon\"W\n" + + "\rToggleStarReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x1a\n" + + "\btargetId\x18\x02 \x01(\tR\btargetId\x12\x12\n" + + "\x04type\x18\x03 \x01(\tR\x04type\"\x8b\x01\n" + + "\x0fClassifyLogInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x1a\n" + + "\bimageUrl\x18\x03 \x01(\tR\bimageUrl\x12\x16\n" + + "\x06result\x18\x04 \x01(\tR\x06result\x12\x1c\n" + + "\tcreatedAt\x18\x05 \x01(\tR\tcreatedAt\"W\n" + + "\x13ClassifyLogListResp\x12*\n" + + "\x04list\x18\x01 \x03(\v2\x16.plant.ClassifyLogInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\xb4\x02\n" + + "\bPostInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x14\n" + + "\x05title\x18\x03 \x01(\tR\x05title\x12\x18\n" + + "\acontent\x18\x04 \x01(\tR\acontent\x12\x1c\n" + + "\tviewCount\x18\x05 \x01(\x05R\tviewCount\x12\"\n" + + "\fcommentCount\x18\x06 \x01(\x05R\fcommentCount\x12\x1c\n" + + "\tlikeCount\x18\a \x01(\x05R\tlikeCount\x12\x1c\n" + + "\tstarCount\x18\b \x01(\x05R\tstarCount\x12\x1a\n" + + "\blocation\x18\t \x01(\tR\blocation\x12\x1c\n" + + "\tcreatedAt\x18\n" + + " \x01(\x03R\tcreatedAt\x12\x18\n" + + "\atopicId\x18\v \x01(\tR\atopicId\"\xa5\x01\n" + + "\rCreatePostReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x14\n" + + "\x05title\x18\x02 \x01(\tR\x05title\x12\x18\n" + + "\acontent\x18\x03 \x01(\tR\acontent\x12\x1a\n" + + "\blocation\x18\x04 \x01(\tR\blocation\x12\x16\n" + + "\x06imgIds\x18\x05 \x03(\tR\x06imgIds\x12\x18\n" + + "\atopicId\x18\x06 \x01(\tR\atopicId\"\x8f\x01\n" + + "\vPostListReq\x12\x18\n" + + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x18\n" + + "\akeyword\x18\x03 \x01(\tR\akeyword\x12\x18\n" + + "\atopicId\x18\x04 \x01(\tR\atopicId\x12\x16\n" + + "\x06userId\x18\x05 \x01(\tR\x06userId\"I\n" + + "\fPostListResp\x12#\n" + + "\x04list\x18\x01 \x03(\v2\x0f.plant.PostInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"i\n" + + "\x0ePostDetailResp\x12#\n" + + "\x04post\x18\x01 \x01(\v2\x0f.plant.PostInfoR\x04post\x122\n" + + "\bcomments\x18\x02 \x03(\v2\x16.plant.PostCommentInfoR\bcomments\"\x8d\x01\n" + + "\x0fPostCommentInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x18\n" + + "\acontent\x18\x03 \x01(\tR\acontent\x12\x1a\n" + + "\bparentId\x18\x04 \x01(\tR\bparentId\x12\x1c\n" + + "\tcreatedAt\x18\x05 \x01(\x03R\tcreatedAt\"v\n" + + "\x0eCommentPostReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x16\n" + + "\x06postId\x18\x02 \x01(\tR\x06postId\x12\x18\n" + + "\acontent\x18\x03 \x01(\tR\acontent\x12\x1a\n" + + "\bparentId\x18\x04 \x01(\tR\bparentId\"=\n" + + "\vLikePostReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x16\n" + + "\x06postId\x18\x02 \x01(\tR\x06postId\"\xdb\x01\n" + + "\tTopicInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1c\n" + + "\tpostCount\x18\x03 \x01(\x05R\tpostCount\x12\x12\n" + + "\x04icon\x18\x04 \x01(\tR\x04icon\x12\x12\n" + + "\x04desc\x18\x05 \x01(\tR\x04desc\x12\x14\n" + + "\x05title\x18\x06 \x01(\tR\x05title\x12\x16\n" + + "\x06remark\x18\a \x01(\tR\x06remark\x12\x1c\n" + + "\tstartTime\x18\b \x01(\tR\tstartTime\x12\x18\n" + + "\aendTime\x18\t \x01(\tR\aendTime\"5\n" + + "\rTopicListResp\x12$\n" + + "\x04list\x18\x01 \x03(\v2\x10.plant.TopicInfoR\x04list\"\xb2\x01\n" + + "\x0eCreateTopicReq\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + + "\x04icon\x18\x02 \x01(\tR\x04icon\x12\x12\n" + + "\x04desc\x18\x03 \x01(\tR\x04desc\x12\x14\n" + + "\x05title\x18\x04 \x01(\tR\x05title\x12\x16\n" + + "\x06remark\x18\x05 \x01(\tR\x06remark\x12\x1c\n" + + "\tstartTime\x18\x06 \x01(\tR\tstartTime\x12\x18\n" + + "\aendTime\x18\a \x01(\tR\aendTime\"\xc2\x01\n" + + "\x0eUpdateTopicReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04icon\x18\x03 \x01(\tR\x04icon\x12\x12\n" + + "\x04desc\x18\x04 \x01(\tR\x04desc\x12\x14\n" + + "\x05title\x18\x05 \x01(\tR\x05title\x12\x16\n" + + "\x06remark\x18\x06 \x01(\tR\x06remark\x12\x1c\n" + + "\tstartTime\x18\a \x01(\tR\tstartTime\x12\x18\n" + + "\aendTime\x18\b \x01(\tR\aendTime\"\xa2\x01\n" + + "\x10ExchangeItemInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04desc\x18\x03 \x01(\tR\x04desc\x12\x14\n" + + "\x05imgId\x18\x04 \x01(\tR\x05imgId\x12\x12\n" + + "\x04cost\x18\x05 \x01(\x03R\x04cost\x12\x14\n" + + "\x05stock\x18\x06 \x01(\x05R\x05stock\x12\x16\n" + + "\x06status\x18\a \x01(\x05R\x06status\"c\n" + + "\x13ExchangeItemListReq\x12\x18\n" + + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x16\n" + + "\x06status\x18\x03 \x01(\x05R\x06status\"Y\n" + + "\x14ExchangeItemListResp\x12+\n" + + "\x04list\x18\x01 \x03(\v2\x17.plant.ExchangeItemInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\xba\x01\n" + + "\x16CreateExchangeOrderReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x16\n" + + "\x06itemId\x18\x02 \x01(\tR\x06itemId\x12\x1a\n" + + "\bquantity\x18\x03 \x01(\x05R\bquantity\x12$\n" + + "\rrecipientName\x18\x04 \x01(\tR\rrecipientName\x12\x14\n" + + "\x05phone\x18\x05 \x01(\tR\x05phone\x12\x18\n" + + "\aaddress\x18\x06 \x01(\tR\aaddress\"\xc1\x02\n" + + "\x15CreateExchangeItemReq\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + + "\x04desc\x18\x02 \x01(\tR\x04desc\x12\x14\n" + + "\x05imgId\x18\x03 \x01(\tR\x05imgId\x12\x12\n" + + "\x04cost\x18\x04 \x01(\x03R\x04cost\x12\x14\n" + + "\x05stock\x18\x05 \x01(\x05R\x05stock\x12\x12\n" + + "\x04type\x18\x06 \x01(\tR\x04type\x12\"\n" + + "\fcostSunlight\x18\a \x01(\x03R\fcostSunlight\x12\"\n" + + "\flimitPerUser\x18\b \x01(\x05R\flimitPerUser\x12\x12\n" + + "\x04sort\x18\t \x01(\x05R\x04sort\x12\x1c\n" + + "\tstartTime\x18\n" + + " \x01(\tR\tstartTime\x12\x18\n" + + "\aendTime\x18\v \x01(\tR\aendTime\x12\x18\n" + + "\aimageId\x18\f \x01(\tR\aimageId\"\xe9\x02\n" + + "\x15UpdateExchangeItemReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04desc\x18\x03 \x01(\tR\x04desc\x12\x14\n" + + "\x05imgId\x18\x04 \x01(\tR\x05imgId\x12\x12\n" + + "\x04cost\x18\x05 \x01(\x03R\x04cost\x12\x14\n" + + "\x05stock\x18\x06 \x01(\x05R\x05stock\x12\x16\n" + + "\x06status\x18\a \x01(\x05R\x06status\x12\x12\n" + + "\x04type\x18\b \x01(\tR\x04type\x12\"\n" + + "\fcostSunlight\x18\t \x01(\x03R\fcostSunlight\x12\"\n" + + "\flimitPerUser\x18\n" + + " \x01(\x05R\flimitPerUser\x12\x12\n" + + "\x04sort\x18\v \x01(\x05R\x04sort\x12\x1c\n" + + "\tstartTime\x18\f \x01(\tR\tstartTime\x12\x18\n" + + "\aendTime\x18\r \x01(\tR\aendTime\x12\x18\n" + + "\aimageId\x18\x0e \x01(\tR\aimageId\"\xa1\x03\n" + + "\x11ExchangeOrderInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x16\n" + + "\x06itemId\x18\x03 \x01(\tR\x06itemId\x12\x1a\n" + + "\bitemName\x18\x04 \x01(\tR\bitemName\x12\x12\n" + + "\x04cost\x18\x05 \x01(\x03R\x04cost\x12\x16\n" + + "\x06status\x18\x06 \x01(\x05R\x06status\x12\x18\n" + + "\aaddress\x18\a \x01(\tR\aaddress\x12\x1c\n" + + "\tcreatedAt\x18\b \x01(\tR\tcreatedAt\x12\x1a\n" + + "\bquantity\x18\t \x01(\x05R\bquantity\x12\x1a\n" + + "\bitemType\x18\n" + + " \x01(\tR\bitemType\x12$\n" + + "\rrecipientName\x18\v \x01(\tR\rrecipientName\x12\x14\n" + + "\x05phone\x18\f \x01(\tR\x05phone\x12\x1e\n" + + "\n" + + "trackingNo\x18\r \x01(\tR\n" + + "trackingNo\x12\x16\n" + + "\x06remark\x18\x0e \x01(\tR\x06remark\x12 \n" + + "\vcompletedAt\x18\x0f \x01(\tR\vcompletedAt\"|\n" + + "\x14ExchangeOrderListReq\x12\x18\n" + + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x16\n" + + "\x06userId\x18\x03 \x01(\tR\x06userId\x12\x16\n" + + "\x06status\x18\x04 \x01(\x05R\x06status\"[\n" + + "\x15ExchangeOrderListResp\x12,\n" + + "\x04list\x18\x01 \x03(\v2\x18.plant.ExchangeOrderInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"x\n" + + "\x16UpdateExchangeOrderReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + + "\x06status\x18\x02 \x01(\x05R\x06status\x12\x1e\n" + + "\n" + + "trackingNo\x18\x03 \x01(\tR\n" + + "trackingNo\x12\x16\n" + + "\x06remark\x18\x04 \x01(\tR\x06remark\"\xbb\x01\n" + + "\x15MediaCheckCallbackReq\x12\x18\n" + + "\atraceId\x18\x01 \x01(\tR\atraceId\x12\x16\n" + + "\x06postId\x18\x02 \x01(\tR\x06postId\x12\x14\n" + + "\x05ossId\x18\x03 \x01(\tR\x05ossId\x12\x16\n" + + "\x06userId\x18\x04 \x01(\tR\x06userId\x12\x16\n" + + "\x06status\x18\x05 \x01(\x05R\x06status\x12\x12\n" + + "\x04type\x18\x06 \x01(\x05R\x04type\x12\x16\n" + + "\x06errMsg\x18\a \x01(\tR\x06errMsg\"b\n" + + "\x14SaveAiChatHistoryReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x1a\n" + + "\bquestion\x18\x02 \x01(\tR\bquestion\x12\x16\n" + + "\x06answer\x18\x03 \x01(\tR\x06answer\"+\n" + + "\x11SyncWikiVectorReq\x12\x16\n" + + "\x06wikiId\x18\x01 \x01(\tR\x06wikiId\"\x85\x01\n" + + "\x0fLevelConfigInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x14\n" + + "\x05level\x18\x02 \x01(\x05R\x05level\x12\x14\n" + + "\x05title\x18\x03 \x01(\tR\x05title\x12 \n" + + "\vminSunlight\x18\x04 \x01(\x03R\vminSunlight\x12\x14\n" + + "\x05perks\x18\x05 \x01(\tR\x05perks\"A\n" + + "\x13LevelConfigListResp\x12*\n" + + "\x04list\x18\x01 \x03(\v2\x16.plant.LevelConfigInfoR\x04list\"z\n" + + "\x14CreateLevelConfigReq\x12\x14\n" + + "\x05level\x18\x01 \x01(\x05R\x05level\x12\x14\n" + + "\x05title\x18\x02 \x01(\tR\x05title\x12 \n" + + "\vminSunlight\x18\x03 \x01(\x03R\vminSunlight\x12\x14\n" + + "\x05perks\x18\x04 \x01(\tR\x05perks\"\x8a\x01\n" + + "\x14UpdateLevelConfigReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x14\n" + + "\x05level\x18\x02 \x01(\x05R\x05level\x12\x14\n" + + "\x05title\x18\x03 \x01(\tR\x05title\x12 \n" + + "\vminSunlight\x18\x04 \x01(\x03R\vminSunlight\x12\x14\n" + + "\x05perks\x18\x05 \x01(\tR\x05perks\"\xb9\x02\n" + + "\x0fBadgeConfigInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x1c\n" + + "\tdimension\x18\x04 \x01(\tR\tdimension\x12\x18\n" + + "\agroupId\x18\x05 \x01(\tR\agroupId\x12\x12\n" + + "\x04tier\x18\x06 \x01(\x05R\x04tier\x12\"\n" + + "\ftargetAction\x18\a \x01(\tR\ftargetAction\x12\x1c\n" + + "\tthreshold\x18\b \x01(\x03R\tthreshold\x12&\n" + + "\x0erewardSunlight\x18\t \x01(\x03R\x0erewardSunlight\x12\x16\n" + + "\x06iconId\x18\n" + + " \x01(\tR\x06iconId\x12\x12\n" + + "\x04sort\x18\v \x01(\x05R\x04sort\"h\n" + + "\x12BadgeConfigListReq\x12\x18\n" + + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x1c\n" + + "\tdimension\x18\x03 \x01(\tR\tdimension\"W\n" + + "\x13BadgeConfigListResp\x12*\n" + + "\x04list\x18\x01 \x03(\v2\x16.plant.BadgeConfigInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\xae\x02\n" + + "\x14CreateBadgeConfigReq\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x02 \x01(\tR\vdescription\x12\x1c\n" + + "\tdimension\x18\x03 \x01(\tR\tdimension\x12\x18\n" + + "\agroupId\x18\x04 \x01(\tR\agroupId\x12\x12\n" + + "\x04tier\x18\x05 \x01(\x05R\x04tier\x12\"\n" + + "\ftargetAction\x18\x06 \x01(\tR\ftargetAction\x12\x1c\n" + + "\tthreshold\x18\a \x01(\x03R\tthreshold\x12&\n" + + "\x0erewardSunlight\x18\b \x01(\x03R\x0erewardSunlight\x12\x16\n" + + "\x06iconId\x18\t \x01(\tR\x06iconId\x12\x12\n" + + "\x04sort\x18\n" + + " \x01(\x05R\x04sort\"\xbe\x02\n" + + "\x14UpdateBadgeConfigReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x1c\n" + + "\tdimension\x18\x04 \x01(\tR\tdimension\x12\x18\n" + + "\agroupId\x18\x05 \x01(\tR\agroupId\x12\x12\n" + + "\x04tier\x18\x06 \x01(\x05R\x04tier\x12\"\n" + + "\ftargetAction\x18\a \x01(\tR\ftargetAction\x12\x1c\n" + + "\tthreshold\x18\b \x01(\x03R\tthreshold\x12&\n" + + "\x0erewardSunlight\x18\t \x01(\x03R\x0erewardSunlight\x12\x16\n" + + "\x06iconId\x18\n" + + " \x01(\tR\x06iconId\x12\x12\n" + + "\x04sort\x18\v \x01(\x05R\x04sort\"Y\n" + + "\x0fCompleteTaskReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x16\n" + + "\x06taskId\x18\x02 \x01(\tR\x06taskId\x12\x16\n" + + "\x06remark\x18\x03 \x01(\tR\x06remark\"\xec\x01\n" + + "\x14TaskCompletionResult\x12\x1c\n" + + "\tisLevelUp\x18\x01 \x01(\bR\tisLevelUp\x12:\n" + + "\fcurrentLevel\x18\x02 \x01(\v2\x16.plant.LevelConfigInfoR\fcurrentLevel\x12\x1e\n" + + "\n" + + "isGetBadge\x18\x03 \x01(\bR\n" + + "isGetBadge\x122\n" + + "\bnewBadge\x18\x04 \x01(\v2\x16.plant.BadgeConfigInfoR\bnewBadge\x12&\n" + + "\x0erewardSunlight\x18\x05 \x01(\x03R\x0erewardSunlight\"x\n" + + "\x0eBadgeGroupInfo\x12\x18\n" + + "\agroupId\x18\x01 \x01(\tR\agroupId\x12\x1c\n" + + "\tdimension\x18\x02 \x01(\tR\tdimension\x12.\n" + + "\x06badges\x18\x03 \x03(\v2\x16.plant.BadgeConfigInfoR\x06badges\"D\n" + + "\x13BadgeConfigTreeResp\x12-\n" + + "\x06groups\x18\x01 \x03(\v2\x15.plant.BadgeGroupInfoR\x06groups\"k\n" + + "\vAiQuotaResp\x12\x1c\n" + + "\tremaining\x18\x01 \x01(\x03R\tremaining\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\x12\x12\n" + + "\x04used\x18\x03 \x01(\x03R\x04used\x12\x14\n" + + "\x05limit\x18\x04 \x01(\x03R\x05limit\"\x8d\x01\n" + + "\x11AiChatHistoryInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x1a\n" + + "\bquestion\x18\x03 \x01(\tR\bquestion\x12\x16\n" + + "\x06answer\x18\x04 \x01(\tR\x06answer\x12\x1c\n" + + "\tcreatedAt\x18\x05 \x01(\tR\tcreatedAt\"`\n" + + "\x10AiChatHistoryReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x18\n" + + "\acurrent\x18\x02 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x03 \x01(\x05R\bpageSize\"W\n" + + "\x11AiChatHistoryResp\x12,\n" + + "\x04list\x18\x01 \x03(\v2\x18.plant.AiChatHistoryInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total2\x9c!\n" + + "\fPlantService\x12?\n" + + "\x0eGetUserProfile\x12\x14.plant.GetProfileReq\x1a\x17.plant.PlantUserProfile\x12?\n" + + "\x11UpdateUserProfile\x12\x17.plant.UpdateProfileReq\x1a\x11.plant.CommonResp\x12=\n" + + "\vGetMyBadges\x12\x14.plant.GetProfileReq\x1a\x18.plant.UserBadgeListResp\x12;\n" + + "\n" + + "GetMyStars\x12\x14.plant.GetProfileReq\x1a\x17.plant.UserStarListResp\x127\n" + + "\vCreatePlant\x12\x15.plant.CreatePlantReq\x1a\x11.plant.CommonResp\x127\n" + + "\vUpdatePlant\x12\x15.plant.UpdatePlantReq\x1a\x11.plant.CommonResp\x12/\n" + + "\vDeletePlant\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x129\n" + + "\fGetPlantList\x12\x13.plant.PlantListReq\x1a\x14.plant.PlantListResp\x126\n" + + "\x0eGetPlantDetail\x12\f.plant.IdReq\x1a\x16.plant.PlantDetailResp\x127\n" + + "\vAddCarePlan\x12\x15.plant.AddCarePlanReq\x1a\x11.plant.CommonResp\x122\n" + + "\x0eDeleteCarePlan\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x12A\n" + + "\x10GetTodayTaskList\x12\x14.plant.GetProfileReq\x1a\x17.plant.CareTaskListResp\x12C\n" + + "\fCompleteTask\x12\x16.plant.CompleteTaskReq\x1a\x1b.plant.TaskCompletionResult\x12;\n" + + "\rAddCareRecord\x12\x17.plant.AddCareRecordReq\x1a\x11.plant.CommonResp\x12?\n" + + "\x0fAddGrowthRecord\x12\x19.plant.AddGrowthRecordReq\x1a\x11.plant.CommonResp\x126\n" + + "\vGetWikiList\x12\x12.plant.WikiListReq\x1a\x13.plant.WikiListResp\x124\n" + + "\rGetWikiDetail\x12\f.plant.IdReq\x1a\x15.plant.WikiDetailResp\x125\n" + + "\n" + + "CreateWiki\x12\x14.plant.CreateWikiReq\x1a\x11.plant.CommonResp\x125\n" + + "\n" + + "UpdateWiki\x12\x14.plant.UpdateWikiReq\x1a\x11.plant.CommonResp\x12.\n" + + "\n" + + "DeleteWiki\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x12=\n" + + "\x0eSyncWikiVector\x12\x18.plant.SyncWikiVectorReq\x1a\x11.plant.CommonResp\x12?\n" + + "\x10DeleteWikiVector\x12\x18.plant.SyncWikiVectorReq\x1a\x11.plant.CommonResp\x126\n" + + "\x11SyncAllWikiVector\x12\x0e.plant.PageReq\x1a\x11.plant.CommonResp\x12:\n" + + "\x10GetWikiClassList\x12\f.plant.IdReq\x1a\x18.plant.WikiClassListResp\x12?\n" + + "\x0fCreateWikiClass\x12\x19.plant.CreateWikiClassReq\x1a\x11.plant.CommonResp\x12?\n" + + "\x0fUpdateWikiClass\x12\x19.plant.UpdateWikiClassReq\x1a\x11.plant.CommonResp\x123\n" + + "\x0fDeleteWikiClass\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x129\n" + + "\x0eToggleWikiStar\x12\x14.plant.ToggleStarReq\x1a\x11.plant.CommonResp\x12D\n" + + "\x10GetMyClassifyLog\x12\x14.plant.GetProfileReq\x1a\x1a.plant.ClassifyLogListResp\x125\n" + + "\x11DeleteClassifyLog\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x125\n" + + "\n" + + "CreatePost\x12\x14.plant.CreatePostReq\x1a\x11.plant.CommonResp\x12.\n" + + "\n" + + "DeletePost\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x126\n" + + "\vGetPostList\x12\x12.plant.PostListReq\x1a\x13.plant.PostListResp\x124\n" + + "\rGetPostDetail\x12\f.plant.IdReq\x1a\x15.plant.PostDetailResp\x127\n" + + "\vCommentPost\x12\x15.plant.CommentPostReq\x1a\x11.plant.CommonResp\x121\n" + + "\bLikePost\x12\x12.plant.LikePostReq\x1a\x11.plant.CommonResp\x121\n" + + "\bStarPost\x12\x12.plant.LikePostReq\x1a\x11.plant.CommonResp\x12E\n" + + "\x12MediaCheckCallback\x12\x1c.plant.MediaCheckCallbackReq\x1a\x11.plant.CommonResp\x122\n" + + "\fGetTopicList\x12\f.plant.IdReq\x1a\x14.plant.TopicListResp\x120\n" + + "\x0eGetTopicDetail\x12\f.plant.IdReq\x1a\x10.plant.TopicInfo\x127\n" + + "\vCreateTopic\x12\x15.plant.CreateTopicReq\x1a\x11.plant.CommonResp\x127\n" + + "\vUpdateTopic\x12\x15.plant.UpdateTopicReq\x1a\x11.plant.CommonResp\x12/\n" + + "\vDeleteTopic\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x12N\n" + + "\x13GetExchangeItemList\x12\x1a.plant.ExchangeItemListReq\x1a\x1b.plant.ExchangeItemListResp\x12>\n" + + "\x15GetExchangeItemDetail\x12\f.plant.IdReq\x1a\x17.plant.ExchangeItemInfo\x12E\n" + + "\x12CreateExchangeItem\x12\x1c.plant.CreateExchangeItemReq\x1a\x11.plant.CommonResp\x12E\n" + + "\x12UpdateExchangeItem\x12\x1c.plant.UpdateExchangeItemReq\x1a\x11.plant.CommonResp\x126\n" + + "\x12DeleteExchangeItem\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x12G\n" + + "\x13CreateExchangeOrder\x12\x1d.plant.CreateExchangeOrderReq\x1a\x11.plant.CommonResp\x12P\n" + + "\x13GetMyExchangeOrders\x12\x1b.plant.ExchangeOrderListReq\x1a\x1c.plant.ExchangeOrderListResp\x12Q\n" + + "\x14GetExchangeOrderList\x12\x1b.plant.ExchangeOrderListReq\x1a\x1c.plant.ExchangeOrderListResp\x12G\n" + + "\x13UpdateExchangeOrder\x12\x1d.plant.UpdateExchangeOrderReq\x1a\x11.plant.CommonResp\x12@\n" + + "\x12GetLevelConfigList\x12\x0e.plant.PageReq\x1a\x1a.plant.LevelConfigListResp\x12<\n" + + "\x14GetLevelConfigDetail\x12\f.plant.IdReq\x1a\x16.plant.LevelConfigInfo\x12C\n" + + "\x11CreateLevelConfig\x12\x1b.plant.CreateLevelConfigReq\x1a\x11.plant.CommonResp\x12C\n" + + "\x11UpdateLevelConfig\x12\x1b.plant.UpdateLevelConfigReq\x1a\x11.plant.CommonResp\x125\n" + + "\x11DeleteLevelConfig\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x12K\n" + + "\x12GetBadgeConfigList\x12\x19.plant.BadgeConfigListReq\x1a\x1a.plant.BadgeConfigListResp\x12<\n" + + "\x14GetBadgeConfigDetail\x12\f.plant.IdReq\x1a\x16.plant.BadgeConfigInfo\x12>\n" + + "\x12GetBadgeConfigTree\x12\f.plant.IdReq\x1a\x1a.plant.BadgeConfigTreeResp\x12C\n" + + "\x11CreateBadgeConfig\x12\x1b.plant.CreateBadgeConfigReq\x1a\x11.plant.CommonResp\x12C\n" + + "\x11UpdateBadgeConfig\x12\x1b.plant.UpdateBadgeConfigReq\x1a\x11.plant.CommonResp\x125\n" + + "\x11DeleteBadgeConfig\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x128\n" + + "\x12GetWikiClassDetail\x12\f.plant.IdReq\x1a\x14.plant.WikiClassInfo\x12E\n" + + "\x10GetAiChatHistory\x12\x17.plant.AiChatHistoryReq\x1a\x18.plant.AiChatHistoryResp\x12C\n" + + "\x11SaveAiChatHistory\x12\x1b.plant.SaveAiChatHistoryReq\x1a\x11.plant.CommonResp\x127\n" + + "\x13DeleteAiChatHistory\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x12=\n" + + "\x12ClearAiChatHistory\x12\x14.plant.GetProfileReq\x1a\x11.plant.CommonResp\x12:\n" + + "\x0eGetAiChatQuota\x12\x14.plant.GetProfileReq\x1a\x12.plant.AiQuotaRespB\tZ\a./plantb\x06proto3" + +var ( + file_pb_plant_proto_rawDescOnce sync.Once + file_pb_plant_proto_rawDescData []byte +) + +func file_pb_plant_proto_rawDescGZIP() []byte { + file_pb_plant_proto_rawDescOnce.Do(func() { + file_pb_plant_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_pb_plant_proto_rawDesc), len(file_pb_plant_proto_rawDesc))) + }) + return file_pb_plant_proto_rawDescData +} + +var file_pb_plant_proto_msgTypes = make([]protoimpl.MessageInfo, 79) +var file_pb_plant_proto_goTypes = []any{ + (*CommonResp)(nil), // 0: plant.CommonResp + (*IdReq)(nil), // 1: plant.IdReq + (*IdsReq)(nil), // 2: plant.IdsReq + (*PageReq)(nil), // 3: plant.PageReq + (*PlantUserProfile)(nil), // 4: plant.PlantUserProfile + (*GetProfileReq)(nil), // 5: plant.GetProfileReq + (*UpdateProfileReq)(nil), // 6: plant.UpdateProfileReq + (*UserBadgeInfo)(nil), // 7: plant.UserBadgeInfo + (*UserBadgeListResp)(nil), // 8: plant.UserBadgeListResp + (*UserStarInfo)(nil), // 9: plant.UserStarInfo + (*UserStarListResp)(nil), // 10: plant.UserStarListResp + (*PlantInfo)(nil), // 11: plant.PlantInfo + (*CreatePlantReq)(nil), // 12: plant.CreatePlantReq + (*UpdatePlantReq)(nil), // 13: plant.UpdatePlantReq + (*PlantListReq)(nil), // 14: plant.PlantListReq + (*PlantListResp)(nil), // 15: plant.PlantListResp + (*PlantDetailResp)(nil), // 16: plant.PlantDetailResp + (*CarePlanInfo)(nil), // 17: plant.CarePlanInfo + (*AddCarePlanReq)(nil), // 18: plant.AddCarePlanReq + (*CareTaskInfo)(nil), // 19: plant.CareTaskInfo + (*CareTaskListResp)(nil), // 20: plant.CareTaskListResp + (*AddCareRecordReq)(nil), // 21: plant.AddCareRecordReq + (*GrowthRecordInfo)(nil), // 22: plant.GrowthRecordInfo + (*AddGrowthRecordReq)(nil), // 23: plant.AddGrowthRecordReq + (*WikiInfo)(nil), // 24: plant.WikiInfo + (*WikiListReq)(nil), // 25: plant.WikiListReq + (*WikiListResp)(nil), // 26: plant.WikiListResp + (*WikiDetailResp)(nil), // 27: plant.WikiDetailResp + (*CreateWikiReq)(nil), // 28: plant.CreateWikiReq + (*UpdateWikiReq)(nil), // 29: plant.UpdateWikiReq + (*WikiClassInfo)(nil), // 30: plant.WikiClassInfo + (*WikiClassListResp)(nil), // 31: plant.WikiClassListResp + (*CreateWikiClassReq)(nil), // 32: plant.CreateWikiClassReq + (*UpdateWikiClassReq)(nil), // 33: plant.UpdateWikiClassReq + (*ToggleStarReq)(nil), // 34: plant.ToggleStarReq + (*ClassifyLogInfo)(nil), // 35: plant.ClassifyLogInfo + (*ClassifyLogListResp)(nil), // 36: plant.ClassifyLogListResp + (*PostInfo)(nil), // 37: plant.PostInfo + (*CreatePostReq)(nil), // 38: plant.CreatePostReq + (*PostListReq)(nil), // 39: plant.PostListReq + (*PostListResp)(nil), // 40: plant.PostListResp + (*PostDetailResp)(nil), // 41: plant.PostDetailResp + (*PostCommentInfo)(nil), // 42: plant.PostCommentInfo + (*CommentPostReq)(nil), // 43: plant.CommentPostReq + (*LikePostReq)(nil), // 44: plant.LikePostReq + (*TopicInfo)(nil), // 45: plant.TopicInfo + (*TopicListResp)(nil), // 46: plant.TopicListResp + (*CreateTopicReq)(nil), // 47: plant.CreateTopicReq + (*UpdateTopicReq)(nil), // 48: plant.UpdateTopicReq + (*ExchangeItemInfo)(nil), // 49: plant.ExchangeItemInfo + (*ExchangeItemListReq)(nil), // 50: plant.ExchangeItemListReq + (*ExchangeItemListResp)(nil), // 51: plant.ExchangeItemListResp + (*CreateExchangeOrderReq)(nil), // 52: plant.CreateExchangeOrderReq + (*CreateExchangeItemReq)(nil), // 53: plant.CreateExchangeItemReq + (*UpdateExchangeItemReq)(nil), // 54: plant.UpdateExchangeItemReq + (*ExchangeOrderInfo)(nil), // 55: plant.ExchangeOrderInfo + (*ExchangeOrderListReq)(nil), // 56: plant.ExchangeOrderListReq + (*ExchangeOrderListResp)(nil), // 57: plant.ExchangeOrderListResp + (*UpdateExchangeOrderReq)(nil), // 58: plant.UpdateExchangeOrderReq + (*MediaCheckCallbackReq)(nil), // 59: plant.MediaCheckCallbackReq + (*SaveAiChatHistoryReq)(nil), // 60: plant.SaveAiChatHistoryReq + (*SyncWikiVectorReq)(nil), // 61: plant.SyncWikiVectorReq + (*LevelConfigInfo)(nil), // 62: plant.LevelConfigInfo + (*LevelConfigListResp)(nil), // 63: plant.LevelConfigListResp + (*CreateLevelConfigReq)(nil), // 64: plant.CreateLevelConfigReq + (*UpdateLevelConfigReq)(nil), // 65: plant.UpdateLevelConfigReq + (*BadgeConfigInfo)(nil), // 66: plant.BadgeConfigInfo + (*BadgeConfigListReq)(nil), // 67: plant.BadgeConfigListReq + (*BadgeConfigListResp)(nil), // 68: plant.BadgeConfigListResp + (*CreateBadgeConfigReq)(nil), // 69: plant.CreateBadgeConfigReq + (*UpdateBadgeConfigReq)(nil), // 70: plant.UpdateBadgeConfigReq + (*CompleteTaskReq)(nil), // 71: plant.CompleteTaskReq + (*TaskCompletionResult)(nil), // 72: plant.TaskCompletionResult + (*BadgeGroupInfo)(nil), // 73: plant.BadgeGroupInfo + (*BadgeConfigTreeResp)(nil), // 74: plant.BadgeConfigTreeResp + (*AiQuotaResp)(nil), // 75: plant.AiQuotaResp + (*AiChatHistoryInfo)(nil), // 76: plant.AiChatHistoryInfo + (*AiChatHistoryReq)(nil), // 77: plant.AiChatHistoryReq + (*AiChatHistoryResp)(nil), // 78: plant.AiChatHistoryResp +} +var file_pb_plant_proto_depIdxs = []int32{ + 7, // 0: plant.UserBadgeListResp.list:type_name -> plant.UserBadgeInfo + 9, // 1: plant.UserStarListResp.list:type_name -> plant.UserStarInfo + 11, // 2: plant.PlantListResp.list:type_name -> plant.PlantInfo + 11, // 3: plant.PlantDetailResp.plant:type_name -> plant.PlantInfo + 17, // 4: plant.PlantDetailResp.carePlans:type_name -> plant.CarePlanInfo + 22, // 5: plant.PlantDetailResp.growthRecords:type_name -> plant.GrowthRecordInfo + 19, // 6: plant.CareTaskListResp.list:type_name -> plant.CareTaskInfo + 24, // 7: plant.WikiListResp.list:type_name -> plant.WikiInfo + 24, // 8: plant.WikiDetailResp.wiki:type_name -> plant.WikiInfo + 30, // 9: plant.WikiClassListResp.list:type_name -> plant.WikiClassInfo + 35, // 10: plant.ClassifyLogListResp.list:type_name -> plant.ClassifyLogInfo + 37, // 11: plant.PostListResp.list:type_name -> plant.PostInfo + 37, // 12: plant.PostDetailResp.post:type_name -> plant.PostInfo + 42, // 13: plant.PostDetailResp.comments:type_name -> plant.PostCommentInfo + 45, // 14: plant.TopicListResp.list:type_name -> plant.TopicInfo + 49, // 15: plant.ExchangeItemListResp.list:type_name -> plant.ExchangeItemInfo + 55, // 16: plant.ExchangeOrderListResp.list:type_name -> plant.ExchangeOrderInfo + 62, // 17: plant.LevelConfigListResp.list:type_name -> plant.LevelConfigInfo + 66, // 18: plant.BadgeConfigListResp.list:type_name -> plant.BadgeConfigInfo + 62, // 19: plant.TaskCompletionResult.currentLevel:type_name -> plant.LevelConfigInfo + 66, // 20: plant.TaskCompletionResult.newBadge:type_name -> plant.BadgeConfigInfo + 66, // 21: plant.BadgeGroupInfo.badges:type_name -> plant.BadgeConfigInfo + 73, // 22: plant.BadgeConfigTreeResp.groups:type_name -> plant.BadgeGroupInfo + 76, // 23: plant.AiChatHistoryResp.list:type_name -> plant.AiChatHistoryInfo + 5, // 24: plant.PlantService.GetUserProfile:input_type -> plant.GetProfileReq + 6, // 25: plant.PlantService.UpdateUserProfile:input_type -> plant.UpdateProfileReq + 5, // 26: plant.PlantService.GetMyBadges:input_type -> plant.GetProfileReq + 5, // 27: plant.PlantService.GetMyStars:input_type -> plant.GetProfileReq + 12, // 28: plant.PlantService.CreatePlant:input_type -> plant.CreatePlantReq + 13, // 29: plant.PlantService.UpdatePlant:input_type -> plant.UpdatePlantReq + 2, // 30: plant.PlantService.DeletePlant:input_type -> plant.IdsReq + 14, // 31: plant.PlantService.GetPlantList:input_type -> plant.PlantListReq + 1, // 32: plant.PlantService.GetPlantDetail:input_type -> plant.IdReq + 18, // 33: plant.PlantService.AddCarePlan:input_type -> plant.AddCarePlanReq + 2, // 34: plant.PlantService.DeleteCarePlan:input_type -> plant.IdsReq + 5, // 35: plant.PlantService.GetTodayTaskList:input_type -> plant.GetProfileReq + 71, // 36: plant.PlantService.CompleteTask:input_type -> plant.CompleteTaskReq + 21, // 37: plant.PlantService.AddCareRecord:input_type -> plant.AddCareRecordReq + 23, // 38: plant.PlantService.AddGrowthRecord:input_type -> plant.AddGrowthRecordReq + 25, // 39: plant.PlantService.GetWikiList:input_type -> plant.WikiListReq + 1, // 40: plant.PlantService.GetWikiDetail:input_type -> plant.IdReq + 28, // 41: plant.PlantService.CreateWiki:input_type -> plant.CreateWikiReq + 29, // 42: plant.PlantService.UpdateWiki:input_type -> plant.UpdateWikiReq + 2, // 43: plant.PlantService.DeleteWiki:input_type -> plant.IdsReq + 61, // 44: plant.PlantService.SyncWikiVector:input_type -> plant.SyncWikiVectorReq + 61, // 45: plant.PlantService.DeleteWikiVector:input_type -> plant.SyncWikiVectorReq + 3, // 46: plant.PlantService.SyncAllWikiVector:input_type -> plant.PageReq + 1, // 47: plant.PlantService.GetWikiClassList:input_type -> plant.IdReq + 32, // 48: plant.PlantService.CreateWikiClass:input_type -> plant.CreateWikiClassReq + 33, // 49: plant.PlantService.UpdateWikiClass:input_type -> plant.UpdateWikiClassReq + 2, // 50: plant.PlantService.DeleteWikiClass:input_type -> plant.IdsReq + 34, // 51: plant.PlantService.ToggleWikiStar:input_type -> plant.ToggleStarReq + 5, // 52: plant.PlantService.GetMyClassifyLog:input_type -> plant.GetProfileReq + 2, // 53: plant.PlantService.DeleteClassifyLog:input_type -> plant.IdsReq + 38, // 54: plant.PlantService.CreatePost:input_type -> plant.CreatePostReq + 2, // 55: plant.PlantService.DeletePost:input_type -> plant.IdsReq + 39, // 56: plant.PlantService.GetPostList:input_type -> plant.PostListReq + 1, // 57: plant.PlantService.GetPostDetail:input_type -> plant.IdReq + 43, // 58: plant.PlantService.CommentPost:input_type -> plant.CommentPostReq + 44, // 59: plant.PlantService.LikePost:input_type -> plant.LikePostReq + 44, // 60: plant.PlantService.StarPost:input_type -> plant.LikePostReq + 59, // 61: plant.PlantService.MediaCheckCallback:input_type -> plant.MediaCheckCallbackReq + 1, // 62: plant.PlantService.GetTopicList:input_type -> plant.IdReq + 1, // 63: plant.PlantService.GetTopicDetail:input_type -> plant.IdReq + 47, // 64: plant.PlantService.CreateTopic:input_type -> plant.CreateTopicReq + 48, // 65: plant.PlantService.UpdateTopic:input_type -> plant.UpdateTopicReq + 2, // 66: plant.PlantService.DeleteTopic:input_type -> plant.IdsReq + 50, // 67: plant.PlantService.GetExchangeItemList:input_type -> plant.ExchangeItemListReq + 1, // 68: plant.PlantService.GetExchangeItemDetail:input_type -> plant.IdReq + 53, // 69: plant.PlantService.CreateExchangeItem:input_type -> plant.CreateExchangeItemReq + 54, // 70: plant.PlantService.UpdateExchangeItem:input_type -> plant.UpdateExchangeItemReq + 2, // 71: plant.PlantService.DeleteExchangeItem:input_type -> plant.IdsReq + 52, // 72: plant.PlantService.CreateExchangeOrder:input_type -> plant.CreateExchangeOrderReq + 56, // 73: plant.PlantService.GetMyExchangeOrders:input_type -> plant.ExchangeOrderListReq + 56, // 74: plant.PlantService.GetExchangeOrderList:input_type -> plant.ExchangeOrderListReq + 58, // 75: plant.PlantService.UpdateExchangeOrder:input_type -> plant.UpdateExchangeOrderReq + 3, // 76: plant.PlantService.GetLevelConfigList:input_type -> plant.PageReq + 1, // 77: plant.PlantService.GetLevelConfigDetail:input_type -> plant.IdReq + 64, // 78: plant.PlantService.CreateLevelConfig:input_type -> plant.CreateLevelConfigReq + 65, // 79: plant.PlantService.UpdateLevelConfig:input_type -> plant.UpdateLevelConfigReq + 2, // 80: plant.PlantService.DeleteLevelConfig:input_type -> plant.IdsReq + 67, // 81: plant.PlantService.GetBadgeConfigList:input_type -> plant.BadgeConfigListReq + 1, // 82: plant.PlantService.GetBadgeConfigDetail:input_type -> plant.IdReq + 1, // 83: plant.PlantService.GetBadgeConfigTree:input_type -> plant.IdReq + 69, // 84: plant.PlantService.CreateBadgeConfig:input_type -> plant.CreateBadgeConfigReq + 70, // 85: plant.PlantService.UpdateBadgeConfig:input_type -> plant.UpdateBadgeConfigReq + 2, // 86: plant.PlantService.DeleteBadgeConfig:input_type -> plant.IdsReq + 1, // 87: plant.PlantService.GetWikiClassDetail:input_type -> plant.IdReq + 77, // 88: plant.PlantService.GetAiChatHistory:input_type -> plant.AiChatHistoryReq + 60, // 89: plant.PlantService.SaveAiChatHistory:input_type -> plant.SaveAiChatHistoryReq + 2, // 90: plant.PlantService.DeleteAiChatHistory:input_type -> plant.IdsReq + 5, // 91: plant.PlantService.ClearAiChatHistory:input_type -> plant.GetProfileReq + 5, // 92: plant.PlantService.GetAiChatQuota:input_type -> plant.GetProfileReq + 4, // 93: plant.PlantService.GetUserProfile:output_type -> plant.PlantUserProfile + 0, // 94: plant.PlantService.UpdateUserProfile:output_type -> plant.CommonResp + 8, // 95: plant.PlantService.GetMyBadges:output_type -> plant.UserBadgeListResp + 10, // 96: plant.PlantService.GetMyStars:output_type -> plant.UserStarListResp + 0, // 97: plant.PlantService.CreatePlant:output_type -> plant.CommonResp + 0, // 98: plant.PlantService.UpdatePlant:output_type -> plant.CommonResp + 0, // 99: plant.PlantService.DeletePlant:output_type -> plant.CommonResp + 15, // 100: plant.PlantService.GetPlantList:output_type -> plant.PlantListResp + 16, // 101: plant.PlantService.GetPlantDetail:output_type -> plant.PlantDetailResp + 0, // 102: plant.PlantService.AddCarePlan:output_type -> plant.CommonResp + 0, // 103: plant.PlantService.DeleteCarePlan:output_type -> plant.CommonResp + 20, // 104: plant.PlantService.GetTodayTaskList:output_type -> plant.CareTaskListResp + 72, // 105: plant.PlantService.CompleteTask:output_type -> plant.TaskCompletionResult + 0, // 106: plant.PlantService.AddCareRecord:output_type -> plant.CommonResp + 0, // 107: plant.PlantService.AddGrowthRecord:output_type -> plant.CommonResp + 26, // 108: plant.PlantService.GetWikiList:output_type -> plant.WikiListResp + 27, // 109: plant.PlantService.GetWikiDetail:output_type -> plant.WikiDetailResp + 0, // 110: plant.PlantService.CreateWiki:output_type -> plant.CommonResp + 0, // 111: plant.PlantService.UpdateWiki:output_type -> plant.CommonResp + 0, // 112: plant.PlantService.DeleteWiki:output_type -> plant.CommonResp + 0, // 113: plant.PlantService.SyncWikiVector:output_type -> plant.CommonResp + 0, // 114: plant.PlantService.DeleteWikiVector:output_type -> plant.CommonResp + 0, // 115: plant.PlantService.SyncAllWikiVector:output_type -> plant.CommonResp + 31, // 116: plant.PlantService.GetWikiClassList:output_type -> plant.WikiClassListResp + 0, // 117: plant.PlantService.CreateWikiClass:output_type -> plant.CommonResp + 0, // 118: plant.PlantService.UpdateWikiClass:output_type -> plant.CommonResp + 0, // 119: plant.PlantService.DeleteWikiClass:output_type -> plant.CommonResp + 0, // 120: plant.PlantService.ToggleWikiStar:output_type -> plant.CommonResp + 36, // 121: plant.PlantService.GetMyClassifyLog:output_type -> plant.ClassifyLogListResp + 0, // 122: plant.PlantService.DeleteClassifyLog:output_type -> plant.CommonResp + 0, // 123: plant.PlantService.CreatePost:output_type -> plant.CommonResp + 0, // 124: plant.PlantService.DeletePost:output_type -> plant.CommonResp + 40, // 125: plant.PlantService.GetPostList:output_type -> plant.PostListResp + 41, // 126: plant.PlantService.GetPostDetail:output_type -> plant.PostDetailResp + 0, // 127: plant.PlantService.CommentPost:output_type -> plant.CommonResp + 0, // 128: plant.PlantService.LikePost:output_type -> plant.CommonResp + 0, // 129: plant.PlantService.StarPost:output_type -> plant.CommonResp + 0, // 130: plant.PlantService.MediaCheckCallback:output_type -> plant.CommonResp + 46, // 131: plant.PlantService.GetTopicList:output_type -> plant.TopicListResp + 45, // 132: plant.PlantService.GetTopicDetail:output_type -> plant.TopicInfo + 0, // 133: plant.PlantService.CreateTopic:output_type -> plant.CommonResp + 0, // 134: plant.PlantService.UpdateTopic:output_type -> plant.CommonResp + 0, // 135: plant.PlantService.DeleteTopic:output_type -> plant.CommonResp + 51, // 136: plant.PlantService.GetExchangeItemList:output_type -> plant.ExchangeItemListResp + 49, // 137: plant.PlantService.GetExchangeItemDetail:output_type -> plant.ExchangeItemInfo + 0, // 138: plant.PlantService.CreateExchangeItem:output_type -> plant.CommonResp + 0, // 139: plant.PlantService.UpdateExchangeItem:output_type -> plant.CommonResp + 0, // 140: plant.PlantService.DeleteExchangeItem:output_type -> plant.CommonResp + 0, // 141: plant.PlantService.CreateExchangeOrder:output_type -> plant.CommonResp + 57, // 142: plant.PlantService.GetMyExchangeOrders:output_type -> plant.ExchangeOrderListResp + 57, // 143: plant.PlantService.GetExchangeOrderList:output_type -> plant.ExchangeOrderListResp + 0, // 144: plant.PlantService.UpdateExchangeOrder:output_type -> plant.CommonResp + 63, // 145: plant.PlantService.GetLevelConfigList:output_type -> plant.LevelConfigListResp + 62, // 146: plant.PlantService.GetLevelConfigDetail:output_type -> plant.LevelConfigInfo + 0, // 147: plant.PlantService.CreateLevelConfig:output_type -> plant.CommonResp + 0, // 148: plant.PlantService.UpdateLevelConfig:output_type -> plant.CommonResp + 0, // 149: plant.PlantService.DeleteLevelConfig:output_type -> plant.CommonResp + 68, // 150: plant.PlantService.GetBadgeConfigList:output_type -> plant.BadgeConfigListResp + 66, // 151: plant.PlantService.GetBadgeConfigDetail:output_type -> plant.BadgeConfigInfo + 74, // 152: plant.PlantService.GetBadgeConfigTree:output_type -> plant.BadgeConfigTreeResp + 0, // 153: plant.PlantService.CreateBadgeConfig:output_type -> plant.CommonResp + 0, // 154: plant.PlantService.UpdateBadgeConfig:output_type -> plant.CommonResp + 0, // 155: plant.PlantService.DeleteBadgeConfig:output_type -> plant.CommonResp + 30, // 156: plant.PlantService.GetWikiClassDetail:output_type -> plant.WikiClassInfo + 78, // 157: plant.PlantService.GetAiChatHistory:output_type -> plant.AiChatHistoryResp + 0, // 158: plant.PlantService.SaveAiChatHistory:output_type -> plant.CommonResp + 0, // 159: plant.PlantService.DeleteAiChatHistory:output_type -> plant.CommonResp + 0, // 160: plant.PlantService.ClearAiChatHistory:output_type -> plant.CommonResp + 75, // 161: plant.PlantService.GetAiChatQuota:output_type -> plant.AiQuotaResp + 93, // [93:162] is the sub-list for method output_type + 24, // [24:93] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name +} + +func init() { file_pb_plant_proto_init() } +func file_pb_plant_proto_init() { + if File_pb_plant_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_pb_plant_proto_rawDesc), len(file_pb_plant_proto_rawDesc)), + NumEnums: 0, + NumMessages: 79, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_pb_plant_proto_goTypes, + DependencyIndexes: file_pb_plant_proto_depIdxs, + MessageInfos: file_pb_plant_proto_msgTypes, + }.Build() + File_pb_plant_proto = out.File + file_pb_plant_proto_goTypes = nil + file_pb_plant_proto_depIdxs = nil +} diff --git a/app/plant/rpc/pb/plant.proto b/app/plant/rpc/pb/plant.proto index 827a400..fc2cf4d 100644 --- a/app/plant/rpc/pb/plant.proto +++ b/app/plant/rpc/pb/plant.proto @@ -54,6 +54,33 @@ message UpdateProfileReq { string avatarId = 3; } +// 我的徽章 +message UserBadgeInfo { + string id = 1; + string badgeId = 2; + string badgeName = 3; + string dimension = 4; + int32 tier = 5; + string awardedAt = 6; +} + +message UserBadgeListResp { + repeated UserBadgeInfo list = 1; +} + +// 我的收藏 +message UserStarInfo { + string id = 1; + string targetId = 2; + string type = 3; + string createdAt = 4; +} + +message UserStarListResp { + repeated UserStarInfo list = 1; + int64 total = 2; +} + // ========== 我的植物 ========== message PlantInfo { @@ -113,7 +140,7 @@ message PlantDetailResp { repeated GrowthRecordInfo growthRecords = 3; } -// ========== 养护计划 ========== +// ========== 养护计划/任务 ========== message CarePlanInfo { string id = 1; @@ -133,6 +160,23 @@ message AddCarePlanReq { int32 period = 6; } +// 养护任务 status: 1=待完成 2=已完成 3=已过期 +message CareTaskInfo { + string id = 1; + string plantId = 2; + string planId = 3; + string name = 4; + string icon = 5; + string targetAction = 6; + string dueDate = 7; + int32 status = 8; +} + +message CareTaskListResp { + repeated CareTaskInfo list = 1; + int64 total = 2; +} + // ========== 养护记录 ========== message AddCareRecordReq { @@ -173,6 +217,27 @@ message WikiInfo { string lightIntensity = 9; string optimalTempPeriod = 10; int64 createdAt = 11; + string classId = 12; + string distributionArea = 13; + string lifeCycle = 14; + repeated string classIds = 15; + repeated string ossIds = 16; + repeated string relatedWikiIds = 17; + bool isVectorSynced = 18; + bool isStar = 19; + string reproductionMethod = 20; + string pestsDiseases = 21; + string lightType = 22; + string stem = 23; + string fruit = 24; + string foliageType = 25; + string foliageColor = 26; + string foliageShape = 27; + int32 height = 28; + string floweringPeriod = 29; + string floweringColor = 30; + string floweringShape = 31; + int32 floweringDiameter = 32; } message WikiListReq { @@ -192,6 +257,69 @@ message WikiDetailResp { WikiInfo wiki = 1; } +message CreateWikiReq { + string name = 1; + string latinName = 2; + string aliases = 3; + string genus = 4; + int32 difficulty = 5; + int32 isHot = 6; + string growthHabit = 7; + string lightIntensity = 8; + string optimalTempPeriod = 9; + string classId = 10; + string distributionArea = 11; + string lifeCycle = 12; + repeated string classIds = 13; + repeated string ossIds = 14; + repeated string relatedWikiIds = 15; + string reproductionMethod = 16; + string pestsDiseases = 17; + string lightType = 18; + string stem = 19; + string fruit = 20; + string foliageType = 21; + string foliageColor = 22; + string foliageShape = 23; + int32 height = 24; + string floweringPeriod = 25; + string floweringColor = 26; + string floweringShape = 27; + int32 floweringDiameter = 28; +} + +message UpdateWikiReq { + string id = 1; + string name = 2; + string latinName = 3; + string aliases = 4; + string genus = 5; + int32 difficulty = 6; + int32 isHot = 7; + string growthHabit = 8; + string lightIntensity = 9; + string optimalTempPeriod = 10; + string classId = 11; + string distributionArea = 12; + string lifeCycle = 13; + repeated string classIds = 14; + repeated string ossIds = 15; + repeated string relatedWikiIds = 16; + string reproductionMethod = 17; + string pestsDiseases = 18; + string lightType = 19; + string stem = 20; + string fruit = 21; + string foliageType = 22; + string foliageColor = 23; + string foliageShape = 24; + int32 height = 25; + string floweringPeriod = 26; + string floweringColor = 27; + string floweringShape = 28; + int32 floweringDiameter = 29; +} + message WikiClassInfo { string id = 1; string name = 2; @@ -207,12 +335,33 @@ message CreateWikiClassReq { string icon = 2; } +message UpdateWikiClassReq { + string id = 1; + string name = 2; + string icon = 3; +} + message ToggleStarReq { string userId = 1; string targetId = 2; string type = 3; } +// ========== OCR ========== + +message ClassifyLogInfo { + string id = 1; + string userId = 2; + string imageUrl = 3; + string result = 4; + string createdAt = 5; +} + +message ClassifyLogListResp { + repeated ClassifyLogInfo list = 1; + int64 total = 2; +} + // ========== 社区帖子 ========== message PostInfo { @@ -226,6 +375,7 @@ message PostInfo { int32 starCount = 8; string location = 9; int64 createdAt = 10; + string topicId = 11; } message CreatePostReq { @@ -281,6 +431,12 @@ message TopicInfo { string id = 1; string name = 2; int32 postCount = 3; + string icon = 4; + string desc = 5; + string title = 6; + string remark = 7; + string startTime = 8; + string endTime = 9; } message TopicListResp { @@ -291,6 +447,21 @@ message CreateTopicReq { string name = 1; string icon = 2; string desc = 3; + string title = 4; + string remark = 5; + string startTime = 6; + string endTime = 7; +} + +message UpdateTopicReq { + string id = 1; + string name = 2; + string icon = 3; + string desc = 4; + string title = 5; + string remark = 6; + string startTime = 7; + string endTime = 8; } // ========== 兑换商城 ========== @@ -302,11 +473,13 @@ message ExchangeItemInfo { string imgId = 4; int64 cost = 5; int32 stock = 6; + int32 status = 7; } message ExchangeItemListReq { int32 current = 1; int32 pageSize = 2; + int32 status = 3; } message ExchangeItemListResp { @@ -317,6 +490,150 @@ message ExchangeItemListResp { message CreateExchangeOrderReq { string userId = 1; string itemId = 2; + int32 quantity = 3; + string recipientName = 4; + string phone = 5; + string address = 6; +} + +message CreateExchangeItemReq { + string name = 1; + string desc = 2; + string imgId = 3; + int64 cost = 4; + int32 stock = 5; + string type = 6; + int64 costSunlight = 7; + int32 limitPerUser = 8; + int32 sort = 9; + string startTime = 10; + string endTime = 11; + string imageId = 12; +} + +message UpdateExchangeItemReq { + string id = 1; + string name = 2; + string desc = 3; + string imgId = 4; + int64 cost = 5; + int32 stock = 6; + int32 status = 7; + string type = 8; + int64 costSunlight = 9; + int32 limitPerUser = 10; + int32 sort = 11; + string startTime = 12; + string endTime = 13; + string imageId = 14; +} + +message ExchangeOrderInfo { + string id = 1; + string userId = 2; + string itemId = 3; + string itemName = 4; + int64 cost = 5; + int32 status = 6; + string address = 7; + string createdAt = 8; + int32 quantity = 9; + string itemType = 10; + string recipientName = 11; + string phone = 12; + string trackingNo = 13; + string remark = 14; + string completedAt = 15; +} + +message ExchangeOrderListReq { + int32 current = 1; + int32 pageSize = 2; + string userId = 3; + int32 status = 4; +} + +message ExchangeOrderListResp { + repeated ExchangeOrderInfo list = 1; + int64 total = 2; +} + +message UpdateExchangeOrderReq { + string id = 1; + int32 status = 2; + string trackingNo = 3; + string remark = 4; +} + +message MediaCheckCallbackReq { + string traceId = 1; + string postId = 2; + string ossId = 3; + string userId = 4; + int32 status = 5; + int32 type = 6; + string errMsg = 7; +} + +// ========== 快捷养护 ========== + +message QuickCareReq { + string userId = 1; + string plantId = 2; + string name = 3; + string icon = 4; + string remark = 5; +} + +// ========== Banner ========== + +message BannerInfo { + string id = 1; + string title = 2; + string imageId = 3; + int32 sort = 4; + int32 isActive = 5; + string targetUrl = 6; + string createdAt = 7; +} + +message BannerListReq { + int32 current = 1; + int32 pageSize = 2; + string title = 3; + int32 isActive = 4; +} + +message BannerListResp { + repeated BannerInfo list = 1; + int64 total = 2; +} + +message CreateBannerReq { + string title = 1; + string imageId = 2; + int32 sort = 3; + int32 isActive = 4; + string targetUrl = 5; +} + +message UpdateBannerReq { + string id = 1; + string title = 2; + string imageId = 3; + int32 sort = 4; + int32 isActive = 5; + string targetUrl = 6; +} + +message SaveAiChatHistoryReq { + string userId = 1; + string question = 2; + string answer = 3; +} + +message SyncWikiVectorReq { + string wikiId = 1; } // ========== 配置 ========== @@ -333,6 +650,21 @@ message LevelConfigListResp { repeated LevelConfigInfo list = 1; } +message CreateLevelConfigReq { + int32 level = 1; + string title = 2; + int64 minSunlight = 3; + string perks = 4; +} + +message UpdateLevelConfigReq { + string id = 1; + int32 level = 2; + string title = 3; + int64 minSunlight = 4; + string perks = 5; +} + message BadgeConfigInfo { string id = 1; string name = 2; @@ -343,6 +675,8 @@ message BadgeConfigInfo { string targetAction = 7; int64 threshold = 8; int64 rewardSunlight = 9; + string iconId = 10; + int32 sort = 11; } message BadgeConfigListReq { @@ -356,12 +690,97 @@ message BadgeConfigListResp { int64 total = 2; } +message CreateBadgeConfigReq { + string name = 1; + string description = 2; + string dimension = 3; + string groupId = 4; + int32 tier = 5; + string targetAction = 6; + int64 threshold = 7; + int64 rewardSunlight = 8; + string iconId = 9; + int32 sort = 10; +} + +message UpdateBadgeConfigReq { + string id = 1; + string name = 2; + string description = 3; + string dimension = 4; + string groupId = 5; + int32 tier = 6; + string targetAction = 7; + int64 threshold = 8; + int64 rewardSunlight = 9; + string iconId = 10; + int32 sort = 11; +} + +// ========== 完成任务 ========== + +message CompleteTaskReq { + string userId = 1; + string taskId = 2; + string remark = 3; +} + +message TaskCompletionResult { + bool isLevelUp = 1; + LevelConfigInfo currentLevel = 2; + bool isGetBadge = 3; + BadgeConfigInfo newBadge = 4; + int64 rewardSunlight = 5; +} + +// ========== 徽章树 ========== + +message BadgeGroupInfo { + string groupId = 1; + string dimension = 2; + repeated BadgeConfigInfo badges = 3; +} + +message BadgeConfigTreeResp { + repeated BadgeGroupInfo groups = 1; +} + +// ========== AI ========== + +message AiQuotaResp { + int64 remaining = 1; + int64 total = 2; + int64 used = 3; + int64 limit = 4; +} + +message AiChatHistoryInfo { + string id = 1; + string userId = 2; + string question = 3; + string answer = 4; + string createdAt = 5; +} + +message AiChatHistoryReq { + string userId = 1; + int32 current = 2; + int32 pageSize = 3; +} + +message AiChatHistoryResp { + repeated AiChatHistoryInfo list = 1; + int64 total = 2; +} + // ========== 服务定义 ========== service PlantService { // 用户Profile rpc GetUserProfile(GetProfileReq) returns (PlantUserProfile); rpc UpdateUserProfile(UpdateProfileReq) returns (CommonResp); + rpc GetMyBadges(GetProfileReq) returns (UserBadgeListResp); + rpc GetMyStars(GetProfileReq) returns (UserStarListResp); // 我的植物 rpc CreatePlant(CreatePlantReq) returns (CommonResp); @@ -372,16 +791,31 @@ service PlantService { // 养护 rpc AddCarePlan(AddCarePlanReq) returns (CommonResp); + rpc DeleteCarePlan(IdsReq) returns (CommonResp); + rpc GetTodayTaskList(GetProfileReq) returns (CareTaskListResp); + rpc CompleteTask(CompleteTaskReq) returns (TaskCompletionResult); rpc AddCareRecord(AddCareRecordReq) returns (CommonResp); rpc AddGrowthRecord(AddGrowthRecordReq) returns (CommonResp); // 百科 rpc GetWikiList(WikiListReq) returns (WikiListResp); rpc GetWikiDetail(IdReq) returns (WikiDetailResp); + rpc CreateWiki(CreateWikiReq) returns (CommonResp); + rpc UpdateWiki(UpdateWikiReq) returns (CommonResp); + rpc DeleteWiki(IdsReq) returns (CommonResp); + rpc SyncWikiVector(SyncWikiVectorReq) returns (CommonResp); + rpc DeleteWikiVector(SyncWikiVectorReq) returns (CommonResp); + rpc SyncAllWikiVector(PageReq) returns (CommonResp); rpc GetWikiClassList(IdReq) returns (WikiClassListResp); rpc CreateWikiClass(CreateWikiClassReq) returns (CommonResp); + rpc UpdateWikiClass(UpdateWikiClassReq) returns (CommonResp); + rpc DeleteWikiClass(IdsReq) returns (CommonResp); rpc ToggleWikiStar(ToggleStarReq) returns (CommonResp); + // OCR + rpc GetMyClassifyLog(GetProfileReq) returns (ClassifyLogListResp); + rpc DeleteClassifyLog(IdsReq) returns (CommonResp); + // 社区 rpc CreatePost(CreatePostReq) returns (CommonResp); rpc DeletePost(IdsReq) returns (CommonResp); @@ -389,17 +823,55 @@ service PlantService { rpc GetPostDetail(IdReq) returns (PostDetailResp); rpc CommentPost(CommentPostReq) returns (CommonResp); rpc LikePost(LikePostReq) returns (CommonResp); + rpc StarPost(LikePostReq) returns (CommonResp); + rpc MediaCheckCallback(MediaCheckCallbackReq) returns (CommonResp); // 话题 rpc GetTopicList(IdReq) returns (TopicListResp); + rpc GetTopicDetail(IdReq) returns (TopicInfo); rpc CreateTopic(CreateTopicReq) returns (CommonResp); + rpc UpdateTopic(UpdateTopicReq) returns (CommonResp); rpc DeleteTopic(IdsReq) returns (CommonResp); // 兑换 rpc GetExchangeItemList(ExchangeItemListReq) returns (ExchangeItemListResp); + rpc GetExchangeItemDetail(IdReq) returns (ExchangeItemInfo); + rpc CreateExchangeItem(CreateExchangeItemReq) returns (CommonResp); + rpc UpdateExchangeItem(UpdateExchangeItemReq) returns (CommonResp); + rpc DeleteExchangeItem(IdsReq) returns (CommonResp); rpc CreateExchangeOrder(CreateExchangeOrderReq) returns (CommonResp); + rpc GetMyExchangeOrders(ExchangeOrderListReq) returns (ExchangeOrderListResp); + rpc GetExchangeOrderList(ExchangeOrderListReq) returns (ExchangeOrderListResp); + rpc UpdateExchangeOrder(UpdateExchangeOrderReq) returns (CommonResp); // 配置 rpc GetLevelConfigList(PageReq) returns (LevelConfigListResp); + rpc GetLevelConfigDetail(IdReq) returns (LevelConfigInfo); + rpc CreateLevelConfig(CreateLevelConfigReq) returns (CommonResp); + rpc UpdateLevelConfig(UpdateLevelConfigReq) returns (CommonResp); + rpc DeleteLevelConfig(IdsReq) returns (CommonResp); rpc GetBadgeConfigList(BadgeConfigListReq) returns (BadgeConfigListResp); + rpc GetBadgeConfigDetail(IdReq) returns (BadgeConfigInfo); + rpc GetBadgeConfigTree(IdReq) returns (BadgeConfigTreeResp); + rpc CreateBadgeConfig(CreateBadgeConfigReq) returns (CommonResp); + rpc UpdateBadgeConfig(UpdateBadgeConfigReq) returns (CommonResp); + rpc DeleteBadgeConfig(IdsReq) returns (CommonResp); + rpc GetWikiClassDetail(IdReq) returns (WikiClassInfo); + + // AI + rpc GetAiChatHistory(AiChatHistoryReq) returns (AiChatHistoryResp); + rpc SaveAiChatHistory(SaveAiChatHistoryReq) returns (CommonResp); + rpc DeleteAiChatHistory(IdsReq) returns (CommonResp); + rpc ClearAiChatHistory(GetProfileReq) returns (CommonResp); + rpc GetAiChatQuota(GetProfileReq) returns (AiQuotaResp); + + // 快捷养护 + rpc QuickCare(QuickCareReq) returns (CommonResp); + + // Banner + rpc CreateBanner(CreateBannerReq) returns (CommonResp); + rpc UpdateBanner(UpdateBannerReq) returns (CommonResp); + rpc DeleteBanner(IdsReq) returns (CommonResp); + rpc GetBannerList(BannerListReq) returns (BannerListResp); + rpc GetActiveBannerList(PageReq) returns (BannerListResp); } diff --git a/app/plant/rpc/pb/plant_grpc.pb.go b/app/plant/rpc/pb/plant_grpc.pb.go new file mode 100644 index 0000000..3f69543 --- /dev/null +++ b/app/plant/rpc/pb/plant_grpc.pb.go @@ -0,0 +1,2725 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.1 +// - protoc v7.34.1 +// source: pb/plant.proto + +package plant + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + PlantService_GetUserProfile_FullMethodName = "/plant.PlantService/GetUserProfile" + PlantService_UpdateUserProfile_FullMethodName = "/plant.PlantService/UpdateUserProfile" + PlantService_GetMyBadges_FullMethodName = "/plant.PlantService/GetMyBadges" + PlantService_GetMyStars_FullMethodName = "/plant.PlantService/GetMyStars" + PlantService_CreatePlant_FullMethodName = "/plant.PlantService/CreatePlant" + PlantService_UpdatePlant_FullMethodName = "/plant.PlantService/UpdatePlant" + PlantService_DeletePlant_FullMethodName = "/plant.PlantService/DeletePlant" + PlantService_GetPlantList_FullMethodName = "/plant.PlantService/GetPlantList" + PlantService_GetPlantDetail_FullMethodName = "/plant.PlantService/GetPlantDetail" + PlantService_AddCarePlan_FullMethodName = "/plant.PlantService/AddCarePlan" + PlantService_DeleteCarePlan_FullMethodName = "/plant.PlantService/DeleteCarePlan" + PlantService_GetTodayTaskList_FullMethodName = "/plant.PlantService/GetTodayTaskList" + PlantService_CompleteTask_FullMethodName = "/plant.PlantService/CompleteTask" + PlantService_AddCareRecord_FullMethodName = "/plant.PlantService/AddCareRecord" + PlantService_AddGrowthRecord_FullMethodName = "/plant.PlantService/AddGrowthRecord" + PlantService_GetWikiList_FullMethodName = "/plant.PlantService/GetWikiList" + PlantService_GetWikiDetail_FullMethodName = "/plant.PlantService/GetWikiDetail" + PlantService_CreateWiki_FullMethodName = "/plant.PlantService/CreateWiki" + PlantService_UpdateWiki_FullMethodName = "/plant.PlantService/UpdateWiki" + PlantService_DeleteWiki_FullMethodName = "/plant.PlantService/DeleteWiki" + PlantService_SyncWikiVector_FullMethodName = "/plant.PlantService/SyncWikiVector" + PlantService_DeleteWikiVector_FullMethodName = "/plant.PlantService/DeleteWikiVector" + PlantService_SyncAllWikiVector_FullMethodName = "/plant.PlantService/SyncAllWikiVector" + PlantService_GetWikiClassList_FullMethodName = "/plant.PlantService/GetWikiClassList" + PlantService_CreateWikiClass_FullMethodName = "/plant.PlantService/CreateWikiClass" + PlantService_UpdateWikiClass_FullMethodName = "/plant.PlantService/UpdateWikiClass" + PlantService_DeleteWikiClass_FullMethodName = "/plant.PlantService/DeleteWikiClass" + PlantService_ToggleWikiStar_FullMethodName = "/plant.PlantService/ToggleWikiStar" + PlantService_GetMyClassifyLog_FullMethodName = "/plant.PlantService/GetMyClassifyLog" + PlantService_DeleteClassifyLog_FullMethodName = "/plant.PlantService/DeleteClassifyLog" + PlantService_CreatePost_FullMethodName = "/plant.PlantService/CreatePost" + PlantService_DeletePost_FullMethodName = "/plant.PlantService/DeletePost" + PlantService_GetPostList_FullMethodName = "/plant.PlantService/GetPostList" + PlantService_GetPostDetail_FullMethodName = "/plant.PlantService/GetPostDetail" + PlantService_CommentPost_FullMethodName = "/plant.PlantService/CommentPost" + PlantService_LikePost_FullMethodName = "/plant.PlantService/LikePost" + PlantService_StarPost_FullMethodName = "/plant.PlantService/StarPost" + PlantService_MediaCheckCallback_FullMethodName = "/plant.PlantService/MediaCheckCallback" + PlantService_GetTopicList_FullMethodName = "/plant.PlantService/GetTopicList" + PlantService_GetTopicDetail_FullMethodName = "/plant.PlantService/GetTopicDetail" + PlantService_CreateTopic_FullMethodName = "/plant.PlantService/CreateTopic" + PlantService_UpdateTopic_FullMethodName = "/plant.PlantService/UpdateTopic" + PlantService_DeleteTopic_FullMethodName = "/plant.PlantService/DeleteTopic" + PlantService_GetExchangeItemList_FullMethodName = "/plant.PlantService/GetExchangeItemList" + PlantService_GetExchangeItemDetail_FullMethodName = "/plant.PlantService/GetExchangeItemDetail" + PlantService_CreateExchangeItem_FullMethodName = "/plant.PlantService/CreateExchangeItem" + PlantService_UpdateExchangeItem_FullMethodName = "/plant.PlantService/UpdateExchangeItem" + PlantService_DeleteExchangeItem_FullMethodName = "/plant.PlantService/DeleteExchangeItem" + PlantService_CreateExchangeOrder_FullMethodName = "/plant.PlantService/CreateExchangeOrder" + PlantService_GetMyExchangeOrders_FullMethodName = "/plant.PlantService/GetMyExchangeOrders" + PlantService_GetExchangeOrderList_FullMethodName = "/plant.PlantService/GetExchangeOrderList" + PlantService_UpdateExchangeOrder_FullMethodName = "/plant.PlantService/UpdateExchangeOrder" + PlantService_GetLevelConfigList_FullMethodName = "/plant.PlantService/GetLevelConfigList" + PlantService_GetLevelConfigDetail_FullMethodName = "/plant.PlantService/GetLevelConfigDetail" + PlantService_CreateLevelConfig_FullMethodName = "/plant.PlantService/CreateLevelConfig" + PlantService_UpdateLevelConfig_FullMethodName = "/plant.PlantService/UpdateLevelConfig" + PlantService_DeleteLevelConfig_FullMethodName = "/plant.PlantService/DeleteLevelConfig" + PlantService_GetBadgeConfigList_FullMethodName = "/plant.PlantService/GetBadgeConfigList" + PlantService_GetBadgeConfigDetail_FullMethodName = "/plant.PlantService/GetBadgeConfigDetail" + PlantService_GetBadgeConfigTree_FullMethodName = "/plant.PlantService/GetBadgeConfigTree" + PlantService_CreateBadgeConfig_FullMethodName = "/plant.PlantService/CreateBadgeConfig" + PlantService_UpdateBadgeConfig_FullMethodName = "/plant.PlantService/UpdateBadgeConfig" + PlantService_DeleteBadgeConfig_FullMethodName = "/plant.PlantService/DeleteBadgeConfig" + PlantService_GetWikiClassDetail_FullMethodName = "/plant.PlantService/GetWikiClassDetail" + PlantService_GetAiChatHistory_FullMethodName = "/plant.PlantService/GetAiChatHistory" + PlantService_SaveAiChatHistory_FullMethodName = "/plant.PlantService/SaveAiChatHistory" + PlantService_DeleteAiChatHistory_FullMethodName = "/plant.PlantService/DeleteAiChatHistory" + PlantService_ClearAiChatHistory_FullMethodName = "/plant.PlantService/ClearAiChatHistory" + PlantService_GetAiChatQuota_FullMethodName = "/plant.PlantService/GetAiChatQuota" +) + +// PlantServiceClient is the client API for PlantService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PlantServiceClient interface { + // 用户Profile + GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*PlantUserProfile, error) + UpdateUserProfile(ctx context.Context, in *UpdateProfileReq, opts ...grpc.CallOption) (*CommonResp, error) + GetMyBadges(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserBadgeListResp, error) + GetMyStars(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserStarListResp, error) + // 我的植物 + CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) + DeletePlant(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetPlantList(ctx context.Context, in *PlantListReq, opts ...grpc.CallOption) (*PlantListResp, error) + GetPlantDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PlantDetailResp, error) + // 养护 + AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteCarePlan(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetTodayTaskList(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CareTaskListResp, error) + CompleteTask(ctx context.Context, in *CompleteTaskReq, opts ...grpc.CallOption) (*TaskCompletionResult, error) + AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*CommonResp, error) + AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*CommonResp, error) + // 百科 + GetWikiList(ctx context.Context, in *WikiListReq, opts ...grpc.CallOption) (*WikiListResp, error) + GetWikiDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiDetailResp, error) + CreateWiki(ctx context.Context, in *CreateWikiReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateWiki(ctx context.Context, in *UpdateWikiReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteWiki(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + SyncWikiVector(ctx context.Context, in *SyncWikiVectorReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteWikiVector(ctx context.Context, in *SyncWikiVectorReq, opts ...grpc.CallOption) (*CommonResp, error) + SyncAllWikiVector(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*CommonResp, error) + GetWikiClassList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassListResp, error) + CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateWikiClass(ctx context.Context, in *UpdateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteWikiClass(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + ToggleWikiStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*CommonResp, error) + // OCR + GetMyClassifyLog(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*ClassifyLogListResp, error) + DeleteClassifyLog(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + // 社区 + CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CommonResp, error) + DeletePost(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetPostList(ctx context.Context, in *PostListReq, opts ...grpc.CallOption) (*PostListResp, error) + GetPostDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PostDetailResp, error) + CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommonResp, error) + LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) + StarPost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) + MediaCheckCallback(ctx context.Context, in *MediaCheckCallbackReq, opts ...grpc.CallOption) (*CommonResp, error) + // 话题 + GetTopicList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicListResp, error) + GetTopicDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicInfo, error) + CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateTopic(ctx context.Context, in *UpdateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteTopic(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + // 兑换 + GetExchangeItemList(ctx context.Context, in *ExchangeItemListReq, opts ...grpc.CallOption) (*ExchangeItemListResp, error) + GetExchangeItemDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ExchangeItemInfo, error) + CreateExchangeItem(ctx context.Context, in *CreateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateExchangeItem(ctx context.Context, in *UpdateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteExchangeItem(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) + GetMyExchangeOrders(ctx context.Context, in *ExchangeOrderListReq, opts ...grpc.CallOption) (*ExchangeOrderListResp, error) + GetExchangeOrderList(ctx context.Context, in *ExchangeOrderListReq, opts ...grpc.CallOption) (*ExchangeOrderListResp, error) + UpdateExchangeOrder(ctx context.Context, in *UpdateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) + // 配置 + GetLevelConfigList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*LevelConfigListResp, error) + GetLevelConfigDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*LevelConfigInfo, error) + CreateLevelConfig(ctx context.Context, in *CreateLevelConfigReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateLevelConfig(ctx context.Context, in *UpdateLevelConfigReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteLevelConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetBadgeConfigList(ctx context.Context, in *BadgeConfigListReq, opts ...grpc.CallOption) (*BadgeConfigListResp, error) + GetBadgeConfigDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*BadgeConfigInfo, error) + GetBadgeConfigTree(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*BadgeConfigTreeResp, error) + CreateBadgeConfig(ctx context.Context, in *CreateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateBadgeConfig(ctx context.Context, in *UpdateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteBadgeConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetWikiClassDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassInfo, error) + // AI + GetAiChatHistory(ctx context.Context, in *AiChatHistoryReq, opts ...grpc.CallOption) (*AiChatHistoryResp, error) + SaveAiChatHistory(ctx context.Context, in *SaveAiChatHistoryReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteAiChatHistory(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + ClearAiChatHistory(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CommonResp, error) + GetAiChatQuota(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*AiQuotaResp, error) +} + +type plantServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewPlantServiceClient(cc grpc.ClientConnInterface) PlantServiceClient { + return &plantServiceClient{cc} +} + +func (c *plantServiceClient) GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*PlantUserProfile, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PlantUserProfile) + err := c.cc.Invoke(ctx, PlantService_GetUserProfile_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) UpdateUserProfile(ctx context.Context, in *UpdateProfileReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateUserProfile_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetMyBadges(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserBadgeListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UserBadgeListResp) + err := c.cc.Invoke(ctx, PlantService_GetMyBadges_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetMyStars(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserStarListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UserStarListResp) + err := c.cc.Invoke(ctx, PlantService_GetMyStars_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_CreatePlant_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdatePlant_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeletePlant(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeletePlant_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetPlantList(ctx context.Context, in *PlantListReq, opts ...grpc.CallOption) (*PlantListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PlantListResp) + err := c.cc.Invoke(ctx, PlantService_GetPlantList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetPlantDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PlantDetailResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PlantDetailResp) + err := c.cc.Invoke(ctx, PlantService_GetPlantDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_AddCarePlan_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteCarePlan(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteCarePlan_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetTodayTaskList(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CareTaskListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CareTaskListResp) + err := c.cc.Invoke(ctx, PlantService_GetTodayTaskList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CompleteTask(ctx context.Context, in *CompleteTaskReq, opts ...grpc.CallOption) (*TaskCompletionResult, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TaskCompletionResult) + err := c.cc.Invoke(ctx, PlantService_CompleteTask_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_AddCareRecord_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_AddGrowthRecord_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetWikiList(ctx context.Context, in *WikiListReq, opts ...grpc.CallOption) (*WikiListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(WikiListResp) + err := c.cc.Invoke(ctx, PlantService_GetWikiList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetWikiDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiDetailResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(WikiDetailResp) + err := c.cc.Invoke(ctx, PlantService_GetWikiDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CreateWiki(ctx context.Context, in *CreateWikiReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_CreateWiki_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) UpdateWiki(ctx context.Context, in *UpdateWikiReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateWiki_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteWiki(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteWiki_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) SyncWikiVector(ctx context.Context, in *SyncWikiVectorReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_SyncWikiVector_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteWikiVector(ctx context.Context, in *SyncWikiVectorReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteWikiVector_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) SyncAllWikiVector(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_SyncAllWikiVector_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetWikiClassList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(WikiClassListResp) + err := c.cc.Invoke(ctx, PlantService_GetWikiClassList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_CreateWikiClass_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) UpdateWikiClass(ctx context.Context, in *UpdateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateWikiClass_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteWikiClass(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteWikiClass_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) ToggleWikiStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_ToggleWikiStar_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetMyClassifyLog(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*ClassifyLogListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ClassifyLogListResp) + err := c.cc.Invoke(ctx, PlantService_GetMyClassifyLog_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteClassifyLog(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteClassifyLog_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_CreatePost_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeletePost(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeletePost_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetPostList(ctx context.Context, in *PostListReq, opts ...grpc.CallOption) (*PostListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PostListResp) + err := c.cc.Invoke(ctx, PlantService_GetPostList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetPostDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PostDetailResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PostDetailResp) + err := c.cc.Invoke(ctx, PlantService_GetPostDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_CommentPost_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_LikePost_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) StarPost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_StarPost_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) MediaCheckCallback(ctx context.Context, in *MediaCheckCallbackReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_MediaCheckCallback_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetTopicList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TopicListResp) + err := c.cc.Invoke(ctx, PlantService_GetTopicList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetTopicDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TopicInfo) + err := c.cc.Invoke(ctx, PlantService_GetTopicDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_CreateTopic_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) UpdateTopic(ctx context.Context, in *UpdateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateTopic_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteTopic(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteTopic_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetExchangeItemList(ctx context.Context, in *ExchangeItemListReq, opts ...grpc.CallOption) (*ExchangeItemListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ExchangeItemListResp) + err := c.cc.Invoke(ctx, PlantService_GetExchangeItemList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetExchangeItemDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ExchangeItemInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ExchangeItemInfo) + err := c.cc.Invoke(ctx, PlantService_GetExchangeItemDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CreateExchangeItem(ctx context.Context, in *CreateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_CreateExchangeItem_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) UpdateExchangeItem(ctx context.Context, in *UpdateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateExchangeItem_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteExchangeItem(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteExchangeItem_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_CreateExchangeOrder_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetMyExchangeOrders(ctx context.Context, in *ExchangeOrderListReq, opts ...grpc.CallOption) (*ExchangeOrderListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ExchangeOrderListResp) + err := c.cc.Invoke(ctx, PlantService_GetMyExchangeOrders_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetExchangeOrderList(ctx context.Context, in *ExchangeOrderListReq, opts ...grpc.CallOption) (*ExchangeOrderListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ExchangeOrderListResp) + err := c.cc.Invoke(ctx, PlantService_GetExchangeOrderList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) UpdateExchangeOrder(ctx context.Context, in *UpdateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateExchangeOrder_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetLevelConfigList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*LevelConfigListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(LevelConfigListResp) + err := c.cc.Invoke(ctx, PlantService_GetLevelConfigList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetLevelConfigDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*LevelConfigInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(LevelConfigInfo) + err := c.cc.Invoke(ctx, PlantService_GetLevelConfigDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CreateLevelConfig(ctx context.Context, in *CreateLevelConfigReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_CreateLevelConfig_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) UpdateLevelConfig(ctx context.Context, in *UpdateLevelConfigReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateLevelConfig_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteLevelConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteLevelConfig_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetBadgeConfigList(ctx context.Context, in *BadgeConfigListReq, opts ...grpc.CallOption) (*BadgeConfigListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BadgeConfigListResp) + err := c.cc.Invoke(ctx, PlantService_GetBadgeConfigList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetBadgeConfigDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*BadgeConfigInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BadgeConfigInfo) + err := c.cc.Invoke(ctx, PlantService_GetBadgeConfigDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetBadgeConfigTree(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*BadgeConfigTreeResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BadgeConfigTreeResp) + err := c.cc.Invoke(ctx, PlantService_GetBadgeConfigTree_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CreateBadgeConfig(ctx context.Context, in *CreateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_CreateBadgeConfig_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) UpdateBadgeConfig(ctx context.Context, in *UpdateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateBadgeConfig_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteBadgeConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteBadgeConfig_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetWikiClassDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(WikiClassInfo) + err := c.cc.Invoke(ctx, PlantService_GetWikiClassDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetAiChatHistory(ctx context.Context, in *AiChatHistoryReq, opts ...grpc.CallOption) (*AiChatHistoryResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AiChatHistoryResp) + err := c.cc.Invoke(ctx, PlantService_GetAiChatHistory_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) SaveAiChatHistory(ctx context.Context, in *SaveAiChatHistoryReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_SaveAiChatHistory_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteAiChatHistory(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteAiChatHistory_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) ClearAiChatHistory(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_ClearAiChatHistory_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetAiChatQuota(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*AiQuotaResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AiQuotaResp) + err := c.cc.Invoke(ctx, PlantService_GetAiChatQuota_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PlantServiceServer is the server API for PlantService service. +// All implementations must embed UnimplementedPlantServiceServer +// for forward compatibility. +type PlantServiceServer interface { + // 用户Profile + GetUserProfile(context.Context, *GetProfileReq) (*PlantUserProfile, error) + UpdateUserProfile(context.Context, *UpdateProfileReq) (*CommonResp, error) + GetMyBadges(context.Context, *GetProfileReq) (*UserBadgeListResp, error) + GetMyStars(context.Context, *GetProfileReq) (*UserStarListResp, error) + // 我的植物 + CreatePlant(context.Context, *CreatePlantReq) (*CommonResp, error) + UpdatePlant(context.Context, *UpdatePlantReq) (*CommonResp, error) + DeletePlant(context.Context, *IdsReq) (*CommonResp, error) + GetPlantList(context.Context, *PlantListReq) (*PlantListResp, error) + GetPlantDetail(context.Context, *IdReq) (*PlantDetailResp, error) + // 养护 + AddCarePlan(context.Context, *AddCarePlanReq) (*CommonResp, error) + DeleteCarePlan(context.Context, *IdsReq) (*CommonResp, error) + GetTodayTaskList(context.Context, *GetProfileReq) (*CareTaskListResp, error) + CompleteTask(context.Context, *CompleteTaskReq) (*TaskCompletionResult, error) + AddCareRecord(context.Context, *AddCareRecordReq) (*CommonResp, error) + AddGrowthRecord(context.Context, *AddGrowthRecordReq) (*CommonResp, error) + // 百科 + GetWikiList(context.Context, *WikiListReq) (*WikiListResp, error) + GetWikiDetail(context.Context, *IdReq) (*WikiDetailResp, error) + CreateWiki(context.Context, *CreateWikiReq) (*CommonResp, error) + UpdateWiki(context.Context, *UpdateWikiReq) (*CommonResp, error) + DeleteWiki(context.Context, *IdsReq) (*CommonResp, error) + SyncWikiVector(context.Context, *SyncWikiVectorReq) (*CommonResp, error) + DeleteWikiVector(context.Context, *SyncWikiVectorReq) (*CommonResp, error) + SyncAllWikiVector(context.Context, *PageReq) (*CommonResp, error) + GetWikiClassList(context.Context, *IdReq) (*WikiClassListResp, error) + CreateWikiClass(context.Context, *CreateWikiClassReq) (*CommonResp, error) + UpdateWikiClass(context.Context, *UpdateWikiClassReq) (*CommonResp, error) + DeleteWikiClass(context.Context, *IdsReq) (*CommonResp, error) + ToggleWikiStar(context.Context, *ToggleStarReq) (*CommonResp, error) + // OCR + GetMyClassifyLog(context.Context, *GetProfileReq) (*ClassifyLogListResp, error) + DeleteClassifyLog(context.Context, *IdsReq) (*CommonResp, error) + // 社区 + CreatePost(context.Context, *CreatePostReq) (*CommonResp, error) + DeletePost(context.Context, *IdsReq) (*CommonResp, error) + GetPostList(context.Context, *PostListReq) (*PostListResp, error) + GetPostDetail(context.Context, *IdReq) (*PostDetailResp, error) + CommentPost(context.Context, *CommentPostReq) (*CommonResp, error) + LikePost(context.Context, *LikePostReq) (*CommonResp, error) + StarPost(context.Context, *LikePostReq) (*CommonResp, error) + MediaCheckCallback(context.Context, *MediaCheckCallbackReq) (*CommonResp, error) + // 话题 + GetTopicList(context.Context, *IdReq) (*TopicListResp, error) + GetTopicDetail(context.Context, *IdReq) (*TopicInfo, error) + CreateTopic(context.Context, *CreateTopicReq) (*CommonResp, error) + UpdateTopic(context.Context, *UpdateTopicReq) (*CommonResp, error) + DeleteTopic(context.Context, *IdsReq) (*CommonResp, error) + // 兑换 + GetExchangeItemList(context.Context, *ExchangeItemListReq) (*ExchangeItemListResp, error) + GetExchangeItemDetail(context.Context, *IdReq) (*ExchangeItemInfo, error) + CreateExchangeItem(context.Context, *CreateExchangeItemReq) (*CommonResp, error) + UpdateExchangeItem(context.Context, *UpdateExchangeItemReq) (*CommonResp, error) + DeleteExchangeItem(context.Context, *IdsReq) (*CommonResp, error) + CreateExchangeOrder(context.Context, *CreateExchangeOrderReq) (*CommonResp, error) + GetMyExchangeOrders(context.Context, *ExchangeOrderListReq) (*ExchangeOrderListResp, error) + GetExchangeOrderList(context.Context, *ExchangeOrderListReq) (*ExchangeOrderListResp, error) + UpdateExchangeOrder(context.Context, *UpdateExchangeOrderReq) (*CommonResp, error) + // 配置 + GetLevelConfigList(context.Context, *PageReq) (*LevelConfigListResp, error) + GetLevelConfigDetail(context.Context, *IdReq) (*LevelConfigInfo, error) + CreateLevelConfig(context.Context, *CreateLevelConfigReq) (*CommonResp, error) + UpdateLevelConfig(context.Context, *UpdateLevelConfigReq) (*CommonResp, error) + DeleteLevelConfig(context.Context, *IdsReq) (*CommonResp, error) + GetBadgeConfigList(context.Context, *BadgeConfigListReq) (*BadgeConfigListResp, error) + GetBadgeConfigDetail(context.Context, *IdReq) (*BadgeConfigInfo, error) + GetBadgeConfigTree(context.Context, *IdReq) (*BadgeConfigTreeResp, error) + CreateBadgeConfig(context.Context, *CreateBadgeConfigReq) (*CommonResp, error) + UpdateBadgeConfig(context.Context, *UpdateBadgeConfigReq) (*CommonResp, error) + DeleteBadgeConfig(context.Context, *IdsReq) (*CommonResp, error) + GetWikiClassDetail(context.Context, *IdReq) (*WikiClassInfo, error) + // AI + GetAiChatHistory(context.Context, *AiChatHistoryReq) (*AiChatHistoryResp, error) + SaveAiChatHistory(context.Context, *SaveAiChatHistoryReq) (*CommonResp, error) + DeleteAiChatHistory(context.Context, *IdsReq) (*CommonResp, error) + ClearAiChatHistory(context.Context, *GetProfileReq) (*CommonResp, error) + GetAiChatQuota(context.Context, *GetProfileReq) (*AiQuotaResp, error) + mustEmbedUnimplementedPlantServiceServer() +} + +// UnimplementedPlantServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedPlantServiceServer struct{} + +func (UnimplementedPlantServiceServer) GetUserProfile(context.Context, *GetProfileReq) (*PlantUserProfile, error) { + return nil, status.Error(codes.Unimplemented, "method GetUserProfile not implemented") +} +func (UnimplementedPlantServiceServer) UpdateUserProfile(context.Context, *UpdateProfileReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateUserProfile not implemented") +} +func (UnimplementedPlantServiceServer) GetMyBadges(context.Context, *GetProfileReq) (*UserBadgeListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetMyBadges not implemented") +} +func (UnimplementedPlantServiceServer) GetMyStars(context.Context, *GetProfileReq) (*UserStarListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetMyStars not implemented") +} +func (UnimplementedPlantServiceServer) CreatePlant(context.Context, *CreatePlantReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreatePlant not implemented") +} +func (UnimplementedPlantServiceServer) UpdatePlant(context.Context, *UpdatePlantReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdatePlant not implemented") +} +func (UnimplementedPlantServiceServer) DeletePlant(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeletePlant not implemented") +} +func (UnimplementedPlantServiceServer) GetPlantList(context.Context, *PlantListReq) (*PlantListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetPlantList not implemented") +} +func (UnimplementedPlantServiceServer) GetPlantDetail(context.Context, *IdReq) (*PlantDetailResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetPlantDetail not implemented") +} +func (UnimplementedPlantServiceServer) AddCarePlan(context.Context, *AddCarePlanReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method AddCarePlan not implemented") +} +func (UnimplementedPlantServiceServer) DeleteCarePlan(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteCarePlan not implemented") +} +func (UnimplementedPlantServiceServer) GetTodayTaskList(context.Context, *GetProfileReq) (*CareTaskListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetTodayTaskList not implemented") +} +func (UnimplementedPlantServiceServer) CompleteTask(context.Context, *CompleteTaskReq) (*TaskCompletionResult, error) { + return nil, status.Error(codes.Unimplemented, "method CompleteTask not implemented") +} +func (UnimplementedPlantServiceServer) AddCareRecord(context.Context, *AddCareRecordReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method AddCareRecord not implemented") +} +func (UnimplementedPlantServiceServer) AddGrowthRecord(context.Context, *AddGrowthRecordReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method AddGrowthRecord not implemented") +} +func (UnimplementedPlantServiceServer) GetWikiList(context.Context, *WikiListReq) (*WikiListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetWikiList not implemented") +} +func (UnimplementedPlantServiceServer) GetWikiDetail(context.Context, *IdReq) (*WikiDetailResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetWikiDetail not implemented") +} +func (UnimplementedPlantServiceServer) CreateWiki(context.Context, *CreateWikiReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateWiki not implemented") +} +func (UnimplementedPlantServiceServer) UpdateWiki(context.Context, *UpdateWikiReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateWiki not implemented") +} +func (UnimplementedPlantServiceServer) DeleteWiki(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteWiki not implemented") +} +func (UnimplementedPlantServiceServer) SyncWikiVector(context.Context, *SyncWikiVectorReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method SyncWikiVector not implemented") +} +func (UnimplementedPlantServiceServer) DeleteWikiVector(context.Context, *SyncWikiVectorReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteWikiVector not implemented") +} +func (UnimplementedPlantServiceServer) SyncAllWikiVector(context.Context, *PageReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method SyncAllWikiVector not implemented") +} +func (UnimplementedPlantServiceServer) GetWikiClassList(context.Context, *IdReq) (*WikiClassListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetWikiClassList not implemented") +} +func (UnimplementedPlantServiceServer) CreateWikiClass(context.Context, *CreateWikiClassReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateWikiClass not implemented") +} +func (UnimplementedPlantServiceServer) UpdateWikiClass(context.Context, *UpdateWikiClassReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateWikiClass not implemented") +} +func (UnimplementedPlantServiceServer) DeleteWikiClass(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteWikiClass not implemented") +} +func (UnimplementedPlantServiceServer) ToggleWikiStar(context.Context, *ToggleStarReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method ToggleWikiStar not implemented") +} +func (UnimplementedPlantServiceServer) GetMyClassifyLog(context.Context, *GetProfileReq) (*ClassifyLogListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetMyClassifyLog not implemented") +} +func (UnimplementedPlantServiceServer) DeleteClassifyLog(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteClassifyLog not implemented") +} +func (UnimplementedPlantServiceServer) CreatePost(context.Context, *CreatePostReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreatePost not implemented") +} +func (UnimplementedPlantServiceServer) DeletePost(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeletePost not implemented") +} +func (UnimplementedPlantServiceServer) GetPostList(context.Context, *PostListReq) (*PostListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetPostList not implemented") +} +func (UnimplementedPlantServiceServer) GetPostDetail(context.Context, *IdReq) (*PostDetailResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetPostDetail not implemented") +} +func (UnimplementedPlantServiceServer) CommentPost(context.Context, *CommentPostReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CommentPost not implemented") +} +func (UnimplementedPlantServiceServer) LikePost(context.Context, *LikePostReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method LikePost not implemented") +} +func (UnimplementedPlantServiceServer) StarPost(context.Context, *LikePostReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method StarPost not implemented") +} +func (UnimplementedPlantServiceServer) MediaCheckCallback(context.Context, *MediaCheckCallbackReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method MediaCheckCallback not implemented") +} +func (UnimplementedPlantServiceServer) GetTopicList(context.Context, *IdReq) (*TopicListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetTopicList not implemented") +} +func (UnimplementedPlantServiceServer) GetTopicDetail(context.Context, *IdReq) (*TopicInfo, error) { + return nil, status.Error(codes.Unimplemented, "method GetTopicDetail not implemented") +} +func (UnimplementedPlantServiceServer) CreateTopic(context.Context, *CreateTopicReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateTopic not implemented") +} +func (UnimplementedPlantServiceServer) UpdateTopic(context.Context, *UpdateTopicReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateTopic not implemented") +} +func (UnimplementedPlantServiceServer) DeleteTopic(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteTopic not implemented") +} +func (UnimplementedPlantServiceServer) GetExchangeItemList(context.Context, *ExchangeItemListReq) (*ExchangeItemListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetExchangeItemList not implemented") +} +func (UnimplementedPlantServiceServer) GetExchangeItemDetail(context.Context, *IdReq) (*ExchangeItemInfo, error) { + return nil, status.Error(codes.Unimplemented, "method GetExchangeItemDetail not implemented") +} +func (UnimplementedPlantServiceServer) CreateExchangeItem(context.Context, *CreateExchangeItemReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateExchangeItem not implemented") +} +func (UnimplementedPlantServiceServer) UpdateExchangeItem(context.Context, *UpdateExchangeItemReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateExchangeItem not implemented") +} +func (UnimplementedPlantServiceServer) DeleteExchangeItem(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteExchangeItem not implemented") +} +func (UnimplementedPlantServiceServer) CreateExchangeOrder(context.Context, *CreateExchangeOrderReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateExchangeOrder not implemented") +} +func (UnimplementedPlantServiceServer) GetMyExchangeOrders(context.Context, *ExchangeOrderListReq) (*ExchangeOrderListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetMyExchangeOrders not implemented") +} +func (UnimplementedPlantServiceServer) GetExchangeOrderList(context.Context, *ExchangeOrderListReq) (*ExchangeOrderListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetExchangeOrderList not implemented") +} +func (UnimplementedPlantServiceServer) UpdateExchangeOrder(context.Context, *UpdateExchangeOrderReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateExchangeOrder not implemented") +} +func (UnimplementedPlantServiceServer) GetLevelConfigList(context.Context, *PageReq) (*LevelConfigListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetLevelConfigList not implemented") +} +func (UnimplementedPlantServiceServer) GetLevelConfigDetail(context.Context, *IdReq) (*LevelConfigInfo, error) { + return nil, status.Error(codes.Unimplemented, "method GetLevelConfigDetail not implemented") +} +func (UnimplementedPlantServiceServer) CreateLevelConfig(context.Context, *CreateLevelConfigReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateLevelConfig not implemented") +} +func (UnimplementedPlantServiceServer) UpdateLevelConfig(context.Context, *UpdateLevelConfigReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateLevelConfig not implemented") +} +func (UnimplementedPlantServiceServer) DeleteLevelConfig(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteLevelConfig not implemented") +} +func (UnimplementedPlantServiceServer) GetBadgeConfigList(context.Context, *BadgeConfigListReq) (*BadgeConfigListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetBadgeConfigList not implemented") +} +func (UnimplementedPlantServiceServer) GetBadgeConfigDetail(context.Context, *IdReq) (*BadgeConfigInfo, error) { + return nil, status.Error(codes.Unimplemented, "method GetBadgeConfigDetail not implemented") +} +func (UnimplementedPlantServiceServer) GetBadgeConfigTree(context.Context, *IdReq) (*BadgeConfigTreeResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetBadgeConfigTree not implemented") +} +func (UnimplementedPlantServiceServer) CreateBadgeConfig(context.Context, *CreateBadgeConfigReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateBadgeConfig not implemented") +} +func (UnimplementedPlantServiceServer) UpdateBadgeConfig(context.Context, *UpdateBadgeConfigReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateBadgeConfig not implemented") +} +func (UnimplementedPlantServiceServer) DeleteBadgeConfig(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteBadgeConfig not implemented") +} +func (UnimplementedPlantServiceServer) GetWikiClassDetail(context.Context, *IdReq) (*WikiClassInfo, error) { + return nil, status.Error(codes.Unimplemented, "method GetWikiClassDetail not implemented") +} +func (UnimplementedPlantServiceServer) GetAiChatHistory(context.Context, *AiChatHistoryReq) (*AiChatHistoryResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetAiChatHistory not implemented") +} +func (UnimplementedPlantServiceServer) SaveAiChatHistory(context.Context, *SaveAiChatHistoryReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method SaveAiChatHistory not implemented") +} +func (UnimplementedPlantServiceServer) DeleteAiChatHistory(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteAiChatHistory not implemented") +} +func (UnimplementedPlantServiceServer) ClearAiChatHistory(context.Context, *GetProfileReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method ClearAiChatHistory not implemented") +} +func (UnimplementedPlantServiceServer) GetAiChatQuota(context.Context, *GetProfileReq) (*AiQuotaResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetAiChatQuota not implemented") +} +func (UnimplementedPlantServiceServer) mustEmbedUnimplementedPlantServiceServer() {} +func (UnimplementedPlantServiceServer) testEmbeddedByValue() {} + +// UnsafePlantServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PlantServiceServer will +// result in compilation errors. +type UnsafePlantServiceServer interface { + mustEmbedUnimplementedPlantServiceServer() +} + +func RegisterPlantServiceServer(s grpc.ServiceRegistrar, srv PlantServiceServer) { + // If the following call panics, it indicates UnimplementedPlantServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&PlantService_ServiceDesc, srv) +} + +func _PlantService_GetUserProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetUserProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetUserProfile_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetUserProfile(ctx, req.(*GetProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_UpdateUserProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateProfileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateUserProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateUserProfile_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateUserProfile(ctx, req.(*UpdateProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetMyBadges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetMyBadges(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetMyBadges_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetMyBadges(ctx, req.(*GetProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetMyStars_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetMyStars(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetMyStars_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetMyStars(ctx, req.(*GetProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CreatePlant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreatePlantReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CreatePlant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CreatePlant_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CreatePlant(ctx, req.(*CreatePlantReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_UpdatePlant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdatePlantReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdatePlant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdatePlant_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdatePlant(ctx, req.(*UpdatePlantReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeletePlant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeletePlant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeletePlant_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeletePlant(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetPlantList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PlantListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetPlantList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetPlantList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetPlantList(ctx, req.(*PlantListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetPlantDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetPlantDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetPlantDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetPlantDetail(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_AddCarePlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddCarePlanReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).AddCarePlan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_AddCarePlan_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).AddCarePlan(ctx, req.(*AddCarePlanReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteCarePlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteCarePlan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteCarePlan_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteCarePlan(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetTodayTaskList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetTodayTaskList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetTodayTaskList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetTodayTaskList(ctx, req.(*GetProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CompleteTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CompleteTaskReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CompleteTask(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CompleteTask_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CompleteTask(ctx, req.(*CompleteTaskReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_AddCareRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddCareRecordReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).AddCareRecord(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_AddCareRecord_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).AddCareRecord(ctx, req.(*AddCareRecordReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_AddGrowthRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddGrowthRecordReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).AddGrowthRecord(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_AddGrowthRecord_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).AddGrowthRecord(ctx, req.(*AddGrowthRecordReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetWikiList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WikiListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetWikiList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetWikiList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetWikiList(ctx, req.(*WikiListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetWikiDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetWikiDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetWikiDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetWikiDetail(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CreateWiki_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateWikiReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CreateWiki(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CreateWiki_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CreateWiki(ctx, req.(*CreateWikiReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_UpdateWiki_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateWikiReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateWiki(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateWiki_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateWiki(ctx, req.(*UpdateWikiReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteWiki_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteWiki(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteWiki_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteWiki(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_SyncWikiVector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SyncWikiVectorReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).SyncWikiVector(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_SyncWikiVector_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).SyncWikiVector(ctx, req.(*SyncWikiVectorReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteWikiVector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SyncWikiVectorReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteWikiVector(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteWikiVector_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteWikiVector(ctx, req.(*SyncWikiVectorReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_SyncAllWikiVector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).SyncAllWikiVector(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_SyncAllWikiVector_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).SyncAllWikiVector(ctx, req.(*PageReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetWikiClassList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetWikiClassList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetWikiClassList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetWikiClassList(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CreateWikiClass_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateWikiClassReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CreateWikiClass(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CreateWikiClass_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CreateWikiClass(ctx, req.(*CreateWikiClassReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_UpdateWikiClass_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateWikiClassReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateWikiClass(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateWikiClass_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateWikiClass(ctx, req.(*UpdateWikiClassReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteWikiClass_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteWikiClass(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteWikiClass_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteWikiClass(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_ToggleWikiStar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ToggleStarReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).ToggleWikiStar(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_ToggleWikiStar_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).ToggleWikiStar(ctx, req.(*ToggleStarReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetMyClassifyLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetMyClassifyLog(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetMyClassifyLog_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetMyClassifyLog(ctx, req.(*GetProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteClassifyLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteClassifyLog(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteClassifyLog_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteClassifyLog(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CreatePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreatePostReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CreatePost(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CreatePost_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CreatePost(ctx, req.(*CreatePostReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeletePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeletePost(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeletePost_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeletePost(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetPostList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PostListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetPostList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetPostList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetPostList(ctx, req.(*PostListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetPostDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetPostDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetPostDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetPostDetail(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CommentPost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CommentPostReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CommentPost(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CommentPost_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CommentPost(ctx, req.(*CommentPostReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_LikePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LikePostReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).LikePost(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_LikePost_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).LikePost(ctx, req.(*LikePostReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_StarPost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LikePostReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).StarPost(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_StarPost_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).StarPost(ctx, req.(*LikePostReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_MediaCheckCallback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MediaCheckCallbackReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).MediaCheckCallback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_MediaCheckCallback_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).MediaCheckCallback(ctx, req.(*MediaCheckCallbackReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetTopicList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetTopicList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetTopicList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetTopicList(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetTopicDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetTopicDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetTopicDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetTopicDetail(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CreateTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTopicReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CreateTopic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CreateTopic_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CreateTopic(ctx, req.(*CreateTopicReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_UpdateTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateTopicReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateTopic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateTopic_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateTopic(ctx, req.(*UpdateTopicReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteTopic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteTopic_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteTopic(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetExchangeItemList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExchangeItemListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetExchangeItemList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetExchangeItemList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetExchangeItemList(ctx, req.(*ExchangeItemListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetExchangeItemDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetExchangeItemDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetExchangeItemDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetExchangeItemDetail(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CreateExchangeItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateExchangeItemReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CreateExchangeItem(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CreateExchangeItem_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CreateExchangeItem(ctx, req.(*CreateExchangeItemReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_UpdateExchangeItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateExchangeItemReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateExchangeItem(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateExchangeItem_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateExchangeItem(ctx, req.(*UpdateExchangeItemReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteExchangeItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteExchangeItem(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteExchangeItem_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteExchangeItem(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CreateExchangeOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateExchangeOrderReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CreateExchangeOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CreateExchangeOrder_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CreateExchangeOrder(ctx, req.(*CreateExchangeOrderReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetMyExchangeOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExchangeOrderListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetMyExchangeOrders(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetMyExchangeOrders_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetMyExchangeOrders(ctx, req.(*ExchangeOrderListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetExchangeOrderList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExchangeOrderListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetExchangeOrderList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetExchangeOrderList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetExchangeOrderList(ctx, req.(*ExchangeOrderListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_UpdateExchangeOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateExchangeOrderReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateExchangeOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateExchangeOrder_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateExchangeOrder(ctx, req.(*UpdateExchangeOrderReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetLevelConfigList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetLevelConfigList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetLevelConfigList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetLevelConfigList(ctx, req.(*PageReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetLevelConfigDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetLevelConfigDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetLevelConfigDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetLevelConfigDetail(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CreateLevelConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateLevelConfigReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CreateLevelConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CreateLevelConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CreateLevelConfig(ctx, req.(*CreateLevelConfigReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_UpdateLevelConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateLevelConfigReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateLevelConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateLevelConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateLevelConfig(ctx, req.(*UpdateLevelConfigReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteLevelConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteLevelConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteLevelConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteLevelConfig(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetBadgeConfigList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BadgeConfigListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetBadgeConfigList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetBadgeConfigList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetBadgeConfigList(ctx, req.(*BadgeConfigListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetBadgeConfigDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetBadgeConfigDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetBadgeConfigDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetBadgeConfigDetail(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetBadgeConfigTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetBadgeConfigTree(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetBadgeConfigTree_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetBadgeConfigTree(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CreateBadgeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateBadgeConfigReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CreateBadgeConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CreateBadgeConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CreateBadgeConfig(ctx, req.(*CreateBadgeConfigReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_UpdateBadgeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateBadgeConfigReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateBadgeConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateBadgeConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateBadgeConfig(ctx, req.(*UpdateBadgeConfigReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteBadgeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteBadgeConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteBadgeConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteBadgeConfig(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetWikiClassDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetWikiClassDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetWikiClassDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetWikiClassDetail(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetAiChatHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AiChatHistoryReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetAiChatHistory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetAiChatHistory_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetAiChatHistory(ctx, req.(*AiChatHistoryReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_SaveAiChatHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SaveAiChatHistoryReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).SaveAiChatHistory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_SaveAiChatHistory_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).SaveAiChatHistory(ctx, req.(*SaveAiChatHistoryReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteAiChatHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteAiChatHistory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteAiChatHistory_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteAiChatHistory(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_ClearAiChatHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).ClearAiChatHistory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_ClearAiChatHistory_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).ClearAiChatHistory(ctx, req.(*GetProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetAiChatQuota_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetAiChatQuota(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetAiChatQuota_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetAiChatQuota(ctx, req.(*GetProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + +// PlantService_ServiceDesc is the grpc.ServiceDesc for PlantService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PlantService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "plant.PlantService", + HandlerType: (*PlantServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetUserProfile", + Handler: _PlantService_GetUserProfile_Handler, + }, + { + MethodName: "UpdateUserProfile", + Handler: _PlantService_UpdateUserProfile_Handler, + }, + { + MethodName: "GetMyBadges", + Handler: _PlantService_GetMyBadges_Handler, + }, + { + MethodName: "GetMyStars", + Handler: _PlantService_GetMyStars_Handler, + }, + { + MethodName: "CreatePlant", + Handler: _PlantService_CreatePlant_Handler, + }, + { + MethodName: "UpdatePlant", + Handler: _PlantService_UpdatePlant_Handler, + }, + { + MethodName: "DeletePlant", + Handler: _PlantService_DeletePlant_Handler, + }, + { + MethodName: "GetPlantList", + Handler: _PlantService_GetPlantList_Handler, + }, + { + MethodName: "GetPlantDetail", + Handler: _PlantService_GetPlantDetail_Handler, + }, + { + MethodName: "AddCarePlan", + Handler: _PlantService_AddCarePlan_Handler, + }, + { + MethodName: "DeleteCarePlan", + Handler: _PlantService_DeleteCarePlan_Handler, + }, + { + MethodName: "GetTodayTaskList", + Handler: _PlantService_GetTodayTaskList_Handler, + }, + { + MethodName: "CompleteTask", + Handler: _PlantService_CompleteTask_Handler, + }, + { + MethodName: "AddCareRecord", + Handler: _PlantService_AddCareRecord_Handler, + }, + { + MethodName: "AddGrowthRecord", + Handler: _PlantService_AddGrowthRecord_Handler, + }, + { + MethodName: "GetWikiList", + Handler: _PlantService_GetWikiList_Handler, + }, + { + MethodName: "GetWikiDetail", + Handler: _PlantService_GetWikiDetail_Handler, + }, + { + MethodName: "CreateWiki", + Handler: _PlantService_CreateWiki_Handler, + }, + { + MethodName: "UpdateWiki", + Handler: _PlantService_UpdateWiki_Handler, + }, + { + MethodName: "DeleteWiki", + Handler: _PlantService_DeleteWiki_Handler, + }, + { + MethodName: "SyncWikiVector", + Handler: _PlantService_SyncWikiVector_Handler, + }, + { + MethodName: "DeleteWikiVector", + Handler: _PlantService_DeleteWikiVector_Handler, + }, + { + MethodName: "SyncAllWikiVector", + Handler: _PlantService_SyncAllWikiVector_Handler, + }, + { + MethodName: "GetWikiClassList", + Handler: _PlantService_GetWikiClassList_Handler, + }, + { + MethodName: "CreateWikiClass", + Handler: _PlantService_CreateWikiClass_Handler, + }, + { + MethodName: "UpdateWikiClass", + Handler: _PlantService_UpdateWikiClass_Handler, + }, + { + MethodName: "DeleteWikiClass", + Handler: _PlantService_DeleteWikiClass_Handler, + }, + { + MethodName: "ToggleWikiStar", + Handler: _PlantService_ToggleWikiStar_Handler, + }, + { + MethodName: "GetMyClassifyLog", + Handler: _PlantService_GetMyClassifyLog_Handler, + }, + { + MethodName: "DeleteClassifyLog", + Handler: _PlantService_DeleteClassifyLog_Handler, + }, + { + MethodName: "CreatePost", + Handler: _PlantService_CreatePost_Handler, + }, + { + MethodName: "DeletePost", + Handler: _PlantService_DeletePost_Handler, + }, + { + MethodName: "GetPostList", + Handler: _PlantService_GetPostList_Handler, + }, + { + MethodName: "GetPostDetail", + Handler: _PlantService_GetPostDetail_Handler, + }, + { + MethodName: "CommentPost", + Handler: _PlantService_CommentPost_Handler, + }, + { + MethodName: "LikePost", + Handler: _PlantService_LikePost_Handler, + }, + { + MethodName: "StarPost", + Handler: _PlantService_StarPost_Handler, + }, + { + MethodName: "MediaCheckCallback", + Handler: _PlantService_MediaCheckCallback_Handler, + }, + { + MethodName: "GetTopicList", + Handler: _PlantService_GetTopicList_Handler, + }, + { + MethodName: "GetTopicDetail", + Handler: _PlantService_GetTopicDetail_Handler, + }, + { + MethodName: "CreateTopic", + Handler: _PlantService_CreateTopic_Handler, + }, + { + MethodName: "UpdateTopic", + Handler: _PlantService_UpdateTopic_Handler, + }, + { + MethodName: "DeleteTopic", + Handler: _PlantService_DeleteTopic_Handler, + }, + { + MethodName: "GetExchangeItemList", + Handler: _PlantService_GetExchangeItemList_Handler, + }, + { + MethodName: "GetExchangeItemDetail", + Handler: _PlantService_GetExchangeItemDetail_Handler, + }, + { + MethodName: "CreateExchangeItem", + Handler: _PlantService_CreateExchangeItem_Handler, + }, + { + MethodName: "UpdateExchangeItem", + Handler: _PlantService_UpdateExchangeItem_Handler, + }, + { + MethodName: "DeleteExchangeItem", + Handler: _PlantService_DeleteExchangeItem_Handler, + }, + { + MethodName: "CreateExchangeOrder", + Handler: _PlantService_CreateExchangeOrder_Handler, + }, + { + MethodName: "GetMyExchangeOrders", + Handler: _PlantService_GetMyExchangeOrders_Handler, + }, + { + MethodName: "GetExchangeOrderList", + Handler: _PlantService_GetExchangeOrderList_Handler, + }, + { + MethodName: "UpdateExchangeOrder", + Handler: _PlantService_UpdateExchangeOrder_Handler, + }, + { + MethodName: "GetLevelConfigList", + Handler: _PlantService_GetLevelConfigList_Handler, + }, + { + MethodName: "GetLevelConfigDetail", + Handler: _PlantService_GetLevelConfigDetail_Handler, + }, + { + MethodName: "CreateLevelConfig", + Handler: _PlantService_CreateLevelConfig_Handler, + }, + { + MethodName: "UpdateLevelConfig", + Handler: _PlantService_UpdateLevelConfig_Handler, + }, + { + MethodName: "DeleteLevelConfig", + Handler: _PlantService_DeleteLevelConfig_Handler, + }, + { + MethodName: "GetBadgeConfigList", + Handler: _PlantService_GetBadgeConfigList_Handler, + }, + { + MethodName: "GetBadgeConfigDetail", + Handler: _PlantService_GetBadgeConfigDetail_Handler, + }, + { + MethodName: "GetBadgeConfigTree", + Handler: _PlantService_GetBadgeConfigTree_Handler, + }, + { + MethodName: "CreateBadgeConfig", + Handler: _PlantService_CreateBadgeConfig_Handler, + }, + { + MethodName: "UpdateBadgeConfig", + Handler: _PlantService_UpdateBadgeConfig_Handler, + }, + { + MethodName: "DeleteBadgeConfig", + Handler: _PlantService_DeleteBadgeConfig_Handler, + }, + { + MethodName: "GetWikiClassDetail", + Handler: _PlantService_GetWikiClassDetail_Handler, + }, + { + MethodName: "GetAiChatHistory", + Handler: _PlantService_GetAiChatHistory_Handler, + }, + { + MethodName: "SaveAiChatHistory", + Handler: _PlantService_SaveAiChatHistory_Handler, + }, + { + MethodName: "DeleteAiChatHistory", + Handler: _PlantService_DeleteAiChatHistory_Handler, + }, + { + MethodName: "ClearAiChatHistory", + Handler: _PlantService_ClearAiChatHistory_Handler, + }, + { + MethodName: "GetAiChatQuota", + Handler: _PlantService_GetAiChatQuota_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pb/plant.proto", +} diff --git a/app/plant/rpc/plant.go b/app/plant/rpc/plant.go index ca5a98b..dcf6a47 100644 --- a/app/plant/rpc/plant.go +++ b/app/plant/rpc/plant.go @@ -7,7 +7,9 @@ import ( "sundynix-micro-go/app/plant/rpc/internal/config" "sundynix-micro-go/app/plant/rpc/internal/server" "sundynix-micro-go/app/plant/rpc/internal/svc" + "sundynix-micro-go/app/plant/rpc/internal/task" "sundynix-micro-go/app/plant/rpc/plant" + "sundynix-micro-go/common/utils/timer" "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/core/service" @@ -27,6 +29,13 @@ func main() { conf.MustLoad(*configFile, &c) ctx := svc.NewServiceContext(c) + // 注册定时任务 + timerTask := timer.NewTimerTask() + // 每天凌晨 1:00 检查过期养护任务 + if _, err := timerTask.AddTaskByJob("plant", "0 1 * * *", task.NewExpireCareTaskJob(ctx), "expire_care_task"); err != nil { + fmt.Printf("注册养护任务过期检查失败: %v\n", err) + } + s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { plant.RegisterPlantServiceServer(grpcServer, server.NewPlantServiceServer(ctx)) @@ -34,7 +43,10 @@ func main() { reflection.Register(grpcServer) } }) - defer s.Stop() + defer func() { + timerTask.Close() + s.Stop() + }() fmt.Printf("Starting rpc server at %s...\n", c.ListenOn) s.Start() diff --git a/app/plant/rpc/plant/plant.pb.go b/app/plant/rpc/plant/plant.pb.go index 4872fc5..d171d95 100644 --- a/app/plant/rpc/plant/plant.pb.go +++ b/app/plant/rpc/plant/plant.pb.go @@ -473,6 +473,256 @@ func (x *UpdateProfileReq) GetAvatarId() string { return "" } +// 我的徽章 +type UserBadgeInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + BadgeId string `protobuf:"bytes,2,opt,name=badgeId,proto3" json:"badgeId,omitempty"` + BadgeName string `protobuf:"bytes,3,opt,name=badgeName,proto3" json:"badgeName,omitempty"` + Dimension string `protobuf:"bytes,4,opt,name=dimension,proto3" json:"dimension,omitempty"` + Tier int32 `protobuf:"varint,5,opt,name=tier,proto3" json:"tier,omitempty"` + AwardedAt string `protobuf:"bytes,6,opt,name=awardedAt,proto3" json:"awardedAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserBadgeInfo) Reset() { + *x = UserBadgeInfo{} + mi := &file_pb_plant_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserBadgeInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserBadgeInfo) ProtoMessage() {} + +func (x *UserBadgeInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserBadgeInfo.ProtoReflect.Descriptor instead. +func (*UserBadgeInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{7} +} + +func (x *UserBadgeInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UserBadgeInfo) GetBadgeId() string { + if x != nil { + return x.BadgeId + } + return "" +} + +func (x *UserBadgeInfo) GetBadgeName() string { + if x != nil { + return x.BadgeName + } + return "" +} + +func (x *UserBadgeInfo) GetDimension() string { + if x != nil { + return x.Dimension + } + return "" +} + +func (x *UserBadgeInfo) GetTier() int32 { + if x != nil { + return x.Tier + } + return 0 +} + +func (x *UserBadgeInfo) GetAwardedAt() string { + if x != nil { + return x.AwardedAt + } + return "" +} + +type UserBadgeListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*UserBadgeInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserBadgeListResp) Reset() { + *x = UserBadgeListResp{} + mi := &file_pb_plant_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserBadgeListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserBadgeListResp) ProtoMessage() {} + +func (x *UserBadgeListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserBadgeListResp.ProtoReflect.Descriptor instead. +func (*UserBadgeListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{8} +} + +func (x *UserBadgeListResp) GetList() []*UserBadgeInfo { + if x != nil { + return x.List + } + return nil +} + +// 我的收藏 +type UserStarInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + TargetId string `protobuf:"bytes,2,opt,name=targetId,proto3" json:"targetId,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + CreatedAt string `protobuf:"bytes,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserStarInfo) Reset() { + *x = UserStarInfo{} + mi := &file_pb_plant_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserStarInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserStarInfo) ProtoMessage() {} + +func (x *UserStarInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserStarInfo.ProtoReflect.Descriptor instead. +func (*UserStarInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{9} +} + +func (x *UserStarInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UserStarInfo) GetTargetId() string { + if x != nil { + return x.TargetId + } + return "" +} + +func (x *UserStarInfo) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *UserStarInfo) GetCreatedAt() string { + if x != nil { + return x.CreatedAt + } + return "" +} + +type UserStarListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*UserStarInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserStarListResp) Reset() { + *x = UserStarListResp{} + mi := &file_pb_plant_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserStarListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserStarListResp) ProtoMessage() {} + +func (x *UserStarListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserStarListResp.ProtoReflect.Descriptor instead. +func (*UserStarListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{10} +} + +func (x *UserStarListResp) GetList() []*UserStarInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *UserStarListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + type PlantInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -493,7 +743,7 @@ type PlantInfo struct { func (x *PlantInfo) Reset() { *x = PlantInfo{} - mi := &file_pb_plant_proto_msgTypes[7] + mi := &file_pb_plant_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -505,7 +755,7 @@ func (x *PlantInfo) String() string { func (*PlantInfo) ProtoMessage() {} func (x *PlantInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[7] + mi := &file_pb_plant_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -518,7 +768,7 @@ func (x *PlantInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use PlantInfo.ProtoReflect.Descriptor instead. func (*PlantInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{7} + return file_pb_plant_proto_rawDescGZIP(), []int{11} } func (x *PlantInfo) GetId() string { @@ -622,7 +872,7 @@ type CreatePlantReq struct { func (x *CreatePlantReq) Reset() { *x = CreatePlantReq{} - mi := &file_pb_plant_proto_msgTypes[8] + mi := &file_pb_plant_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -634,7 +884,7 @@ func (x *CreatePlantReq) String() string { func (*CreatePlantReq) ProtoMessage() {} func (x *CreatePlantReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[8] + mi := &file_pb_plant_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -647,7 +897,7 @@ func (x *CreatePlantReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreatePlantReq.ProtoReflect.Descriptor instead. func (*CreatePlantReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{8} + return file_pb_plant_proto_rawDescGZIP(), []int{12} } func (x *CreatePlantReq) GetUserId() string { @@ -730,7 +980,7 @@ type UpdatePlantReq struct { func (x *UpdatePlantReq) Reset() { *x = UpdatePlantReq{} - mi := &file_pb_plant_proto_msgTypes[9] + mi := &file_pb_plant_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -742,7 +992,7 @@ func (x *UpdatePlantReq) String() string { func (*UpdatePlantReq) ProtoMessage() {} func (x *UpdatePlantReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[9] + mi := &file_pb_plant_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -755,7 +1005,7 @@ func (x *UpdatePlantReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdatePlantReq.ProtoReflect.Descriptor instead. func (*UpdatePlantReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{9} + return file_pb_plant_proto_rawDescGZIP(), []int{13} } func (x *UpdatePlantReq) GetId() string { @@ -833,7 +1083,7 @@ type PlantListReq struct { func (x *PlantListReq) Reset() { *x = PlantListReq{} - mi := &file_pb_plant_proto_msgTypes[10] + mi := &file_pb_plant_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -845,7 +1095,7 @@ func (x *PlantListReq) String() string { func (*PlantListReq) ProtoMessage() {} func (x *PlantListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[10] + mi := &file_pb_plant_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -858,7 +1108,7 @@ func (x *PlantListReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PlantListReq.ProtoReflect.Descriptor instead. func (*PlantListReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{10} + return file_pb_plant_proto_rawDescGZIP(), []int{14} } func (x *PlantListReq) GetUserId() string { @@ -899,7 +1149,7 @@ type PlantListResp struct { func (x *PlantListResp) Reset() { *x = PlantListResp{} - mi := &file_pb_plant_proto_msgTypes[11] + mi := &file_pb_plant_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -911,7 +1161,7 @@ func (x *PlantListResp) String() string { func (*PlantListResp) ProtoMessage() {} func (x *PlantListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[11] + mi := &file_pb_plant_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -924,7 +1174,7 @@ func (x *PlantListResp) ProtoReflect() protoreflect.Message { // Deprecated: Use PlantListResp.ProtoReflect.Descriptor instead. func (*PlantListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{11} + return file_pb_plant_proto_rawDescGZIP(), []int{15} } func (x *PlantListResp) GetList() []*PlantInfo { @@ -952,7 +1202,7 @@ type PlantDetailResp struct { func (x *PlantDetailResp) Reset() { *x = PlantDetailResp{} - mi := &file_pb_plant_proto_msgTypes[12] + mi := &file_pb_plant_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -964,7 +1214,7 @@ func (x *PlantDetailResp) String() string { func (*PlantDetailResp) ProtoMessage() {} func (x *PlantDetailResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[12] + mi := &file_pb_plant_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -977,7 +1227,7 @@ func (x *PlantDetailResp) ProtoReflect() protoreflect.Message { // Deprecated: Use PlantDetailResp.ProtoReflect.Descriptor instead. func (*PlantDetailResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{12} + return file_pb_plant_proto_rawDescGZIP(), []int{16} } func (x *PlantDetailResp) GetPlant() *PlantInfo { @@ -1015,7 +1265,7 @@ type CarePlanInfo struct { func (x *CarePlanInfo) Reset() { *x = CarePlanInfo{} - mi := &file_pb_plant_proto_msgTypes[13] + mi := &file_pb_plant_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1027,7 +1277,7 @@ func (x *CarePlanInfo) String() string { func (*CarePlanInfo) ProtoMessage() {} func (x *CarePlanInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[13] + mi := &file_pb_plant_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1040,7 +1290,7 @@ func (x *CarePlanInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use CarePlanInfo.ProtoReflect.Descriptor instead. func (*CarePlanInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{13} + return file_pb_plant_proto_rawDescGZIP(), []int{17} } func (x *CarePlanInfo) GetId() string { @@ -1099,7 +1349,7 @@ type AddCarePlanReq struct { func (x *AddCarePlanReq) Reset() { *x = AddCarePlanReq{} - mi := &file_pb_plant_proto_msgTypes[14] + mi := &file_pb_plant_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1111,7 +1361,7 @@ func (x *AddCarePlanReq) String() string { func (*AddCarePlanReq) ProtoMessage() {} func (x *AddCarePlanReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[14] + mi := &file_pb_plant_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1124,7 +1374,7 @@ func (x *AddCarePlanReq) ProtoReflect() protoreflect.Message { // Deprecated: Use AddCarePlanReq.ProtoReflect.Descriptor instead. func (*AddCarePlanReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{14} + return file_pb_plant_proto_rawDescGZIP(), []int{18} } func (x *AddCarePlanReq) GetUserId() string { @@ -1169,6 +1419,159 @@ func (x *AddCarePlanReq) GetPeriod() int32 { return 0 } +// 养护任务 status: 1=待完成 2=已完成 3=已过期 +type CareTaskInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + PlantId string `protobuf:"bytes,2,opt,name=plantId,proto3" json:"plantId,omitempty"` + PlanId string `protobuf:"bytes,3,opt,name=planId,proto3" json:"planId,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,5,opt,name=icon,proto3" json:"icon,omitempty"` + TargetAction string `protobuf:"bytes,6,opt,name=targetAction,proto3" json:"targetAction,omitempty"` + DueDate string `protobuf:"bytes,7,opt,name=dueDate,proto3" json:"dueDate,omitempty"` + Status int32 `protobuf:"varint,8,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CareTaskInfo) Reset() { + *x = CareTaskInfo{} + mi := &file_pb_plant_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CareTaskInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CareTaskInfo) ProtoMessage() {} + +func (x *CareTaskInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CareTaskInfo.ProtoReflect.Descriptor instead. +func (*CareTaskInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{19} +} + +func (x *CareTaskInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *CareTaskInfo) GetPlantId() string { + if x != nil { + return x.PlantId + } + return "" +} + +func (x *CareTaskInfo) GetPlanId() string { + if x != nil { + return x.PlanId + } + return "" +} + +func (x *CareTaskInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CareTaskInfo) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *CareTaskInfo) GetTargetAction() string { + if x != nil { + return x.TargetAction + } + return "" +} + +func (x *CareTaskInfo) GetDueDate() string { + if x != nil { + return x.DueDate + } + return "" +} + +func (x *CareTaskInfo) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type CareTaskListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*CareTaskInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CareTaskListResp) Reset() { + *x = CareTaskListResp{} + mi := &file_pb_plant_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CareTaskListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CareTaskListResp) ProtoMessage() {} + +func (x *CareTaskListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CareTaskListResp.ProtoReflect.Descriptor instead. +func (*CareTaskListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{20} +} + +func (x *CareTaskListResp) GetList() []*CareTaskInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *CareTaskListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + type AddCareRecordReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` @@ -1182,7 +1585,7 @@ type AddCareRecordReq struct { func (x *AddCareRecordReq) Reset() { *x = AddCareRecordReq{} - mi := &file_pb_plant_proto_msgTypes[15] + mi := &file_pb_plant_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1194,7 +1597,7 @@ func (x *AddCareRecordReq) String() string { func (*AddCareRecordReq) ProtoMessage() {} func (x *AddCareRecordReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[15] + mi := &file_pb_plant_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1207,7 +1610,7 @@ func (x *AddCareRecordReq) ProtoReflect() protoreflect.Message { // Deprecated: Use AddCareRecordReq.ProtoReflect.Descriptor instead. func (*AddCareRecordReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{15} + return file_pb_plant_proto_rawDescGZIP(), []int{21} } func (x *AddCareRecordReq) GetUserId() string { @@ -1257,7 +1660,7 @@ type GrowthRecordInfo struct { func (x *GrowthRecordInfo) Reset() { *x = GrowthRecordInfo{} - mi := &file_pb_plant_proto_msgTypes[16] + mi := &file_pb_plant_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1269,7 +1672,7 @@ func (x *GrowthRecordInfo) String() string { func (*GrowthRecordInfo) ProtoMessage() {} func (x *GrowthRecordInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[16] + mi := &file_pb_plant_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1282,7 +1685,7 @@ func (x *GrowthRecordInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use GrowthRecordInfo.ProtoReflect.Descriptor instead. func (*GrowthRecordInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{16} + return file_pb_plant_proto_rawDescGZIP(), []int{22} } func (x *GrowthRecordInfo) GetId() string { @@ -1325,7 +1728,7 @@ type AddGrowthRecordReq struct { func (x *AddGrowthRecordReq) Reset() { *x = AddGrowthRecordReq{} - mi := &file_pb_plant_proto_msgTypes[17] + mi := &file_pb_plant_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1337,7 +1740,7 @@ func (x *AddGrowthRecordReq) String() string { func (*AddGrowthRecordReq) ProtoMessage() {} func (x *AddGrowthRecordReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[17] + mi := &file_pb_plant_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1350,7 +1753,7 @@ func (x *AddGrowthRecordReq) ProtoReflect() protoreflect.Message { // Deprecated: Use AddGrowthRecordReq.ProtoReflect.Descriptor instead. func (*AddGrowthRecordReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{17} + return file_pb_plant_proto_rawDescGZIP(), []int{23} } func (x *AddGrowthRecordReq) GetUserId() string { @@ -1382,25 +1785,46 @@ func (x *AddGrowthRecordReq) GetImgIds() []string { } type WikiInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - LatinName string `protobuf:"bytes,3,opt,name=latinName,proto3" json:"latinName,omitempty"` - Aliases string `protobuf:"bytes,4,opt,name=aliases,proto3" json:"aliases,omitempty"` - Genus string `protobuf:"bytes,5,opt,name=genus,proto3" json:"genus,omitempty"` - Difficulty int32 `protobuf:"varint,6,opt,name=difficulty,proto3" json:"difficulty,omitempty"` - IsHot int32 `protobuf:"varint,7,opt,name=isHot,proto3" json:"isHot,omitempty"` - GrowthHabit string `protobuf:"bytes,8,opt,name=growthHabit,proto3" json:"growthHabit,omitempty"` - LightIntensity string `protobuf:"bytes,9,opt,name=lightIntensity,proto3" json:"lightIntensity,omitempty"` - OptimalTempPeriod string `protobuf:"bytes,10,opt,name=optimalTempPeriod,proto3" json:"optimalTempPeriod,omitempty"` - CreatedAt int64 `protobuf:"varint,11,opt,name=createdAt,proto3" json:"createdAt,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + LatinName string `protobuf:"bytes,3,opt,name=latinName,proto3" json:"latinName,omitempty"` + Aliases string `protobuf:"bytes,4,opt,name=aliases,proto3" json:"aliases,omitempty"` + Genus string `protobuf:"bytes,5,opt,name=genus,proto3" json:"genus,omitempty"` + Difficulty int32 `protobuf:"varint,6,opt,name=difficulty,proto3" json:"difficulty,omitempty"` + IsHot int32 `protobuf:"varint,7,opt,name=isHot,proto3" json:"isHot,omitempty"` + GrowthHabit string `protobuf:"bytes,8,opt,name=growthHabit,proto3" json:"growthHabit,omitempty"` + LightIntensity string `protobuf:"bytes,9,opt,name=lightIntensity,proto3" json:"lightIntensity,omitempty"` + OptimalTempPeriod string `protobuf:"bytes,10,opt,name=optimalTempPeriod,proto3" json:"optimalTempPeriod,omitempty"` + CreatedAt int64 `protobuf:"varint,11,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + ClassId string `protobuf:"bytes,12,opt,name=classId,proto3" json:"classId,omitempty"` + DistributionArea string `protobuf:"bytes,13,opt,name=distributionArea,proto3" json:"distributionArea,omitempty"` + LifeCycle string `protobuf:"bytes,14,opt,name=lifeCycle,proto3" json:"lifeCycle,omitempty"` + ClassIds []string `protobuf:"bytes,15,rep,name=classIds,proto3" json:"classIds,omitempty"` + OssIds []string `protobuf:"bytes,16,rep,name=ossIds,proto3" json:"ossIds,omitempty"` + RelatedWikiIds []string `protobuf:"bytes,17,rep,name=relatedWikiIds,proto3" json:"relatedWikiIds,omitempty"` + IsVectorSynced bool `protobuf:"varint,18,opt,name=isVectorSynced,proto3" json:"isVectorSynced,omitempty"` + IsStar bool `protobuf:"varint,19,opt,name=isStar,proto3" json:"isStar,omitempty"` + ReproductionMethod string `protobuf:"bytes,20,opt,name=reproductionMethod,proto3" json:"reproductionMethod,omitempty"` + PestsDiseases string `protobuf:"bytes,21,opt,name=pestsDiseases,proto3" json:"pestsDiseases,omitempty"` + LightType string `protobuf:"bytes,22,opt,name=lightType,proto3" json:"lightType,omitempty"` + Stem string `protobuf:"bytes,23,opt,name=stem,proto3" json:"stem,omitempty"` + Fruit string `protobuf:"bytes,24,opt,name=fruit,proto3" json:"fruit,omitempty"` + FoliageType string `protobuf:"bytes,25,opt,name=foliageType,proto3" json:"foliageType,omitempty"` + FoliageColor string `protobuf:"bytes,26,opt,name=foliageColor,proto3" json:"foliageColor,omitempty"` + FoliageShape string `protobuf:"bytes,27,opt,name=foliageShape,proto3" json:"foliageShape,omitempty"` + Height int32 `protobuf:"varint,28,opt,name=height,proto3" json:"height,omitempty"` + FloweringPeriod string `protobuf:"bytes,29,opt,name=floweringPeriod,proto3" json:"floweringPeriod,omitempty"` + FloweringColor string `protobuf:"bytes,30,opt,name=floweringColor,proto3" json:"floweringColor,omitempty"` + FloweringShape string `protobuf:"bytes,31,opt,name=floweringShape,proto3" json:"floweringShape,omitempty"` + FloweringDiameter int32 `protobuf:"varint,32,opt,name=floweringDiameter,proto3" json:"floweringDiameter,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *WikiInfo) Reset() { *x = WikiInfo{} - mi := &file_pb_plant_proto_msgTypes[18] + mi := &file_pb_plant_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1412,7 +1836,7 @@ func (x *WikiInfo) String() string { func (*WikiInfo) ProtoMessage() {} func (x *WikiInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[18] + mi := &file_pb_plant_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1425,7 +1849,7 @@ func (x *WikiInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use WikiInfo.ProtoReflect.Descriptor instead. func (*WikiInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{18} + return file_pb_plant_proto_rawDescGZIP(), []int{24} } func (x *WikiInfo) GetId() string { @@ -1505,6 +1929,153 @@ func (x *WikiInfo) GetCreatedAt() int64 { return 0 } +func (x *WikiInfo) GetClassId() string { + if x != nil { + return x.ClassId + } + return "" +} + +func (x *WikiInfo) GetDistributionArea() string { + if x != nil { + return x.DistributionArea + } + return "" +} + +func (x *WikiInfo) GetLifeCycle() string { + if x != nil { + return x.LifeCycle + } + return "" +} + +func (x *WikiInfo) GetClassIds() []string { + if x != nil { + return x.ClassIds + } + return nil +} + +func (x *WikiInfo) GetOssIds() []string { + if x != nil { + return x.OssIds + } + return nil +} + +func (x *WikiInfo) GetRelatedWikiIds() []string { + if x != nil { + return x.RelatedWikiIds + } + return nil +} + +func (x *WikiInfo) GetIsVectorSynced() bool { + if x != nil { + return x.IsVectorSynced + } + return false +} + +func (x *WikiInfo) GetIsStar() bool { + if x != nil { + return x.IsStar + } + return false +} + +func (x *WikiInfo) GetReproductionMethod() string { + if x != nil { + return x.ReproductionMethod + } + return "" +} + +func (x *WikiInfo) GetPestsDiseases() string { + if x != nil { + return x.PestsDiseases + } + return "" +} + +func (x *WikiInfo) GetLightType() string { + if x != nil { + return x.LightType + } + return "" +} + +func (x *WikiInfo) GetStem() string { + if x != nil { + return x.Stem + } + return "" +} + +func (x *WikiInfo) GetFruit() string { + if x != nil { + return x.Fruit + } + return "" +} + +func (x *WikiInfo) GetFoliageType() string { + if x != nil { + return x.FoliageType + } + return "" +} + +func (x *WikiInfo) GetFoliageColor() string { + if x != nil { + return x.FoliageColor + } + return "" +} + +func (x *WikiInfo) GetFoliageShape() string { + if x != nil { + return x.FoliageShape + } + return "" +} + +func (x *WikiInfo) GetHeight() int32 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *WikiInfo) GetFloweringPeriod() string { + if x != nil { + return x.FloweringPeriod + } + return "" +} + +func (x *WikiInfo) GetFloweringColor() string { + if x != nil { + return x.FloweringColor + } + return "" +} + +func (x *WikiInfo) GetFloweringShape() string { + if x != nil { + return x.FloweringShape + } + return "" +} + +func (x *WikiInfo) GetFloweringDiameter() int32 { + if x != nil { + return x.FloweringDiameter + } + return 0 +} + type WikiListReq struct { state protoimpl.MessageState `protogen:"open.v1"` Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` @@ -1518,7 +2089,7 @@ type WikiListReq struct { func (x *WikiListReq) Reset() { *x = WikiListReq{} - mi := &file_pb_plant_proto_msgTypes[19] + mi := &file_pb_plant_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1530,7 +2101,7 @@ func (x *WikiListReq) String() string { func (*WikiListReq) ProtoMessage() {} func (x *WikiListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[19] + mi := &file_pb_plant_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1543,7 +2114,7 @@ func (x *WikiListReq) ProtoReflect() protoreflect.Message { // Deprecated: Use WikiListReq.ProtoReflect.Descriptor instead. func (*WikiListReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{19} + return file_pb_plant_proto_rawDescGZIP(), []int{25} } func (x *WikiListReq) GetCurrent() int32 { @@ -1591,7 +2162,7 @@ type WikiListResp struct { func (x *WikiListResp) Reset() { *x = WikiListResp{} - mi := &file_pb_plant_proto_msgTypes[20] + mi := &file_pb_plant_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1603,7 +2174,7 @@ func (x *WikiListResp) String() string { func (*WikiListResp) ProtoMessage() {} func (x *WikiListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[20] + mi := &file_pb_plant_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1616,7 +2187,7 @@ func (x *WikiListResp) ProtoReflect() protoreflect.Message { // Deprecated: Use WikiListResp.ProtoReflect.Descriptor instead. func (*WikiListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{20} + return file_pb_plant_proto_rawDescGZIP(), []int{26} } func (x *WikiListResp) GetList() []*WikiInfo { @@ -1642,7 +2213,7 @@ type WikiDetailResp struct { func (x *WikiDetailResp) Reset() { *x = WikiDetailResp{} - mi := &file_pb_plant_proto_msgTypes[21] + mi := &file_pb_plant_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1654,7 +2225,7 @@ func (x *WikiDetailResp) String() string { func (*WikiDetailResp) ProtoMessage() {} func (x *WikiDetailResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[21] + mi := &file_pb_plant_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1667,7 +2238,7 @@ func (x *WikiDetailResp) ProtoReflect() protoreflect.Message { // Deprecated: Use WikiDetailResp.ProtoReflect.Descriptor instead. func (*WikiDetailResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{21} + return file_pb_plant_proto_rawDescGZIP(), []int{27} } func (x *WikiDetailResp) GetWiki() *WikiInfo { @@ -1677,6 +2248,534 @@ func (x *WikiDetailResp) GetWiki() *WikiInfo { return nil } +type CreateWikiReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + LatinName string `protobuf:"bytes,2,opt,name=latinName,proto3" json:"latinName,omitempty"` + Aliases string `protobuf:"bytes,3,opt,name=aliases,proto3" json:"aliases,omitempty"` + Genus string `protobuf:"bytes,4,opt,name=genus,proto3" json:"genus,omitempty"` + Difficulty int32 `protobuf:"varint,5,opt,name=difficulty,proto3" json:"difficulty,omitempty"` + IsHot int32 `protobuf:"varint,6,opt,name=isHot,proto3" json:"isHot,omitempty"` + GrowthHabit string `protobuf:"bytes,7,opt,name=growthHabit,proto3" json:"growthHabit,omitempty"` + LightIntensity string `protobuf:"bytes,8,opt,name=lightIntensity,proto3" json:"lightIntensity,omitempty"` + OptimalTempPeriod string `protobuf:"bytes,9,opt,name=optimalTempPeriod,proto3" json:"optimalTempPeriod,omitempty"` + ClassId string `protobuf:"bytes,10,opt,name=classId,proto3" json:"classId,omitempty"` + DistributionArea string `protobuf:"bytes,11,opt,name=distributionArea,proto3" json:"distributionArea,omitempty"` + LifeCycle string `protobuf:"bytes,12,opt,name=lifeCycle,proto3" json:"lifeCycle,omitempty"` + ClassIds []string `protobuf:"bytes,13,rep,name=classIds,proto3" json:"classIds,omitempty"` + OssIds []string `protobuf:"bytes,14,rep,name=ossIds,proto3" json:"ossIds,omitempty"` + RelatedWikiIds []string `protobuf:"bytes,15,rep,name=relatedWikiIds,proto3" json:"relatedWikiIds,omitempty"` + ReproductionMethod string `protobuf:"bytes,16,opt,name=reproductionMethod,proto3" json:"reproductionMethod,omitempty"` + PestsDiseases string `protobuf:"bytes,17,opt,name=pestsDiseases,proto3" json:"pestsDiseases,omitempty"` + LightType string `protobuf:"bytes,18,opt,name=lightType,proto3" json:"lightType,omitempty"` + Stem string `protobuf:"bytes,19,opt,name=stem,proto3" json:"stem,omitempty"` + Fruit string `protobuf:"bytes,20,opt,name=fruit,proto3" json:"fruit,omitempty"` + FoliageType string `protobuf:"bytes,21,opt,name=foliageType,proto3" json:"foliageType,omitempty"` + FoliageColor string `protobuf:"bytes,22,opt,name=foliageColor,proto3" json:"foliageColor,omitempty"` + FoliageShape string `protobuf:"bytes,23,opt,name=foliageShape,proto3" json:"foliageShape,omitempty"` + Height int32 `protobuf:"varint,24,opt,name=height,proto3" json:"height,omitempty"` + FloweringPeriod string `protobuf:"bytes,25,opt,name=floweringPeriod,proto3" json:"floweringPeriod,omitempty"` + FloweringColor string `protobuf:"bytes,26,opt,name=floweringColor,proto3" json:"floweringColor,omitempty"` + FloweringShape string `protobuf:"bytes,27,opt,name=floweringShape,proto3" json:"floweringShape,omitempty"` + FloweringDiameter int32 `protobuf:"varint,28,opt,name=floweringDiameter,proto3" json:"floweringDiameter,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateWikiReq) Reset() { + *x = CreateWikiReq{} + mi := &file_pb_plant_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateWikiReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateWikiReq) ProtoMessage() {} + +func (x *CreateWikiReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateWikiReq.ProtoReflect.Descriptor instead. +func (*CreateWikiReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{28} +} + +func (x *CreateWikiReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateWikiReq) GetLatinName() string { + if x != nil { + return x.LatinName + } + return "" +} + +func (x *CreateWikiReq) GetAliases() string { + if x != nil { + return x.Aliases + } + return "" +} + +func (x *CreateWikiReq) GetGenus() string { + if x != nil { + return x.Genus + } + return "" +} + +func (x *CreateWikiReq) GetDifficulty() int32 { + if x != nil { + return x.Difficulty + } + return 0 +} + +func (x *CreateWikiReq) GetIsHot() int32 { + if x != nil { + return x.IsHot + } + return 0 +} + +func (x *CreateWikiReq) GetGrowthHabit() string { + if x != nil { + return x.GrowthHabit + } + return "" +} + +func (x *CreateWikiReq) GetLightIntensity() string { + if x != nil { + return x.LightIntensity + } + return "" +} + +func (x *CreateWikiReq) GetOptimalTempPeriod() string { + if x != nil { + return x.OptimalTempPeriod + } + return "" +} + +func (x *CreateWikiReq) GetClassId() string { + if x != nil { + return x.ClassId + } + return "" +} + +func (x *CreateWikiReq) GetDistributionArea() string { + if x != nil { + return x.DistributionArea + } + return "" +} + +func (x *CreateWikiReq) GetLifeCycle() string { + if x != nil { + return x.LifeCycle + } + return "" +} + +func (x *CreateWikiReq) GetClassIds() []string { + if x != nil { + return x.ClassIds + } + return nil +} + +func (x *CreateWikiReq) GetOssIds() []string { + if x != nil { + return x.OssIds + } + return nil +} + +func (x *CreateWikiReq) GetRelatedWikiIds() []string { + if x != nil { + return x.RelatedWikiIds + } + return nil +} + +func (x *CreateWikiReq) GetReproductionMethod() string { + if x != nil { + return x.ReproductionMethod + } + return "" +} + +func (x *CreateWikiReq) GetPestsDiseases() string { + if x != nil { + return x.PestsDiseases + } + return "" +} + +func (x *CreateWikiReq) GetLightType() string { + if x != nil { + return x.LightType + } + return "" +} + +func (x *CreateWikiReq) GetStem() string { + if x != nil { + return x.Stem + } + return "" +} + +func (x *CreateWikiReq) GetFruit() string { + if x != nil { + return x.Fruit + } + return "" +} + +func (x *CreateWikiReq) GetFoliageType() string { + if x != nil { + return x.FoliageType + } + return "" +} + +func (x *CreateWikiReq) GetFoliageColor() string { + if x != nil { + return x.FoliageColor + } + return "" +} + +func (x *CreateWikiReq) GetFoliageShape() string { + if x != nil { + return x.FoliageShape + } + return "" +} + +func (x *CreateWikiReq) GetHeight() int32 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *CreateWikiReq) GetFloweringPeriod() string { + if x != nil { + return x.FloweringPeriod + } + return "" +} + +func (x *CreateWikiReq) GetFloweringColor() string { + if x != nil { + return x.FloweringColor + } + return "" +} + +func (x *CreateWikiReq) GetFloweringShape() string { + if x != nil { + return x.FloweringShape + } + return "" +} + +func (x *CreateWikiReq) GetFloweringDiameter() int32 { + if x != nil { + return x.FloweringDiameter + } + return 0 +} + +type UpdateWikiReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + LatinName string `protobuf:"bytes,3,opt,name=latinName,proto3" json:"latinName,omitempty"` + Aliases string `protobuf:"bytes,4,opt,name=aliases,proto3" json:"aliases,omitempty"` + Genus string `protobuf:"bytes,5,opt,name=genus,proto3" json:"genus,omitempty"` + Difficulty int32 `protobuf:"varint,6,opt,name=difficulty,proto3" json:"difficulty,omitempty"` + IsHot int32 `protobuf:"varint,7,opt,name=isHot,proto3" json:"isHot,omitempty"` + GrowthHabit string `protobuf:"bytes,8,opt,name=growthHabit,proto3" json:"growthHabit,omitempty"` + LightIntensity string `protobuf:"bytes,9,opt,name=lightIntensity,proto3" json:"lightIntensity,omitempty"` + OptimalTempPeriod string `protobuf:"bytes,10,opt,name=optimalTempPeriod,proto3" json:"optimalTempPeriod,omitempty"` + ClassId string `protobuf:"bytes,11,opt,name=classId,proto3" json:"classId,omitempty"` + DistributionArea string `protobuf:"bytes,12,opt,name=distributionArea,proto3" json:"distributionArea,omitempty"` + LifeCycle string `protobuf:"bytes,13,opt,name=lifeCycle,proto3" json:"lifeCycle,omitempty"` + ClassIds []string `protobuf:"bytes,14,rep,name=classIds,proto3" json:"classIds,omitempty"` + OssIds []string `protobuf:"bytes,15,rep,name=ossIds,proto3" json:"ossIds,omitempty"` + RelatedWikiIds []string `protobuf:"bytes,16,rep,name=relatedWikiIds,proto3" json:"relatedWikiIds,omitempty"` + ReproductionMethod string `protobuf:"bytes,17,opt,name=reproductionMethod,proto3" json:"reproductionMethod,omitempty"` + PestsDiseases string `protobuf:"bytes,18,opt,name=pestsDiseases,proto3" json:"pestsDiseases,omitempty"` + LightType string `protobuf:"bytes,19,opt,name=lightType,proto3" json:"lightType,omitempty"` + Stem string `protobuf:"bytes,20,opt,name=stem,proto3" json:"stem,omitempty"` + Fruit string `protobuf:"bytes,21,opt,name=fruit,proto3" json:"fruit,omitempty"` + FoliageType string `protobuf:"bytes,22,opt,name=foliageType,proto3" json:"foliageType,omitempty"` + FoliageColor string `protobuf:"bytes,23,opt,name=foliageColor,proto3" json:"foliageColor,omitempty"` + FoliageShape string `protobuf:"bytes,24,opt,name=foliageShape,proto3" json:"foliageShape,omitempty"` + Height int32 `protobuf:"varint,25,opt,name=height,proto3" json:"height,omitempty"` + FloweringPeriod string `protobuf:"bytes,26,opt,name=floweringPeriod,proto3" json:"floweringPeriod,omitempty"` + FloweringColor string `protobuf:"bytes,27,opt,name=floweringColor,proto3" json:"floweringColor,omitempty"` + FloweringShape string `protobuf:"bytes,28,opt,name=floweringShape,proto3" json:"floweringShape,omitempty"` + FloweringDiameter int32 `protobuf:"varint,29,opt,name=floweringDiameter,proto3" json:"floweringDiameter,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateWikiReq) Reset() { + *x = UpdateWikiReq{} + mi := &file_pb_plant_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateWikiReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateWikiReq) ProtoMessage() {} + +func (x *UpdateWikiReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateWikiReq.ProtoReflect.Descriptor instead. +func (*UpdateWikiReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{29} +} + +func (x *UpdateWikiReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateWikiReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateWikiReq) GetLatinName() string { + if x != nil { + return x.LatinName + } + return "" +} + +func (x *UpdateWikiReq) GetAliases() string { + if x != nil { + return x.Aliases + } + return "" +} + +func (x *UpdateWikiReq) GetGenus() string { + if x != nil { + return x.Genus + } + return "" +} + +func (x *UpdateWikiReq) GetDifficulty() int32 { + if x != nil { + return x.Difficulty + } + return 0 +} + +func (x *UpdateWikiReq) GetIsHot() int32 { + if x != nil { + return x.IsHot + } + return 0 +} + +func (x *UpdateWikiReq) GetGrowthHabit() string { + if x != nil { + return x.GrowthHabit + } + return "" +} + +func (x *UpdateWikiReq) GetLightIntensity() string { + if x != nil { + return x.LightIntensity + } + return "" +} + +func (x *UpdateWikiReq) GetOptimalTempPeriod() string { + if x != nil { + return x.OptimalTempPeriod + } + return "" +} + +func (x *UpdateWikiReq) GetClassId() string { + if x != nil { + return x.ClassId + } + return "" +} + +func (x *UpdateWikiReq) GetDistributionArea() string { + if x != nil { + return x.DistributionArea + } + return "" +} + +func (x *UpdateWikiReq) GetLifeCycle() string { + if x != nil { + return x.LifeCycle + } + return "" +} + +func (x *UpdateWikiReq) GetClassIds() []string { + if x != nil { + return x.ClassIds + } + return nil +} + +func (x *UpdateWikiReq) GetOssIds() []string { + if x != nil { + return x.OssIds + } + return nil +} + +func (x *UpdateWikiReq) GetRelatedWikiIds() []string { + if x != nil { + return x.RelatedWikiIds + } + return nil +} + +func (x *UpdateWikiReq) GetReproductionMethod() string { + if x != nil { + return x.ReproductionMethod + } + return "" +} + +func (x *UpdateWikiReq) GetPestsDiseases() string { + if x != nil { + return x.PestsDiseases + } + return "" +} + +func (x *UpdateWikiReq) GetLightType() string { + if x != nil { + return x.LightType + } + return "" +} + +func (x *UpdateWikiReq) GetStem() string { + if x != nil { + return x.Stem + } + return "" +} + +func (x *UpdateWikiReq) GetFruit() string { + if x != nil { + return x.Fruit + } + return "" +} + +func (x *UpdateWikiReq) GetFoliageType() string { + if x != nil { + return x.FoliageType + } + return "" +} + +func (x *UpdateWikiReq) GetFoliageColor() string { + if x != nil { + return x.FoliageColor + } + return "" +} + +func (x *UpdateWikiReq) GetFoliageShape() string { + if x != nil { + return x.FoliageShape + } + return "" +} + +func (x *UpdateWikiReq) GetHeight() int32 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *UpdateWikiReq) GetFloweringPeriod() string { + if x != nil { + return x.FloweringPeriod + } + return "" +} + +func (x *UpdateWikiReq) GetFloweringColor() string { + if x != nil { + return x.FloweringColor + } + return "" +} + +func (x *UpdateWikiReq) GetFloweringShape() string { + if x != nil { + return x.FloweringShape + } + return "" +} + +func (x *UpdateWikiReq) GetFloweringDiameter() int32 { + if x != nil { + return x.FloweringDiameter + } + return 0 +} + type WikiClassInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -1688,7 +2787,7 @@ type WikiClassInfo struct { func (x *WikiClassInfo) Reset() { *x = WikiClassInfo{} - mi := &file_pb_plant_proto_msgTypes[22] + mi := &file_pb_plant_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1700,7 +2799,7 @@ func (x *WikiClassInfo) String() string { func (*WikiClassInfo) ProtoMessage() {} func (x *WikiClassInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[22] + mi := &file_pb_plant_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1713,7 +2812,7 @@ func (x *WikiClassInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use WikiClassInfo.ProtoReflect.Descriptor instead. func (*WikiClassInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{22} + return file_pb_plant_proto_rawDescGZIP(), []int{30} } func (x *WikiClassInfo) GetId() string { @@ -1746,7 +2845,7 @@ type WikiClassListResp struct { func (x *WikiClassListResp) Reset() { *x = WikiClassListResp{} - mi := &file_pb_plant_proto_msgTypes[23] + mi := &file_pb_plant_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1758,7 +2857,7 @@ func (x *WikiClassListResp) String() string { func (*WikiClassListResp) ProtoMessage() {} func (x *WikiClassListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[23] + mi := &file_pb_plant_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1771,7 +2870,7 @@ func (x *WikiClassListResp) ProtoReflect() protoreflect.Message { // Deprecated: Use WikiClassListResp.ProtoReflect.Descriptor instead. func (*WikiClassListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{23} + return file_pb_plant_proto_rawDescGZIP(), []int{31} } func (x *WikiClassListResp) GetList() []*WikiClassInfo { @@ -1791,7 +2890,7 @@ type CreateWikiClassReq struct { func (x *CreateWikiClassReq) Reset() { *x = CreateWikiClassReq{} - mi := &file_pb_plant_proto_msgTypes[24] + mi := &file_pb_plant_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1803,7 +2902,7 @@ func (x *CreateWikiClassReq) String() string { func (*CreateWikiClassReq) ProtoMessage() {} func (x *CreateWikiClassReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[24] + mi := &file_pb_plant_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1816,7 +2915,7 @@ func (x *CreateWikiClassReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateWikiClassReq.ProtoReflect.Descriptor instead. func (*CreateWikiClassReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{24} + return file_pb_plant_proto_rawDescGZIP(), []int{32} } func (x *CreateWikiClassReq) GetName() string { @@ -1833,6 +2932,66 @@ func (x *CreateWikiClassReq) GetIcon() string { return "" } +type UpdateWikiClassReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateWikiClassReq) Reset() { + *x = UpdateWikiClassReq{} + mi := &file_pb_plant_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateWikiClassReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateWikiClassReq) ProtoMessage() {} + +func (x *UpdateWikiClassReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateWikiClassReq.ProtoReflect.Descriptor instead. +func (*UpdateWikiClassReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{33} +} + +func (x *UpdateWikiClassReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateWikiClassReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateWikiClassReq) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + type ToggleStarReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` @@ -1844,7 +3003,7 @@ type ToggleStarReq struct { func (x *ToggleStarReq) Reset() { *x = ToggleStarReq{} - mi := &file_pb_plant_proto_msgTypes[25] + mi := &file_pb_plant_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1856,7 +3015,7 @@ func (x *ToggleStarReq) String() string { func (*ToggleStarReq) ProtoMessage() {} func (x *ToggleStarReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[25] + mi := &file_pb_plant_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1869,7 +3028,7 @@ func (x *ToggleStarReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ToggleStarReq.ProtoReflect.Descriptor instead. func (*ToggleStarReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{25} + return file_pb_plant_proto_rawDescGZIP(), []int{34} } func (x *ToggleStarReq) GetUserId() string { @@ -1893,6 +3052,134 @@ func (x *ToggleStarReq) GetType() string { return "" } +type ClassifyLogInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` + ImageUrl string `protobuf:"bytes,3,opt,name=imageUrl,proto3" json:"imageUrl,omitempty"` + Result string `protobuf:"bytes,4,opt,name=result,proto3" json:"result,omitempty"` + CreatedAt string `protobuf:"bytes,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClassifyLogInfo) Reset() { + *x = ClassifyLogInfo{} + mi := &file_pb_plant_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClassifyLogInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClassifyLogInfo) ProtoMessage() {} + +func (x *ClassifyLogInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClassifyLogInfo.ProtoReflect.Descriptor instead. +func (*ClassifyLogInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{35} +} + +func (x *ClassifyLogInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ClassifyLogInfo) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ClassifyLogInfo) GetImageUrl() string { + if x != nil { + return x.ImageUrl + } + return "" +} + +func (x *ClassifyLogInfo) GetResult() string { + if x != nil { + return x.Result + } + return "" +} + +func (x *ClassifyLogInfo) GetCreatedAt() string { + if x != nil { + return x.CreatedAt + } + return "" +} + +type ClassifyLogListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*ClassifyLogInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClassifyLogListResp) Reset() { + *x = ClassifyLogListResp{} + mi := &file_pb_plant_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClassifyLogListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClassifyLogListResp) ProtoMessage() {} + +func (x *ClassifyLogListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClassifyLogListResp.ProtoReflect.Descriptor instead. +func (*ClassifyLogListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{36} +} + +func (x *ClassifyLogListResp) GetList() []*ClassifyLogInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *ClassifyLogListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + type PostInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -1905,13 +3192,14 @@ type PostInfo struct { StarCount int32 `protobuf:"varint,8,opt,name=starCount,proto3" json:"starCount,omitempty"` Location string `protobuf:"bytes,9,opt,name=location,proto3" json:"location,omitempty"` CreatedAt int64 `protobuf:"varint,10,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + TopicId string `protobuf:"bytes,11,opt,name=topicId,proto3" json:"topicId,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *PostInfo) Reset() { *x = PostInfo{} - mi := &file_pb_plant_proto_msgTypes[26] + mi := &file_pb_plant_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1923,7 +3211,7 @@ func (x *PostInfo) String() string { func (*PostInfo) ProtoMessage() {} func (x *PostInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[26] + mi := &file_pb_plant_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1936,7 +3224,7 @@ func (x *PostInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use PostInfo.ProtoReflect.Descriptor instead. func (*PostInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{26} + return file_pb_plant_proto_rawDescGZIP(), []int{37} } func (x *PostInfo) GetId() string { @@ -2009,6 +3297,13 @@ func (x *PostInfo) GetCreatedAt() int64 { return 0 } +func (x *PostInfo) GetTopicId() string { + if x != nil { + return x.TopicId + } + return "" +} + type CreatePostReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` @@ -2023,7 +3318,7 @@ type CreatePostReq struct { func (x *CreatePostReq) Reset() { *x = CreatePostReq{} - mi := &file_pb_plant_proto_msgTypes[27] + mi := &file_pb_plant_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2035,7 +3330,7 @@ func (x *CreatePostReq) String() string { func (*CreatePostReq) ProtoMessage() {} func (x *CreatePostReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[27] + mi := &file_pb_plant_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2048,7 +3343,7 @@ func (x *CreatePostReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreatePostReq.ProtoReflect.Descriptor instead. func (*CreatePostReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{27} + return file_pb_plant_proto_rawDescGZIP(), []int{38} } func (x *CreatePostReq) GetUserId() string { @@ -2106,7 +3401,7 @@ type PostListReq struct { func (x *PostListReq) Reset() { *x = PostListReq{} - mi := &file_pb_plant_proto_msgTypes[28] + mi := &file_pb_plant_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2118,7 +3413,7 @@ func (x *PostListReq) String() string { func (*PostListReq) ProtoMessage() {} func (x *PostListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[28] + mi := &file_pb_plant_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2131,7 +3426,7 @@ func (x *PostListReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PostListReq.ProtoReflect.Descriptor instead. func (*PostListReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{28} + return file_pb_plant_proto_rawDescGZIP(), []int{39} } func (x *PostListReq) GetCurrent() int32 { @@ -2179,7 +3474,7 @@ type PostListResp struct { func (x *PostListResp) Reset() { *x = PostListResp{} - mi := &file_pb_plant_proto_msgTypes[29] + mi := &file_pb_plant_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2191,7 +3486,7 @@ func (x *PostListResp) String() string { func (*PostListResp) ProtoMessage() {} func (x *PostListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[29] + mi := &file_pb_plant_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2204,7 +3499,7 @@ func (x *PostListResp) ProtoReflect() protoreflect.Message { // Deprecated: Use PostListResp.ProtoReflect.Descriptor instead. func (*PostListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{29} + return file_pb_plant_proto_rawDescGZIP(), []int{40} } func (x *PostListResp) GetList() []*PostInfo { @@ -2231,7 +3526,7 @@ type PostDetailResp struct { func (x *PostDetailResp) Reset() { *x = PostDetailResp{} - mi := &file_pb_plant_proto_msgTypes[30] + mi := &file_pb_plant_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2243,7 +3538,7 @@ func (x *PostDetailResp) String() string { func (*PostDetailResp) ProtoMessage() {} func (x *PostDetailResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[30] + mi := &file_pb_plant_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2256,7 +3551,7 @@ func (x *PostDetailResp) ProtoReflect() protoreflect.Message { // Deprecated: Use PostDetailResp.ProtoReflect.Descriptor instead. func (*PostDetailResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{30} + return file_pb_plant_proto_rawDescGZIP(), []int{41} } func (x *PostDetailResp) GetPost() *PostInfo { @@ -2286,7 +3581,7 @@ type PostCommentInfo struct { func (x *PostCommentInfo) Reset() { *x = PostCommentInfo{} - mi := &file_pb_plant_proto_msgTypes[31] + mi := &file_pb_plant_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2298,7 +3593,7 @@ func (x *PostCommentInfo) String() string { func (*PostCommentInfo) ProtoMessage() {} func (x *PostCommentInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[31] + mi := &file_pb_plant_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2311,7 +3606,7 @@ func (x *PostCommentInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use PostCommentInfo.ProtoReflect.Descriptor instead. func (*PostCommentInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{31} + return file_pb_plant_proto_rawDescGZIP(), []int{42} } func (x *PostCommentInfo) GetId() string { @@ -2361,7 +3656,7 @@ type CommentPostReq struct { func (x *CommentPostReq) Reset() { *x = CommentPostReq{} - mi := &file_pb_plant_proto_msgTypes[32] + mi := &file_pb_plant_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2373,7 +3668,7 @@ func (x *CommentPostReq) String() string { func (*CommentPostReq) ProtoMessage() {} func (x *CommentPostReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[32] + mi := &file_pb_plant_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2386,7 +3681,7 @@ func (x *CommentPostReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CommentPostReq.ProtoReflect.Descriptor instead. func (*CommentPostReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{32} + return file_pb_plant_proto_rawDescGZIP(), []int{43} } func (x *CommentPostReq) GetUserId() string { @@ -2427,7 +3722,7 @@ type LikePostReq struct { func (x *LikePostReq) Reset() { *x = LikePostReq{} - mi := &file_pb_plant_proto_msgTypes[33] + mi := &file_pb_plant_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2439,7 +3734,7 @@ func (x *LikePostReq) String() string { func (*LikePostReq) ProtoMessage() {} func (x *LikePostReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[33] + mi := &file_pb_plant_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2452,7 +3747,7 @@ func (x *LikePostReq) ProtoReflect() protoreflect.Message { // Deprecated: Use LikePostReq.ProtoReflect.Descriptor instead. func (*LikePostReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{33} + return file_pb_plant_proto_rawDescGZIP(), []int{44} } func (x *LikePostReq) GetUserId() string { @@ -2474,13 +3769,19 @@ type TopicInfo struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` PostCount int32 `protobuf:"varint,3,opt,name=postCount,proto3" json:"postCount,omitempty"` + Icon string `protobuf:"bytes,4,opt,name=icon,proto3" json:"icon,omitempty"` + Desc string `protobuf:"bytes,5,opt,name=desc,proto3" json:"desc,omitempty"` + Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"` + Remark string `protobuf:"bytes,7,opt,name=remark,proto3" json:"remark,omitempty"` + StartTime string `protobuf:"bytes,8,opt,name=startTime,proto3" json:"startTime,omitempty"` + EndTime string `protobuf:"bytes,9,opt,name=endTime,proto3" json:"endTime,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *TopicInfo) Reset() { *x = TopicInfo{} - mi := &file_pb_plant_proto_msgTypes[34] + mi := &file_pb_plant_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2492,7 +3793,7 @@ func (x *TopicInfo) String() string { func (*TopicInfo) ProtoMessage() {} func (x *TopicInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[34] + mi := &file_pb_plant_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2505,7 +3806,7 @@ func (x *TopicInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use TopicInfo.ProtoReflect.Descriptor instead. func (*TopicInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{34} + return file_pb_plant_proto_rawDescGZIP(), []int{45} } func (x *TopicInfo) GetId() string { @@ -2529,6 +3830,48 @@ func (x *TopicInfo) GetPostCount() int32 { return 0 } +func (x *TopicInfo) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *TopicInfo) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *TopicInfo) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *TopicInfo) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *TopicInfo) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *TopicInfo) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + type TopicListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*TopicInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` @@ -2538,7 +3881,7 @@ type TopicListResp struct { func (x *TopicListResp) Reset() { *x = TopicListResp{} - mi := &file_pb_plant_proto_msgTypes[35] + mi := &file_pb_plant_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2550,7 +3893,7 @@ func (x *TopicListResp) String() string { func (*TopicListResp) ProtoMessage() {} func (x *TopicListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[35] + mi := &file_pb_plant_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2563,7 +3906,7 @@ func (x *TopicListResp) ProtoReflect() protoreflect.Message { // Deprecated: Use TopicListResp.ProtoReflect.Descriptor instead. func (*TopicListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{35} + return file_pb_plant_proto_rawDescGZIP(), []int{46} } func (x *TopicListResp) GetList() []*TopicInfo { @@ -2578,13 +3921,17 @@ type CreateTopicReq struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Icon string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"` Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` + Remark string `protobuf:"bytes,5,opt,name=remark,proto3" json:"remark,omitempty"` + StartTime string `protobuf:"bytes,6,opt,name=startTime,proto3" json:"startTime,omitempty"` + EndTime string `protobuf:"bytes,7,opt,name=endTime,proto3" json:"endTime,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *CreateTopicReq) Reset() { *x = CreateTopicReq{} - mi := &file_pb_plant_proto_msgTypes[36] + mi := &file_pb_plant_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2596,7 +3943,7 @@ func (x *CreateTopicReq) String() string { func (*CreateTopicReq) ProtoMessage() {} func (x *CreateTopicReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[36] + mi := &file_pb_plant_proto_msgTypes[47] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2609,7 +3956,7 @@ func (x *CreateTopicReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateTopicReq.ProtoReflect.Descriptor instead. func (*CreateTopicReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{36} + return file_pb_plant_proto_rawDescGZIP(), []int{47} } func (x *CreateTopicReq) GetName() string { @@ -2633,6 +3980,134 @@ func (x *CreateTopicReq) GetDesc() string { return "" } +func (x *CreateTopicReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *CreateTopicReq) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *CreateTopicReq) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *CreateTopicReq) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + +type UpdateTopicReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` + Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` + Remark string `protobuf:"bytes,6,opt,name=remark,proto3" json:"remark,omitempty"` + StartTime string `protobuf:"bytes,7,opt,name=startTime,proto3" json:"startTime,omitempty"` + EndTime string `protobuf:"bytes,8,opt,name=endTime,proto3" json:"endTime,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateTopicReq) Reset() { + *x = UpdateTopicReq{} + mi := &file_pb_plant_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateTopicReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateTopicReq) ProtoMessage() {} + +func (x *UpdateTopicReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[48] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateTopicReq.ProtoReflect.Descriptor instead. +func (*UpdateTopicReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{48} +} + +func (x *UpdateTopicReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateTopicReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateTopicReq) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *UpdateTopicReq) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *UpdateTopicReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UpdateTopicReq) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *UpdateTopicReq) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *UpdateTopicReq) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + type ExchangeItemInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -2641,13 +4116,14 @@ type ExchangeItemInfo struct { ImgId string `protobuf:"bytes,4,opt,name=imgId,proto3" json:"imgId,omitempty"` Cost int64 `protobuf:"varint,5,opt,name=cost,proto3" json:"cost,omitempty"` Stock int32 `protobuf:"varint,6,opt,name=stock,proto3" json:"stock,omitempty"` + Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ExchangeItemInfo) Reset() { *x = ExchangeItemInfo{} - mi := &file_pb_plant_proto_msgTypes[37] + mi := &file_pb_plant_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2659,7 +4135,7 @@ func (x *ExchangeItemInfo) String() string { func (*ExchangeItemInfo) ProtoMessage() {} func (x *ExchangeItemInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[37] + mi := &file_pb_plant_proto_msgTypes[49] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2672,7 +4148,7 @@ func (x *ExchangeItemInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ExchangeItemInfo.ProtoReflect.Descriptor instead. func (*ExchangeItemInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{37} + return file_pb_plant_proto_rawDescGZIP(), []int{49} } func (x *ExchangeItemInfo) GetId() string { @@ -2717,17 +4193,25 @@ func (x *ExchangeItemInfo) GetStock() int32 { return 0 } +func (x *ExchangeItemInfo) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + type ExchangeItemListReq struct { state protoimpl.MessageState `protogen:"open.v1"` Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ExchangeItemListReq) Reset() { *x = ExchangeItemListReq{} - mi := &file_pb_plant_proto_msgTypes[38] + mi := &file_pb_plant_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2739,7 +4223,7 @@ func (x *ExchangeItemListReq) String() string { func (*ExchangeItemListReq) ProtoMessage() {} func (x *ExchangeItemListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[38] + mi := &file_pb_plant_proto_msgTypes[50] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2752,7 +4236,7 @@ func (x *ExchangeItemListReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ExchangeItemListReq.ProtoReflect.Descriptor instead. func (*ExchangeItemListReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{38} + return file_pb_plant_proto_rawDescGZIP(), []int{50} } func (x *ExchangeItemListReq) GetCurrent() int32 { @@ -2769,6 +4253,13 @@ func (x *ExchangeItemListReq) GetPageSize() int32 { return 0 } +func (x *ExchangeItemListReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + type ExchangeItemListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*ExchangeItemInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` @@ -2779,7 +4270,7 @@ type ExchangeItemListResp struct { func (x *ExchangeItemListResp) Reset() { *x = ExchangeItemListResp{} - mi := &file_pb_plant_proto_msgTypes[39] + mi := &file_pb_plant_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2791,7 +4282,7 @@ func (x *ExchangeItemListResp) String() string { func (*ExchangeItemListResp) ProtoMessage() {} func (x *ExchangeItemListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[39] + mi := &file_pb_plant_proto_msgTypes[51] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2804,7 +4295,7 @@ func (x *ExchangeItemListResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ExchangeItemListResp.ProtoReflect.Descriptor instead. func (*ExchangeItemListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{39} + return file_pb_plant_proto_rawDescGZIP(), []int{51} } func (x *ExchangeItemListResp) GetList() []*ExchangeItemInfo { @@ -2825,13 +4316,17 @@ type CreateExchangeOrderReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` ItemId string `protobuf:"bytes,2,opt,name=itemId,proto3" json:"itemId,omitempty"` + Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` + RecipientName string `protobuf:"bytes,4,opt,name=recipientName,proto3" json:"recipientName,omitempty"` + Phone string `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"` + Address string `protobuf:"bytes,6,opt,name=address,proto3" json:"address,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *CreateExchangeOrderReq) Reset() { *x = CreateExchangeOrderReq{} - mi := &file_pb_plant_proto_msgTypes[40] + mi := &file_pb_plant_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2843,7 +4338,7 @@ func (x *CreateExchangeOrderReq) String() string { func (*CreateExchangeOrderReq) ProtoMessage() {} func (x *CreateExchangeOrderReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[40] + mi := &file_pb_plant_proto_msgTypes[52] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2856,7 +4351,7 @@ func (x *CreateExchangeOrderReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateExchangeOrderReq.ProtoReflect.Descriptor instead. func (*CreateExchangeOrderReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{40} + return file_pb_plant_proto_rawDescGZIP(), []int{52} } func (x *CreateExchangeOrderReq) GetUserId() string { @@ -2873,6 +4368,854 @@ func (x *CreateExchangeOrderReq) GetItemId() string { return "" } +func (x *CreateExchangeOrderReq) GetQuantity() int32 { + if x != nil { + return x.Quantity + } + return 0 +} + +func (x *CreateExchangeOrderReq) GetRecipientName() string { + if x != nil { + return x.RecipientName + } + return "" +} + +func (x *CreateExchangeOrderReq) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +func (x *CreateExchangeOrderReq) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +type CreateExchangeItemReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` + ImgId string `protobuf:"bytes,3,opt,name=imgId,proto3" json:"imgId,omitempty"` + Cost int64 `protobuf:"varint,4,opt,name=cost,proto3" json:"cost,omitempty"` + Stock int32 `protobuf:"varint,5,opt,name=stock,proto3" json:"stock,omitempty"` + Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` + CostSunlight int64 `protobuf:"varint,7,opt,name=costSunlight,proto3" json:"costSunlight,omitempty"` + LimitPerUser int32 `protobuf:"varint,8,opt,name=limitPerUser,proto3" json:"limitPerUser,omitempty"` + Sort int32 `protobuf:"varint,9,opt,name=sort,proto3" json:"sort,omitempty"` + StartTime string `protobuf:"bytes,10,opt,name=startTime,proto3" json:"startTime,omitempty"` + EndTime string `protobuf:"bytes,11,opt,name=endTime,proto3" json:"endTime,omitempty"` + ImageId string `protobuf:"bytes,12,opt,name=imageId,proto3" json:"imageId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateExchangeItemReq) Reset() { + *x = CreateExchangeItemReq{} + mi := &file_pb_plant_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateExchangeItemReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateExchangeItemReq) ProtoMessage() {} + +func (x *CreateExchangeItemReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[53] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateExchangeItemReq.ProtoReflect.Descriptor instead. +func (*CreateExchangeItemReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{53} +} + +func (x *CreateExchangeItemReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateExchangeItemReq) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *CreateExchangeItemReq) GetImgId() string { + if x != nil { + return x.ImgId + } + return "" +} + +func (x *CreateExchangeItemReq) GetCost() int64 { + if x != nil { + return x.Cost + } + return 0 +} + +func (x *CreateExchangeItemReq) GetStock() int32 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *CreateExchangeItemReq) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *CreateExchangeItemReq) GetCostSunlight() int64 { + if x != nil { + return x.CostSunlight + } + return 0 +} + +func (x *CreateExchangeItemReq) GetLimitPerUser() int32 { + if x != nil { + return x.LimitPerUser + } + return 0 +} + +func (x *CreateExchangeItemReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *CreateExchangeItemReq) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *CreateExchangeItemReq) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + +func (x *CreateExchangeItemReq) GetImageId() string { + if x != nil { + return x.ImageId + } + return "" +} + +type UpdateExchangeItemReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` + ImgId string `protobuf:"bytes,4,opt,name=imgId,proto3" json:"imgId,omitempty"` + Cost int64 `protobuf:"varint,5,opt,name=cost,proto3" json:"cost,omitempty"` + Stock int32 `protobuf:"varint,6,opt,name=stock,proto3" json:"stock,omitempty"` + Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` + Type string `protobuf:"bytes,8,opt,name=type,proto3" json:"type,omitempty"` + CostSunlight int64 `protobuf:"varint,9,opt,name=costSunlight,proto3" json:"costSunlight,omitempty"` + LimitPerUser int32 `protobuf:"varint,10,opt,name=limitPerUser,proto3" json:"limitPerUser,omitempty"` + Sort int32 `protobuf:"varint,11,opt,name=sort,proto3" json:"sort,omitempty"` + StartTime string `protobuf:"bytes,12,opt,name=startTime,proto3" json:"startTime,omitempty"` + EndTime string `protobuf:"bytes,13,opt,name=endTime,proto3" json:"endTime,omitempty"` + ImageId string `protobuf:"bytes,14,opt,name=imageId,proto3" json:"imageId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateExchangeItemReq) Reset() { + *x = UpdateExchangeItemReq{} + mi := &file_pb_plant_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateExchangeItemReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateExchangeItemReq) ProtoMessage() {} + +func (x *UpdateExchangeItemReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[54] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateExchangeItemReq.ProtoReflect.Descriptor instead. +func (*UpdateExchangeItemReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{54} +} + +func (x *UpdateExchangeItemReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateExchangeItemReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateExchangeItemReq) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *UpdateExchangeItemReq) GetImgId() string { + if x != nil { + return x.ImgId + } + return "" +} + +func (x *UpdateExchangeItemReq) GetCost() int64 { + if x != nil { + return x.Cost + } + return 0 +} + +func (x *UpdateExchangeItemReq) GetStock() int32 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *UpdateExchangeItemReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *UpdateExchangeItemReq) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *UpdateExchangeItemReq) GetCostSunlight() int64 { + if x != nil { + return x.CostSunlight + } + return 0 +} + +func (x *UpdateExchangeItemReq) GetLimitPerUser() int32 { + if x != nil { + return x.LimitPerUser + } + return 0 +} + +func (x *UpdateExchangeItemReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *UpdateExchangeItemReq) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *UpdateExchangeItemReq) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + +func (x *UpdateExchangeItemReq) GetImageId() string { + if x != nil { + return x.ImageId + } + return "" +} + +type ExchangeOrderInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` + ItemId string `protobuf:"bytes,3,opt,name=itemId,proto3" json:"itemId,omitempty"` + ItemName string `protobuf:"bytes,4,opt,name=itemName,proto3" json:"itemName,omitempty"` + Cost int64 `protobuf:"varint,5,opt,name=cost,proto3" json:"cost,omitempty"` + Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` + Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"` + CreatedAt string `protobuf:"bytes,8,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + Quantity int32 `protobuf:"varint,9,opt,name=quantity,proto3" json:"quantity,omitempty"` + ItemType string `protobuf:"bytes,10,opt,name=itemType,proto3" json:"itemType,omitempty"` + RecipientName string `protobuf:"bytes,11,opt,name=recipientName,proto3" json:"recipientName,omitempty"` + Phone string `protobuf:"bytes,12,opt,name=phone,proto3" json:"phone,omitempty"` + TrackingNo string `protobuf:"bytes,13,opt,name=trackingNo,proto3" json:"trackingNo,omitempty"` + Remark string `protobuf:"bytes,14,opt,name=remark,proto3" json:"remark,omitempty"` + CompletedAt string `protobuf:"bytes,15,opt,name=completedAt,proto3" json:"completedAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExchangeOrderInfo) Reset() { + *x = ExchangeOrderInfo{} + mi := &file_pb_plant_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExchangeOrderInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeOrderInfo) ProtoMessage() {} + +func (x *ExchangeOrderInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[55] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExchangeOrderInfo.ProtoReflect.Descriptor instead. +func (*ExchangeOrderInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{55} +} + +func (x *ExchangeOrderInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ExchangeOrderInfo) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ExchangeOrderInfo) GetItemId() string { + if x != nil { + return x.ItemId + } + return "" +} + +func (x *ExchangeOrderInfo) GetItemName() string { + if x != nil { + return x.ItemName + } + return "" +} + +func (x *ExchangeOrderInfo) GetCost() int64 { + if x != nil { + return x.Cost + } + return 0 +} + +func (x *ExchangeOrderInfo) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ExchangeOrderInfo) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *ExchangeOrderInfo) GetCreatedAt() string { + if x != nil { + return x.CreatedAt + } + return "" +} + +func (x *ExchangeOrderInfo) GetQuantity() int32 { + if x != nil { + return x.Quantity + } + return 0 +} + +func (x *ExchangeOrderInfo) GetItemType() string { + if x != nil { + return x.ItemType + } + return "" +} + +func (x *ExchangeOrderInfo) GetRecipientName() string { + if x != nil { + return x.RecipientName + } + return "" +} + +func (x *ExchangeOrderInfo) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +func (x *ExchangeOrderInfo) GetTrackingNo() string { + if x != nil { + return x.TrackingNo + } + return "" +} + +func (x *ExchangeOrderInfo) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *ExchangeOrderInfo) GetCompletedAt() string { + if x != nil { + return x.CompletedAt + } + return "" +} + +type ExchangeOrderListReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + UserId string `protobuf:"bytes,3,opt,name=userId,proto3" json:"userId,omitempty"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExchangeOrderListReq) Reset() { + *x = ExchangeOrderListReq{} + mi := &file_pb_plant_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExchangeOrderListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeOrderListReq) ProtoMessage() {} + +func (x *ExchangeOrderListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[56] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExchangeOrderListReq.ProtoReflect.Descriptor instead. +func (*ExchangeOrderListReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{56} +} + +func (x *ExchangeOrderListReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *ExchangeOrderListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ExchangeOrderListReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ExchangeOrderListReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type ExchangeOrderListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*ExchangeOrderInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExchangeOrderListResp) Reset() { + *x = ExchangeOrderListResp{} + mi := &file_pb_plant_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExchangeOrderListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeOrderListResp) ProtoMessage() {} + +func (x *ExchangeOrderListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[57] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExchangeOrderListResp.ProtoReflect.Descriptor instead. +func (*ExchangeOrderListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{57} +} + +func (x *ExchangeOrderListResp) GetList() []*ExchangeOrderInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *ExchangeOrderListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type UpdateExchangeOrderReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` + TrackingNo string `protobuf:"bytes,3,opt,name=trackingNo,proto3" json:"trackingNo,omitempty"` + Remark string `protobuf:"bytes,4,opt,name=remark,proto3" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateExchangeOrderReq) Reset() { + *x = UpdateExchangeOrderReq{} + mi := &file_pb_plant_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateExchangeOrderReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateExchangeOrderReq) ProtoMessage() {} + +func (x *UpdateExchangeOrderReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[58] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateExchangeOrderReq.ProtoReflect.Descriptor instead. +func (*UpdateExchangeOrderReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{58} +} + +func (x *UpdateExchangeOrderReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateExchangeOrderReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *UpdateExchangeOrderReq) GetTrackingNo() string { + if x != nil { + return x.TrackingNo + } + return "" +} + +func (x *UpdateExchangeOrderReq) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +type MediaCheckCallbackReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + TraceId string `protobuf:"bytes,1,opt,name=traceId,proto3" json:"traceId,omitempty"` + PostId string `protobuf:"bytes,2,opt,name=postId,proto3" json:"postId,omitempty"` + OssId string `protobuf:"bytes,3,opt,name=ossId,proto3" json:"ossId,omitempty"` + UserId string `protobuf:"bytes,4,opt,name=userId,proto3" json:"userId,omitempty"` + Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` + Type int32 `protobuf:"varint,6,opt,name=type,proto3" json:"type,omitempty"` + ErrMsg string `protobuf:"bytes,7,opt,name=errMsg,proto3" json:"errMsg,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MediaCheckCallbackReq) Reset() { + *x = MediaCheckCallbackReq{} + mi := &file_pb_plant_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MediaCheckCallbackReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MediaCheckCallbackReq) ProtoMessage() {} + +func (x *MediaCheckCallbackReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[59] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MediaCheckCallbackReq.ProtoReflect.Descriptor instead. +func (*MediaCheckCallbackReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{59} +} + +func (x *MediaCheckCallbackReq) GetTraceId() string { + if x != nil { + return x.TraceId + } + return "" +} + +func (x *MediaCheckCallbackReq) GetPostId() string { + if x != nil { + return x.PostId + } + return "" +} + +func (x *MediaCheckCallbackReq) GetOssId() string { + if x != nil { + return x.OssId + } + return "" +} + +func (x *MediaCheckCallbackReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *MediaCheckCallbackReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *MediaCheckCallbackReq) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *MediaCheckCallbackReq) GetErrMsg() string { + if x != nil { + return x.ErrMsg + } + return "" +} + +type SaveAiChatHistoryReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + Question string `protobuf:"bytes,2,opt,name=question,proto3" json:"question,omitempty"` + Answer string `protobuf:"bytes,3,opt,name=answer,proto3" json:"answer,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SaveAiChatHistoryReq) Reset() { + *x = SaveAiChatHistoryReq{} + mi := &file_pb_plant_proto_msgTypes[60] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SaveAiChatHistoryReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveAiChatHistoryReq) ProtoMessage() {} + +func (x *SaveAiChatHistoryReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[60] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveAiChatHistoryReq.ProtoReflect.Descriptor instead. +func (*SaveAiChatHistoryReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{60} +} + +func (x *SaveAiChatHistoryReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *SaveAiChatHistoryReq) GetQuestion() string { + if x != nil { + return x.Question + } + return "" +} + +func (x *SaveAiChatHistoryReq) GetAnswer() string { + if x != nil { + return x.Answer + } + return "" +} + +type SyncWikiVectorReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + WikiId string `protobuf:"bytes,1,opt,name=wikiId,proto3" json:"wikiId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SyncWikiVectorReq) Reset() { + *x = SyncWikiVectorReq{} + mi := &file_pb_plant_proto_msgTypes[61] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SyncWikiVectorReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncWikiVectorReq) ProtoMessage() {} + +func (x *SyncWikiVectorReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[61] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncWikiVectorReq.ProtoReflect.Descriptor instead. +func (*SyncWikiVectorReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{61} +} + +func (x *SyncWikiVectorReq) GetWikiId() string { + if x != nil { + return x.WikiId + } + return "" +} + type LevelConfigInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -2886,7 +5229,7 @@ type LevelConfigInfo struct { func (x *LevelConfigInfo) Reset() { *x = LevelConfigInfo{} - mi := &file_pb_plant_proto_msgTypes[41] + mi := &file_pb_plant_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2898,7 +5241,7 @@ func (x *LevelConfigInfo) String() string { func (*LevelConfigInfo) ProtoMessage() {} func (x *LevelConfigInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[41] + mi := &file_pb_plant_proto_msgTypes[62] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2911,7 +5254,7 @@ func (x *LevelConfigInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use LevelConfigInfo.ProtoReflect.Descriptor instead. func (*LevelConfigInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{41} + return file_pb_plant_proto_rawDescGZIP(), []int{62} } func (x *LevelConfigInfo) GetId() string { @@ -2958,7 +5301,7 @@ type LevelConfigListResp struct { func (x *LevelConfigListResp) Reset() { *x = LevelConfigListResp{} - mi := &file_pb_plant_proto_msgTypes[42] + mi := &file_pb_plant_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2970,7 +5313,7 @@ func (x *LevelConfigListResp) String() string { func (*LevelConfigListResp) ProtoMessage() {} func (x *LevelConfigListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[42] + mi := &file_pb_plant_proto_msgTypes[63] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2983,7 +5326,7 @@ func (x *LevelConfigListResp) ProtoReflect() protoreflect.Message { // Deprecated: Use LevelConfigListResp.ProtoReflect.Descriptor instead. func (*LevelConfigListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{42} + return file_pb_plant_proto_rawDescGZIP(), []int{63} } func (x *LevelConfigListResp) GetList() []*LevelConfigInfo { @@ -2993,6 +5336,150 @@ func (x *LevelConfigListResp) GetList() []*LevelConfigInfo { return nil } +type CreateLevelConfigReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Level int32 `protobuf:"varint,1,opt,name=level,proto3" json:"level,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + MinSunlight int64 `protobuf:"varint,3,opt,name=minSunlight,proto3" json:"minSunlight,omitempty"` + Perks string `protobuf:"bytes,4,opt,name=perks,proto3" json:"perks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateLevelConfigReq) Reset() { + *x = CreateLevelConfigReq{} + mi := &file_pb_plant_proto_msgTypes[64] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateLevelConfigReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateLevelConfigReq) ProtoMessage() {} + +func (x *CreateLevelConfigReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[64] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateLevelConfigReq.ProtoReflect.Descriptor instead. +func (*CreateLevelConfigReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{64} +} + +func (x *CreateLevelConfigReq) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + +func (x *CreateLevelConfigReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *CreateLevelConfigReq) GetMinSunlight() int64 { + if x != nil { + return x.MinSunlight + } + return 0 +} + +func (x *CreateLevelConfigReq) GetPerks() string { + if x != nil { + return x.Perks + } + return "" +} + +type UpdateLevelConfigReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + MinSunlight int64 `protobuf:"varint,4,opt,name=minSunlight,proto3" json:"minSunlight,omitempty"` + Perks string `protobuf:"bytes,5,opt,name=perks,proto3" json:"perks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateLevelConfigReq) Reset() { + *x = UpdateLevelConfigReq{} + mi := &file_pb_plant_proto_msgTypes[65] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateLevelConfigReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateLevelConfigReq) ProtoMessage() {} + +func (x *UpdateLevelConfigReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[65] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateLevelConfigReq.ProtoReflect.Descriptor instead. +func (*UpdateLevelConfigReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{65} +} + +func (x *UpdateLevelConfigReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateLevelConfigReq) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + +func (x *UpdateLevelConfigReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UpdateLevelConfigReq) GetMinSunlight() int64 { + if x != nil { + return x.MinSunlight + } + return 0 +} + +func (x *UpdateLevelConfigReq) GetPerks() string { + if x != nil { + return x.Perks + } + return "" +} + type BadgeConfigInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -3004,13 +5491,15 @@ type BadgeConfigInfo struct { TargetAction string `protobuf:"bytes,7,opt,name=targetAction,proto3" json:"targetAction,omitempty"` Threshold int64 `protobuf:"varint,8,opt,name=threshold,proto3" json:"threshold,omitempty"` RewardSunlight int64 `protobuf:"varint,9,opt,name=rewardSunlight,proto3" json:"rewardSunlight,omitempty"` + IconId string `protobuf:"bytes,10,opt,name=iconId,proto3" json:"iconId,omitempty"` + Sort int32 `protobuf:"varint,11,opt,name=sort,proto3" json:"sort,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *BadgeConfigInfo) Reset() { *x = BadgeConfigInfo{} - mi := &file_pb_plant_proto_msgTypes[43] + mi := &file_pb_plant_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3022,7 +5511,7 @@ func (x *BadgeConfigInfo) String() string { func (*BadgeConfigInfo) ProtoMessage() {} func (x *BadgeConfigInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[43] + mi := &file_pb_plant_proto_msgTypes[66] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3035,7 +5524,7 @@ func (x *BadgeConfigInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use BadgeConfigInfo.ProtoReflect.Descriptor instead. func (*BadgeConfigInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{43} + return file_pb_plant_proto_rawDescGZIP(), []int{66} } func (x *BadgeConfigInfo) GetId() string { @@ -3101,6 +5590,20 @@ func (x *BadgeConfigInfo) GetRewardSunlight() int64 { return 0 } +func (x *BadgeConfigInfo) GetIconId() string { + if x != nil { + return x.IconId + } + return "" +} + +func (x *BadgeConfigInfo) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + type BadgeConfigListReq struct { state protoimpl.MessageState `protogen:"open.v1"` Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` @@ -3112,7 +5615,7 @@ type BadgeConfigListReq struct { func (x *BadgeConfigListReq) Reset() { *x = BadgeConfigListReq{} - mi := &file_pb_plant_proto_msgTypes[44] + mi := &file_pb_plant_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3124,7 +5627,7 @@ func (x *BadgeConfigListReq) String() string { func (*BadgeConfigListReq) ProtoMessage() {} func (x *BadgeConfigListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[44] + mi := &file_pb_plant_proto_msgTypes[67] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3137,7 +5640,7 @@ func (x *BadgeConfigListReq) ProtoReflect() protoreflect.Message { // Deprecated: Use BadgeConfigListReq.ProtoReflect.Descriptor instead. func (*BadgeConfigListReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{44} + return file_pb_plant_proto_rawDescGZIP(), []int{67} } func (x *BadgeConfigListReq) GetCurrent() int32 { @@ -3171,7 +5674,7 @@ type BadgeConfigListResp struct { func (x *BadgeConfigListResp) Reset() { *x = BadgeConfigListResp{} - mi := &file_pb_plant_proto_msgTypes[45] + mi := &file_pb_plant_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3183,7 +5686,7 @@ func (x *BadgeConfigListResp) String() string { func (*BadgeConfigListResp) ProtoMessage() {} func (x *BadgeConfigListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[45] + mi := &file_pb_plant_proto_msgTypes[68] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3196,7 +5699,7 @@ func (x *BadgeConfigListResp) ProtoReflect() protoreflect.Message { // Deprecated: Use BadgeConfigListResp.ProtoReflect.Descriptor instead. func (*BadgeConfigListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{45} + return file_pb_plant_proto_rawDescGZIP(), []int{68} } func (x *BadgeConfigListResp) GetList() []*BadgeConfigInfo { @@ -3213,6 +5716,742 @@ func (x *BadgeConfigListResp) GetTotal() int64 { return 0 } +type CreateBadgeConfigReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Dimension string `protobuf:"bytes,3,opt,name=dimension,proto3" json:"dimension,omitempty"` + GroupId string `protobuf:"bytes,4,opt,name=groupId,proto3" json:"groupId,omitempty"` + Tier int32 `protobuf:"varint,5,opt,name=tier,proto3" json:"tier,omitempty"` + TargetAction string `protobuf:"bytes,6,opt,name=targetAction,proto3" json:"targetAction,omitempty"` + Threshold int64 `protobuf:"varint,7,opt,name=threshold,proto3" json:"threshold,omitempty"` + RewardSunlight int64 `protobuf:"varint,8,opt,name=rewardSunlight,proto3" json:"rewardSunlight,omitempty"` + IconId string `protobuf:"bytes,9,opt,name=iconId,proto3" json:"iconId,omitempty"` + Sort int32 `protobuf:"varint,10,opt,name=sort,proto3" json:"sort,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateBadgeConfigReq) Reset() { + *x = CreateBadgeConfigReq{} + mi := &file_pb_plant_proto_msgTypes[69] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateBadgeConfigReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateBadgeConfigReq) ProtoMessage() {} + +func (x *CreateBadgeConfigReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[69] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateBadgeConfigReq.ProtoReflect.Descriptor instead. +func (*CreateBadgeConfigReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{69} +} + +func (x *CreateBadgeConfigReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateBadgeConfigReq) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *CreateBadgeConfigReq) GetDimension() string { + if x != nil { + return x.Dimension + } + return "" +} + +func (x *CreateBadgeConfigReq) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *CreateBadgeConfigReq) GetTier() int32 { + if x != nil { + return x.Tier + } + return 0 +} + +func (x *CreateBadgeConfigReq) GetTargetAction() string { + if x != nil { + return x.TargetAction + } + return "" +} + +func (x *CreateBadgeConfigReq) GetThreshold() int64 { + if x != nil { + return x.Threshold + } + return 0 +} + +func (x *CreateBadgeConfigReq) GetRewardSunlight() int64 { + if x != nil { + return x.RewardSunlight + } + return 0 +} + +func (x *CreateBadgeConfigReq) GetIconId() string { + if x != nil { + return x.IconId + } + return "" +} + +func (x *CreateBadgeConfigReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +type UpdateBadgeConfigReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Dimension string `protobuf:"bytes,4,opt,name=dimension,proto3" json:"dimension,omitempty"` + GroupId string `protobuf:"bytes,5,opt,name=groupId,proto3" json:"groupId,omitempty"` + Tier int32 `protobuf:"varint,6,opt,name=tier,proto3" json:"tier,omitempty"` + TargetAction string `protobuf:"bytes,7,opt,name=targetAction,proto3" json:"targetAction,omitempty"` + Threshold int64 `protobuf:"varint,8,opt,name=threshold,proto3" json:"threshold,omitempty"` + RewardSunlight int64 `protobuf:"varint,9,opt,name=rewardSunlight,proto3" json:"rewardSunlight,omitempty"` + IconId string `protobuf:"bytes,10,opt,name=iconId,proto3" json:"iconId,omitempty"` + Sort int32 `protobuf:"varint,11,opt,name=sort,proto3" json:"sort,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateBadgeConfigReq) Reset() { + *x = UpdateBadgeConfigReq{} + mi := &file_pb_plant_proto_msgTypes[70] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateBadgeConfigReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateBadgeConfigReq) ProtoMessage() {} + +func (x *UpdateBadgeConfigReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[70] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateBadgeConfigReq.ProtoReflect.Descriptor instead. +func (*UpdateBadgeConfigReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{70} +} + +func (x *UpdateBadgeConfigReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateBadgeConfigReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateBadgeConfigReq) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *UpdateBadgeConfigReq) GetDimension() string { + if x != nil { + return x.Dimension + } + return "" +} + +func (x *UpdateBadgeConfigReq) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *UpdateBadgeConfigReq) GetTier() int32 { + if x != nil { + return x.Tier + } + return 0 +} + +func (x *UpdateBadgeConfigReq) GetTargetAction() string { + if x != nil { + return x.TargetAction + } + return "" +} + +func (x *UpdateBadgeConfigReq) GetThreshold() int64 { + if x != nil { + return x.Threshold + } + return 0 +} + +func (x *UpdateBadgeConfigReq) GetRewardSunlight() int64 { + if x != nil { + return x.RewardSunlight + } + return 0 +} + +func (x *UpdateBadgeConfigReq) GetIconId() string { + if x != nil { + return x.IconId + } + return "" +} + +func (x *UpdateBadgeConfigReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +type CompleteTaskReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + TaskId string `protobuf:"bytes,2,opt,name=taskId,proto3" json:"taskId,omitempty"` + Remark string `protobuf:"bytes,3,opt,name=remark,proto3" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CompleteTaskReq) Reset() { + *x = CompleteTaskReq{} + mi := &file_pb_plant_proto_msgTypes[71] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CompleteTaskReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompleteTaskReq) ProtoMessage() {} + +func (x *CompleteTaskReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[71] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CompleteTaskReq.ProtoReflect.Descriptor instead. +func (*CompleteTaskReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{71} +} + +func (x *CompleteTaskReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *CompleteTaskReq) GetTaskId() string { + if x != nil { + return x.TaskId + } + return "" +} + +func (x *CompleteTaskReq) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +type TaskCompletionResult struct { + state protoimpl.MessageState `protogen:"open.v1"` + IsLevelUp bool `protobuf:"varint,1,opt,name=isLevelUp,proto3" json:"isLevelUp,omitempty"` + CurrentLevel *LevelConfigInfo `protobuf:"bytes,2,opt,name=currentLevel,proto3" json:"currentLevel,omitempty"` + IsGetBadge bool `protobuf:"varint,3,opt,name=isGetBadge,proto3" json:"isGetBadge,omitempty"` + NewBadge *BadgeConfigInfo `protobuf:"bytes,4,opt,name=newBadge,proto3" json:"newBadge,omitempty"` + RewardSunlight int64 `protobuf:"varint,5,opt,name=rewardSunlight,proto3" json:"rewardSunlight,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TaskCompletionResult) Reset() { + *x = TaskCompletionResult{} + mi := &file_pb_plant_proto_msgTypes[72] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TaskCompletionResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskCompletionResult) ProtoMessage() {} + +func (x *TaskCompletionResult) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[72] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TaskCompletionResult.ProtoReflect.Descriptor instead. +func (*TaskCompletionResult) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{72} +} + +func (x *TaskCompletionResult) GetIsLevelUp() bool { + if x != nil { + return x.IsLevelUp + } + return false +} + +func (x *TaskCompletionResult) GetCurrentLevel() *LevelConfigInfo { + if x != nil { + return x.CurrentLevel + } + return nil +} + +func (x *TaskCompletionResult) GetIsGetBadge() bool { + if x != nil { + return x.IsGetBadge + } + return false +} + +func (x *TaskCompletionResult) GetNewBadge() *BadgeConfigInfo { + if x != nil { + return x.NewBadge + } + return nil +} + +func (x *TaskCompletionResult) GetRewardSunlight() int64 { + if x != nil { + return x.RewardSunlight + } + return 0 +} + +type BadgeGroupInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + GroupId string `protobuf:"bytes,1,opt,name=groupId,proto3" json:"groupId,omitempty"` + Dimension string `protobuf:"bytes,2,opt,name=dimension,proto3" json:"dimension,omitempty"` + Badges []*BadgeConfigInfo `protobuf:"bytes,3,rep,name=badges,proto3" json:"badges,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BadgeGroupInfo) Reset() { + *x = BadgeGroupInfo{} + mi := &file_pb_plant_proto_msgTypes[73] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BadgeGroupInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BadgeGroupInfo) ProtoMessage() {} + +func (x *BadgeGroupInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[73] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BadgeGroupInfo.ProtoReflect.Descriptor instead. +func (*BadgeGroupInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{73} +} + +func (x *BadgeGroupInfo) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *BadgeGroupInfo) GetDimension() string { + if x != nil { + return x.Dimension + } + return "" +} + +func (x *BadgeGroupInfo) GetBadges() []*BadgeConfigInfo { + if x != nil { + return x.Badges + } + return nil +} + +type BadgeConfigTreeResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Groups []*BadgeGroupInfo `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BadgeConfigTreeResp) Reset() { + *x = BadgeConfigTreeResp{} + mi := &file_pb_plant_proto_msgTypes[74] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BadgeConfigTreeResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BadgeConfigTreeResp) ProtoMessage() {} + +func (x *BadgeConfigTreeResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[74] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BadgeConfigTreeResp.ProtoReflect.Descriptor instead. +func (*BadgeConfigTreeResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{74} +} + +func (x *BadgeConfigTreeResp) GetGroups() []*BadgeGroupInfo { + if x != nil { + return x.Groups + } + return nil +} + +type AiQuotaResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Remaining int64 `protobuf:"varint,1,opt,name=remaining,proto3" json:"remaining,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + Used int64 `protobuf:"varint,3,opt,name=used,proto3" json:"used,omitempty"` + Limit int64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AiQuotaResp) Reset() { + *x = AiQuotaResp{} + mi := &file_pb_plant_proto_msgTypes[75] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AiQuotaResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AiQuotaResp) ProtoMessage() {} + +func (x *AiQuotaResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[75] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AiQuotaResp.ProtoReflect.Descriptor instead. +func (*AiQuotaResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{75} +} + +func (x *AiQuotaResp) GetRemaining() int64 { + if x != nil { + return x.Remaining + } + return 0 +} + +func (x *AiQuotaResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *AiQuotaResp) GetUsed() int64 { + if x != nil { + return x.Used + } + return 0 +} + +func (x *AiQuotaResp) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +type AiChatHistoryInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` + Question string `protobuf:"bytes,3,opt,name=question,proto3" json:"question,omitempty"` + Answer string `protobuf:"bytes,4,opt,name=answer,proto3" json:"answer,omitempty"` + CreatedAt string `protobuf:"bytes,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AiChatHistoryInfo) Reset() { + *x = AiChatHistoryInfo{} + mi := &file_pb_plant_proto_msgTypes[76] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AiChatHistoryInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AiChatHistoryInfo) ProtoMessage() {} + +func (x *AiChatHistoryInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[76] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AiChatHistoryInfo.ProtoReflect.Descriptor instead. +func (*AiChatHistoryInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{76} +} + +func (x *AiChatHistoryInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *AiChatHistoryInfo) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *AiChatHistoryInfo) GetQuestion() string { + if x != nil { + return x.Question + } + return "" +} + +func (x *AiChatHistoryInfo) GetAnswer() string { + if x != nil { + return x.Answer + } + return "" +} + +func (x *AiChatHistoryInfo) GetCreatedAt() string { + if x != nil { + return x.CreatedAt + } + return "" +} + +type AiChatHistoryReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + Current int32 `protobuf:"varint,2,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AiChatHistoryReq) Reset() { + *x = AiChatHistoryReq{} + mi := &file_pb_plant_proto_msgTypes[77] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AiChatHistoryReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AiChatHistoryReq) ProtoMessage() {} + +func (x *AiChatHistoryReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[77] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AiChatHistoryReq.ProtoReflect.Descriptor instead. +func (*AiChatHistoryReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{77} +} + +func (x *AiChatHistoryReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *AiChatHistoryReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *AiChatHistoryReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type AiChatHistoryResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*AiChatHistoryInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AiChatHistoryResp) Reset() { + *x = AiChatHistoryResp{} + mi := &file_pb_plant_proto_msgTypes[78] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AiChatHistoryResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AiChatHistoryResp) ProtoMessage() {} + +func (x *AiChatHistoryResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[78] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AiChatHistoryResp.ProtoReflect.Descriptor instead. +func (*AiChatHistoryResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{78} +} + +func (x *AiChatHistoryResp) GetList() []*AiChatHistoryInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *AiChatHistoryResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + var File_pb_plant_proto protoreflect.FileDescriptor const file_pb_plant_proto_rawDesc = "" + @@ -3261,7 +6500,24 @@ const file_pb_plant_proto_rawDesc = "" + "\x10UpdateProfileReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x1a\n" + "\bnickName\x18\x02 \x01(\tR\bnickName\x12\x1a\n" + - "\bavatarId\x18\x03 \x01(\tR\bavatarId\"\xd5\x02\n" + + "\bavatarId\x18\x03 \x01(\tR\bavatarId\"\xa7\x01\n" + + "\rUserBadgeInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n" + + "\abadgeId\x18\x02 \x01(\tR\abadgeId\x12\x1c\n" + + "\tbadgeName\x18\x03 \x01(\tR\tbadgeName\x12\x1c\n" + + "\tdimension\x18\x04 \x01(\tR\tdimension\x12\x12\n" + + "\x04tier\x18\x05 \x01(\x05R\x04tier\x12\x1c\n" + + "\tawardedAt\x18\x06 \x01(\tR\tawardedAt\"=\n" + + "\x11UserBadgeListResp\x12(\n" + + "\x04list\x18\x01 \x03(\v2\x14.plant.UserBadgeInfoR\x04list\"l\n" + + "\fUserStarInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + + "\btargetId\x18\x02 \x01(\tR\btargetId\x12\x12\n" + + "\x04type\x18\x03 \x01(\tR\x04type\x12\x1c\n" + + "\tcreatedAt\x18\x04 \x01(\tR\tcreatedAt\"Q\n" + + "\x10UserStarListResp\x12'\n" + + "\x04list\x18\x01 \x03(\v2\x13.plant.UserStarInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\xd5\x02\n" + "\tPlantInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x12\n" + @@ -3321,7 +6577,19 @@ const file_pb_plant_proto_rawDesc = "" + "\x04name\x18\x03 \x01(\tR\x04name\x12\x12\n" + "\x04icon\x18\x04 \x01(\tR\x04icon\x12\"\n" + "\ftargetAction\x18\x05 \x01(\tR\ftargetAction\x12\x16\n" + - "\x06period\x18\x06 \x01(\x05R\x06period\"\x88\x01\n" + + "\x06period\x18\x06 \x01(\x05R\x06period\"\xce\x01\n" + + "\fCareTaskInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n" + + "\aplantId\x18\x02 \x01(\tR\aplantId\x12\x16\n" + + "\x06planId\x18\x03 \x01(\tR\x06planId\x12\x12\n" + + "\x04name\x18\x04 \x01(\tR\x04name\x12\x12\n" + + "\x04icon\x18\x05 \x01(\tR\x04icon\x12\"\n" + + "\ftargetAction\x18\x06 \x01(\tR\ftargetAction\x12\x18\n" + + "\adueDate\x18\a \x01(\tR\adueDate\x12\x16\n" + + "\x06status\x18\b \x01(\x05R\x06status\"Q\n" + + "\x10CareTaskListResp\x12'\n" + + "\x04list\x18\x01 \x03(\v2\x13.plant.CareTaskInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\x88\x01\n" + "\x10AddCareRecordReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x18\n" + "\aplantId\x18\x02 \x01(\tR\aplantId\x12\x16\n" + @@ -3337,7 +6605,7 @@ const file_pb_plant_proto_rawDesc = "" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x18\n" + "\aplantId\x18\x02 \x01(\tR\aplantId\x12\x18\n" + "\acontent\x18\x03 \x01(\tR\acontent\x12\x16\n" + - "\x06imgIds\x18\x04 \x03(\tR\x06imgIds\"\xc8\x02\n" + + "\x06imgIds\x18\x04 \x03(\tR\x06imgIds\"\x90\b\n" + "\bWikiInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1c\n" + @@ -3352,7 +6620,28 @@ const file_pb_plant_proto_rawDesc = "" + "\x0elightIntensity\x18\t \x01(\tR\x0elightIntensity\x12,\n" + "\x11optimalTempPeriod\x18\n" + " \x01(\tR\x11optimalTempPeriod\x12\x1c\n" + - "\tcreatedAt\x18\v \x01(\x03R\tcreatedAt\"\x87\x01\n" + + "\tcreatedAt\x18\v \x01(\x03R\tcreatedAt\x12\x18\n" + + "\aclassId\x18\f \x01(\tR\aclassId\x12*\n" + + "\x10distributionArea\x18\r \x01(\tR\x10distributionArea\x12\x1c\n" + + "\tlifeCycle\x18\x0e \x01(\tR\tlifeCycle\x12\x1a\n" + + "\bclassIds\x18\x0f \x03(\tR\bclassIds\x12\x16\n" + + "\x06ossIds\x18\x10 \x03(\tR\x06ossIds\x12&\n" + + "\x0erelatedWikiIds\x18\x11 \x03(\tR\x0erelatedWikiIds\x12&\n" + + "\x0eisVectorSynced\x18\x12 \x01(\bR\x0eisVectorSynced\x12\x16\n" + + "\x06isStar\x18\x13 \x01(\bR\x06isStar\x12.\n" + + "\x12reproductionMethod\x18\x14 \x01(\tR\x12reproductionMethod\x12$\n" + + "\rpestsDiseases\x18\x15 \x01(\tR\rpestsDiseases\x12\x1c\n" + + "\tlightType\x18\x16 \x01(\tR\tlightType\x12\x12\n" + + "\x04stem\x18\x17 \x01(\tR\x04stem\x12\x14\n" + + "\x05fruit\x18\x18 \x01(\tR\x05fruit\x12 \n" + + "\vfoliageType\x18\x19 \x01(\tR\vfoliageType\x12\"\n" + + "\ffoliageColor\x18\x1a \x01(\tR\ffoliageColor\x12\"\n" + + "\ffoliageShape\x18\x1b \x01(\tR\ffoliageShape\x12\x16\n" + + "\x06height\x18\x1c \x01(\x05R\x06height\x12(\n" + + "\x0ffloweringPeriod\x18\x1d \x01(\tR\x0ffloweringPeriod\x12&\n" + + "\x0efloweringColor\x18\x1e \x01(\tR\x0efloweringColor\x12&\n" + + "\x0efloweringShape\x18\x1f \x01(\tR\x0efloweringShape\x12,\n" + + "\x11floweringDiameter\x18 \x01(\x05R\x11floweringDiameter\"\x87\x01\n" + "\vWikiListReq\x12\x18\n" + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x12\n" + @@ -3363,7 +6652,72 @@ const file_pb_plant_proto_rawDesc = "" + "\x04list\x18\x01 \x03(\v2\x0f.plant.WikiInfoR\x04list\x12\x14\n" + "\x05total\x18\x02 \x01(\x03R\x05total\"5\n" + "\x0eWikiDetailResp\x12#\n" + - "\x04wiki\x18\x01 \x01(\v2\x0f.plant.WikiInfoR\x04wiki\"I\n" + + "\x04wiki\x18\x01 \x01(\v2\x0f.plant.WikiInfoR\x04wiki\"\xa7\a\n" + + "\rCreateWikiReq\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x1c\n" + + "\tlatinName\x18\x02 \x01(\tR\tlatinName\x12\x18\n" + + "\aaliases\x18\x03 \x01(\tR\aaliases\x12\x14\n" + + "\x05genus\x18\x04 \x01(\tR\x05genus\x12\x1e\n" + + "\n" + + "difficulty\x18\x05 \x01(\x05R\n" + + "difficulty\x12\x14\n" + + "\x05isHot\x18\x06 \x01(\x05R\x05isHot\x12 \n" + + "\vgrowthHabit\x18\a \x01(\tR\vgrowthHabit\x12&\n" + + "\x0elightIntensity\x18\b \x01(\tR\x0elightIntensity\x12,\n" + + "\x11optimalTempPeriod\x18\t \x01(\tR\x11optimalTempPeriod\x12\x18\n" + + "\aclassId\x18\n" + + " \x01(\tR\aclassId\x12*\n" + + "\x10distributionArea\x18\v \x01(\tR\x10distributionArea\x12\x1c\n" + + "\tlifeCycle\x18\f \x01(\tR\tlifeCycle\x12\x1a\n" + + "\bclassIds\x18\r \x03(\tR\bclassIds\x12\x16\n" + + "\x06ossIds\x18\x0e \x03(\tR\x06ossIds\x12&\n" + + "\x0erelatedWikiIds\x18\x0f \x03(\tR\x0erelatedWikiIds\x12.\n" + + "\x12reproductionMethod\x18\x10 \x01(\tR\x12reproductionMethod\x12$\n" + + "\rpestsDiseases\x18\x11 \x01(\tR\rpestsDiseases\x12\x1c\n" + + "\tlightType\x18\x12 \x01(\tR\tlightType\x12\x12\n" + + "\x04stem\x18\x13 \x01(\tR\x04stem\x12\x14\n" + + "\x05fruit\x18\x14 \x01(\tR\x05fruit\x12 \n" + + "\vfoliageType\x18\x15 \x01(\tR\vfoliageType\x12\"\n" + + "\ffoliageColor\x18\x16 \x01(\tR\ffoliageColor\x12\"\n" + + "\ffoliageShape\x18\x17 \x01(\tR\ffoliageShape\x12\x16\n" + + "\x06height\x18\x18 \x01(\x05R\x06height\x12(\n" + + "\x0ffloweringPeriod\x18\x19 \x01(\tR\x0ffloweringPeriod\x12&\n" + + "\x0efloweringColor\x18\x1a \x01(\tR\x0efloweringColor\x12&\n" + + "\x0efloweringShape\x18\x1b \x01(\tR\x0efloweringShape\x12,\n" + + "\x11floweringDiameter\x18\x1c \x01(\x05R\x11floweringDiameter\"\xb7\a\n" + + "\rUpdateWikiReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1c\n" + + "\tlatinName\x18\x03 \x01(\tR\tlatinName\x12\x18\n" + + "\aaliases\x18\x04 \x01(\tR\aaliases\x12\x14\n" + + "\x05genus\x18\x05 \x01(\tR\x05genus\x12\x1e\n" + + "\n" + + "difficulty\x18\x06 \x01(\x05R\n" + + "difficulty\x12\x14\n" + + "\x05isHot\x18\a \x01(\x05R\x05isHot\x12 \n" + + "\vgrowthHabit\x18\b \x01(\tR\vgrowthHabit\x12&\n" + + "\x0elightIntensity\x18\t \x01(\tR\x0elightIntensity\x12,\n" + + "\x11optimalTempPeriod\x18\n" + + " \x01(\tR\x11optimalTempPeriod\x12\x18\n" + + "\aclassId\x18\v \x01(\tR\aclassId\x12*\n" + + "\x10distributionArea\x18\f \x01(\tR\x10distributionArea\x12\x1c\n" + + "\tlifeCycle\x18\r \x01(\tR\tlifeCycle\x12\x1a\n" + + "\bclassIds\x18\x0e \x03(\tR\bclassIds\x12\x16\n" + + "\x06ossIds\x18\x0f \x03(\tR\x06ossIds\x12&\n" + + "\x0erelatedWikiIds\x18\x10 \x03(\tR\x0erelatedWikiIds\x12.\n" + + "\x12reproductionMethod\x18\x11 \x01(\tR\x12reproductionMethod\x12$\n" + + "\rpestsDiseases\x18\x12 \x01(\tR\rpestsDiseases\x12\x1c\n" + + "\tlightType\x18\x13 \x01(\tR\tlightType\x12\x12\n" + + "\x04stem\x18\x14 \x01(\tR\x04stem\x12\x14\n" + + "\x05fruit\x18\x15 \x01(\tR\x05fruit\x12 \n" + + "\vfoliageType\x18\x16 \x01(\tR\vfoliageType\x12\"\n" + + "\ffoliageColor\x18\x17 \x01(\tR\ffoliageColor\x12\"\n" + + "\ffoliageShape\x18\x18 \x01(\tR\ffoliageShape\x12\x16\n" + + "\x06height\x18\x19 \x01(\x05R\x06height\x12(\n" + + "\x0ffloweringPeriod\x18\x1a \x01(\tR\x0ffloweringPeriod\x12&\n" + + "\x0efloweringColor\x18\x1b \x01(\tR\x0efloweringColor\x12&\n" + + "\x0efloweringShape\x18\x1c \x01(\tR\x0efloweringShape\x12,\n" + + "\x11floweringDiameter\x18\x1d \x01(\x05R\x11floweringDiameter\"I\n" + "\rWikiClassInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + @@ -3372,11 +6726,24 @@ const file_pb_plant_proto_rawDesc = "" + "\x04list\x18\x01 \x03(\v2\x14.plant.WikiClassInfoR\x04list\"<\n" + "\x12CreateWikiClassReq\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + - "\x04icon\x18\x02 \x01(\tR\x04icon\"W\n" + + "\x04icon\x18\x02 \x01(\tR\x04icon\"L\n" + + "\x12UpdateWikiClassReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04icon\x18\x03 \x01(\tR\x04icon\"W\n" + "\rToggleStarReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x1a\n" + "\btargetId\x18\x02 \x01(\tR\btargetId\x12\x12\n" + - "\x04type\x18\x03 \x01(\tR\x04type\"\x9a\x02\n" + + "\x04type\x18\x03 \x01(\tR\x04type\"\x8b\x01\n" + + "\x0fClassifyLogInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x1a\n" + + "\bimageUrl\x18\x03 \x01(\tR\bimageUrl\x12\x16\n" + + "\x06result\x18\x04 \x01(\tR\x06result\x12\x1c\n" + + "\tcreatedAt\x18\x05 \x01(\tR\tcreatedAt\"W\n" + + "\x13ClassifyLogListResp\x12*\n" + + "\x04list\x18\x01 \x03(\v2\x16.plant.ClassifyLogInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\xb4\x02\n" + "\bPostInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x14\n" + @@ -3388,7 +6755,8 @@ const file_pb_plant_proto_rawDesc = "" + "\tstarCount\x18\b \x01(\x05R\tstarCount\x12\x1a\n" + "\blocation\x18\t \x01(\tR\blocation\x12\x1c\n" + "\tcreatedAt\x18\n" + - " \x01(\x03R\tcreatedAt\"\xa5\x01\n" + + " \x01(\x03R\tcreatedAt\x12\x18\n" + + "\atopicId\x18\v \x01(\tR\atopicId\"\xa5\x01\n" + "\rCreatePostReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x14\n" + "\x05title\x18\x02 \x01(\tR\x05title\x12\x18\n" + @@ -3421,33 +6789,136 @@ const file_pb_plant_proto_rawDesc = "" + "\bparentId\x18\x04 \x01(\tR\bparentId\"=\n" + "\vLikePostReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x16\n" + - "\x06postId\x18\x02 \x01(\tR\x06postId\"M\n" + + "\x06postId\x18\x02 \x01(\tR\x06postId\"\xdb\x01\n" + "\tTopicInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1c\n" + - "\tpostCount\x18\x03 \x01(\x05R\tpostCount\"5\n" + + "\tpostCount\x18\x03 \x01(\x05R\tpostCount\x12\x12\n" + + "\x04icon\x18\x04 \x01(\tR\x04icon\x12\x12\n" + + "\x04desc\x18\x05 \x01(\tR\x04desc\x12\x14\n" + + "\x05title\x18\x06 \x01(\tR\x05title\x12\x16\n" + + "\x06remark\x18\a \x01(\tR\x06remark\x12\x1c\n" + + "\tstartTime\x18\b \x01(\tR\tstartTime\x12\x18\n" + + "\aendTime\x18\t \x01(\tR\aendTime\"5\n" + "\rTopicListResp\x12$\n" + - "\x04list\x18\x01 \x03(\v2\x10.plant.TopicInfoR\x04list\"L\n" + + "\x04list\x18\x01 \x03(\v2\x10.plant.TopicInfoR\x04list\"\xb2\x01\n" + "\x0eCreateTopicReq\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + "\x04icon\x18\x02 \x01(\tR\x04icon\x12\x12\n" + - "\x04desc\x18\x03 \x01(\tR\x04desc\"\x8a\x01\n" + + "\x04desc\x18\x03 \x01(\tR\x04desc\x12\x14\n" + + "\x05title\x18\x04 \x01(\tR\x05title\x12\x16\n" + + "\x06remark\x18\x05 \x01(\tR\x06remark\x12\x1c\n" + + "\tstartTime\x18\x06 \x01(\tR\tstartTime\x12\x18\n" + + "\aendTime\x18\a \x01(\tR\aendTime\"\xc2\x01\n" + + "\x0eUpdateTopicReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04icon\x18\x03 \x01(\tR\x04icon\x12\x12\n" + + "\x04desc\x18\x04 \x01(\tR\x04desc\x12\x14\n" + + "\x05title\x18\x05 \x01(\tR\x05title\x12\x16\n" + + "\x06remark\x18\x06 \x01(\tR\x06remark\x12\x1c\n" + + "\tstartTime\x18\a \x01(\tR\tstartTime\x12\x18\n" + + "\aendTime\x18\b \x01(\tR\aendTime\"\xa2\x01\n" + "\x10ExchangeItemInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + "\x04desc\x18\x03 \x01(\tR\x04desc\x12\x14\n" + "\x05imgId\x18\x04 \x01(\tR\x05imgId\x12\x12\n" + "\x04cost\x18\x05 \x01(\x03R\x04cost\x12\x14\n" + - "\x05stock\x18\x06 \x01(\x05R\x05stock\"K\n" + + "\x05stock\x18\x06 \x01(\x05R\x05stock\x12\x16\n" + + "\x06status\x18\a \x01(\x05R\x06status\"c\n" + "\x13ExchangeItemListReq\x12\x18\n" + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + - "\bpageSize\x18\x02 \x01(\x05R\bpageSize\"Y\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x16\n" + + "\x06status\x18\x03 \x01(\x05R\x06status\"Y\n" + "\x14ExchangeItemListResp\x12+\n" + "\x04list\x18\x01 \x03(\v2\x17.plant.ExchangeItemInfoR\x04list\x12\x14\n" + - "\x05total\x18\x02 \x01(\x03R\x05total\"H\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\xba\x01\n" + "\x16CreateExchangeOrderReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x16\n" + - "\x06itemId\x18\x02 \x01(\tR\x06itemId\"\x85\x01\n" + + "\x06itemId\x18\x02 \x01(\tR\x06itemId\x12\x1a\n" + + "\bquantity\x18\x03 \x01(\x05R\bquantity\x12$\n" + + "\rrecipientName\x18\x04 \x01(\tR\rrecipientName\x12\x14\n" + + "\x05phone\x18\x05 \x01(\tR\x05phone\x12\x18\n" + + "\aaddress\x18\x06 \x01(\tR\aaddress\"\xc1\x02\n" + + "\x15CreateExchangeItemReq\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + + "\x04desc\x18\x02 \x01(\tR\x04desc\x12\x14\n" + + "\x05imgId\x18\x03 \x01(\tR\x05imgId\x12\x12\n" + + "\x04cost\x18\x04 \x01(\x03R\x04cost\x12\x14\n" + + "\x05stock\x18\x05 \x01(\x05R\x05stock\x12\x12\n" + + "\x04type\x18\x06 \x01(\tR\x04type\x12\"\n" + + "\fcostSunlight\x18\a \x01(\x03R\fcostSunlight\x12\"\n" + + "\flimitPerUser\x18\b \x01(\x05R\flimitPerUser\x12\x12\n" + + "\x04sort\x18\t \x01(\x05R\x04sort\x12\x1c\n" + + "\tstartTime\x18\n" + + " \x01(\tR\tstartTime\x12\x18\n" + + "\aendTime\x18\v \x01(\tR\aendTime\x12\x18\n" + + "\aimageId\x18\f \x01(\tR\aimageId\"\xe9\x02\n" + + "\x15UpdateExchangeItemReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04desc\x18\x03 \x01(\tR\x04desc\x12\x14\n" + + "\x05imgId\x18\x04 \x01(\tR\x05imgId\x12\x12\n" + + "\x04cost\x18\x05 \x01(\x03R\x04cost\x12\x14\n" + + "\x05stock\x18\x06 \x01(\x05R\x05stock\x12\x16\n" + + "\x06status\x18\a \x01(\x05R\x06status\x12\x12\n" + + "\x04type\x18\b \x01(\tR\x04type\x12\"\n" + + "\fcostSunlight\x18\t \x01(\x03R\fcostSunlight\x12\"\n" + + "\flimitPerUser\x18\n" + + " \x01(\x05R\flimitPerUser\x12\x12\n" + + "\x04sort\x18\v \x01(\x05R\x04sort\x12\x1c\n" + + "\tstartTime\x18\f \x01(\tR\tstartTime\x12\x18\n" + + "\aendTime\x18\r \x01(\tR\aendTime\x12\x18\n" + + "\aimageId\x18\x0e \x01(\tR\aimageId\"\xa1\x03\n" + + "\x11ExchangeOrderInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x16\n" + + "\x06itemId\x18\x03 \x01(\tR\x06itemId\x12\x1a\n" + + "\bitemName\x18\x04 \x01(\tR\bitemName\x12\x12\n" + + "\x04cost\x18\x05 \x01(\x03R\x04cost\x12\x16\n" + + "\x06status\x18\x06 \x01(\x05R\x06status\x12\x18\n" + + "\aaddress\x18\a \x01(\tR\aaddress\x12\x1c\n" + + "\tcreatedAt\x18\b \x01(\tR\tcreatedAt\x12\x1a\n" + + "\bquantity\x18\t \x01(\x05R\bquantity\x12\x1a\n" + + "\bitemType\x18\n" + + " \x01(\tR\bitemType\x12$\n" + + "\rrecipientName\x18\v \x01(\tR\rrecipientName\x12\x14\n" + + "\x05phone\x18\f \x01(\tR\x05phone\x12\x1e\n" + + "\n" + + "trackingNo\x18\r \x01(\tR\n" + + "trackingNo\x12\x16\n" + + "\x06remark\x18\x0e \x01(\tR\x06remark\x12 \n" + + "\vcompletedAt\x18\x0f \x01(\tR\vcompletedAt\"|\n" + + "\x14ExchangeOrderListReq\x12\x18\n" + + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x16\n" + + "\x06userId\x18\x03 \x01(\tR\x06userId\x12\x16\n" + + "\x06status\x18\x04 \x01(\x05R\x06status\"[\n" + + "\x15ExchangeOrderListResp\x12,\n" + + "\x04list\x18\x01 \x03(\v2\x18.plant.ExchangeOrderInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"x\n" + + "\x16UpdateExchangeOrderReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + + "\x06status\x18\x02 \x01(\x05R\x06status\x12\x1e\n" + + "\n" + + "trackingNo\x18\x03 \x01(\tR\n" + + "trackingNo\x12\x16\n" + + "\x06remark\x18\x04 \x01(\tR\x06remark\"\xbb\x01\n" + + "\x15MediaCheckCallbackReq\x12\x18\n" + + "\atraceId\x18\x01 \x01(\tR\atraceId\x12\x16\n" + + "\x06postId\x18\x02 \x01(\tR\x06postId\x12\x14\n" + + "\x05ossId\x18\x03 \x01(\tR\x05ossId\x12\x16\n" + + "\x06userId\x18\x04 \x01(\tR\x06userId\x12\x16\n" + + "\x06status\x18\x05 \x01(\x05R\x06status\x12\x12\n" + + "\x04type\x18\x06 \x01(\x05R\x04type\x12\x16\n" + + "\x06errMsg\x18\a \x01(\tR\x06errMsg\"b\n" + + "\x14SaveAiChatHistoryReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x1a\n" + + "\bquestion\x18\x02 \x01(\tR\bquestion\x12\x16\n" + + "\x06answer\x18\x03 \x01(\tR\x06answer\"+\n" + + "\x11SyncWikiVectorReq\x12\x16\n" + + "\x06wikiId\x18\x01 \x01(\tR\x06wikiId\"\x85\x01\n" + "\x0fLevelConfigInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x14\n" + "\x05level\x18\x02 \x01(\x05R\x05level\x12\x14\n" + @@ -3455,7 +6926,18 @@ const file_pb_plant_proto_rawDesc = "" + "\vminSunlight\x18\x04 \x01(\x03R\vminSunlight\x12\x14\n" + "\x05perks\x18\x05 \x01(\tR\x05perks\"A\n" + "\x13LevelConfigListResp\x12*\n" + - "\x04list\x18\x01 \x03(\v2\x16.plant.LevelConfigInfoR\x04list\"\x8d\x02\n" + + "\x04list\x18\x01 \x03(\v2\x16.plant.LevelConfigInfoR\x04list\"z\n" + + "\x14CreateLevelConfigReq\x12\x14\n" + + "\x05level\x18\x01 \x01(\x05R\x05level\x12\x14\n" + + "\x05title\x18\x02 \x01(\tR\x05title\x12 \n" + + "\vminSunlight\x18\x03 \x01(\x03R\vminSunlight\x12\x14\n" + + "\x05perks\x18\x04 \x01(\tR\x05perks\"\x8a\x01\n" + + "\x14UpdateLevelConfigReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x14\n" + + "\x05level\x18\x02 \x01(\x05R\x05level\x12\x14\n" + + "\x05title\x18\x03 \x01(\tR\x05title\x12 \n" + + "\vminSunlight\x18\x04 \x01(\x03R\vminSunlight\x12\x14\n" + + "\x05perks\x18\x05 \x01(\tR\x05perks\"\xb9\x02\n" + "\x0fBadgeConfigInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + @@ -3465,30 +6947,113 @@ const file_pb_plant_proto_rawDesc = "" + "\x04tier\x18\x06 \x01(\x05R\x04tier\x12\"\n" + "\ftargetAction\x18\a \x01(\tR\ftargetAction\x12\x1c\n" + "\tthreshold\x18\b \x01(\x03R\tthreshold\x12&\n" + - "\x0erewardSunlight\x18\t \x01(\x03R\x0erewardSunlight\"h\n" + + "\x0erewardSunlight\x18\t \x01(\x03R\x0erewardSunlight\x12\x16\n" + + "\x06iconId\x18\n" + + " \x01(\tR\x06iconId\x12\x12\n" + + "\x04sort\x18\v \x01(\x05R\x04sort\"h\n" + "\x12BadgeConfigListReq\x12\x18\n" + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x1c\n" + "\tdimension\x18\x03 \x01(\tR\tdimension\"W\n" + "\x13BadgeConfigListResp\x12*\n" + "\x04list\x18\x01 \x03(\v2\x16.plant.BadgeConfigInfoR\x04list\x12\x14\n" + - "\x05total\x18\x02 \x01(\x03R\x05total2\x8a\r\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\xae\x02\n" + + "\x14CreateBadgeConfigReq\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x02 \x01(\tR\vdescription\x12\x1c\n" + + "\tdimension\x18\x03 \x01(\tR\tdimension\x12\x18\n" + + "\agroupId\x18\x04 \x01(\tR\agroupId\x12\x12\n" + + "\x04tier\x18\x05 \x01(\x05R\x04tier\x12\"\n" + + "\ftargetAction\x18\x06 \x01(\tR\ftargetAction\x12\x1c\n" + + "\tthreshold\x18\a \x01(\x03R\tthreshold\x12&\n" + + "\x0erewardSunlight\x18\b \x01(\x03R\x0erewardSunlight\x12\x16\n" + + "\x06iconId\x18\t \x01(\tR\x06iconId\x12\x12\n" + + "\x04sort\x18\n" + + " \x01(\x05R\x04sort\"\xbe\x02\n" + + "\x14UpdateBadgeConfigReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x1c\n" + + "\tdimension\x18\x04 \x01(\tR\tdimension\x12\x18\n" + + "\agroupId\x18\x05 \x01(\tR\agroupId\x12\x12\n" + + "\x04tier\x18\x06 \x01(\x05R\x04tier\x12\"\n" + + "\ftargetAction\x18\a \x01(\tR\ftargetAction\x12\x1c\n" + + "\tthreshold\x18\b \x01(\x03R\tthreshold\x12&\n" + + "\x0erewardSunlight\x18\t \x01(\x03R\x0erewardSunlight\x12\x16\n" + + "\x06iconId\x18\n" + + " \x01(\tR\x06iconId\x12\x12\n" + + "\x04sort\x18\v \x01(\x05R\x04sort\"Y\n" + + "\x0fCompleteTaskReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x16\n" + + "\x06taskId\x18\x02 \x01(\tR\x06taskId\x12\x16\n" + + "\x06remark\x18\x03 \x01(\tR\x06remark\"\xec\x01\n" + + "\x14TaskCompletionResult\x12\x1c\n" + + "\tisLevelUp\x18\x01 \x01(\bR\tisLevelUp\x12:\n" + + "\fcurrentLevel\x18\x02 \x01(\v2\x16.plant.LevelConfigInfoR\fcurrentLevel\x12\x1e\n" + + "\n" + + "isGetBadge\x18\x03 \x01(\bR\n" + + "isGetBadge\x122\n" + + "\bnewBadge\x18\x04 \x01(\v2\x16.plant.BadgeConfigInfoR\bnewBadge\x12&\n" + + "\x0erewardSunlight\x18\x05 \x01(\x03R\x0erewardSunlight\"x\n" + + "\x0eBadgeGroupInfo\x12\x18\n" + + "\agroupId\x18\x01 \x01(\tR\agroupId\x12\x1c\n" + + "\tdimension\x18\x02 \x01(\tR\tdimension\x12.\n" + + "\x06badges\x18\x03 \x03(\v2\x16.plant.BadgeConfigInfoR\x06badges\"D\n" + + "\x13BadgeConfigTreeResp\x12-\n" + + "\x06groups\x18\x01 \x03(\v2\x15.plant.BadgeGroupInfoR\x06groups\"k\n" + + "\vAiQuotaResp\x12\x1c\n" + + "\tremaining\x18\x01 \x01(\x03R\tremaining\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\x12\x12\n" + + "\x04used\x18\x03 \x01(\x03R\x04used\x12\x14\n" + + "\x05limit\x18\x04 \x01(\x03R\x05limit\"\x8d\x01\n" + + "\x11AiChatHistoryInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x1a\n" + + "\bquestion\x18\x03 \x01(\tR\bquestion\x12\x16\n" + + "\x06answer\x18\x04 \x01(\tR\x06answer\x12\x1c\n" + + "\tcreatedAt\x18\x05 \x01(\tR\tcreatedAt\"`\n" + + "\x10AiChatHistoryReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x18\n" + + "\acurrent\x18\x02 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x03 \x01(\x05R\bpageSize\"W\n" + + "\x11AiChatHistoryResp\x12,\n" + + "\x04list\x18\x01 \x03(\v2\x18.plant.AiChatHistoryInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total2\x9c!\n" + "\fPlantService\x12?\n" + "\x0eGetUserProfile\x12\x14.plant.GetProfileReq\x1a\x17.plant.PlantUserProfile\x12?\n" + - "\x11UpdateUserProfile\x12\x17.plant.UpdateProfileReq\x1a\x11.plant.CommonResp\x127\n" + + "\x11UpdateUserProfile\x12\x17.plant.UpdateProfileReq\x1a\x11.plant.CommonResp\x12=\n" + + "\vGetMyBadges\x12\x14.plant.GetProfileReq\x1a\x18.plant.UserBadgeListResp\x12;\n" + + "\n" + + "GetMyStars\x12\x14.plant.GetProfileReq\x1a\x17.plant.UserStarListResp\x127\n" + "\vCreatePlant\x12\x15.plant.CreatePlantReq\x1a\x11.plant.CommonResp\x127\n" + "\vUpdatePlant\x12\x15.plant.UpdatePlantReq\x1a\x11.plant.CommonResp\x12/\n" + "\vDeletePlant\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x129\n" + "\fGetPlantList\x12\x13.plant.PlantListReq\x1a\x14.plant.PlantListResp\x126\n" + "\x0eGetPlantDetail\x12\f.plant.IdReq\x1a\x16.plant.PlantDetailResp\x127\n" + - "\vAddCarePlan\x12\x15.plant.AddCarePlanReq\x1a\x11.plant.CommonResp\x12;\n" + + "\vAddCarePlan\x12\x15.plant.AddCarePlanReq\x1a\x11.plant.CommonResp\x122\n" + + "\x0eDeleteCarePlan\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x12A\n" + + "\x10GetTodayTaskList\x12\x14.plant.GetProfileReq\x1a\x17.plant.CareTaskListResp\x12C\n" + + "\fCompleteTask\x12\x16.plant.CompleteTaskReq\x1a\x1b.plant.TaskCompletionResult\x12;\n" + "\rAddCareRecord\x12\x17.plant.AddCareRecordReq\x1a\x11.plant.CommonResp\x12?\n" + "\x0fAddGrowthRecord\x12\x19.plant.AddGrowthRecordReq\x1a\x11.plant.CommonResp\x126\n" + "\vGetWikiList\x12\x12.plant.WikiListReq\x1a\x13.plant.WikiListResp\x124\n" + - "\rGetWikiDetail\x12\f.plant.IdReq\x1a\x15.plant.WikiDetailResp\x12:\n" + + "\rGetWikiDetail\x12\f.plant.IdReq\x1a\x15.plant.WikiDetailResp\x125\n" + + "\n" + + "CreateWiki\x12\x14.plant.CreateWikiReq\x1a\x11.plant.CommonResp\x125\n" + + "\n" + + "UpdateWiki\x12\x14.plant.UpdateWikiReq\x1a\x11.plant.CommonResp\x12.\n" + + "\n" + + "DeleteWiki\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x12=\n" + + "\x0eSyncWikiVector\x12\x18.plant.SyncWikiVectorReq\x1a\x11.plant.CommonResp\x12?\n" + + "\x10DeleteWikiVector\x12\x18.plant.SyncWikiVectorReq\x1a\x11.plant.CommonResp\x126\n" + + "\x11SyncAllWikiVector\x12\x0e.plant.PageReq\x1a\x11.plant.CommonResp\x12:\n" + "\x10GetWikiClassList\x12\f.plant.IdReq\x1a\x18.plant.WikiClassListResp\x12?\n" + - "\x0fCreateWikiClass\x12\x19.plant.CreateWikiClassReq\x1a\x11.plant.CommonResp\x129\n" + - "\x0eToggleWikiStar\x12\x14.plant.ToggleStarReq\x1a\x11.plant.CommonResp\x125\n" + + "\x0fCreateWikiClass\x12\x19.plant.CreateWikiClassReq\x1a\x11.plant.CommonResp\x12?\n" + + "\x0fUpdateWikiClass\x12\x19.plant.UpdateWikiClassReq\x1a\x11.plant.CommonResp\x123\n" + + "\x0fDeleteWikiClass\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x129\n" + + "\x0eToggleWikiStar\x12\x14.plant.ToggleStarReq\x1a\x11.plant.CommonResp\x12D\n" + + "\x10GetMyClassifyLog\x12\x14.plant.GetProfileReq\x1a\x1a.plant.ClassifyLogListResp\x125\n" + + "\x11DeleteClassifyLog\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x125\n" + "\n" + "CreatePost\x12\x14.plant.CreatePostReq\x1a\x11.plant.CommonResp\x12.\n" + "\n" + @@ -3496,14 +7061,40 @@ const file_pb_plant_proto_rawDesc = "" + "\vGetPostList\x12\x12.plant.PostListReq\x1a\x13.plant.PostListResp\x124\n" + "\rGetPostDetail\x12\f.plant.IdReq\x1a\x15.plant.PostDetailResp\x127\n" + "\vCommentPost\x12\x15.plant.CommentPostReq\x1a\x11.plant.CommonResp\x121\n" + - "\bLikePost\x12\x12.plant.LikePostReq\x1a\x11.plant.CommonResp\x122\n" + - "\fGetTopicList\x12\f.plant.IdReq\x1a\x14.plant.TopicListResp\x127\n" + - "\vCreateTopic\x12\x15.plant.CreateTopicReq\x1a\x11.plant.CommonResp\x12/\n" + + "\bLikePost\x12\x12.plant.LikePostReq\x1a\x11.plant.CommonResp\x121\n" + + "\bStarPost\x12\x12.plant.LikePostReq\x1a\x11.plant.CommonResp\x12E\n" + + "\x12MediaCheckCallback\x12\x1c.plant.MediaCheckCallbackReq\x1a\x11.plant.CommonResp\x122\n" + + "\fGetTopicList\x12\f.plant.IdReq\x1a\x14.plant.TopicListResp\x120\n" + + "\x0eGetTopicDetail\x12\f.plant.IdReq\x1a\x10.plant.TopicInfo\x127\n" + + "\vCreateTopic\x12\x15.plant.CreateTopicReq\x1a\x11.plant.CommonResp\x127\n" + + "\vUpdateTopic\x12\x15.plant.UpdateTopicReq\x1a\x11.plant.CommonResp\x12/\n" + "\vDeleteTopic\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x12N\n" + - "\x13GetExchangeItemList\x12\x1a.plant.ExchangeItemListReq\x1a\x1b.plant.ExchangeItemListResp\x12G\n" + - "\x13CreateExchangeOrder\x12\x1d.plant.CreateExchangeOrderReq\x1a\x11.plant.CommonResp\x12@\n" + - "\x12GetLevelConfigList\x12\x0e.plant.PageReq\x1a\x1a.plant.LevelConfigListResp\x12K\n" + - "\x12GetBadgeConfigList\x12\x19.plant.BadgeConfigListReq\x1a\x1a.plant.BadgeConfigListRespB\tZ\a./plantb\x06proto3" + "\x13GetExchangeItemList\x12\x1a.plant.ExchangeItemListReq\x1a\x1b.plant.ExchangeItemListResp\x12>\n" + + "\x15GetExchangeItemDetail\x12\f.plant.IdReq\x1a\x17.plant.ExchangeItemInfo\x12E\n" + + "\x12CreateExchangeItem\x12\x1c.plant.CreateExchangeItemReq\x1a\x11.plant.CommonResp\x12E\n" + + "\x12UpdateExchangeItem\x12\x1c.plant.UpdateExchangeItemReq\x1a\x11.plant.CommonResp\x126\n" + + "\x12DeleteExchangeItem\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x12G\n" + + "\x13CreateExchangeOrder\x12\x1d.plant.CreateExchangeOrderReq\x1a\x11.plant.CommonResp\x12P\n" + + "\x13GetMyExchangeOrders\x12\x1b.plant.ExchangeOrderListReq\x1a\x1c.plant.ExchangeOrderListResp\x12Q\n" + + "\x14GetExchangeOrderList\x12\x1b.plant.ExchangeOrderListReq\x1a\x1c.plant.ExchangeOrderListResp\x12G\n" + + "\x13UpdateExchangeOrder\x12\x1d.plant.UpdateExchangeOrderReq\x1a\x11.plant.CommonResp\x12@\n" + + "\x12GetLevelConfigList\x12\x0e.plant.PageReq\x1a\x1a.plant.LevelConfigListResp\x12<\n" + + "\x14GetLevelConfigDetail\x12\f.plant.IdReq\x1a\x16.plant.LevelConfigInfo\x12C\n" + + "\x11CreateLevelConfig\x12\x1b.plant.CreateLevelConfigReq\x1a\x11.plant.CommonResp\x12C\n" + + "\x11UpdateLevelConfig\x12\x1b.plant.UpdateLevelConfigReq\x1a\x11.plant.CommonResp\x125\n" + + "\x11DeleteLevelConfig\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x12K\n" + + "\x12GetBadgeConfigList\x12\x19.plant.BadgeConfigListReq\x1a\x1a.plant.BadgeConfigListResp\x12<\n" + + "\x14GetBadgeConfigDetail\x12\f.plant.IdReq\x1a\x16.plant.BadgeConfigInfo\x12>\n" + + "\x12GetBadgeConfigTree\x12\f.plant.IdReq\x1a\x1a.plant.BadgeConfigTreeResp\x12C\n" + + "\x11CreateBadgeConfig\x12\x1b.plant.CreateBadgeConfigReq\x1a\x11.plant.CommonResp\x12C\n" + + "\x11UpdateBadgeConfig\x12\x1b.plant.UpdateBadgeConfigReq\x1a\x11.plant.CommonResp\x125\n" + + "\x11DeleteBadgeConfig\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x128\n" + + "\x12GetWikiClassDetail\x12\f.plant.IdReq\x1a\x14.plant.WikiClassInfo\x12E\n" + + "\x10GetAiChatHistory\x12\x17.plant.AiChatHistoryReq\x1a\x18.plant.AiChatHistoryResp\x12C\n" + + "\x11SaveAiChatHistory\x12\x1b.plant.SaveAiChatHistoryReq\x1a\x11.plant.CommonResp\x127\n" + + "\x13DeleteAiChatHistory\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x12=\n" + + "\x12ClearAiChatHistory\x12\x14.plant.GetProfileReq\x1a\x11.plant.CommonResp\x12:\n" + + "\x0eGetAiChatQuota\x12\x14.plant.GetProfileReq\x1a\x12.plant.AiQuotaRespB\tZ\a./plantb\x06proto3" var ( file_pb_plant_proto_rawDescOnce sync.Once @@ -3517,7 +7108,7 @@ func file_pb_plant_proto_rawDescGZIP() []byte { return file_pb_plant_proto_rawDescData } -var file_pb_plant_proto_msgTypes = make([]protoimpl.MessageInfo, 46) +var file_pb_plant_proto_msgTypes = make([]protoimpl.MessageInfo, 79) var file_pb_plant_proto_goTypes = []any{ (*CommonResp)(nil), // 0: plant.CommonResp (*IdReq)(nil), // 1: plant.IdReq @@ -3526,122 +7117,247 @@ var file_pb_plant_proto_goTypes = []any{ (*PlantUserProfile)(nil), // 4: plant.PlantUserProfile (*GetProfileReq)(nil), // 5: plant.GetProfileReq (*UpdateProfileReq)(nil), // 6: plant.UpdateProfileReq - (*PlantInfo)(nil), // 7: plant.PlantInfo - (*CreatePlantReq)(nil), // 8: plant.CreatePlantReq - (*UpdatePlantReq)(nil), // 9: plant.UpdatePlantReq - (*PlantListReq)(nil), // 10: plant.PlantListReq - (*PlantListResp)(nil), // 11: plant.PlantListResp - (*PlantDetailResp)(nil), // 12: plant.PlantDetailResp - (*CarePlanInfo)(nil), // 13: plant.CarePlanInfo - (*AddCarePlanReq)(nil), // 14: plant.AddCarePlanReq - (*AddCareRecordReq)(nil), // 15: plant.AddCareRecordReq - (*GrowthRecordInfo)(nil), // 16: plant.GrowthRecordInfo - (*AddGrowthRecordReq)(nil), // 17: plant.AddGrowthRecordReq - (*WikiInfo)(nil), // 18: plant.WikiInfo - (*WikiListReq)(nil), // 19: plant.WikiListReq - (*WikiListResp)(nil), // 20: plant.WikiListResp - (*WikiDetailResp)(nil), // 21: plant.WikiDetailResp - (*WikiClassInfo)(nil), // 22: plant.WikiClassInfo - (*WikiClassListResp)(nil), // 23: plant.WikiClassListResp - (*CreateWikiClassReq)(nil), // 24: plant.CreateWikiClassReq - (*ToggleStarReq)(nil), // 25: plant.ToggleStarReq - (*PostInfo)(nil), // 26: plant.PostInfo - (*CreatePostReq)(nil), // 27: plant.CreatePostReq - (*PostListReq)(nil), // 28: plant.PostListReq - (*PostListResp)(nil), // 29: plant.PostListResp - (*PostDetailResp)(nil), // 30: plant.PostDetailResp - (*PostCommentInfo)(nil), // 31: plant.PostCommentInfo - (*CommentPostReq)(nil), // 32: plant.CommentPostReq - (*LikePostReq)(nil), // 33: plant.LikePostReq - (*TopicInfo)(nil), // 34: plant.TopicInfo - (*TopicListResp)(nil), // 35: plant.TopicListResp - (*CreateTopicReq)(nil), // 36: plant.CreateTopicReq - (*ExchangeItemInfo)(nil), // 37: plant.ExchangeItemInfo - (*ExchangeItemListReq)(nil), // 38: plant.ExchangeItemListReq - (*ExchangeItemListResp)(nil), // 39: plant.ExchangeItemListResp - (*CreateExchangeOrderReq)(nil), // 40: plant.CreateExchangeOrderReq - (*LevelConfigInfo)(nil), // 41: plant.LevelConfigInfo - (*LevelConfigListResp)(nil), // 42: plant.LevelConfigListResp - (*BadgeConfigInfo)(nil), // 43: plant.BadgeConfigInfo - (*BadgeConfigListReq)(nil), // 44: plant.BadgeConfigListReq - (*BadgeConfigListResp)(nil), // 45: plant.BadgeConfigListResp + (*UserBadgeInfo)(nil), // 7: plant.UserBadgeInfo + (*UserBadgeListResp)(nil), // 8: plant.UserBadgeListResp + (*UserStarInfo)(nil), // 9: plant.UserStarInfo + (*UserStarListResp)(nil), // 10: plant.UserStarListResp + (*PlantInfo)(nil), // 11: plant.PlantInfo + (*CreatePlantReq)(nil), // 12: plant.CreatePlantReq + (*UpdatePlantReq)(nil), // 13: plant.UpdatePlantReq + (*PlantListReq)(nil), // 14: plant.PlantListReq + (*PlantListResp)(nil), // 15: plant.PlantListResp + (*PlantDetailResp)(nil), // 16: plant.PlantDetailResp + (*CarePlanInfo)(nil), // 17: plant.CarePlanInfo + (*AddCarePlanReq)(nil), // 18: plant.AddCarePlanReq + (*CareTaskInfo)(nil), // 19: plant.CareTaskInfo + (*CareTaskListResp)(nil), // 20: plant.CareTaskListResp + (*AddCareRecordReq)(nil), // 21: plant.AddCareRecordReq + (*GrowthRecordInfo)(nil), // 22: plant.GrowthRecordInfo + (*AddGrowthRecordReq)(nil), // 23: plant.AddGrowthRecordReq + (*WikiInfo)(nil), // 24: plant.WikiInfo + (*WikiListReq)(nil), // 25: plant.WikiListReq + (*WikiListResp)(nil), // 26: plant.WikiListResp + (*WikiDetailResp)(nil), // 27: plant.WikiDetailResp + (*CreateWikiReq)(nil), // 28: plant.CreateWikiReq + (*UpdateWikiReq)(nil), // 29: plant.UpdateWikiReq + (*WikiClassInfo)(nil), // 30: plant.WikiClassInfo + (*WikiClassListResp)(nil), // 31: plant.WikiClassListResp + (*CreateWikiClassReq)(nil), // 32: plant.CreateWikiClassReq + (*UpdateWikiClassReq)(nil), // 33: plant.UpdateWikiClassReq + (*ToggleStarReq)(nil), // 34: plant.ToggleStarReq + (*ClassifyLogInfo)(nil), // 35: plant.ClassifyLogInfo + (*ClassifyLogListResp)(nil), // 36: plant.ClassifyLogListResp + (*PostInfo)(nil), // 37: plant.PostInfo + (*CreatePostReq)(nil), // 38: plant.CreatePostReq + (*PostListReq)(nil), // 39: plant.PostListReq + (*PostListResp)(nil), // 40: plant.PostListResp + (*PostDetailResp)(nil), // 41: plant.PostDetailResp + (*PostCommentInfo)(nil), // 42: plant.PostCommentInfo + (*CommentPostReq)(nil), // 43: plant.CommentPostReq + (*LikePostReq)(nil), // 44: plant.LikePostReq + (*TopicInfo)(nil), // 45: plant.TopicInfo + (*TopicListResp)(nil), // 46: plant.TopicListResp + (*CreateTopicReq)(nil), // 47: plant.CreateTopicReq + (*UpdateTopicReq)(nil), // 48: plant.UpdateTopicReq + (*ExchangeItemInfo)(nil), // 49: plant.ExchangeItemInfo + (*ExchangeItemListReq)(nil), // 50: plant.ExchangeItemListReq + (*ExchangeItemListResp)(nil), // 51: plant.ExchangeItemListResp + (*CreateExchangeOrderReq)(nil), // 52: plant.CreateExchangeOrderReq + (*CreateExchangeItemReq)(nil), // 53: plant.CreateExchangeItemReq + (*UpdateExchangeItemReq)(nil), // 54: plant.UpdateExchangeItemReq + (*ExchangeOrderInfo)(nil), // 55: plant.ExchangeOrderInfo + (*ExchangeOrderListReq)(nil), // 56: plant.ExchangeOrderListReq + (*ExchangeOrderListResp)(nil), // 57: plant.ExchangeOrderListResp + (*UpdateExchangeOrderReq)(nil), // 58: plant.UpdateExchangeOrderReq + (*MediaCheckCallbackReq)(nil), // 59: plant.MediaCheckCallbackReq + (*SaveAiChatHistoryReq)(nil), // 60: plant.SaveAiChatHistoryReq + (*SyncWikiVectorReq)(nil), // 61: plant.SyncWikiVectorReq + (*LevelConfigInfo)(nil), // 62: plant.LevelConfigInfo + (*LevelConfigListResp)(nil), // 63: plant.LevelConfigListResp + (*CreateLevelConfigReq)(nil), // 64: plant.CreateLevelConfigReq + (*UpdateLevelConfigReq)(nil), // 65: plant.UpdateLevelConfigReq + (*BadgeConfigInfo)(nil), // 66: plant.BadgeConfigInfo + (*BadgeConfigListReq)(nil), // 67: plant.BadgeConfigListReq + (*BadgeConfigListResp)(nil), // 68: plant.BadgeConfigListResp + (*CreateBadgeConfigReq)(nil), // 69: plant.CreateBadgeConfigReq + (*UpdateBadgeConfigReq)(nil), // 70: plant.UpdateBadgeConfigReq + (*CompleteTaskReq)(nil), // 71: plant.CompleteTaskReq + (*TaskCompletionResult)(nil), // 72: plant.TaskCompletionResult + (*BadgeGroupInfo)(nil), // 73: plant.BadgeGroupInfo + (*BadgeConfigTreeResp)(nil), // 74: plant.BadgeConfigTreeResp + (*AiQuotaResp)(nil), // 75: plant.AiQuotaResp + (*AiChatHistoryInfo)(nil), // 76: plant.AiChatHistoryInfo + (*AiChatHistoryReq)(nil), // 77: plant.AiChatHistoryReq + (*AiChatHistoryResp)(nil), // 78: plant.AiChatHistoryResp } var file_pb_plant_proto_depIdxs = []int32{ - 7, // 0: plant.PlantListResp.list:type_name -> plant.PlantInfo - 7, // 1: plant.PlantDetailResp.plant:type_name -> plant.PlantInfo - 13, // 2: plant.PlantDetailResp.carePlans:type_name -> plant.CarePlanInfo - 16, // 3: plant.PlantDetailResp.growthRecords:type_name -> plant.GrowthRecordInfo - 18, // 4: plant.WikiListResp.list:type_name -> plant.WikiInfo - 18, // 5: plant.WikiDetailResp.wiki:type_name -> plant.WikiInfo - 22, // 6: plant.WikiClassListResp.list:type_name -> plant.WikiClassInfo - 26, // 7: plant.PostListResp.list:type_name -> plant.PostInfo - 26, // 8: plant.PostDetailResp.post:type_name -> plant.PostInfo - 31, // 9: plant.PostDetailResp.comments:type_name -> plant.PostCommentInfo - 34, // 10: plant.TopicListResp.list:type_name -> plant.TopicInfo - 37, // 11: plant.ExchangeItemListResp.list:type_name -> plant.ExchangeItemInfo - 41, // 12: plant.LevelConfigListResp.list:type_name -> plant.LevelConfigInfo - 43, // 13: plant.BadgeConfigListResp.list:type_name -> plant.BadgeConfigInfo - 5, // 14: plant.PlantService.GetUserProfile:input_type -> plant.GetProfileReq - 6, // 15: plant.PlantService.UpdateUserProfile:input_type -> plant.UpdateProfileReq - 8, // 16: plant.PlantService.CreatePlant:input_type -> plant.CreatePlantReq - 9, // 17: plant.PlantService.UpdatePlant:input_type -> plant.UpdatePlantReq - 2, // 18: plant.PlantService.DeletePlant:input_type -> plant.IdsReq - 10, // 19: plant.PlantService.GetPlantList:input_type -> plant.PlantListReq - 1, // 20: plant.PlantService.GetPlantDetail:input_type -> plant.IdReq - 14, // 21: plant.PlantService.AddCarePlan:input_type -> plant.AddCarePlanReq - 15, // 22: plant.PlantService.AddCareRecord:input_type -> plant.AddCareRecordReq - 17, // 23: plant.PlantService.AddGrowthRecord:input_type -> plant.AddGrowthRecordReq - 19, // 24: plant.PlantService.GetWikiList:input_type -> plant.WikiListReq - 1, // 25: plant.PlantService.GetWikiDetail:input_type -> plant.IdReq - 1, // 26: plant.PlantService.GetWikiClassList:input_type -> plant.IdReq - 24, // 27: plant.PlantService.CreateWikiClass:input_type -> plant.CreateWikiClassReq - 25, // 28: plant.PlantService.ToggleWikiStar:input_type -> plant.ToggleStarReq - 27, // 29: plant.PlantService.CreatePost:input_type -> plant.CreatePostReq - 2, // 30: plant.PlantService.DeletePost:input_type -> plant.IdsReq - 28, // 31: plant.PlantService.GetPostList:input_type -> plant.PostListReq - 1, // 32: plant.PlantService.GetPostDetail:input_type -> plant.IdReq - 32, // 33: plant.PlantService.CommentPost:input_type -> plant.CommentPostReq - 33, // 34: plant.PlantService.LikePost:input_type -> plant.LikePostReq - 1, // 35: plant.PlantService.GetTopicList:input_type -> plant.IdReq - 36, // 36: plant.PlantService.CreateTopic:input_type -> plant.CreateTopicReq - 2, // 37: plant.PlantService.DeleteTopic:input_type -> plant.IdsReq - 38, // 38: plant.PlantService.GetExchangeItemList:input_type -> plant.ExchangeItemListReq - 40, // 39: plant.PlantService.CreateExchangeOrder:input_type -> plant.CreateExchangeOrderReq - 3, // 40: plant.PlantService.GetLevelConfigList:input_type -> plant.PageReq - 44, // 41: plant.PlantService.GetBadgeConfigList:input_type -> plant.BadgeConfigListReq - 4, // 42: plant.PlantService.GetUserProfile:output_type -> plant.PlantUserProfile - 0, // 43: plant.PlantService.UpdateUserProfile:output_type -> plant.CommonResp - 0, // 44: plant.PlantService.CreatePlant:output_type -> plant.CommonResp - 0, // 45: plant.PlantService.UpdatePlant:output_type -> plant.CommonResp - 0, // 46: plant.PlantService.DeletePlant:output_type -> plant.CommonResp - 11, // 47: plant.PlantService.GetPlantList:output_type -> plant.PlantListResp - 12, // 48: plant.PlantService.GetPlantDetail:output_type -> plant.PlantDetailResp - 0, // 49: plant.PlantService.AddCarePlan:output_type -> plant.CommonResp - 0, // 50: plant.PlantService.AddCareRecord:output_type -> plant.CommonResp - 0, // 51: plant.PlantService.AddGrowthRecord:output_type -> plant.CommonResp - 20, // 52: plant.PlantService.GetWikiList:output_type -> plant.WikiListResp - 21, // 53: plant.PlantService.GetWikiDetail:output_type -> plant.WikiDetailResp - 23, // 54: plant.PlantService.GetWikiClassList:output_type -> plant.WikiClassListResp - 0, // 55: plant.PlantService.CreateWikiClass:output_type -> plant.CommonResp - 0, // 56: plant.PlantService.ToggleWikiStar:output_type -> plant.CommonResp - 0, // 57: plant.PlantService.CreatePost:output_type -> plant.CommonResp - 0, // 58: plant.PlantService.DeletePost:output_type -> plant.CommonResp - 29, // 59: plant.PlantService.GetPostList:output_type -> plant.PostListResp - 30, // 60: plant.PlantService.GetPostDetail:output_type -> plant.PostDetailResp - 0, // 61: plant.PlantService.CommentPost:output_type -> plant.CommonResp - 0, // 62: plant.PlantService.LikePost:output_type -> plant.CommonResp - 35, // 63: plant.PlantService.GetTopicList:output_type -> plant.TopicListResp - 0, // 64: plant.PlantService.CreateTopic:output_type -> plant.CommonResp - 0, // 65: plant.PlantService.DeleteTopic:output_type -> plant.CommonResp - 39, // 66: plant.PlantService.GetExchangeItemList:output_type -> plant.ExchangeItemListResp - 0, // 67: plant.PlantService.CreateExchangeOrder:output_type -> plant.CommonResp - 42, // 68: plant.PlantService.GetLevelConfigList:output_type -> plant.LevelConfigListResp - 45, // 69: plant.PlantService.GetBadgeConfigList:output_type -> plant.BadgeConfigListResp - 42, // [42:70] is the sub-list for method output_type - 14, // [14:42] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 7, // 0: plant.UserBadgeListResp.list:type_name -> plant.UserBadgeInfo + 9, // 1: plant.UserStarListResp.list:type_name -> plant.UserStarInfo + 11, // 2: plant.PlantListResp.list:type_name -> plant.PlantInfo + 11, // 3: plant.PlantDetailResp.plant:type_name -> plant.PlantInfo + 17, // 4: plant.PlantDetailResp.carePlans:type_name -> plant.CarePlanInfo + 22, // 5: plant.PlantDetailResp.growthRecords:type_name -> plant.GrowthRecordInfo + 19, // 6: plant.CareTaskListResp.list:type_name -> plant.CareTaskInfo + 24, // 7: plant.WikiListResp.list:type_name -> plant.WikiInfo + 24, // 8: plant.WikiDetailResp.wiki:type_name -> plant.WikiInfo + 30, // 9: plant.WikiClassListResp.list:type_name -> plant.WikiClassInfo + 35, // 10: plant.ClassifyLogListResp.list:type_name -> plant.ClassifyLogInfo + 37, // 11: plant.PostListResp.list:type_name -> plant.PostInfo + 37, // 12: plant.PostDetailResp.post:type_name -> plant.PostInfo + 42, // 13: plant.PostDetailResp.comments:type_name -> plant.PostCommentInfo + 45, // 14: plant.TopicListResp.list:type_name -> plant.TopicInfo + 49, // 15: plant.ExchangeItemListResp.list:type_name -> plant.ExchangeItemInfo + 55, // 16: plant.ExchangeOrderListResp.list:type_name -> plant.ExchangeOrderInfo + 62, // 17: plant.LevelConfigListResp.list:type_name -> plant.LevelConfigInfo + 66, // 18: plant.BadgeConfigListResp.list:type_name -> plant.BadgeConfigInfo + 62, // 19: plant.TaskCompletionResult.currentLevel:type_name -> plant.LevelConfigInfo + 66, // 20: plant.TaskCompletionResult.newBadge:type_name -> plant.BadgeConfigInfo + 66, // 21: plant.BadgeGroupInfo.badges:type_name -> plant.BadgeConfigInfo + 73, // 22: plant.BadgeConfigTreeResp.groups:type_name -> plant.BadgeGroupInfo + 76, // 23: plant.AiChatHistoryResp.list:type_name -> plant.AiChatHistoryInfo + 5, // 24: plant.PlantService.GetUserProfile:input_type -> plant.GetProfileReq + 6, // 25: plant.PlantService.UpdateUserProfile:input_type -> plant.UpdateProfileReq + 5, // 26: plant.PlantService.GetMyBadges:input_type -> plant.GetProfileReq + 5, // 27: plant.PlantService.GetMyStars:input_type -> plant.GetProfileReq + 12, // 28: plant.PlantService.CreatePlant:input_type -> plant.CreatePlantReq + 13, // 29: plant.PlantService.UpdatePlant:input_type -> plant.UpdatePlantReq + 2, // 30: plant.PlantService.DeletePlant:input_type -> plant.IdsReq + 14, // 31: plant.PlantService.GetPlantList:input_type -> plant.PlantListReq + 1, // 32: plant.PlantService.GetPlantDetail:input_type -> plant.IdReq + 18, // 33: plant.PlantService.AddCarePlan:input_type -> plant.AddCarePlanReq + 2, // 34: plant.PlantService.DeleteCarePlan:input_type -> plant.IdsReq + 5, // 35: plant.PlantService.GetTodayTaskList:input_type -> plant.GetProfileReq + 71, // 36: plant.PlantService.CompleteTask:input_type -> plant.CompleteTaskReq + 21, // 37: plant.PlantService.AddCareRecord:input_type -> plant.AddCareRecordReq + 23, // 38: plant.PlantService.AddGrowthRecord:input_type -> plant.AddGrowthRecordReq + 25, // 39: plant.PlantService.GetWikiList:input_type -> plant.WikiListReq + 1, // 40: plant.PlantService.GetWikiDetail:input_type -> plant.IdReq + 28, // 41: plant.PlantService.CreateWiki:input_type -> plant.CreateWikiReq + 29, // 42: plant.PlantService.UpdateWiki:input_type -> plant.UpdateWikiReq + 2, // 43: plant.PlantService.DeleteWiki:input_type -> plant.IdsReq + 61, // 44: plant.PlantService.SyncWikiVector:input_type -> plant.SyncWikiVectorReq + 61, // 45: plant.PlantService.DeleteWikiVector:input_type -> plant.SyncWikiVectorReq + 3, // 46: plant.PlantService.SyncAllWikiVector:input_type -> plant.PageReq + 1, // 47: plant.PlantService.GetWikiClassList:input_type -> plant.IdReq + 32, // 48: plant.PlantService.CreateWikiClass:input_type -> plant.CreateWikiClassReq + 33, // 49: plant.PlantService.UpdateWikiClass:input_type -> plant.UpdateWikiClassReq + 2, // 50: plant.PlantService.DeleteWikiClass:input_type -> plant.IdsReq + 34, // 51: plant.PlantService.ToggleWikiStar:input_type -> plant.ToggleStarReq + 5, // 52: plant.PlantService.GetMyClassifyLog:input_type -> plant.GetProfileReq + 2, // 53: plant.PlantService.DeleteClassifyLog:input_type -> plant.IdsReq + 38, // 54: plant.PlantService.CreatePost:input_type -> plant.CreatePostReq + 2, // 55: plant.PlantService.DeletePost:input_type -> plant.IdsReq + 39, // 56: plant.PlantService.GetPostList:input_type -> plant.PostListReq + 1, // 57: plant.PlantService.GetPostDetail:input_type -> plant.IdReq + 43, // 58: plant.PlantService.CommentPost:input_type -> plant.CommentPostReq + 44, // 59: plant.PlantService.LikePost:input_type -> plant.LikePostReq + 44, // 60: plant.PlantService.StarPost:input_type -> plant.LikePostReq + 59, // 61: plant.PlantService.MediaCheckCallback:input_type -> plant.MediaCheckCallbackReq + 1, // 62: plant.PlantService.GetTopicList:input_type -> plant.IdReq + 1, // 63: plant.PlantService.GetTopicDetail:input_type -> plant.IdReq + 47, // 64: plant.PlantService.CreateTopic:input_type -> plant.CreateTopicReq + 48, // 65: plant.PlantService.UpdateTopic:input_type -> plant.UpdateTopicReq + 2, // 66: plant.PlantService.DeleteTopic:input_type -> plant.IdsReq + 50, // 67: plant.PlantService.GetExchangeItemList:input_type -> plant.ExchangeItemListReq + 1, // 68: plant.PlantService.GetExchangeItemDetail:input_type -> plant.IdReq + 53, // 69: plant.PlantService.CreateExchangeItem:input_type -> plant.CreateExchangeItemReq + 54, // 70: plant.PlantService.UpdateExchangeItem:input_type -> plant.UpdateExchangeItemReq + 2, // 71: plant.PlantService.DeleteExchangeItem:input_type -> plant.IdsReq + 52, // 72: plant.PlantService.CreateExchangeOrder:input_type -> plant.CreateExchangeOrderReq + 56, // 73: plant.PlantService.GetMyExchangeOrders:input_type -> plant.ExchangeOrderListReq + 56, // 74: plant.PlantService.GetExchangeOrderList:input_type -> plant.ExchangeOrderListReq + 58, // 75: plant.PlantService.UpdateExchangeOrder:input_type -> plant.UpdateExchangeOrderReq + 3, // 76: plant.PlantService.GetLevelConfigList:input_type -> plant.PageReq + 1, // 77: plant.PlantService.GetLevelConfigDetail:input_type -> plant.IdReq + 64, // 78: plant.PlantService.CreateLevelConfig:input_type -> plant.CreateLevelConfigReq + 65, // 79: plant.PlantService.UpdateLevelConfig:input_type -> plant.UpdateLevelConfigReq + 2, // 80: plant.PlantService.DeleteLevelConfig:input_type -> plant.IdsReq + 67, // 81: plant.PlantService.GetBadgeConfigList:input_type -> plant.BadgeConfigListReq + 1, // 82: plant.PlantService.GetBadgeConfigDetail:input_type -> plant.IdReq + 1, // 83: plant.PlantService.GetBadgeConfigTree:input_type -> plant.IdReq + 69, // 84: plant.PlantService.CreateBadgeConfig:input_type -> plant.CreateBadgeConfigReq + 70, // 85: plant.PlantService.UpdateBadgeConfig:input_type -> plant.UpdateBadgeConfigReq + 2, // 86: plant.PlantService.DeleteBadgeConfig:input_type -> plant.IdsReq + 1, // 87: plant.PlantService.GetWikiClassDetail:input_type -> plant.IdReq + 77, // 88: plant.PlantService.GetAiChatHistory:input_type -> plant.AiChatHistoryReq + 60, // 89: plant.PlantService.SaveAiChatHistory:input_type -> plant.SaveAiChatHistoryReq + 2, // 90: plant.PlantService.DeleteAiChatHistory:input_type -> plant.IdsReq + 5, // 91: plant.PlantService.ClearAiChatHistory:input_type -> plant.GetProfileReq + 5, // 92: plant.PlantService.GetAiChatQuota:input_type -> plant.GetProfileReq + 4, // 93: plant.PlantService.GetUserProfile:output_type -> plant.PlantUserProfile + 0, // 94: plant.PlantService.UpdateUserProfile:output_type -> plant.CommonResp + 8, // 95: plant.PlantService.GetMyBadges:output_type -> plant.UserBadgeListResp + 10, // 96: plant.PlantService.GetMyStars:output_type -> plant.UserStarListResp + 0, // 97: plant.PlantService.CreatePlant:output_type -> plant.CommonResp + 0, // 98: plant.PlantService.UpdatePlant:output_type -> plant.CommonResp + 0, // 99: plant.PlantService.DeletePlant:output_type -> plant.CommonResp + 15, // 100: plant.PlantService.GetPlantList:output_type -> plant.PlantListResp + 16, // 101: plant.PlantService.GetPlantDetail:output_type -> plant.PlantDetailResp + 0, // 102: plant.PlantService.AddCarePlan:output_type -> plant.CommonResp + 0, // 103: plant.PlantService.DeleteCarePlan:output_type -> plant.CommonResp + 20, // 104: plant.PlantService.GetTodayTaskList:output_type -> plant.CareTaskListResp + 72, // 105: plant.PlantService.CompleteTask:output_type -> plant.TaskCompletionResult + 0, // 106: plant.PlantService.AddCareRecord:output_type -> plant.CommonResp + 0, // 107: plant.PlantService.AddGrowthRecord:output_type -> plant.CommonResp + 26, // 108: plant.PlantService.GetWikiList:output_type -> plant.WikiListResp + 27, // 109: plant.PlantService.GetWikiDetail:output_type -> plant.WikiDetailResp + 0, // 110: plant.PlantService.CreateWiki:output_type -> plant.CommonResp + 0, // 111: plant.PlantService.UpdateWiki:output_type -> plant.CommonResp + 0, // 112: plant.PlantService.DeleteWiki:output_type -> plant.CommonResp + 0, // 113: plant.PlantService.SyncWikiVector:output_type -> plant.CommonResp + 0, // 114: plant.PlantService.DeleteWikiVector:output_type -> plant.CommonResp + 0, // 115: plant.PlantService.SyncAllWikiVector:output_type -> plant.CommonResp + 31, // 116: plant.PlantService.GetWikiClassList:output_type -> plant.WikiClassListResp + 0, // 117: plant.PlantService.CreateWikiClass:output_type -> plant.CommonResp + 0, // 118: plant.PlantService.UpdateWikiClass:output_type -> plant.CommonResp + 0, // 119: plant.PlantService.DeleteWikiClass:output_type -> plant.CommonResp + 0, // 120: plant.PlantService.ToggleWikiStar:output_type -> plant.CommonResp + 36, // 121: plant.PlantService.GetMyClassifyLog:output_type -> plant.ClassifyLogListResp + 0, // 122: plant.PlantService.DeleteClassifyLog:output_type -> plant.CommonResp + 0, // 123: plant.PlantService.CreatePost:output_type -> plant.CommonResp + 0, // 124: plant.PlantService.DeletePost:output_type -> plant.CommonResp + 40, // 125: plant.PlantService.GetPostList:output_type -> plant.PostListResp + 41, // 126: plant.PlantService.GetPostDetail:output_type -> plant.PostDetailResp + 0, // 127: plant.PlantService.CommentPost:output_type -> plant.CommonResp + 0, // 128: plant.PlantService.LikePost:output_type -> plant.CommonResp + 0, // 129: plant.PlantService.StarPost:output_type -> plant.CommonResp + 0, // 130: plant.PlantService.MediaCheckCallback:output_type -> plant.CommonResp + 46, // 131: plant.PlantService.GetTopicList:output_type -> plant.TopicListResp + 45, // 132: plant.PlantService.GetTopicDetail:output_type -> plant.TopicInfo + 0, // 133: plant.PlantService.CreateTopic:output_type -> plant.CommonResp + 0, // 134: plant.PlantService.UpdateTopic:output_type -> plant.CommonResp + 0, // 135: plant.PlantService.DeleteTopic:output_type -> plant.CommonResp + 51, // 136: plant.PlantService.GetExchangeItemList:output_type -> plant.ExchangeItemListResp + 49, // 137: plant.PlantService.GetExchangeItemDetail:output_type -> plant.ExchangeItemInfo + 0, // 138: plant.PlantService.CreateExchangeItem:output_type -> plant.CommonResp + 0, // 139: plant.PlantService.UpdateExchangeItem:output_type -> plant.CommonResp + 0, // 140: plant.PlantService.DeleteExchangeItem:output_type -> plant.CommonResp + 0, // 141: plant.PlantService.CreateExchangeOrder:output_type -> plant.CommonResp + 57, // 142: plant.PlantService.GetMyExchangeOrders:output_type -> plant.ExchangeOrderListResp + 57, // 143: plant.PlantService.GetExchangeOrderList:output_type -> plant.ExchangeOrderListResp + 0, // 144: plant.PlantService.UpdateExchangeOrder:output_type -> plant.CommonResp + 63, // 145: plant.PlantService.GetLevelConfigList:output_type -> plant.LevelConfigListResp + 62, // 146: plant.PlantService.GetLevelConfigDetail:output_type -> plant.LevelConfigInfo + 0, // 147: plant.PlantService.CreateLevelConfig:output_type -> plant.CommonResp + 0, // 148: plant.PlantService.UpdateLevelConfig:output_type -> plant.CommonResp + 0, // 149: plant.PlantService.DeleteLevelConfig:output_type -> plant.CommonResp + 68, // 150: plant.PlantService.GetBadgeConfigList:output_type -> plant.BadgeConfigListResp + 66, // 151: plant.PlantService.GetBadgeConfigDetail:output_type -> plant.BadgeConfigInfo + 74, // 152: plant.PlantService.GetBadgeConfigTree:output_type -> plant.BadgeConfigTreeResp + 0, // 153: plant.PlantService.CreateBadgeConfig:output_type -> plant.CommonResp + 0, // 154: plant.PlantService.UpdateBadgeConfig:output_type -> plant.CommonResp + 0, // 155: plant.PlantService.DeleteBadgeConfig:output_type -> plant.CommonResp + 30, // 156: plant.PlantService.GetWikiClassDetail:output_type -> plant.WikiClassInfo + 78, // 157: plant.PlantService.GetAiChatHistory:output_type -> plant.AiChatHistoryResp + 0, // 158: plant.PlantService.SaveAiChatHistory:output_type -> plant.CommonResp + 0, // 159: plant.PlantService.DeleteAiChatHistory:output_type -> plant.CommonResp + 0, // 160: plant.PlantService.ClearAiChatHistory:output_type -> plant.CommonResp + 75, // 161: plant.PlantService.GetAiChatQuota:output_type -> plant.AiQuotaResp + 93, // [93:162] is the sub-list for method output_type + 24, // [24:93] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_pb_plant_proto_init() } @@ -3655,7 +7371,7 @@ func file_pb_plant_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_pb_plant_proto_rawDesc), len(file_pb_plant_proto_rawDesc)), NumEnums: 0, - NumMessages: 46, + NumMessages: 79, NumExtensions: 0, NumServices: 1, }, diff --git a/app/plant/rpc/plant/plant_grpc.pb.go b/app/plant/rpc/plant/plant_grpc.pb.go index 339c41a..3f69543 100644 --- a/app/plant/rpc/plant/plant_grpc.pb.go +++ b/app/plant/rpc/plant/plant_grpc.pb.go @@ -19,34 +19,75 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - PlantService_GetUserProfile_FullMethodName = "/plant.PlantService/GetUserProfile" - PlantService_UpdateUserProfile_FullMethodName = "/plant.PlantService/UpdateUserProfile" - PlantService_CreatePlant_FullMethodName = "/plant.PlantService/CreatePlant" - PlantService_UpdatePlant_FullMethodName = "/plant.PlantService/UpdatePlant" - PlantService_DeletePlant_FullMethodName = "/plant.PlantService/DeletePlant" - PlantService_GetPlantList_FullMethodName = "/plant.PlantService/GetPlantList" - PlantService_GetPlantDetail_FullMethodName = "/plant.PlantService/GetPlantDetail" - PlantService_AddCarePlan_FullMethodName = "/plant.PlantService/AddCarePlan" - PlantService_AddCareRecord_FullMethodName = "/plant.PlantService/AddCareRecord" - PlantService_AddGrowthRecord_FullMethodName = "/plant.PlantService/AddGrowthRecord" - PlantService_GetWikiList_FullMethodName = "/plant.PlantService/GetWikiList" - PlantService_GetWikiDetail_FullMethodName = "/plant.PlantService/GetWikiDetail" - PlantService_GetWikiClassList_FullMethodName = "/plant.PlantService/GetWikiClassList" - PlantService_CreateWikiClass_FullMethodName = "/plant.PlantService/CreateWikiClass" - PlantService_ToggleWikiStar_FullMethodName = "/plant.PlantService/ToggleWikiStar" - PlantService_CreatePost_FullMethodName = "/plant.PlantService/CreatePost" - PlantService_DeletePost_FullMethodName = "/plant.PlantService/DeletePost" - PlantService_GetPostList_FullMethodName = "/plant.PlantService/GetPostList" - PlantService_GetPostDetail_FullMethodName = "/plant.PlantService/GetPostDetail" - PlantService_CommentPost_FullMethodName = "/plant.PlantService/CommentPost" - PlantService_LikePost_FullMethodName = "/plant.PlantService/LikePost" - PlantService_GetTopicList_FullMethodName = "/plant.PlantService/GetTopicList" - PlantService_CreateTopic_FullMethodName = "/plant.PlantService/CreateTopic" - PlantService_DeleteTopic_FullMethodName = "/plant.PlantService/DeleteTopic" - PlantService_GetExchangeItemList_FullMethodName = "/plant.PlantService/GetExchangeItemList" - PlantService_CreateExchangeOrder_FullMethodName = "/plant.PlantService/CreateExchangeOrder" - PlantService_GetLevelConfigList_FullMethodName = "/plant.PlantService/GetLevelConfigList" - PlantService_GetBadgeConfigList_FullMethodName = "/plant.PlantService/GetBadgeConfigList" + PlantService_GetUserProfile_FullMethodName = "/plant.PlantService/GetUserProfile" + PlantService_UpdateUserProfile_FullMethodName = "/plant.PlantService/UpdateUserProfile" + PlantService_GetMyBadges_FullMethodName = "/plant.PlantService/GetMyBadges" + PlantService_GetMyStars_FullMethodName = "/plant.PlantService/GetMyStars" + PlantService_CreatePlant_FullMethodName = "/plant.PlantService/CreatePlant" + PlantService_UpdatePlant_FullMethodName = "/plant.PlantService/UpdatePlant" + PlantService_DeletePlant_FullMethodName = "/plant.PlantService/DeletePlant" + PlantService_GetPlantList_FullMethodName = "/plant.PlantService/GetPlantList" + PlantService_GetPlantDetail_FullMethodName = "/plant.PlantService/GetPlantDetail" + PlantService_AddCarePlan_FullMethodName = "/plant.PlantService/AddCarePlan" + PlantService_DeleteCarePlan_FullMethodName = "/plant.PlantService/DeleteCarePlan" + PlantService_GetTodayTaskList_FullMethodName = "/plant.PlantService/GetTodayTaskList" + PlantService_CompleteTask_FullMethodName = "/plant.PlantService/CompleteTask" + PlantService_AddCareRecord_FullMethodName = "/plant.PlantService/AddCareRecord" + PlantService_AddGrowthRecord_FullMethodName = "/plant.PlantService/AddGrowthRecord" + PlantService_GetWikiList_FullMethodName = "/plant.PlantService/GetWikiList" + PlantService_GetWikiDetail_FullMethodName = "/plant.PlantService/GetWikiDetail" + PlantService_CreateWiki_FullMethodName = "/plant.PlantService/CreateWiki" + PlantService_UpdateWiki_FullMethodName = "/plant.PlantService/UpdateWiki" + PlantService_DeleteWiki_FullMethodName = "/plant.PlantService/DeleteWiki" + PlantService_SyncWikiVector_FullMethodName = "/plant.PlantService/SyncWikiVector" + PlantService_DeleteWikiVector_FullMethodName = "/plant.PlantService/DeleteWikiVector" + PlantService_SyncAllWikiVector_FullMethodName = "/plant.PlantService/SyncAllWikiVector" + PlantService_GetWikiClassList_FullMethodName = "/plant.PlantService/GetWikiClassList" + PlantService_CreateWikiClass_FullMethodName = "/plant.PlantService/CreateWikiClass" + PlantService_UpdateWikiClass_FullMethodName = "/plant.PlantService/UpdateWikiClass" + PlantService_DeleteWikiClass_FullMethodName = "/plant.PlantService/DeleteWikiClass" + PlantService_ToggleWikiStar_FullMethodName = "/plant.PlantService/ToggleWikiStar" + PlantService_GetMyClassifyLog_FullMethodName = "/plant.PlantService/GetMyClassifyLog" + PlantService_DeleteClassifyLog_FullMethodName = "/plant.PlantService/DeleteClassifyLog" + PlantService_CreatePost_FullMethodName = "/plant.PlantService/CreatePost" + PlantService_DeletePost_FullMethodName = "/plant.PlantService/DeletePost" + PlantService_GetPostList_FullMethodName = "/plant.PlantService/GetPostList" + PlantService_GetPostDetail_FullMethodName = "/plant.PlantService/GetPostDetail" + PlantService_CommentPost_FullMethodName = "/plant.PlantService/CommentPost" + PlantService_LikePost_FullMethodName = "/plant.PlantService/LikePost" + PlantService_StarPost_FullMethodName = "/plant.PlantService/StarPost" + PlantService_MediaCheckCallback_FullMethodName = "/plant.PlantService/MediaCheckCallback" + PlantService_GetTopicList_FullMethodName = "/plant.PlantService/GetTopicList" + PlantService_GetTopicDetail_FullMethodName = "/plant.PlantService/GetTopicDetail" + PlantService_CreateTopic_FullMethodName = "/plant.PlantService/CreateTopic" + PlantService_UpdateTopic_FullMethodName = "/plant.PlantService/UpdateTopic" + PlantService_DeleteTopic_FullMethodName = "/plant.PlantService/DeleteTopic" + PlantService_GetExchangeItemList_FullMethodName = "/plant.PlantService/GetExchangeItemList" + PlantService_GetExchangeItemDetail_FullMethodName = "/plant.PlantService/GetExchangeItemDetail" + PlantService_CreateExchangeItem_FullMethodName = "/plant.PlantService/CreateExchangeItem" + PlantService_UpdateExchangeItem_FullMethodName = "/plant.PlantService/UpdateExchangeItem" + PlantService_DeleteExchangeItem_FullMethodName = "/plant.PlantService/DeleteExchangeItem" + PlantService_CreateExchangeOrder_FullMethodName = "/plant.PlantService/CreateExchangeOrder" + PlantService_GetMyExchangeOrders_FullMethodName = "/plant.PlantService/GetMyExchangeOrders" + PlantService_GetExchangeOrderList_FullMethodName = "/plant.PlantService/GetExchangeOrderList" + PlantService_UpdateExchangeOrder_FullMethodName = "/plant.PlantService/UpdateExchangeOrder" + PlantService_GetLevelConfigList_FullMethodName = "/plant.PlantService/GetLevelConfigList" + PlantService_GetLevelConfigDetail_FullMethodName = "/plant.PlantService/GetLevelConfigDetail" + PlantService_CreateLevelConfig_FullMethodName = "/plant.PlantService/CreateLevelConfig" + PlantService_UpdateLevelConfig_FullMethodName = "/plant.PlantService/UpdateLevelConfig" + PlantService_DeleteLevelConfig_FullMethodName = "/plant.PlantService/DeleteLevelConfig" + PlantService_GetBadgeConfigList_FullMethodName = "/plant.PlantService/GetBadgeConfigList" + PlantService_GetBadgeConfigDetail_FullMethodName = "/plant.PlantService/GetBadgeConfigDetail" + PlantService_GetBadgeConfigTree_FullMethodName = "/plant.PlantService/GetBadgeConfigTree" + PlantService_CreateBadgeConfig_FullMethodName = "/plant.PlantService/CreateBadgeConfig" + PlantService_UpdateBadgeConfig_FullMethodName = "/plant.PlantService/UpdateBadgeConfig" + PlantService_DeleteBadgeConfig_FullMethodName = "/plant.PlantService/DeleteBadgeConfig" + PlantService_GetWikiClassDetail_FullMethodName = "/plant.PlantService/GetWikiClassDetail" + PlantService_GetAiChatHistory_FullMethodName = "/plant.PlantService/GetAiChatHistory" + PlantService_SaveAiChatHistory_FullMethodName = "/plant.PlantService/SaveAiChatHistory" + PlantService_DeleteAiChatHistory_FullMethodName = "/plant.PlantService/DeleteAiChatHistory" + PlantService_ClearAiChatHistory_FullMethodName = "/plant.PlantService/ClearAiChatHistory" + PlantService_GetAiChatQuota_FullMethodName = "/plant.PlantService/GetAiChatQuota" ) // PlantServiceClient is the client API for PlantService service. @@ -56,6 +97,8 @@ type PlantServiceClient interface { // 用户Profile GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*PlantUserProfile, error) UpdateUserProfile(ctx context.Context, in *UpdateProfileReq, opts ...grpc.CallOption) (*CommonResp, error) + GetMyBadges(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserBadgeListResp, error) + GetMyStars(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserStarListResp, error) // 我的植物 CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) @@ -64,14 +107,28 @@ type PlantServiceClient interface { GetPlantDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PlantDetailResp, error) // 养护 AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteCarePlan(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetTodayTaskList(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CareTaskListResp, error) + CompleteTask(ctx context.Context, in *CompleteTaskReq, opts ...grpc.CallOption) (*TaskCompletionResult, error) AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*CommonResp, error) AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*CommonResp, error) // 百科 GetWikiList(ctx context.Context, in *WikiListReq, opts ...grpc.CallOption) (*WikiListResp, error) GetWikiDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiDetailResp, error) + CreateWiki(ctx context.Context, in *CreateWikiReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateWiki(ctx context.Context, in *UpdateWikiReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteWiki(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + SyncWikiVector(ctx context.Context, in *SyncWikiVectorReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteWikiVector(ctx context.Context, in *SyncWikiVectorReq, opts ...grpc.CallOption) (*CommonResp, error) + SyncAllWikiVector(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*CommonResp, error) GetWikiClassList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassListResp, error) CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateWikiClass(ctx context.Context, in *UpdateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteWikiClass(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) ToggleWikiStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*CommonResp, error) + // OCR + GetMyClassifyLog(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*ClassifyLogListResp, error) + DeleteClassifyLog(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) // 社区 CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CommonResp, error) DeletePost(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) @@ -79,16 +136,43 @@ type PlantServiceClient interface { GetPostDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PostDetailResp, error) CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommonResp, error) LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) + StarPost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) + MediaCheckCallback(ctx context.Context, in *MediaCheckCallbackReq, opts ...grpc.CallOption) (*CommonResp, error) // 话题 GetTopicList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicListResp, error) + GetTopicDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicInfo, error) CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateTopic(ctx context.Context, in *UpdateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) DeleteTopic(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) // 兑换 GetExchangeItemList(ctx context.Context, in *ExchangeItemListReq, opts ...grpc.CallOption) (*ExchangeItemListResp, error) + GetExchangeItemDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ExchangeItemInfo, error) + CreateExchangeItem(ctx context.Context, in *CreateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateExchangeItem(ctx context.Context, in *UpdateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteExchangeItem(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) + GetMyExchangeOrders(ctx context.Context, in *ExchangeOrderListReq, opts ...grpc.CallOption) (*ExchangeOrderListResp, error) + GetExchangeOrderList(ctx context.Context, in *ExchangeOrderListReq, opts ...grpc.CallOption) (*ExchangeOrderListResp, error) + UpdateExchangeOrder(ctx context.Context, in *UpdateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) // 配置 GetLevelConfigList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*LevelConfigListResp, error) + GetLevelConfigDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*LevelConfigInfo, error) + CreateLevelConfig(ctx context.Context, in *CreateLevelConfigReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateLevelConfig(ctx context.Context, in *UpdateLevelConfigReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteLevelConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) GetBadgeConfigList(ctx context.Context, in *BadgeConfigListReq, opts ...grpc.CallOption) (*BadgeConfigListResp, error) + GetBadgeConfigDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*BadgeConfigInfo, error) + GetBadgeConfigTree(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*BadgeConfigTreeResp, error) + CreateBadgeConfig(ctx context.Context, in *CreateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateBadgeConfig(ctx context.Context, in *UpdateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteBadgeConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetWikiClassDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassInfo, error) + // AI + GetAiChatHistory(ctx context.Context, in *AiChatHistoryReq, opts ...grpc.CallOption) (*AiChatHistoryResp, error) + SaveAiChatHistory(ctx context.Context, in *SaveAiChatHistoryReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteAiChatHistory(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + ClearAiChatHistory(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CommonResp, error) + GetAiChatQuota(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*AiQuotaResp, error) } type plantServiceClient struct { @@ -119,6 +203,26 @@ func (c *plantServiceClient) UpdateUserProfile(ctx context.Context, in *UpdatePr return out, nil } +func (c *plantServiceClient) GetMyBadges(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserBadgeListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UserBadgeListResp) + err := c.cc.Invoke(ctx, PlantService_GetMyBadges_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetMyStars(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserStarListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UserStarListResp) + err := c.cc.Invoke(ctx, PlantService_GetMyStars_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *plantServiceClient) CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CommonResp) @@ -179,6 +283,36 @@ func (c *plantServiceClient) AddCarePlan(ctx context.Context, in *AddCarePlanReq return out, nil } +func (c *plantServiceClient) DeleteCarePlan(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteCarePlan_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetTodayTaskList(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CareTaskListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CareTaskListResp) + err := c.cc.Invoke(ctx, PlantService_GetTodayTaskList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CompleteTask(ctx context.Context, in *CompleteTaskReq, opts ...grpc.CallOption) (*TaskCompletionResult, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TaskCompletionResult) + err := c.cc.Invoke(ctx, PlantService_CompleteTask_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *plantServiceClient) AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CommonResp) @@ -219,6 +353,66 @@ func (c *plantServiceClient) GetWikiDetail(ctx context.Context, in *IdReq, opts return out, nil } +func (c *plantServiceClient) CreateWiki(ctx context.Context, in *CreateWikiReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_CreateWiki_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) UpdateWiki(ctx context.Context, in *UpdateWikiReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateWiki_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteWiki(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteWiki_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) SyncWikiVector(ctx context.Context, in *SyncWikiVectorReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_SyncWikiVector_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteWikiVector(ctx context.Context, in *SyncWikiVectorReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteWikiVector_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) SyncAllWikiVector(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_SyncAllWikiVector_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *plantServiceClient) GetWikiClassList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(WikiClassListResp) @@ -239,6 +433,26 @@ func (c *plantServiceClient) CreateWikiClass(ctx context.Context, in *CreateWiki return out, nil } +func (c *plantServiceClient) UpdateWikiClass(ctx context.Context, in *UpdateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateWikiClass_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteWikiClass(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteWikiClass_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *plantServiceClient) ToggleWikiStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CommonResp) @@ -249,6 +463,26 @@ func (c *plantServiceClient) ToggleWikiStar(ctx context.Context, in *ToggleStarR return out, nil } +func (c *plantServiceClient) GetMyClassifyLog(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*ClassifyLogListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ClassifyLogListResp) + err := c.cc.Invoke(ctx, PlantService_GetMyClassifyLog_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteClassifyLog(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteClassifyLog_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *plantServiceClient) CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CommonResp) @@ -309,6 +543,26 @@ func (c *plantServiceClient) LikePost(ctx context.Context, in *LikePostReq, opts return out, nil } +func (c *plantServiceClient) StarPost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_StarPost_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) MediaCheckCallback(ctx context.Context, in *MediaCheckCallbackReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_MediaCheckCallback_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *plantServiceClient) GetTopicList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TopicListResp) @@ -319,6 +573,16 @@ func (c *plantServiceClient) GetTopicList(ctx context.Context, in *IdReq, opts . return out, nil } +func (c *plantServiceClient) GetTopicDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TopicInfo) + err := c.cc.Invoke(ctx, PlantService_GetTopicDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *plantServiceClient) CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CommonResp) @@ -329,6 +593,16 @@ func (c *plantServiceClient) CreateTopic(ctx context.Context, in *CreateTopicReq return out, nil } +func (c *plantServiceClient) UpdateTopic(ctx context.Context, in *UpdateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateTopic_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *plantServiceClient) DeleteTopic(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CommonResp) @@ -349,6 +623,46 @@ func (c *plantServiceClient) GetExchangeItemList(ctx context.Context, in *Exchan return out, nil } +func (c *plantServiceClient) GetExchangeItemDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ExchangeItemInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ExchangeItemInfo) + err := c.cc.Invoke(ctx, PlantService_GetExchangeItemDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CreateExchangeItem(ctx context.Context, in *CreateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_CreateExchangeItem_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) UpdateExchangeItem(ctx context.Context, in *UpdateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateExchangeItem_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteExchangeItem(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteExchangeItem_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *plantServiceClient) CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CommonResp) @@ -359,6 +673,36 @@ func (c *plantServiceClient) CreateExchangeOrder(ctx context.Context, in *Create return out, nil } +func (c *plantServiceClient) GetMyExchangeOrders(ctx context.Context, in *ExchangeOrderListReq, opts ...grpc.CallOption) (*ExchangeOrderListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ExchangeOrderListResp) + err := c.cc.Invoke(ctx, PlantService_GetMyExchangeOrders_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetExchangeOrderList(ctx context.Context, in *ExchangeOrderListReq, opts ...grpc.CallOption) (*ExchangeOrderListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ExchangeOrderListResp) + err := c.cc.Invoke(ctx, PlantService_GetExchangeOrderList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) UpdateExchangeOrder(ctx context.Context, in *UpdateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateExchangeOrder_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *plantServiceClient) GetLevelConfigList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*LevelConfigListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(LevelConfigListResp) @@ -369,6 +713,46 @@ func (c *plantServiceClient) GetLevelConfigList(ctx context.Context, in *PageReq return out, nil } +func (c *plantServiceClient) GetLevelConfigDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*LevelConfigInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(LevelConfigInfo) + err := c.cc.Invoke(ctx, PlantService_GetLevelConfigDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CreateLevelConfig(ctx context.Context, in *CreateLevelConfigReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_CreateLevelConfig_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) UpdateLevelConfig(ctx context.Context, in *UpdateLevelConfigReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateLevelConfig_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteLevelConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteLevelConfig_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *plantServiceClient) GetBadgeConfigList(ctx context.Context, in *BadgeConfigListReq, opts ...grpc.CallOption) (*BadgeConfigListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(BadgeConfigListResp) @@ -379,6 +763,116 @@ func (c *plantServiceClient) GetBadgeConfigList(ctx context.Context, in *BadgeCo return out, nil } +func (c *plantServiceClient) GetBadgeConfigDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*BadgeConfigInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BadgeConfigInfo) + err := c.cc.Invoke(ctx, PlantService_GetBadgeConfigDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetBadgeConfigTree(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*BadgeConfigTreeResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BadgeConfigTreeResp) + err := c.cc.Invoke(ctx, PlantService_GetBadgeConfigTree_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CreateBadgeConfig(ctx context.Context, in *CreateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_CreateBadgeConfig_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) UpdateBadgeConfig(ctx context.Context, in *UpdateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_UpdateBadgeConfig_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteBadgeConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteBadgeConfig_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetWikiClassDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(WikiClassInfo) + err := c.cc.Invoke(ctx, PlantService_GetWikiClassDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetAiChatHistory(ctx context.Context, in *AiChatHistoryReq, opts ...grpc.CallOption) (*AiChatHistoryResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AiChatHistoryResp) + err := c.cc.Invoke(ctx, PlantService_GetAiChatHistory_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) SaveAiChatHistory(ctx context.Context, in *SaveAiChatHistoryReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_SaveAiChatHistory_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) DeleteAiChatHistory(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_DeleteAiChatHistory_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) ClearAiChatHistory(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_ClearAiChatHistory_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetAiChatQuota(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*AiQuotaResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AiQuotaResp) + err := c.cc.Invoke(ctx, PlantService_GetAiChatQuota_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // PlantServiceServer is the server API for PlantService service. // All implementations must embed UnimplementedPlantServiceServer // for forward compatibility. @@ -386,6 +880,8 @@ type PlantServiceServer interface { // 用户Profile GetUserProfile(context.Context, *GetProfileReq) (*PlantUserProfile, error) UpdateUserProfile(context.Context, *UpdateProfileReq) (*CommonResp, error) + GetMyBadges(context.Context, *GetProfileReq) (*UserBadgeListResp, error) + GetMyStars(context.Context, *GetProfileReq) (*UserStarListResp, error) // 我的植物 CreatePlant(context.Context, *CreatePlantReq) (*CommonResp, error) UpdatePlant(context.Context, *UpdatePlantReq) (*CommonResp, error) @@ -394,14 +890,28 @@ type PlantServiceServer interface { GetPlantDetail(context.Context, *IdReq) (*PlantDetailResp, error) // 养护 AddCarePlan(context.Context, *AddCarePlanReq) (*CommonResp, error) + DeleteCarePlan(context.Context, *IdsReq) (*CommonResp, error) + GetTodayTaskList(context.Context, *GetProfileReq) (*CareTaskListResp, error) + CompleteTask(context.Context, *CompleteTaskReq) (*TaskCompletionResult, error) AddCareRecord(context.Context, *AddCareRecordReq) (*CommonResp, error) AddGrowthRecord(context.Context, *AddGrowthRecordReq) (*CommonResp, error) // 百科 GetWikiList(context.Context, *WikiListReq) (*WikiListResp, error) GetWikiDetail(context.Context, *IdReq) (*WikiDetailResp, error) + CreateWiki(context.Context, *CreateWikiReq) (*CommonResp, error) + UpdateWiki(context.Context, *UpdateWikiReq) (*CommonResp, error) + DeleteWiki(context.Context, *IdsReq) (*CommonResp, error) + SyncWikiVector(context.Context, *SyncWikiVectorReq) (*CommonResp, error) + DeleteWikiVector(context.Context, *SyncWikiVectorReq) (*CommonResp, error) + SyncAllWikiVector(context.Context, *PageReq) (*CommonResp, error) GetWikiClassList(context.Context, *IdReq) (*WikiClassListResp, error) CreateWikiClass(context.Context, *CreateWikiClassReq) (*CommonResp, error) + UpdateWikiClass(context.Context, *UpdateWikiClassReq) (*CommonResp, error) + DeleteWikiClass(context.Context, *IdsReq) (*CommonResp, error) ToggleWikiStar(context.Context, *ToggleStarReq) (*CommonResp, error) + // OCR + GetMyClassifyLog(context.Context, *GetProfileReq) (*ClassifyLogListResp, error) + DeleteClassifyLog(context.Context, *IdsReq) (*CommonResp, error) // 社区 CreatePost(context.Context, *CreatePostReq) (*CommonResp, error) DeletePost(context.Context, *IdsReq) (*CommonResp, error) @@ -409,16 +919,43 @@ type PlantServiceServer interface { GetPostDetail(context.Context, *IdReq) (*PostDetailResp, error) CommentPost(context.Context, *CommentPostReq) (*CommonResp, error) LikePost(context.Context, *LikePostReq) (*CommonResp, error) + StarPost(context.Context, *LikePostReq) (*CommonResp, error) + MediaCheckCallback(context.Context, *MediaCheckCallbackReq) (*CommonResp, error) // 话题 GetTopicList(context.Context, *IdReq) (*TopicListResp, error) + GetTopicDetail(context.Context, *IdReq) (*TopicInfo, error) CreateTopic(context.Context, *CreateTopicReq) (*CommonResp, error) + UpdateTopic(context.Context, *UpdateTopicReq) (*CommonResp, error) DeleteTopic(context.Context, *IdsReq) (*CommonResp, error) // 兑换 GetExchangeItemList(context.Context, *ExchangeItemListReq) (*ExchangeItemListResp, error) + GetExchangeItemDetail(context.Context, *IdReq) (*ExchangeItemInfo, error) + CreateExchangeItem(context.Context, *CreateExchangeItemReq) (*CommonResp, error) + UpdateExchangeItem(context.Context, *UpdateExchangeItemReq) (*CommonResp, error) + DeleteExchangeItem(context.Context, *IdsReq) (*CommonResp, error) CreateExchangeOrder(context.Context, *CreateExchangeOrderReq) (*CommonResp, error) + GetMyExchangeOrders(context.Context, *ExchangeOrderListReq) (*ExchangeOrderListResp, error) + GetExchangeOrderList(context.Context, *ExchangeOrderListReq) (*ExchangeOrderListResp, error) + UpdateExchangeOrder(context.Context, *UpdateExchangeOrderReq) (*CommonResp, error) // 配置 GetLevelConfigList(context.Context, *PageReq) (*LevelConfigListResp, error) + GetLevelConfigDetail(context.Context, *IdReq) (*LevelConfigInfo, error) + CreateLevelConfig(context.Context, *CreateLevelConfigReq) (*CommonResp, error) + UpdateLevelConfig(context.Context, *UpdateLevelConfigReq) (*CommonResp, error) + DeleteLevelConfig(context.Context, *IdsReq) (*CommonResp, error) GetBadgeConfigList(context.Context, *BadgeConfigListReq) (*BadgeConfigListResp, error) + GetBadgeConfigDetail(context.Context, *IdReq) (*BadgeConfigInfo, error) + GetBadgeConfigTree(context.Context, *IdReq) (*BadgeConfigTreeResp, error) + CreateBadgeConfig(context.Context, *CreateBadgeConfigReq) (*CommonResp, error) + UpdateBadgeConfig(context.Context, *UpdateBadgeConfigReq) (*CommonResp, error) + DeleteBadgeConfig(context.Context, *IdsReq) (*CommonResp, error) + GetWikiClassDetail(context.Context, *IdReq) (*WikiClassInfo, error) + // AI + GetAiChatHistory(context.Context, *AiChatHistoryReq) (*AiChatHistoryResp, error) + SaveAiChatHistory(context.Context, *SaveAiChatHistoryReq) (*CommonResp, error) + DeleteAiChatHistory(context.Context, *IdsReq) (*CommonResp, error) + ClearAiChatHistory(context.Context, *GetProfileReq) (*CommonResp, error) + GetAiChatQuota(context.Context, *GetProfileReq) (*AiQuotaResp, error) mustEmbedUnimplementedPlantServiceServer() } @@ -435,6 +972,12 @@ func (UnimplementedPlantServiceServer) GetUserProfile(context.Context, *GetProfi func (UnimplementedPlantServiceServer) UpdateUserProfile(context.Context, *UpdateProfileReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method UpdateUserProfile not implemented") } +func (UnimplementedPlantServiceServer) GetMyBadges(context.Context, *GetProfileReq) (*UserBadgeListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetMyBadges not implemented") +} +func (UnimplementedPlantServiceServer) GetMyStars(context.Context, *GetProfileReq) (*UserStarListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetMyStars not implemented") +} func (UnimplementedPlantServiceServer) CreatePlant(context.Context, *CreatePlantReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CreatePlant not implemented") } @@ -453,6 +996,15 @@ func (UnimplementedPlantServiceServer) GetPlantDetail(context.Context, *IdReq) ( func (UnimplementedPlantServiceServer) AddCarePlan(context.Context, *AddCarePlanReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method AddCarePlan not implemented") } +func (UnimplementedPlantServiceServer) DeleteCarePlan(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteCarePlan not implemented") +} +func (UnimplementedPlantServiceServer) GetTodayTaskList(context.Context, *GetProfileReq) (*CareTaskListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetTodayTaskList not implemented") +} +func (UnimplementedPlantServiceServer) CompleteTask(context.Context, *CompleteTaskReq) (*TaskCompletionResult, error) { + return nil, status.Error(codes.Unimplemented, "method CompleteTask not implemented") +} func (UnimplementedPlantServiceServer) AddCareRecord(context.Context, *AddCareRecordReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method AddCareRecord not implemented") } @@ -465,15 +1017,45 @@ func (UnimplementedPlantServiceServer) GetWikiList(context.Context, *WikiListReq func (UnimplementedPlantServiceServer) GetWikiDetail(context.Context, *IdReq) (*WikiDetailResp, error) { return nil, status.Error(codes.Unimplemented, "method GetWikiDetail not implemented") } +func (UnimplementedPlantServiceServer) CreateWiki(context.Context, *CreateWikiReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateWiki not implemented") +} +func (UnimplementedPlantServiceServer) UpdateWiki(context.Context, *UpdateWikiReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateWiki not implemented") +} +func (UnimplementedPlantServiceServer) DeleteWiki(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteWiki not implemented") +} +func (UnimplementedPlantServiceServer) SyncWikiVector(context.Context, *SyncWikiVectorReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method SyncWikiVector not implemented") +} +func (UnimplementedPlantServiceServer) DeleteWikiVector(context.Context, *SyncWikiVectorReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteWikiVector not implemented") +} +func (UnimplementedPlantServiceServer) SyncAllWikiVector(context.Context, *PageReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method SyncAllWikiVector not implemented") +} func (UnimplementedPlantServiceServer) GetWikiClassList(context.Context, *IdReq) (*WikiClassListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetWikiClassList not implemented") } func (UnimplementedPlantServiceServer) CreateWikiClass(context.Context, *CreateWikiClassReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CreateWikiClass not implemented") } +func (UnimplementedPlantServiceServer) UpdateWikiClass(context.Context, *UpdateWikiClassReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateWikiClass not implemented") +} +func (UnimplementedPlantServiceServer) DeleteWikiClass(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteWikiClass not implemented") +} func (UnimplementedPlantServiceServer) ToggleWikiStar(context.Context, *ToggleStarReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method ToggleWikiStar not implemented") } +func (UnimplementedPlantServiceServer) GetMyClassifyLog(context.Context, *GetProfileReq) (*ClassifyLogListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetMyClassifyLog not implemented") +} +func (UnimplementedPlantServiceServer) DeleteClassifyLog(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteClassifyLog not implemented") +} func (UnimplementedPlantServiceServer) CreatePost(context.Context, *CreatePostReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CreatePost not implemented") } @@ -492,27 +1074,105 @@ func (UnimplementedPlantServiceServer) CommentPost(context.Context, *CommentPost func (UnimplementedPlantServiceServer) LikePost(context.Context, *LikePostReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method LikePost not implemented") } +func (UnimplementedPlantServiceServer) StarPost(context.Context, *LikePostReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method StarPost not implemented") +} +func (UnimplementedPlantServiceServer) MediaCheckCallback(context.Context, *MediaCheckCallbackReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method MediaCheckCallback not implemented") +} func (UnimplementedPlantServiceServer) GetTopicList(context.Context, *IdReq) (*TopicListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetTopicList not implemented") } +func (UnimplementedPlantServiceServer) GetTopicDetail(context.Context, *IdReq) (*TopicInfo, error) { + return nil, status.Error(codes.Unimplemented, "method GetTopicDetail not implemented") +} func (UnimplementedPlantServiceServer) CreateTopic(context.Context, *CreateTopicReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CreateTopic not implemented") } +func (UnimplementedPlantServiceServer) UpdateTopic(context.Context, *UpdateTopicReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateTopic not implemented") +} func (UnimplementedPlantServiceServer) DeleteTopic(context.Context, *IdsReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method DeleteTopic not implemented") } func (UnimplementedPlantServiceServer) GetExchangeItemList(context.Context, *ExchangeItemListReq) (*ExchangeItemListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetExchangeItemList not implemented") } +func (UnimplementedPlantServiceServer) GetExchangeItemDetail(context.Context, *IdReq) (*ExchangeItemInfo, error) { + return nil, status.Error(codes.Unimplemented, "method GetExchangeItemDetail not implemented") +} +func (UnimplementedPlantServiceServer) CreateExchangeItem(context.Context, *CreateExchangeItemReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateExchangeItem not implemented") +} +func (UnimplementedPlantServiceServer) UpdateExchangeItem(context.Context, *UpdateExchangeItemReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateExchangeItem not implemented") +} +func (UnimplementedPlantServiceServer) DeleteExchangeItem(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteExchangeItem not implemented") +} func (UnimplementedPlantServiceServer) CreateExchangeOrder(context.Context, *CreateExchangeOrderReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CreateExchangeOrder not implemented") } +func (UnimplementedPlantServiceServer) GetMyExchangeOrders(context.Context, *ExchangeOrderListReq) (*ExchangeOrderListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetMyExchangeOrders not implemented") +} +func (UnimplementedPlantServiceServer) GetExchangeOrderList(context.Context, *ExchangeOrderListReq) (*ExchangeOrderListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetExchangeOrderList not implemented") +} +func (UnimplementedPlantServiceServer) UpdateExchangeOrder(context.Context, *UpdateExchangeOrderReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateExchangeOrder not implemented") +} func (UnimplementedPlantServiceServer) GetLevelConfigList(context.Context, *PageReq) (*LevelConfigListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetLevelConfigList not implemented") } +func (UnimplementedPlantServiceServer) GetLevelConfigDetail(context.Context, *IdReq) (*LevelConfigInfo, error) { + return nil, status.Error(codes.Unimplemented, "method GetLevelConfigDetail not implemented") +} +func (UnimplementedPlantServiceServer) CreateLevelConfig(context.Context, *CreateLevelConfigReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateLevelConfig not implemented") +} +func (UnimplementedPlantServiceServer) UpdateLevelConfig(context.Context, *UpdateLevelConfigReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateLevelConfig not implemented") +} +func (UnimplementedPlantServiceServer) DeleteLevelConfig(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteLevelConfig not implemented") +} func (UnimplementedPlantServiceServer) GetBadgeConfigList(context.Context, *BadgeConfigListReq) (*BadgeConfigListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetBadgeConfigList not implemented") } +func (UnimplementedPlantServiceServer) GetBadgeConfigDetail(context.Context, *IdReq) (*BadgeConfigInfo, error) { + return nil, status.Error(codes.Unimplemented, "method GetBadgeConfigDetail not implemented") +} +func (UnimplementedPlantServiceServer) GetBadgeConfigTree(context.Context, *IdReq) (*BadgeConfigTreeResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetBadgeConfigTree not implemented") +} +func (UnimplementedPlantServiceServer) CreateBadgeConfig(context.Context, *CreateBadgeConfigReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateBadgeConfig not implemented") +} +func (UnimplementedPlantServiceServer) UpdateBadgeConfig(context.Context, *UpdateBadgeConfigReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateBadgeConfig not implemented") +} +func (UnimplementedPlantServiceServer) DeleteBadgeConfig(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteBadgeConfig not implemented") +} +func (UnimplementedPlantServiceServer) GetWikiClassDetail(context.Context, *IdReq) (*WikiClassInfo, error) { + return nil, status.Error(codes.Unimplemented, "method GetWikiClassDetail not implemented") +} +func (UnimplementedPlantServiceServer) GetAiChatHistory(context.Context, *AiChatHistoryReq) (*AiChatHistoryResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetAiChatHistory not implemented") +} +func (UnimplementedPlantServiceServer) SaveAiChatHistory(context.Context, *SaveAiChatHistoryReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method SaveAiChatHistory not implemented") +} +func (UnimplementedPlantServiceServer) DeleteAiChatHistory(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteAiChatHistory not implemented") +} +func (UnimplementedPlantServiceServer) ClearAiChatHistory(context.Context, *GetProfileReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method ClearAiChatHistory not implemented") +} +func (UnimplementedPlantServiceServer) GetAiChatQuota(context.Context, *GetProfileReq) (*AiQuotaResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetAiChatQuota not implemented") +} func (UnimplementedPlantServiceServer) mustEmbedUnimplementedPlantServiceServer() {} func (UnimplementedPlantServiceServer) testEmbeddedByValue() {} @@ -570,6 +1230,42 @@ func _PlantService_UpdateUserProfile_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _PlantService_GetMyBadges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetMyBadges(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetMyBadges_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetMyBadges(ctx, req.(*GetProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetMyStars_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetMyStars(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetMyStars_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetMyStars(ctx, req.(*GetProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + func _PlantService_CreatePlant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreatePlantReq) if err := dec(in); err != nil { @@ -678,6 +1374,60 @@ func _PlantService_AddCarePlan_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _PlantService_DeleteCarePlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteCarePlan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteCarePlan_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteCarePlan(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetTodayTaskList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetTodayTaskList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetTodayTaskList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetTodayTaskList(ctx, req.(*GetProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CompleteTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CompleteTaskReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CompleteTask(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CompleteTask_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CompleteTask(ctx, req.(*CompleteTaskReq)) + } + return interceptor(ctx, in, info, handler) +} + func _PlantService_AddCareRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddCareRecordReq) if err := dec(in); err != nil { @@ -750,6 +1500,114 @@ func _PlantService_GetWikiDetail_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } +func _PlantService_CreateWiki_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateWikiReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CreateWiki(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CreateWiki_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CreateWiki(ctx, req.(*CreateWikiReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_UpdateWiki_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateWikiReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateWiki(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateWiki_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateWiki(ctx, req.(*UpdateWikiReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteWiki_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteWiki(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteWiki_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteWiki(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_SyncWikiVector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SyncWikiVectorReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).SyncWikiVector(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_SyncWikiVector_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).SyncWikiVector(ctx, req.(*SyncWikiVectorReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteWikiVector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SyncWikiVectorReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteWikiVector(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteWikiVector_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteWikiVector(ctx, req.(*SyncWikiVectorReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_SyncAllWikiVector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).SyncAllWikiVector(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_SyncAllWikiVector_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).SyncAllWikiVector(ctx, req.(*PageReq)) + } + return interceptor(ctx, in, info, handler) +} + func _PlantService_GetWikiClassList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(IdReq) if err := dec(in); err != nil { @@ -786,6 +1644,42 @@ func _PlantService_CreateWikiClass_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _PlantService_UpdateWikiClass_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateWikiClassReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateWikiClass(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateWikiClass_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateWikiClass(ctx, req.(*UpdateWikiClassReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteWikiClass_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteWikiClass(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteWikiClass_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteWikiClass(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + func _PlantService_ToggleWikiStar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ToggleStarReq) if err := dec(in); err != nil { @@ -804,6 +1698,42 @@ func _PlantService_ToggleWikiStar_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _PlantService_GetMyClassifyLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetMyClassifyLog(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetMyClassifyLog_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetMyClassifyLog(ctx, req.(*GetProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteClassifyLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteClassifyLog(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteClassifyLog_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteClassifyLog(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + func _PlantService_CreatePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreatePostReq) if err := dec(in); err != nil { @@ -912,6 +1842,42 @@ func _PlantService_LikePost_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _PlantService_StarPost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LikePostReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).StarPost(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_StarPost_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).StarPost(ctx, req.(*LikePostReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_MediaCheckCallback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MediaCheckCallbackReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).MediaCheckCallback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_MediaCheckCallback_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).MediaCheckCallback(ctx, req.(*MediaCheckCallbackReq)) + } + return interceptor(ctx, in, info, handler) +} + func _PlantService_GetTopicList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(IdReq) if err := dec(in); err != nil { @@ -930,6 +1896,24 @@ func _PlantService_GetTopicList_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _PlantService_GetTopicDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetTopicDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetTopicDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetTopicDetail(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + func _PlantService_CreateTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateTopicReq) if err := dec(in); err != nil { @@ -948,6 +1932,24 @@ func _PlantService_CreateTopic_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _PlantService_UpdateTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateTopicReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateTopic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateTopic_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateTopic(ctx, req.(*UpdateTopicReq)) + } + return interceptor(ctx, in, info, handler) +} + func _PlantService_DeleteTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(IdsReq) if err := dec(in); err != nil { @@ -984,6 +1986,78 @@ func _PlantService_GetExchangeItemList_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +func _PlantService_GetExchangeItemDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetExchangeItemDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetExchangeItemDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetExchangeItemDetail(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CreateExchangeItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateExchangeItemReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CreateExchangeItem(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CreateExchangeItem_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CreateExchangeItem(ctx, req.(*CreateExchangeItemReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_UpdateExchangeItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateExchangeItemReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateExchangeItem(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateExchangeItem_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateExchangeItem(ctx, req.(*UpdateExchangeItemReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteExchangeItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteExchangeItem(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteExchangeItem_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteExchangeItem(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + func _PlantService_CreateExchangeOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateExchangeOrderReq) if err := dec(in); err != nil { @@ -1002,6 +2076,60 @@ func _PlantService_CreateExchangeOrder_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +func _PlantService_GetMyExchangeOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExchangeOrderListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetMyExchangeOrders(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetMyExchangeOrders_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetMyExchangeOrders(ctx, req.(*ExchangeOrderListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetExchangeOrderList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExchangeOrderListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetExchangeOrderList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetExchangeOrderList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetExchangeOrderList(ctx, req.(*ExchangeOrderListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_UpdateExchangeOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateExchangeOrderReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateExchangeOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateExchangeOrder_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateExchangeOrder(ctx, req.(*UpdateExchangeOrderReq)) + } + return interceptor(ctx, in, info, handler) +} + func _PlantService_GetLevelConfigList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PageReq) if err := dec(in); err != nil { @@ -1020,6 +2148,78 @@ func _PlantService_GetLevelConfigList_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _PlantService_GetLevelConfigDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetLevelConfigDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetLevelConfigDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetLevelConfigDetail(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CreateLevelConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateLevelConfigReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CreateLevelConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CreateLevelConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CreateLevelConfig(ctx, req.(*CreateLevelConfigReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_UpdateLevelConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateLevelConfigReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateLevelConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateLevelConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateLevelConfig(ctx, req.(*UpdateLevelConfigReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteLevelConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteLevelConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteLevelConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteLevelConfig(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + func _PlantService_GetBadgeConfigList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BadgeConfigListReq) if err := dec(in); err != nil { @@ -1038,6 +2238,204 @@ func _PlantService_GetBadgeConfigList_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _PlantService_GetBadgeConfigDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetBadgeConfigDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetBadgeConfigDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetBadgeConfigDetail(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetBadgeConfigTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetBadgeConfigTree(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetBadgeConfigTree_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetBadgeConfigTree(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_CreateBadgeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateBadgeConfigReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).CreateBadgeConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_CreateBadgeConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).CreateBadgeConfig(ctx, req.(*CreateBadgeConfigReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_UpdateBadgeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateBadgeConfigReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).UpdateBadgeConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_UpdateBadgeConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).UpdateBadgeConfig(ctx, req.(*UpdateBadgeConfigReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteBadgeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteBadgeConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteBadgeConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteBadgeConfig(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetWikiClassDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetWikiClassDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetWikiClassDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetWikiClassDetail(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetAiChatHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AiChatHistoryReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetAiChatHistory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetAiChatHistory_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetAiChatHistory(ctx, req.(*AiChatHistoryReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_SaveAiChatHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SaveAiChatHistoryReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).SaveAiChatHistory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_SaveAiChatHistory_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).SaveAiChatHistory(ctx, req.(*SaveAiChatHistoryReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_DeleteAiChatHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).DeleteAiChatHistory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_DeleteAiChatHistory_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).DeleteAiChatHistory(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_ClearAiChatHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).ClearAiChatHistory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_ClearAiChatHistory_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).ClearAiChatHistory(ctx, req.(*GetProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetAiChatQuota_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetAiChatQuota(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetAiChatQuota_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetAiChatQuota(ctx, req.(*GetProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + // PlantService_ServiceDesc is the grpc.ServiceDesc for PlantService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -1053,6 +2451,14 @@ var PlantService_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateUserProfile", Handler: _PlantService_UpdateUserProfile_Handler, }, + { + MethodName: "GetMyBadges", + Handler: _PlantService_GetMyBadges_Handler, + }, + { + MethodName: "GetMyStars", + Handler: _PlantService_GetMyStars_Handler, + }, { MethodName: "CreatePlant", Handler: _PlantService_CreatePlant_Handler, @@ -1077,6 +2483,18 @@ var PlantService_ServiceDesc = grpc.ServiceDesc{ MethodName: "AddCarePlan", Handler: _PlantService_AddCarePlan_Handler, }, + { + MethodName: "DeleteCarePlan", + Handler: _PlantService_DeleteCarePlan_Handler, + }, + { + MethodName: "GetTodayTaskList", + Handler: _PlantService_GetTodayTaskList_Handler, + }, + { + MethodName: "CompleteTask", + Handler: _PlantService_CompleteTask_Handler, + }, { MethodName: "AddCareRecord", Handler: _PlantService_AddCareRecord_Handler, @@ -1093,6 +2511,30 @@ var PlantService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetWikiDetail", Handler: _PlantService_GetWikiDetail_Handler, }, + { + MethodName: "CreateWiki", + Handler: _PlantService_CreateWiki_Handler, + }, + { + MethodName: "UpdateWiki", + Handler: _PlantService_UpdateWiki_Handler, + }, + { + MethodName: "DeleteWiki", + Handler: _PlantService_DeleteWiki_Handler, + }, + { + MethodName: "SyncWikiVector", + Handler: _PlantService_SyncWikiVector_Handler, + }, + { + MethodName: "DeleteWikiVector", + Handler: _PlantService_DeleteWikiVector_Handler, + }, + { + MethodName: "SyncAllWikiVector", + Handler: _PlantService_SyncAllWikiVector_Handler, + }, { MethodName: "GetWikiClassList", Handler: _PlantService_GetWikiClassList_Handler, @@ -1101,10 +2543,26 @@ var PlantService_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreateWikiClass", Handler: _PlantService_CreateWikiClass_Handler, }, + { + MethodName: "UpdateWikiClass", + Handler: _PlantService_UpdateWikiClass_Handler, + }, + { + MethodName: "DeleteWikiClass", + Handler: _PlantService_DeleteWikiClass_Handler, + }, { MethodName: "ToggleWikiStar", Handler: _PlantService_ToggleWikiStar_Handler, }, + { + MethodName: "GetMyClassifyLog", + Handler: _PlantService_GetMyClassifyLog_Handler, + }, + { + MethodName: "DeleteClassifyLog", + Handler: _PlantService_DeleteClassifyLog_Handler, + }, { MethodName: "CreatePost", Handler: _PlantService_CreatePost_Handler, @@ -1129,14 +2587,30 @@ var PlantService_ServiceDesc = grpc.ServiceDesc{ MethodName: "LikePost", Handler: _PlantService_LikePost_Handler, }, + { + MethodName: "StarPost", + Handler: _PlantService_StarPost_Handler, + }, + { + MethodName: "MediaCheckCallback", + Handler: _PlantService_MediaCheckCallback_Handler, + }, { MethodName: "GetTopicList", Handler: _PlantService_GetTopicList_Handler, }, + { + MethodName: "GetTopicDetail", + Handler: _PlantService_GetTopicDetail_Handler, + }, { MethodName: "CreateTopic", Handler: _PlantService_CreateTopic_Handler, }, + { + MethodName: "UpdateTopic", + Handler: _PlantService_UpdateTopic_Handler, + }, { MethodName: "DeleteTopic", Handler: _PlantService_DeleteTopic_Handler, @@ -1145,18 +2619,106 @@ var PlantService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetExchangeItemList", Handler: _PlantService_GetExchangeItemList_Handler, }, + { + MethodName: "GetExchangeItemDetail", + Handler: _PlantService_GetExchangeItemDetail_Handler, + }, + { + MethodName: "CreateExchangeItem", + Handler: _PlantService_CreateExchangeItem_Handler, + }, + { + MethodName: "UpdateExchangeItem", + Handler: _PlantService_UpdateExchangeItem_Handler, + }, + { + MethodName: "DeleteExchangeItem", + Handler: _PlantService_DeleteExchangeItem_Handler, + }, { MethodName: "CreateExchangeOrder", Handler: _PlantService_CreateExchangeOrder_Handler, }, + { + MethodName: "GetMyExchangeOrders", + Handler: _PlantService_GetMyExchangeOrders_Handler, + }, + { + MethodName: "GetExchangeOrderList", + Handler: _PlantService_GetExchangeOrderList_Handler, + }, + { + MethodName: "UpdateExchangeOrder", + Handler: _PlantService_UpdateExchangeOrder_Handler, + }, { MethodName: "GetLevelConfigList", Handler: _PlantService_GetLevelConfigList_Handler, }, + { + MethodName: "GetLevelConfigDetail", + Handler: _PlantService_GetLevelConfigDetail_Handler, + }, + { + MethodName: "CreateLevelConfig", + Handler: _PlantService_CreateLevelConfig_Handler, + }, + { + MethodName: "UpdateLevelConfig", + Handler: _PlantService_UpdateLevelConfig_Handler, + }, + { + MethodName: "DeleteLevelConfig", + Handler: _PlantService_DeleteLevelConfig_Handler, + }, { MethodName: "GetBadgeConfigList", Handler: _PlantService_GetBadgeConfigList_Handler, }, + { + MethodName: "GetBadgeConfigDetail", + Handler: _PlantService_GetBadgeConfigDetail_Handler, + }, + { + MethodName: "GetBadgeConfigTree", + Handler: _PlantService_GetBadgeConfigTree_Handler, + }, + { + MethodName: "CreateBadgeConfig", + Handler: _PlantService_CreateBadgeConfig_Handler, + }, + { + MethodName: "UpdateBadgeConfig", + Handler: _PlantService_UpdateBadgeConfig_Handler, + }, + { + MethodName: "DeleteBadgeConfig", + Handler: _PlantService_DeleteBadgeConfig_Handler, + }, + { + MethodName: "GetWikiClassDetail", + Handler: _PlantService_GetWikiClassDetail_Handler, + }, + { + MethodName: "GetAiChatHistory", + Handler: _PlantService_GetAiChatHistory_Handler, + }, + { + MethodName: "SaveAiChatHistory", + Handler: _PlantService_SaveAiChatHistory_Handler, + }, + { + MethodName: "DeleteAiChatHistory", + Handler: _PlantService_DeleteAiChatHistory_Handler, + }, + { + MethodName: "ClearAiChatHistory", + Handler: _PlantService_ClearAiChatHistory_Handler, + }, + { + MethodName: "GetAiChatQuota", + Handler: _PlantService_GetAiChatQuota_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "pb/plant.proto", diff --git a/app/plant/rpc/plantservice/plantService.go b/app/plant/rpc/plantservice/plantService.go index 33cb847..b41b7ce 100644 --- a/app/plant/rpc/plantservice/plantService.go +++ b/app/plant/rpc/plantservice/plantService.go @@ -17,20 +17,32 @@ type ( AddCarePlanReq = plant.AddCarePlanReq AddCareRecordReq = plant.AddCareRecordReq AddGrowthRecordReq = plant.AddGrowthRecordReq + AiQuotaResp = plant.AiQuotaResp BadgeConfigInfo = plant.BadgeConfigInfo BadgeConfigListReq = plant.BadgeConfigListReq BadgeConfigListResp = plant.BadgeConfigListResp CarePlanInfo = plant.CarePlanInfo + CareTaskInfo = plant.CareTaskInfo + CareTaskListResp = plant.CareTaskListResp + ClassifyLogInfo = plant.ClassifyLogInfo + ClassifyLogListResp = plant.ClassifyLogListResp CommentPostReq = plant.CommentPostReq CommonResp = plant.CommonResp + CreateBadgeConfigReq = plant.CreateBadgeConfigReq + CreateExchangeItemReq = plant.CreateExchangeItemReq CreateExchangeOrderReq = plant.CreateExchangeOrderReq + CreateLevelConfigReq = plant.CreateLevelConfigReq CreatePlantReq = plant.CreatePlantReq CreatePostReq = plant.CreatePostReq CreateTopicReq = plant.CreateTopicReq CreateWikiClassReq = plant.CreateWikiClassReq + CreateWikiReq = plant.CreateWikiReq ExchangeItemInfo = plant.ExchangeItemInfo ExchangeItemListReq = plant.ExchangeItemListReq ExchangeItemListResp = plant.ExchangeItemListResp + ExchangeOrderInfo = plant.ExchangeOrderInfo + ExchangeOrderListReq = plant.ExchangeOrderListReq + ExchangeOrderListResp = plant.ExchangeOrderListResp GetProfileReq = plant.GetProfileReq GrowthRecordInfo = plant.GrowthRecordInfo IdReq = plant.IdReq @@ -38,6 +50,7 @@ type ( LevelConfigInfo = plant.LevelConfigInfo LevelConfigListResp = plant.LevelConfigListResp LikePostReq = plant.LikePostReq + MediaCheckCallbackReq = plant.MediaCheckCallbackReq PageReq = plant.PageReq PlantDetailResp = plant.PlantDetailResp PlantInfo = plant.PlantInfo @@ -52,19 +65,42 @@ type ( ToggleStarReq = plant.ToggleStarReq TopicInfo = plant.TopicInfo TopicListResp = plant.TopicListResp + UpdateBadgeConfigReq = plant.UpdateBadgeConfigReq + UpdateExchangeItemReq = plant.UpdateExchangeItemReq + UpdateExchangeOrderReq = plant.UpdateExchangeOrderReq + UpdateLevelConfigReq = plant.UpdateLevelConfigReq UpdatePlantReq = plant.UpdatePlantReq UpdateProfileReq = plant.UpdateProfileReq + UpdateTopicReq = plant.UpdateTopicReq + UpdateWikiClassReq = plant.UpdateWikiClassReq + UpdateWikiReq = plant.UpdateWikiReq + UserBadgeInfo = plant.UserBadgeInfo + UserBadgeListResp = plant.UserBadgeListResp + UserStarInfo = plant.UserStarInfo + UserStarListResp = plant.UserStarListResp WikiClassInfo = plant.WikiClassInfo WikiClassListResp = plant.WikiClassListResp WikiDetailResp = plant.WikiDetailResp WikiInfo = plant.WikiInfo WikiListReq = plant.WikiListReq WikiListResp = plant.WikiListResp + // new types + AiChatHistoryInfo = plant.AiChatHistoryInfo + AiChatHistoryReq = plant.AiChatHistoryReq + AiChatHistoryResp = plant.AiChatHistoryResp + BadgeGroupInfo = plant.BadgeGroupInfo + BadgeConfigTreeResp = plant.BadgeConfigTreeResp + CompleteTaskReq = plant.CompleteTaskReq + TaskCompletionResult = plant.TaskCompletionResult + SaveAiChatHistoryReq = plant.SaveAiChatHistoryReq + SyncWikiVectorReq = plant.SyncWikiVectorReq PlantService interface { // 用户Profile GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*PlantUserProfile, error) UpdateUserProfile(ctx context.Context, in *UpdateProfileReq, opts ...grpc.CallOption) (*CommonResp, error) + GetMyBadges(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserBadgeListResp, error) + GetMyStars(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserStarListResp, error) // 我的植物 CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) @@ -73,14 +109,27 @@ type ( GetPlantDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PlantDetailResp, error) // 养护 AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteCarePlan(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetTodayTaskList(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CareTaskListResp, error) AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*CommonResp, error) AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*CommonResp, error) // 百科 GetWikiList(ctx context.Context, in *WikiListReq, opts ...grpc.CallOption) (*WikiListResp, error) GetWikiDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiDetailResp, error) + CreateWiki(ctx context.Context, in *CreateWikiReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateWiki(ctx context.Context, in *UpdateWikiReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteWiki(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + SyncWikiVector(ctx context.Context, in *SyncWikiVectorReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteWikiVector(ctx context.Context, in *SyncWikiVectorReq, opts ...grpc.CallOption) (*CommonResp, error) + SyncAllWikiVector(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*CommonResp, error) GetWikiClassList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassListResp, error) CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateWikiClass(ctx context.Context, in *UpdateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteWikiClass(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) ToggleWikiStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*CommonResp, error) + // OCR + GetMyClassifyLog(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*ClassifyLogListResp, error) + DeleteClassifyLog(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) // 社区 CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CommonResp, error) DeletePost(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) @@ -88,16 +137,46 @@ type ( GetPostDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PostDetailResp, error) CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommonResp, error) LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) + StarPost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) + MediaCheckCallback(ctx context.Context, in *MediaCheckCallbackReq, opts ...grpc.CallOption) (*CommonResp, error) // 话题 GetTopicList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicListResp, error) + GetTopicDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicInfo, error) CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateTopic(ctx context.Context, in *UpdateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) DeleteTopic(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) // 兑换 GetExchangeItemList(ctx context.Context, in *ExchangeItemListReq, opts ...grpc.CallOption) (*ExchangeItemListResp, error) + CreateExchangeItem(ctx context.Context, in *CreateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateExchangeItem(ctx context.Context, in *UpdateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteExchangeItem(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) + GetMyExchangeOrders(ctx context.Context, in *ExchangeOrderListReq, opts ...grpc.CallOption) (*ExchangeOrderListResp, error) + GetExchangeOrderList(ctx context.Context, in *ExchangeOrderListReq, opts ...grpc.CallOption) (*ExchangeOrderListResp, error) + UpdateExchangeOrder(ctx context.Context, in *UpdateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) // 配置 GetLevelConfigList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*LevelConfigListResp, error) + GetLevelConfigDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*LevelConfigInfo, error) + CreateLevelConfig(ctx context.Context, in *CreateLevelConfigReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateLevelConfig(ctx context.Context, in *UpdateLevelConfigReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteLevelConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) GetBadgeConfigList(ctx context.Context, in *BadgeConfigListReq, opts ...grpc.CallOption) (*BadgeConfigListResp, error) + GetBadgeConfigDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*BadgeConfigInfo, error) + GetBadgeConfigTree(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*BadgeConfigTreeResp, error) + CreateBadgeConfig(ctx context.Context, in *CreateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateBadgeConfig(ctx context.Context, in *UpdateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteBadgeConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetWikiClassDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassInfo, error) + // 兑换详情 + GetExchangeItemDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ExchangeItemInfo, error) + // 养护完成任务 + CompleteTask(ctx context.Context, in *CompleteTaskReq, opts ...grpc.CallOption) (*TaskCompletionResult, error) + // AI + GetAiChatHistory(ctx context.Context, in *AiChatHistoryReq, opts ...grpc.CallOption) (*AiChatHistoryResp, error) + SaveAiChatHistory(ctx context.Context, in *SaveAiChatHistoryReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteAiChatHistory(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + ClearAiChatHistory(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CommonResp, error) + GetAiChatQuota(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*AiQuotaResp, error) } defaultPlantService struct { @@ -106,155 +185,238 @@ type ( ) func NewPlantService(cli zrpc.Client) PlantService { - return &defaultPlantService{ - cli: cli, - } + return &defaultPlantService{cli: cli} } -// 用户Profile +// ---- 用户Profile ---- func (m *defaultPlantService) GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*PlantUserProfile, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetUserProfile(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).GetUserProfile(ctx, in, opts...) } - func (m *defaultPlantService) UpdateUserProfile(ctx context.Context, in *UpdateProfileReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.UpdateUserProfile(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).UpdateUserProfile(ctx, in, opts...) +} +func (m *defaultPlantService) GetMyBadges(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserBadgeListResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetMyBadges(ctx, in, opts...) +} +func (m *defaultPlantService) GetMyStars(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserStarListResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetMyStars(ctx, in, opts...) } -// 我的植物 +// ---- 我的植物 ---- func (m *defaultPlantService) CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.CreatePlant(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).CreatePlant(ctx, in, opts...) } - func (m *defaultPlantService) UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.UpdatePlant(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).UpdatePlant(ctx, in, opts...) } - func (m *defaultPlantService) DeletePlant(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.DeletePlant(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).DeletePlant(ctx, in, opts...) } - func (m *defaultPlantService) GetPlantList(ctx context.Context, in *PlantListReq, opts ...grpc.CallOption) (*PlantListResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetPlantList(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).GetPlantList(ctx, in, opts...) } - func (m *defaultPlantService) GetPlantDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PlantDetailResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetPlantDetail(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).GetPlantDetail(ctx, in, opts...) } -// 养护 +// ---- 养护 ---- func (m *defaultPlantService) AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.AddCarePlan(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).AddCarePlan(ctx, in, opts...) +} +func (m *defaultPlantService) DeleteCarePlan(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).DeleteCarePlan(ctx, in, opts...) +} +func (m *defaultPlantService) GetTodayTaskList(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CareTaskListResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetTodayTaskList(ctx, in, opts...) } - func (m *defaultPlantService) AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.AddCareRecord(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).AddCareRecord(ctx, in, opts...) } - func (m *defaultPlantService) AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.AddGrowthRecord(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).AddGrowthRecord(ctx, in, opts...) } -// 百科 +// ---- 百科 ---- func (m *defaultPlantService) GetWikiList(ctx context.Context, in *WikiListReq, opts ...grpc.CallOption) (*WikiListResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetWikiList(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).GetWikiList(ctx, in, opts...) } - func (m *defaultPlantService) GetWikiDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiDetailResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetWikiDetail(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).GetWikiDetail(ctx, in, opts...) +} +func (m *defaultPlantService) CreateWiki(ctx context.Context, in *CreateWikiReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).CreateWiki(ctx, in, opts...) +} +func (m *defaultPlantService) UpdateWiki(ctx context.Context, in *UpdateWikiReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).UpdateWiki(ctx, in, opts...) +} +func (m *defaultPlantService) DeleteWiki(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).DeleteWiki(ctx, in, opts...) +} +func (m *defaultPlantService) SyncWikiVector(ctx context.Context, in *SyncWikiVectorReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).SyncWikiVector(ctx, in, opts...) +} +func (m *defaultPlantService) DeleteWikiVector(ctx context.Context, in *SyncWikiVectorReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).DeleteWikiVector(ctx, in, opts...) +} +func (m *defaultPlantService) SyncAllWikiVector(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).SyncAllWikiVector(ctx, in, opts...) } - func (m *defaultPlantService) GetWikiClassList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassListResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetWikiClassList(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).GetWikiClassList(ctx, in, opts...) } - func (m *defaultPlantService) CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.CreateWikiClass(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).CreateWikiClass(ctx, in, opts...) +} +func (m *defaultPlantService) UpdateWikiClass(ctx context.Context, in *UpdateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).UpdateWikiClass(ctx, in, opts...) +} +func (m *defaultPlantService) DeleteWikiClass(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).DeleteWikiClass(ctx, in, opts...) } - func (m *defaultPlantService) ToggleWikiStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.ToggleWikiStar(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).ToggleWikiStar(ctx, in, opts...) } -// 社区 +// ---- OCR ---- +func (m *defaultPlantService) GetMyClassifyLog(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*ClassifyLogListResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetMyClassifyLog(ctx, in, opts...) +} +func (m *defaultPlantService) DeleteClassifyLog(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).DeleteClassifyLog(ctx, in, opts...) +} + +// ---- 社区 ---- func (m *defaultPlantService) CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.CreatePost(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).CreatePost(ctx, in, opts...) } - func (m *defaultPlantService) DeletePost(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.DeletePost(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).DeletePost(ctx, in, opts...) } - func (m *defaultPlantService) GetPostList(ctx context.Context, in *PostListReq, opts ...grpc.CallOption) (*PostListResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetPostList(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).GetPostList(ctx, in, opts...) } - func (m *defaultPlantService) GetPostDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PostDetailResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetPostDetail(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).GetPostDetail(ctx, in, opts...) } - func (m *defaultPlantService) CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.CommentPost(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).CommentPost(ctx, in, opts...) } - func (m *defaultPlantService) LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.LikePost(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).LikePost(ctx, in, opts...) +} +func (m *defaultPlantService) StarPost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).StarPost(ctx, in, opts...) +} +func (m *defaultPlantService) MediaCheckCallback(ctx context.Context, in *MediaCheckCallbackReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).MediaCheckCallback(ctx, in, opts...) } -// 话题 +// ---- 话题 ---- func (m *defaultPlantService) GetTopicList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicListResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetTopicList(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).GetTopicList(ctx, in, opts...) +} +func (m *defaultPlantService) GetTopicDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicInfo, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetTopicDetail(ctx, in, opts...) } - func (m *defaultPlantService) CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.CreateTopic(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).CreateTopic(ctx, in, opts...) +} +func (m *defaultPlantService) UpdateTopic(ctx context.Context, in *UpdateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).UpdateTopic(ctx, in, opts...) } - func (m *defaultPlantService) DeleteTopic(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.DeleteTopic(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).DeleteTopic(ctx, in, opts...) } -// 兑换 +// ---- 兑换 ---- func (m *defaultPlantService) GetExchangeItemList(ctx context.Context, in *ExchangeItemListReq, opts ...grpc.CallOption) (*ExchangeItemListResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetExchangeItemList(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).GetExchangeItemList(ctx, in, opts...) +} +func (m *defaultPlantService) CreateExchangeItem(ctx context.Context, in *CreateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).CreateExchangeItem(ctx, in, opts...) +} +func (m *defaultPlantService) UpdateExchangeItem(ctx context.Context, in *UpdateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).UpdateExchangeItem(ctx, in, opts...) +} +func (m *defaultPlantService) DeleteExchangeItem(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).DeleteExchangeItem(ctx, in, opts...) } - func (m *defaultPlantService) CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.CreateExchangeOrder(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).CreateExchangeOrder(ctx, in, opts...) +} +func (m *defaultPlantService) GetMyExchangeOrders(ctx context.Context, in *ExchangeOrderListReq, opts ...grpc.CallOption) (*ExchangeOrderListResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetMyExchangeOrders(ctx, in, opts...) +} +func (m *defaultPlantService) GetExchangeOrderList(ctx context.Context, in *ExchangeOrderListReq, opts ...grpc.CallOption) (*ExchangeOrderListResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetExchangeOrderList(ctx, in, opts...) +} +func (m *defaultPlantService) UpdateExchangeOrder(ctx context.Context, in *UpdateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).UpdateExchangeOrder(ctx, in, opts...) } -// 配置 +// ---- 配置 ---- func (m *defaultPlantService) GetLevelConfigList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*LevelConfigListResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetLevelConfigList(ctx, in, opts...) + return plant.NewPlantServiceClient(m.cli.Conn()).GetLevelConfigList(ctx, in, opts...) +} +func (m *defaultPlantService) CreateLevelConfig(ctx context.Context, in *CreateLevelConfigReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).CreateLevelConfig(ctx, in, opts...) +} +func (m *defaultPlantService) UpdateLevelConfig(ctx context.Context, in *UpdateLevelConfigReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).UpdateLevelConfig(ctx, in, opts...) +} +func (m *defaultPlantService) DeleteLevelConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).DeleteLevelConfig(ctx, in, opts...) +} +func (m *defaultPlantService) GetBadgeConfigList(ctx context.Context, in *BadgeConfigListReq, opts ...grpc.CallOption) (*BadgeConfigListResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetBadgeConfigList(ctx, in, opts...) +} +func (m *defaultPlantService) GetBadgeConfigDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*BadgeConfigInfo, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetBadgeConfigDetail(ctx, in, opts...) +} +func (m *defaultPlantService) CreateBadgeConfig(ctx context.Context, in *CreateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).CreateBadgeConfig(ctx, in, opts...) +} +func (m *defaultPlantService) UpdateBadgeConfig(ctx context.Context, in *UpdateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).UpdateBadgeConfig(ctx, in, opts...) +} +func (m *defaultPlantService) DeleteBadgeConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).DeleteBadgeConfig(ctx, in, opts...) } -func (m *defaultPlantService) GetBadgeConfigList(ctx context.Context, in *BadgeConfigListReq, opts ...grpc.CallOption) (*BadgeConfigListResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetBadgeConfigList(ctx, in, opts...) +// ---- AI ---- +func (m *defaultPlantService) DeleteAiChatHistory(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).DeleteAiChatHistory(ctx, in, opts...) +} +func (m *defaultPlantService) SaveAiChatHistory(ctx context.Context, in *SaveAiChatHistoryReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).SaveAiChatHistory(ctx, in, opts...) +} +func (m *defaultPlantService) ClearAiChatHistory(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CommonResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).ClearAiChatHistory(ctx, in, opts...) +} +func (m *defaultPlantService) GetAiChatQuota(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*AiQuotaResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetAiChatQuota(ctx, in, opts...) +} + +func (m *defaultPlantService) CompleteTask(ctx context.Context, in *plant.CompleteTaskReq, opts ...grpc.CallOption) (*plant.TaskCompletionResult, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).CompleteTask(ctx, in, opts...) +} + +func (m *defaultPlantService) GetExchangeItemDetail(ctx context.Context, in *plant.IdReq, opts ...grpc.CallOption) (*plant.ExchangeItemInfo, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetExchangeItemDetail(ctx, in, opts...) +} + +func (m *defaultPlantService) GetWikiClassDetail(ctx context.Context, in *plant.IdReq, opts ...grpc.CallOption) (*plant.WikiClassInfo, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetWikiClassDetail(ctx, in, opts...) +} + +func (m *defaultPlantService) GetLevelConfigDetail(ctx context.Context, in *plant.IdReq, opts ...grpc.CallOption) (*plant.LevelConfigInfo, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetLevelConfigDetail(ctx, in, opts...) +} + +func (m *defaultPlantService) GetBadgeConfigTree(ctx context.Context, in *plant.IdReq, opts ...grpc.CallOption) (*plant.BadgeConfigTreeResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetBadgeConfigTree(ctx, in, opts...) +} + +func (m *defaultPlantService) GetAiChatHistory(ctx context.Context, in *plant.AiChatHistoryReq, opts ...grpc.CallOption) (*plant.AiChatHistoryResp, error) { + return plant.NewPlantServiceClient(m.cli.Conn()).GetAiChatHistory(ctx, in, opts...) } diff --git a/common/model/base_model.go b/common/model/base_model.go index e9ffaea..6650120 100644 --- a/common/model/base_model.go +++ b/common/model/base_model.go @@ -9,10 +9,11 @@ import ( // BaseModel 基础模型,所有表的公共字段 type BaseModel struct { - ID string `gorm:"size:50;primaryKey" json:"id"` - CreatedAt time.Time `json:"createdAt" gorm:"autoCreateTime"` - UpdatedAt time.Time `json:"updatedAt" gorm:"autoCreateTime;autoUpdateTime"` - DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` + ID string `gorm:"size:50;primaryKey" json:"id"` + CreatedAt time.Time `json:"createdAt" gorm:"autoCreateTime"` + UpdatedAt time.Time `json:"updatedAt" gorm:"autoCreateTime;autoUpdateTime"` + DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` + CreatedAtStr string `gorm:"-" json:"createdAtStr"` } // BeforeCreate 创建前自动生成雪花ID @@ -26,3 +27,11 @@ func (m *BaseModel) BeforeUpdate(db *gorm.DB) (err error) { db.Statement.SetColumn("updated_at", time.Now()) return } + +// AfterFind 查询后自动填充 createdAtStr +func (m *BaseModel) AfterFind(db *gorm.DB) (err error) { + if !m.CreatedAt.IsZero() { + m.CreatedAtStr = m.CreatedAt.Format("2006-01-02 15:04:05") + } + return +} diff --git a/go.mod b/go.mod index 43ad591..2784268 100644 --- a/go.mod +++ b/go.mod @@ -65,7 +65,7 @@ require ( github.com/jinzhu/now v1.1.5 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.18.2 // indirect + github.com/klauspost/compress v1.18.4 // indirect github.com/klauspost/cpuid/v2 v2.2.11 // indirect github.com/klauspost/crc32 v1.3.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -89,8 +89,10 @@ require ( github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.66.1 // indirect github.com/prometheus/procfs v0.16.1 // indirect + github.com/qdrant/go-client v1.17.1 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/rs/xid v1.6.0 // indirect + github.com/sashabaranov/go-openai v1.41.2 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect github.com/tinylib/msgp v1.6.1 // indirect @@ -127,7 +129,7 @@ require ( golang.org/x/text v0.36.0 // indirect golang.org/x/time v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index cc4eac6..45d428d 100644 --- a/go.sum +++ b/go.sum @@ -127,6 +127,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.18.2 h1:iiPHWW0YrcFgpBYhsA6D1+fqHssJscY/Tm/y2Uqnapk= github.com/klauspost/compress v1.18.2/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= +github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c= +github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.11 h1:0OwqZRYI2rFrjS4kvkDnqJkKHdHaRnCm68/DY4OxRzU= github.com/klauspost/cpuid/v2 v2.2.11/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= @@ -198,6 +200,8 @@ github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9Z github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA= github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= +github.com/qdrant/go-client v1.17.1 h1:7QmPwDddrHL3hC4NfycwtQlraVKRLcRi++BX6TTm+3g= +github.com/qdrant/go-client v1.17.1/go.mod h1:n1h6GhkdAzcohoXt/5Z19I2yxbCkMA6Jejob3S6NZT8= github.com/qiniu/go-sdk/v7 v7.26.10 h1:1c2c+grH7b8k5inIDKc95CI8+mAzB5YtfQ/dLOB2nNo= github.com/qiniu/go-sdk/v7 v7.26.10/go.mod h1:ri7fGwbio0pRDFr8EK5TUpx0DbnpIMJ2bMSDxGWfCbk= github.com/redis/go-redis/v9 v9.18.0 h1:pMkxYPkEbMPwRdenAzUNyFNrDgHx9U+DrBabWNfSRQs= @@ -213,6 +217,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7 github.com/rs/dnscache v0.0.0-20230804202142-fc85eb664529/go.mod h1:qe5TWALJ8/a1Lqznoc5BDHpYX/8HU60Hm2AwRmqzxqA= github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= +github.com/sashabaranov/go-openai v1.41.2 h1:vfPRBZNMpnqu8ELsclWcAvF19lDNgh1t6TVfFFOPiSM= +github.com/sashabaranov/go-openai v1.41.2/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= @@ -401,6 +407,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 h1: google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409/go.mod h1:fl8J1IvUjCilwZzQowmw2b7HQB2eAuYBabMXzWurF+I= google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 h1:H86B94AW+VfJWDqFeEbBPhEtHzJwJfTbgE2lZa54ZAQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 h1:mWPCjDEyshlQYzBpMNHaEof6UX1PmHcaUODUywQ0uac= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= google.golang.org/grpc v1.80.0 h1:Xr6m2WmWZLETvUNvIUmeD5OAagMw3FiKmMlTdViWsHM= google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= diff --git a/zero-gateway b/zero-gateway new file mode 100755 index 0000000..ebc74dd Binary files /dev/null and b/zero-gateway differ