init: init refactor
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
Name: plant.rpc
|
||||
ListenOn: 0.0.0.0:8080
|
||||
Etcd:
|
||||
Hosts:
|
||||
- 127.0.0.1:2379
|
||||
Key: plant.rpc
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
package config
|
||||
|
||||
import "github.com/zeromicro/go-zero/zrpc"
|
||||
|
||||
type Config struct {
|
||||
zrpc.RpcServerConf
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type AddCarePlanLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewAddCarePlanLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddCarePlanLogic {
|
||||
return &AddCarePlanLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// 养护
|
||||
func (l *AddCarePlanLogic) AddCarePlan(in *plant.AddCarePlanReq) (*plant.AddCarePlanResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.AddCarePlanResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type AddCareRecordLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewAddCareRecordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddCareRecordLogic {
|
||||
return &AddCareRecordLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *AddCareRecordLogic) AddCareRecord(in *plant.AddCareRecordReq) (*plant.AddCareRecordResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.AddCareRecordResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"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 {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewAddGrowthRecordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddGrowthRecordLogic {
|
||||
return &AddGrowthRecordLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *AddGrowthRecordLogic) AddGrowthRecord(in *plant.AddGrowthRecordReq) (*plant.AddGrowthRecordResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.AddGrowthRecordResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type CommentPostLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewCommentPostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CommentPostLogic {
|
||||
return &CommentPostLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *CommentPostLogic) CommentPost(in *plant.CommentPostReq) (*plant.CommentPostResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.CommentPostResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type CreateExchangeOrderLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewCreateExchangeOrderLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateExchangeOrderLogic {
|
||||
return &CreateExchangeOrderLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *CreateExchangeOrderLogic) CreateExchangeOrder(in *plant.CreateExchangeOrderReq) (*plant.CreateExchangeOrderResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.CreateExchangeOrderResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type CreatePlantLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewCreatePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreatePlantLogic {
|
||||
return &CreatePlantLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// 植物
|
||||
func (l *CreatePlantLogic) CreatePlant(in *plant.CreatePlantReq) (*plant.CreatePlantResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.CreatePlantResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type CreatePostLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewCreatePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreatePostLogic {
|
||||
return &CreatePostLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// 社区
|
||||
func (l *CreatePostLogic) CreatePost(in *plant.CreatePostReq) (*plant.CreatePostResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.CreatePostResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type CreateTopicLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewCreateTopicLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateTopicLogic {
|
||||
return &CreateTopicLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *CreateTopicLogic) CreateTopic(in *plant.CreateTopicReq) (*plant.CreateTopicResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.CreateTopicResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type CreateWikiClassLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewCreateWikiClassLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateWikiClassLogic {
|
||||
return &CreateWikiClassLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *CreateWikiClassLogic) CreateWikiClass(in *plant.CreateWikiClassReq) (*plant.CreateWikiClassResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.CreateWikiClassResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type DeletePlantLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewDeletePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeletePlantLogic {
|
||||
return &DeletePlantLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DeletePlantLogic) DeletePlant(in *plant.DeletePlantReq) (*plant.DeletePlantResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.DeletePlantResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type DeletePostLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewDeletePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeletePostLogic {
|
||||
return &DeletePostLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DeletePostLogic) DeletePost(in *plant.DeletePostReq) (*plant.DeletePostResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.DeletePostResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type DeleteTopicLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewDeleteTopicLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteTopicLogic {
|
||||
return &DeleteTopicLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DeleteTopicLogic) DeleteTopic(in *plant.DeleteTopicReq) (*plant.DeleteTopicResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.DeleteTopicResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetBadgeConfigListLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetBadgeConfigListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetBadgeConfigListLogic {
|
||||
return &GetBadgeConfigListLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetBadgeConfigListLogic) GetBadgeConfigList(in *plant.GetBadgeConfigListReq) (*plant.GetBadgeConfigListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.GetBadgeConfigListResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetExchangeItemListLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetExchangeItemListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetExchangeItemListLogic {
|
||||
return &GetExchangeItemListLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// 兑换
|
||||
func (l *GetExchangeItemListLogic) GetExchangeItemList(in *plant.GetExchangeItemListReq) (*plant.GetExchangeItemListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.GetExchangeItemListResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetLevelConfigListLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetLevelConfigListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetLevelConfigListLogic {
|
||||
return &GetLevelConfigListLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// 配置
|
||||
func (l *GetLevelConfigListLogic) GetLevelConfigList(in *plant.GetLevelConfigListReq) (*plant.GetLevelConfigListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.GetLevelConfigListResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetPlantDetailLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetPlantDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetPlantDetailLogic {
|
||||
return &GetPlantDetailLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetPlantDetailLogic) GetPlantDetail(in *plant.GetPlantDetailReq) (*plant.GetPlantDetailResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.GetPlantDetailResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetPlantListLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetPlantListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetPlantListLogic {
|
||||
return &GetPlantListLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetPlantListLogic) GetPlantList(in *plant.GetPlantListReq) (*plant.GetPlantListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.GetPlantListResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetPostDetailLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetPostDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetPostDetailLogic {
|
||||
return &GetPostDetailLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetPostDetailLogic) GetPostDetail(in *plant.GetPostDetailReq) (*plant.GetPostDetailResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.GetPostDetailResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetPostListLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetPostListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetPostListLogic {
|
||||
return &GetPostListLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetPostListLogic) GetPostList(in *plant.GetPostListReq) (*plant.GetPostListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.GetPostListResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetTopicListLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetTopicListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetTopicListLogic {
|
||||
return &GetTopicListLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// 话题
|
||||
func (l *GetTopicListLogic) GetTopicList(in *plant.Empty) (*plant.GetTopicListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.GetTopicListResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetUserProfileLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetUserProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserProfileLogic {
|
||||
return &GetUserProfileLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// 用户Profile
|
||||
func (l *GetUserProfileLogic) GetUserProfile(in *plant.GetUserProfileReq) (*plant.GetUserProfileResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.GetUserProfileResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetWikiClassListLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetWikiClassListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetWikiClassListLogic {
|
||||
return &GetWikiClassListLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetWikiClassListLogic) GetWikiClassList(in *plant.Empty) (*plant.GetWikiClassListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.GetWikiClassListResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetWikiDetailLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetWikiDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetWikiDetailLogic {
|
||||
return &GetWikiDetailLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetWikiDetailLogic) GetWikiDetail(in *plant.GetWikiDetailReq) (*plant.GetWikiDetailResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.GetWikiDetailResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetWikiListLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetWikiListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetWikiListLogic {
|
||||
return &GetWikiListLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// 百科
|
||||
func (l *GetWikiListLogic) GetWikiList(in *plant.GetWikiListReq) (*plant.GetWikiListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.GetWikiListResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type IncrUserCounterLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewIncrUserCounterLogic(ctx context.Context, svcCtx *svc.ServiceContext) *IncrUserCounterLogic {
|
||||
return &IncrUserCounterLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *IncrUserCounterLogic) IncrUserCounter(in *plant.IncrUserCounterReq) (*plant.IncrUserCounterResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.IncrUserCounterResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"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 {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewLikePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LikePostLogic {
|
||||
return &LikePostLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *LikePostLogic) LikePost(in *plant.LikePostReq) (*plant.LikePostResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.LikePostResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type ToggleStarLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewToggleStarLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ToggleStarLogic {
|
||||
return &ToggleStarLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *ToggleStarLogic) ToggleStar(in *plant.ToggleStarReq) (*plant.ToggleStarResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.ToggleStarResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type UpdatePlantLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewUpdatePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdatePlantLogic {
|
||||
return &UpdatePlantLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdatePlantLogic) UpdatePlant(in *plant.UpdatePlantReq) (*plant.UpdatePlantResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.UpdatePlantResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type UpdateUserProfileLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewUpdateUserProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateUserProfileLogic {
|
||||
return &UpdateUserProfileLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateUserProfileLogic) UpdateUserProfile(in *plant.UpdateUserProfileReq) (*plant.UpdateUserProfileResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.UpdateUserProfileResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.10.1
|
||||
// Source: plant.proto
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/internal/logic"
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
)
|
||||
|
||||
type PlantServiceServer struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
plant.UnimplementedPlantServiceServer
|
||||
}
|
||||
|
||||
func NewPlantServiceServer(svcCtx *svc.ServiceContext) *PlantServiceServer {
|
||||
return &PlantServiceServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
// 用户Profile
|
||||
func (s *PlantServiceServer) GetUserProfile(ctx context.Context, in *plant.GetUserProfileReq) (*plant.GetUserProfileResp, error) {
|
||||
l := logic.NewGetUserProfileLogic(ctx, s.svcCtx)
|
||||
return l.GetUserProfile(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) UpdateUserProfile(ctx context.Context, in *plant.UpdateUserProfileReq) (*plant.UpdateUserProfileResp, error) {
|
||||
l := logic.NewUpdateUserProfileLogic(ctx, s.svcCtx)
|
||||
return l.UpdateUserProfile(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) IncrUserCounter(ctx context.Context, in *plant.IncrUserCounterReq) (*plant.IncrUserCounterResp, error) {
|
||||
l := logic.NewIncrUserCounterLogic(ctx, s.svcCtx)
|
||||
return l.IncrUserCounter(in)
|
||||
}
|
||||
|
||||
// 植物
|
||||
func (s *PlantServiceServer) CreatePlant(ctx context.Context, in *plant.CreatePlantReq) (*plant.CreatePlantResp, error) {
|
||||
l := logic.NewCreatePlantLogic(ctx, s.svcCtx)
|
||||
return l.CreatePlant(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) UpdatePlant(ctx context.Context, in *plant.UpdatePlantReq) (*plant.UpdatePlantResp, error) {
|
||||
l := logic.NewUpdatePlantLogic(ctx, s.svcCtx)
|
||||
return l.UpdatePlant(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) DeletePlant(ctx context.Context, in *plant.DeletePlantReq) (*plant.DeletePlantResp, error) {
|
||||
l := logic.NewDeletePlantLogic(ctx, s.svcCtx)
|
||||
return l.DeletePlant(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetPlantList(ctx context.Context, in *plant.GetPlantListReq) (*plant.GetPlantListResp, error) {
|
||||
l := logic.NewGetPlantListLogic(ctx, s.svcCtx)
|
||||
return l.GetPlantList(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetPlantDetail(ctx context.Context, in *plant.GetPlantDetailReq) (*plant.GetPlantDetailResp, error) {
|
||||
l := logic.NewGetPlantDetailLogic(ctx, s.svcCtx)
|
||||
return l.GetPlantDetail(in)
|
||||
}
|
||||
|
||||
// 养护
|
||||
func (s *PlantServiceServer) AddCarePlan(ctx context.Context, in *plant.AddCarePlanReq) (*plant.AddCarePlanResp, error) {
|
||||
l := logic.NewAddCarePlanLogic(ctx, s.svcCtx)
|
||||
return l.AddCarePlan(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) AddCareRecord(ctx context.Context, in *plant.AddCareRecordReq) (*plant.AddCareRecordResp, error) {
|
||||
l := logic.NewAddCareRecordLogic(ctx, s.svcCtx)
|
||||
return l.AddCareRecord(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) AddGrowthRecord(ctx context.Context, in *plant.AddGrowthRecordReq) (*plant.AddGrowthRecordResp, error) {
|
||||
l := logic.NewAddGrowthRecordLogic(ctx, s.svcCtx)
|
||||
return l.AddGrowthRecord(in)
|
||||
}
|
||||
|
||||
// 百科
|
||||
func (s *PlantServiceServer) GetWikiList(ctx context.Context, in *plant.GetWikiListReq) (*plant.GetWikiListResp, error) {
|
||||
l := logic.NewGetWikiListLogic(ctx, s.svcCtx)
|
||||
return l.GetWikiList(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetWikiDetail(ctx context.Context, in *plant.GetWikiDetailReq) (*plant.GetWikiDetailResp, error) {
|
||||
l := logic.NewGetWikiDetailLogic(ctx, s.svcCtx)
|
||||
return l.GetWikiDetail(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetWikiClassList(ctx context.Context, in *plant.Empty) (*plant.GetWikiClassListResp, error) {
|
||||
l := logic.NewGetWikiClassListLogic(ctx, s.svcCtx)
|
||||
return l.GetWikiClassList(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) CreateWikiClass(ctx context.Context, in *plant.CreateWikiClassReq) (*plant.CreateWikiClassResp, error) {
|
||||
l := logic.NewCreateWikiClassLogic(ctx, s.svcCtx)
|
||||
return l.CreateWikiClass(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) ToggleStar(ctx context.Context, in *plant.ToggleStarReq) (*plant.ToggleStarResp, error) {
|
||||
l := logic.NewToggleStarLogic(ctx, s.svcCtx)
|
||||
return l.ToggleStar(in)
|
||||
}
|
||||
|
||||
// 社区
|
||||
func (s *PlantServiceServer) CreatePost(ctx context.Context, in *plant.CreatePostReq) (*plant.CreatePostResp, error) {
|
||||
l := logic.NewCreatePostLogic(ctx, s.svcCtx)
|
||||
return l.CreatePost(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetPostList(ctx context.Context, in *plant.GetPostListReq) (*plant.GetPostListResp, error) {
|
||||
l := logic.NewGetPostListLogic(ctx, s.svcCtx)
|
||||
return l.GetPostList(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetPostDetail(ctx context.Context, in *plant.GetPostDetailReq) (*plant.GetPostDetailResp, error) {
|
||||
l := logic.NewGetPostDetailLogic(ctx, s.svcCtx)
|
||||
return l.GetPostDetail(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) DeletePost(ctx context.Context, in *plant.DeletePostReq) (*plant.DeletePostResp, error) {
|
||||
l := logic.NewDeletePostLogic(ctx, s.svcCtx)
|
||||
return l.DeletePost(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) CommentPost(ctx context.Context, in *plant.CommentPostReq) (*plant.CommentPostResp, error) {
|
||||
l := logic.NewCommentPostLogic(ctx, s.svcCtx)
|
||||
return l.CommentPost(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) LikePost(ctx context.Context, in *plant.LikePostReq) (*plant.LikePostResp, error) {
|
||||
l := logic.NewLikePostLogic(ctx, s.svcCtx)
|
||||
return l.LikePost(in)
|
||||
}
|
||||
|
||||
// 话题
|
||||
func (s *PlantServiceServer) GetTopicList(ctx context.Context, in *plant.Empty) (*plant.GetTopicListResp, error) {
|
||||
l := logic.NewGetTopicListLogic(ctx, s.svcCtx)
|
||||
return l.GetTopicList(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) CreateTopic(ctx context.Context, in *plant.CreateTopicReq) (*plant.CreateTopicResp, error) {
|
||||
l := logic.NewCreateTopicLogic(ctx, s.svcCtx)
|
||||
return l.CreateTopic(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) DeleteTopic(ctx context.Context, in *plant.DeleteTopicReq) (*plant.DeleteTopicResp, error) {
|
||||
l := logic.NewDeleteTopicLogic(ctx, s.svcCtx)
|
||||
return l.DeleteTopic(in)
|
||||
}
|
||||
|
||||
// 配置
|
||||
func (s *PlantServiceServer) GetLevelConfigList(ctx context.Context, in *plant.GetLevelConfigListReq) (*plant.GetLevelConfigListResp, error) {
|
||||
l := logic.NewGetLevelConfigListLogic(ctx, s.svcCtx)
|
||||
return l.GetLevelConfigList(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetBadgeConfigList(ctx context.Context, in *plant.GetBadgeConfigListReq) (*plant.GetBadgeConfigListResp, error) {
|
||||
l := logic.NewGetBadgeConfigListLogic(ctx, s.svcCtx)
|
||||
return l.GetBadgeConfigList(in)
|
||||
}
|
||||
|
||||
// 兑换
|
||||
func (s *PlantServiceServer) GetExchangeItemList(ctx context.Context, in *plant.GetExchangeItemListReq) (*plant.GetExchangeItemListResp, error) {
|
||||
l := logic.NewGetExchangeItemListLogic(ctx, s.svcCtx)
|
||||
return l.GetExchangeItemList(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) CreateExchangeOrder(ctx context.Context, in *plant.CreateExchangeOrderReq) (*plant.CreateExchangeOrderResp, error) {
|
||||
l := logic.NewCreateExchangeOrderLogic(ctx, s.svcCtx)
|
||||
return l.CreateExchangeOrder(in)
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package svc
|
||||
|
||||
import "sundynix-micro-go/app/plant/rpc/internal/config"
|
||||
|
||||
type ServiceContext struct {
|
||||
Config config.Config
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
return &ServiceContext{
|
||||
Config: c,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,328 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package plant;
|
||||
|
||||
option go_package = "./plant";
|
||||
|
||||
// ========== 用户Profile ==========
|
||||
message UserProfile {
|
||||
string id = 1;
|
||||
string userId = 2;
|
||||
string nickName = 3;
|
||||
string avatarId = 4;
|
||||
string levelId = 5;
|
||||
int64 currentSunlight = 6;
|
||||
int64 totalSunlight = 7;
|
||||
int64 plantCount = 8;
|
||||
int64 careCount = 9;
|
||||
int64 postCount = 10;
|
||||
int64 waterCount = 11;
|
||||
int64 fertilizeCount = 12;
|
||||
int64 repotCount = 13;
|
||||
int64 pruneCount = 14;
|
||||
int64 photoCount = 15;
|
||||
}
|
||||
|
||||
message GetUserProfileReq { string userId = 1; }
|
||||
message GetUserProfileResp { UserProfile profile = 1; }
|
||||
message UpdateUserProfileReq {
|
||||
string userId = 1;
|
||||
string nickName = 2;
|
||||
string avatarId = 3;
|
||||
}
|
||||
message UpdateUserProfileResp {}
|
||||
message IncrUserCounterReq {
|
||||
string userId = 1;
|
||||
string field = 2; // care_count, water_count, etc.
|
||||
int64 delta = 3;
|
||||
}
|
||||
message IncrUserCounterResp {}
|
||||
|
||||
// ========== 我的植物 ==========
|
||||
message PlantInfo {
|
||||
string id = 1;
|
||||
string userId = 2;
|
||||
string name = 3;
|
||||
string plantTime = 4;
|
||||
int32 status = 5;
|
||||
string placement = 6;
|
||||
string potMaterial = 7;
|
||||
string potSize = 8;
|
||||
string sunlight = 9;
|
||||
string plantingMaterial = 10;
|
||||
repeated string imgIds = 11;
|
||||
int64 createdAt = 12;
|
||||
}
|
||||
|
||||
message CreatePlantReq {
|
||||
string userId = 1;
|
||||
string name = 2;
|
||||
string plantTime = 3;
|
||||
string placement = 4;
|
||||
string potMaterial = 5;
|
||||
string potSize = 6;
|
||||
string sunlight = 7;
|
||||
string plantingMaterial = 8;
|
||||
repeated string imgIds = 9;
|
||||
}
|
||||
message CreatePlantResp { string id = 1; }
|
||||
|
||||
message UpdatePlantReq {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
int32 status = 3;
|
||||
string placement = 4;
|
||||
string potMaterial = 5;
|
||||
string potSize = 6;
|
||||
string sunlight = 7;
|
||||
string plantingMaterial = 8;
|
||||
}
|
||||
message UpdatePlantResp {}
|
||||
|
||||
message DeletePlantReq { repeated string ids = 1; }
|
||||
message DeletePlantResp {}
|
||||
|
||||
message GetPlantListReq {
|
||||
string userId = 1;
|
||||
int32 current = 2;
|
||||
int32 pageSize = 3;
|
||||
string name = 4;
|
||||
}
|
||||
message GetPlantListResp {
|
||||
repeated PlantInfo list = 1;
|
||||
int64 total = 2;
|
||||
}
|
||||
|
||||
message GetPlantDetailReq { string id = 1; }
|
||||
message GetPlantDetailResp { PlantInfo plant = 1; }
|
||||
|
||||
// ========== 养护 ==========
|
||||
message CarePlanInfo {
|
||||
string id = 1;
|
||||
string userId = 2;
|
||||
string plantId = 3;
|
||||
string name = 4;
|
||||
string icon = 5;
|
||||
string targetAction = 6;
|
||||
int32 period = 7;
|
||||
}
|
||||
|
||||
message AddCarePlanReq {
|
||||
string userId = 1;
|
||||
string plantId = 2;
|
||||
string name = 3;
|
||||
string icon = 4;
|
||||
string targetAction = 5;
|
||||
int32 period = 6;
|
||||
}
|
||||
message AddCarePlanResp { string id = 1; }
|
||||
|
||||
message AddCareRecordReq {
|
||||
string userId = 1;
|
||||
string plantId = 2;
|
||||
string planId = 3;
|
||||
string action = 4;
|
||||
string note = 5;
|
||||
}
|
||||
message AddCareRecordResp {}
|
||||
|
||||
message AddGrowthRecordReq {
|
||||
string userId = 1;
|
||||
string plantId = 2;
|
||||
string content = 3;
|
||||
repeated string imgIds = 4;
|
||||
}
|
||||
message AddGrowthRecordResp {}
|
||||
|
||||
// ========== 百科 ==========
|
||||
message WikiInfo {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string latinName = 3;
|
||||
string aliases = 4;
|
||||
string genus = 5;
|
||||
int32 difficulty = 6;
|
||||
int32 isHot = 7;
|
||||
int64 createdAt = 8;
|
||||
}
|
||||
|
||||
message GetWikiListReq {
|
||||
int32 current = 1;
|
||||
int32 pageSize = 2;
|
||||
string name = 3;
|
||||
string classId = 4;
|
||||
int32 isHot = 5;
|
||||
}
|
||||
message GetWikiListResp {
|
||||
repeated WikiInfo list = 1;
|
||||
int64 total = 2;
|
||||
}
|
||||
|
||||
message GetWikiDetailReq { string id = 1; }
|
||||
message GetWikiDetailResp { WikiInfo wiki = 1; }
|
||||
|
||||
message WikiClassInfo {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string ossId = 3;
|
||||
}
|
||||
message GetWikiClassListResp { repeated WikiClassInfo list = 1; }
|
||||
message CreateWikiClassReq { string name = 1; string ossId = 2; }
|
||||
message CreateWikiClassResp { string id = 1; }
|
||||
|
||||
message ToggleStarReq {
|
||||
string userId = 1;
|
||||
string targetId = 2;
|
||||
string type = 3;
|
||||
}
|
||||
message ToggleStarResp { bool starred = 1; }
|
||||
|
||||
// ========== 社区 ==========
|
||||
message PostInfo {
|
||||
string id = 1;
|
||||
string userId = 2;
|
||||
string title = 3;
|
||||
string content = 4;
|
||||
int32 viewCount = 5;
|
||||
int32 commentCount = 6;
|
||||
int32 likeCount = 7;
|
||||
int32 starCount = 8;
|
||||
string location = 9;
|
||||
int64 createdAt = 10;
|
||||
}
|
||||
|
||||
message CreatePostReq {
|
||||
string userId = 1;
|
||||
string title = 2;
|
||||
string content = 3;
|
||||
string location = 4;
|
||||
repeated string imgIds = 5;
|
||||
string topicId = 6;
|
||||
}
|
||||
message CreatePostResp { string id = 1; }
|
||||
|
||||
message GetPostListReq {
|
||||
int32 current = 1;
|
||||
int32 pageSize = 2;
|
||||
string keyword = 3;
|
||||
string topicId = 4;
|
||||
}
|
||||
message GetPostListResp {
|
||||
repeated PostInfo list = 1;
|
||||
int64 total = 2;
|
||||
}
|
||||
|
||||
message GetPostDetailReq { string id = 1; }
|
||||
message GetPostDetailResp { PostInfo post = 1; }
|
||||
|
||||
message DeletePostReq { repeated string ids = 1; }
|
||||
message DeletePostResp {}
|
||||
|
||||
message CommentPostReq {
|
||||
string userId = 1;
|
||||
string postId = 2;
|
||||
string content = 3;
|
||||
string parentId = 4;
|
||||
}
|
||||
message CommentPostResp {}
|
||||
|
||||
message LikePostReq {
|
||||
string userId = 1;
|
||||
string postId = 2;
|
||||
}
|
||||
message LikePostResp { bool liked = 1; }
|
||||
|
||||
// ========== 话题 ==========
|
||||
message TopicInfo {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
int32 postCount = 3;
|
||||
}
|
||||
message GetTopicListResp { repeated TopicInfo list = 1; }
|
||||
message CreateTopicReq { string name = 1; }
|
||||
message CreateTopicResp { string id = 1; }
|
||||
message DeleteTopicReq { repeated string ids = 1; }
|
||||
message DeleteTopicResp {}
|
||||
|
||||
// ========== 配置 ==========
|
||||
message LevelConfigInfo {
|
||||
string id = 1;
|
||||
int32 level = 2;
|
||||
string title = 3;
|
||||
int64 minSunlight = 4;
|
||||
string perks = 5;
|
||||
}
|
||||
message GetLevelConfigListReq { int32 current = 1; int32 pageSize = 2; }
|
||||
message GetLevelConfigListResp { repeated LevelConfigInfo list = 1; int64 total = 2; }
|
||||
|
||||
message BadgeConfigInfo {
|
||||
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;
|
||||
}
|
||||
message GetBadgeConfigListReq { int32 current = 1; int32 pageSize = 2; string dimension = 3; }
|
||||
message GetBadgeConfigListResp { repeated BadgeConfigInfo list = 1; int64 total = 2; }
|
||||
|
||||
// ========== 兑换 ==========
|
||||
message ExchangeItemInfo {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string desc = 3;
|
||||
int64 cost = 4;
|
||||
int32 stock = 5;
|
||||
}
|
||||
message GetExchangeItemListReq { int32 current = 1; int32 pageSize = 2; }
|
||||
message GetExchangeItemListResp { repeated ExchangeItemInfo list = 1; int64 total = 2; }
|
||||
|
||||
message CreateExchangeOrderReq { string userId = 1; string itemId = 2; }
|
||||
message CreateExchangeOrderResp { string id = 1; }
|
||||
|
||||
// ========== 通用 ==========
|
||||
message Empty {}
|
||||
|
||||
// ========== 服务定义 ==========
|
||||
service PlantService {
|
||||
// 用户Profile
|
||||
rpc GetUserProfile(GetUserProfileReq) returns (GetUserProfileResp);
|
||||
rpc UpdateUserProfile(UpdateUserProfileReq) returns (UpdateUserProfileResp);
|
||||
rpc IncrUserCounter(IncrUserCounterReq) returns (IncrUserCounterResp);
|
||||
// 植物
|
||||
rpc CreatePlant(CreatePlantReq) returns (CreatePlantResp);
|
||||
rpc UpdatePlant(UpdatePlantReq) returns (UpdatePlantResp);
|
||||
rpc DeletePlant(DeletePlantReq) returns (DeletePlantResp);
|
||||
rpc GetPlantList(GetPlantListReq) returns (GetPlantListResp);
|
||||
rpc GetPlantDetail(GetPlantDetailReq) returns (GetPlantDetailResp);
|
||||
// 养护
|
||||
rpc AddCarePlan(AddCarePlanReq) returns (AddCarePlanResp);
|
||||
rpc AddCareRecord(AddCareRecordReq) returns (AddCareRecordResp);
|
||||
rpc AddGrowthRecord(AddGrowthRecordReq) returns (AddGrowthRecordResp);
|
||||
// 百科
|
||||
rpc GetWikiList(GetWikiListReq) returns (GetWikiListResp);
|
||||
rpc GetWikiDetail(GetWikiDetailReq) returns (GetWikiDetailResp);
|
||||
rpc GetWikiClassList(Empty) returns (GetWikiClassListResp);
|
||||
rpc CreateWikiClass(CreateWikiClassReq) returns (CreateWikiClassResp);
|
||||
rpc ToggleStar(ToggleStarReq) returns (ToggleStarResp);
|
||||
// 社区
|
||||
rpc CreatePost(CreatePostReq) returns (CreatePostResp);
|
||||
rpc GetPostList(GetPostListReq) returns (GetPostListResp);
|
||||
rpc GetPostDetail(GetPostDetailReq) returns (GetPostDetailResp);
|
||||
rpc DeletePost(DeletePostReq) returns (DeletePostResp);
|
||||
rpc CommentPost(CommentPostReq) returns (CommentPostResp);
|
||||
rpc LikePost(LikePostReq) returns (LikePostResp);
|
||||
// 话题
|
||||
rpc GetTopicList(Empty) returns (GetTopicListResp);
|
||||
rpc CreateTopic(CreateTopicReq) returns (CreateTopicResp);
|
||||
rpc DeleteTopic(DeleteTopicReq) returns (DeleteTopicResp);
|
||||
// 配置
|
||||
rpc GetLevelConfigList(GetLevelConfigListReq) returns (GetLevelConfigListResp);
|
||||
rpc GetBadgeConfigList(GetBadgeConfigListReq) returns (GetBadgeConfigListResp);
|
||||
// 兑换
|
||||
rpc GetExchangeItemList(GetExchangeItemListReq) returns (GetExchangeItemListResp);
|
||||
rpc CreateExchangeOrder(CreateExchangeOrderReq) returns (CreateExchangeOrderResp);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
|
||||
"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/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/conf"
|
||||
"github.com/zeromicro/go-zero/core/service"
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/reflection"
|
||||
)
|
||||
|
||||
var configFile = flag.String("f", "etc/plant.yaml", "the config file")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
var c config.Config
|
||||
conf.MustLoad(*configFile, &c)
|
||||
ctx := svc.NewServiceContext(c)
|
||||
|
||||
s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
|
||||
plant.RegisterPlantServiceServer(grpcServer, server.NewPlantServiceServer(ctx))
|
||||
|
||||
if c.Mode == service.DevMode || c.Mode == service.TestMode {
|
||||
reflection.Register(grpcServer)
|
||||
}
|
||||
})
|
||||
defer s.Stop()
|
||||
|
||||
fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)
|
||||
s.Start()
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,287 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.10.1
|
||||
// Source: plant.proto
|
||||
|
||||
package plantservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type (
|
||||
AddCarePlanReq = plant.AddCarePlanReq
|
||||
AddCarePlanResp = plant.AddCarePlanResp
|
||||
AddCareRecordReq = plant.AddCareRecordReq
|
||||
AddCareRecordResp = plant.AddCareRecordResp
|
||||
AddGrowthRecordReq = plant.AddGrowthRecordReq
|
||||
AddGrowthRecordResp = plant.AddGrowthRecordResp
|
||||
BadgeConfigInfo = plant.BadgeConfigInfo
|
||||
CarePlanInfo = plant.CarePlanInfo
|
||||
CommentPostReq = plant.CommentPostReq
|
||||
CommentPostResp = plant.CommentPostResp
|
||||
CreateExchangeOrderReq = plant.CreateExchangeOrderReq
|
||||
CreateExchangeOrderResp = plant.CreateExchangeOrderResp
|
||||
CreatePlantReq = plant.CreatePlantReq
|
||||
CreatePlantResp = plant.CreatePlantResp
|
||||
CreatePostReq = plant.CreatePostReq
|
||||
CreatePostResp = plant.CreatePostResp
|
||||
CreateTopicReq = plant.CreateTopicReq
|
||||
CreateTopicResp = plant.CreateTopicResp
|
||||
CreateWikiClassReq = plant.CreateWikiClassReq
|
||||
CreateWikiClassResp = plant.CreateWikiClassResp
|
||||
DeletePlantReq = plant.DeletePlantReq
|
||||
DeletePlantResp = plant.DeletePlantResp
|
||||
DeletePostReq = plant.DeletePostReq
|
||||
DeletePostResp = plant.DeletePostResp
|
||||
DeleteTopicReq = plant.DeleteTopicReq
|
||||
DeleteTopicResp = plant.DeleteTopicResp
|
||||
Empty = plant.Empty
|
||||
ExchangeItemInfo = plant.ExchangeItemInfo
|
||||
GetBadgeConfigListReq = plant.GetBadgeConfigListReq
|
||||
GetBadgeConfigListResp = plant.GetBadgeConfigListResp
|
||||
GetExchangeItemListReq = plant.GetExchangeItemListReq
|
||||
GetExchangeItemListResp = plant.GetExchangeItemListResp
|
||||
GetLevelConfigListReq = plant.GetLevelConfigListReq
|
||||
GetLevelConfigListResp = plant.GetLevelConfigListResp
|
||||
GetPlantDetailReq = plant.GetPlantDetailReq
|
||||
GetPlantDetailResp = plant.GetPlantDetailResp
|
||||
GetPlantListReq = plant.GetPlantListReq
|
||||
GetPlantListResp = plant.GetPlantListResp
|
||||
GetPostDetailReq = plant.GetPostDetailReq
|
||||
GetPostDetailResp = plant.GetPostDetailResp
|
||||
GetPostListReq = plant.GetPostListReq
|
||||
GetPostListResp = plant.GetPostListResp
|
||||
GetTopicListResp = plant.GetTopicListResp
|
||||
GetUserProfileReq = plant.GetUserProfileReq
|
||||
GetUserProfileResp = plant.GetUserProfileResp
|
||||
GetWikiClassListResp = plant.GetWikiClassListResp
|
||||
GetWikiDetailReq = plant.GetWikiDetailReq
|
||||
GetWikiDetailResp = plant.GetWikiDetailResp
|
||||
GetWikiListReq = plant.GetWikiListReq
|
||||
GetWikiListResp = plant.GetWikiListResp
|
||||
IncrUserCounterReq = plant.IncrUserCounterReq
|
||||
IncrUserCounterResp = plant.IncrUserCounterResp
|
||||
LevelConfigInfo = plant.LevelConfigInfo
|
||||
LikePostReq = plant.LikePostReq
|
||||
LikePostResp = plant.LikePostResp
|
||||
PlantInfo = plant.PlantInfo
|
||||
PostInfo = plant.PostInfo
|
||||
ToggleStarReq = plant.ToggleStarReq
|
||||
ToggleStarResp = plant.ToggleStarResp
|
||||
TopicInfo = plant.TopicInfo
|
||||
UpdatePlantReq = plant.UpdatePlantReq
|
||||
UpdatePlantResp = plant.UpdatePlantResp
|
||||
UpdateUserProfileReq = plant.UpdateUserProfileReq
|
||||
UpdateUserProfileResp = plant.UpdateUserProfileResp
|
||||
UserProfile = plant.UserProfile
|
||||
WikiClassInfo = plant.WikiClassInfo
|
||||
WikiInfo = plant.WikiInfo
|
||||
|
||||
PlantService interface {
|
||||
// 用户Profile
|
||||
GetUserProfile(ctx context.Context, in *GetUserProfileReq, opts ...grpc.CallOption) (*GetUserProfileResp, error)
|
||||
UpdateUserProfile(ctx context.Context, in *UpdateUserProfileReq, opts ...grpc.CallOption) (*UpdateUserProfileResp, error)
|
||||
IncrUserCounter(ctx context.Context, in *IncrUserCounterReq, opts ...grpc.CallOption) (*IncrUserCounterResp, error)
|
||||
// 植物
|
||||
CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CreatePlantResp, error)
|
||||
UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*UpdatePlantResp, error)
|
||||
DeletePlant(ctx context.Context, in *DeletePlantReq, opts ...grpc.CallOption) (*DeletePlantResp, error)
|
||||
GetPlantList(ctx context.Context, in *GetPlantListReq, opts ...grpc.CallOption) (*GetPlantListResp, error)
|
||||
GetPlantDetail(ctx context.Context, in *GetPlantDetailReq, opts ...grpc.CallOption) (*GetPlantDetailResp, error)
|
||||
// 养护
|
||||
AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*AddCarePlanResp, error)
|
||||
AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*AddCareRecordResp, error)
|
||||
AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*AddGrowthRecordResp, error)
|
||||
// 百科
|
||||
GetWikiList(ctx context.Context, in *GetWikiListReq, opts ...grpc.CallOption) (*GetWikiListResp, error)
|
||||
GetWikiDetail(ctx context.Context, in *GetWikiDetailReq, opts ...grpc.CallOption) (*GetWikiDetailResp, error)
|
||||
GetWikiClassList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetWikiClassListResp, error)
|
||||
CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CreateWikiClassResp, error)
|
||||
ToggleStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*ToggleStarResp, error)
|
||||
// 社区
|
||||
CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CreatePostResp, error)
|
||||
GetPostList(ctx context.Context, in *GetPostListReq, opts ...grpc.CallOption) (*GetPostListResp, error)
|
||||
GetPostDetail(ctx context.Context, in *GetPostDetailReq, opts ...grpc.CallOption) (*GetPostDetailResp, error)
|
||||
DeletePost(ctx context.Context, in *DeletePostReq, opts ...grpc.CallOption) (*DeletePostResp, error)
|
||||
CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommentPostResp, error)
|
||||
LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*LikePostResp, error)
|
||||
// 话题
|
||||
GetTopicList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetTopicListResp, error)
|
||||
CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CreateTopicResp, error)
|
||||
DeleteTopic(ctx context.Context, in *DeleteTopicReq, opts ...grpc.CallOption) (*DeleteTopicResp, error)
|
||||
// 配置
|
||||
GetLevelConfigList(ctx context.Context, in *GetLevelConfigListReq, opts ...grpc.CallOption) (*GetLevelConfigListResp, error)
|
||||
GetBadgeConfigList(ctx context.Context, in *GetBadgeConfigListReq, opts ...grpc.CallOption) (*GetBadgeConfigListResp, error)
|
||||
// 兑换
|
||||
GetExchangeItemList(ctx context.Context, in *GetExchangeItemListReq, opts ...grpc.CallOption) (*GetExchangeItemListResp, error)
|
||||
CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CreateExchangeOrderResp, error)
|
||||
}
|
||||
|
||||
defaultPlantService struct {
|
||||
cli zrpc.Client
|
||||
}
|
||||
)
|
||||
|
||||
func NewPlantService(cli zrpc.Client) PlantService {
|
||||
return &defaultPlantService{
|
||||
cli: cli,
|
||||
}
|
||||
}
|
||||
|
||||
// 用户Profile
|
||||
func (m *defaultPlantService) GetUserProfile(ctx context.Context, in *GetUserProfileReq, opts ...grpc.CallOption) (*GetUserProfileResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetUserProfile(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) UpdateUserProfile(ctx context.Context, in *UpdateUserProfileReq, opts ...grpc.CallOption) (*UpdateUserProfileResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.UpdateUserProfile(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) IncrUserCounter(ctx context.Context, in *IncrUserCounterReq, opts ...grpc.CallOption) (*IncrUserCounterResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.IncrUserCounter(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 植物
|
||||
func (m *defaultPlantService) CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CreatePlantResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreatePlant(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*UpdatePlantResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.UpdatePlant(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeletePlant(ctx context.Context, in *DeletePlantReq, opts ...grpc.CallOption) (*DeletePlantResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeletePlant(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetPlantList(ctx context.Context, in *GetPlantListReq, opts ...grpc.CallOption) (*GetPlantListResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetPlantList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetPlantDetail(ctx context.Context, in *GetPlantDetailReq, opts ...grpc.CallOption) (*GetPlantDetailResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetPlantDetail(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 养护
|
||||
func (m *defaultPlantService) AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*AddCarePlanResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.AddCarePlan(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*AddCareRecordResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.AddCareRecord(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*AddGrowthRecordResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.AddGrowthRecord(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 百科
|
||||
func (m *defaultPlantService) GetWikiList(ctx context.Context, in *GetWikiListReq, opts ...grpc.CallOption) (*GetWikiListResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetWikiList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetWikiDetail(ctx context.Context, in *GetWikiDetailReq, opts ...grpc.CallOption) (*GetWikiDetailResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetWikiDetail(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetWikiClassList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetWikiClassListResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetWikiClassList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CreateWikiClassResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreateWikiClass(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) ToggleStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*ToggleStarResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.ToggleStar(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 社区
|
||||
func (m *defaultPlantService) CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CreatePostResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreatePost(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetPostList(ctx context.Context, in *GetPostListReq, opts ...grpc.CallOption) (*GetPostListResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetPostList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetPostDetail(ctx context.Context, in *GetPostDetailReq, opts ...grpc.CallOption) (*GetPostDetailResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetPostDetail(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeletePost(ctx context.Context, in *DeletePostReq, opts ...grpc.CallOption) (*DeletePostResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeletePost(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommentPostResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CommentPost(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*LikePostResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.LikePost(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 话题
|
||||
func (m *defaultPlantService) GetTopicList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetTopicListResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetTopicList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CreateTopicResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreateTopic(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeleteTopic(ctx context.Context, in *DeleteTopicReq, opts ...grpc.CallOption) (*DeleteTopicResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeleteTopic(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 配置
|
||||
func (m *defaultPlantService) GetLevelConfigList(ctx context.Context, in *GetLevelConfigListReq, opts ...grpc.CallOption) (*GetLevelConfigListResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetLevelConfigList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetBadgeConfigList(ctx context.Context, in *GetBadgeConfigListReq, opts ...grpc.CallOption) (*GetBadgeConfigListResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetBadgeConfigList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 兑换
|
||||
func (m *defaultPlantService) GetExchangeItemList(ctx context.Context, in *GetExchangeItemListReq, opts ...grpc.CallOption) (*GetExchangeItemListResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetExchangeItemList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CreateExchangeOrderResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreateExchangeOrder(ctx, in, opts...)
|
||||
}
|
||||
Reference in New Issue
Block a user