init: init refactor
This commit is contained in:
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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user