Browse Source

category: 牧场端分类数据同步

Yi 1 year ago
parent
commit
2db1857d33

+ 10 - 0
backend/operation/pasture.proto

@@ -266,4 +266,14 @@ message FormulaTypeEnum {
 message FormulaOptionEnum {
   int32 value = 1;
   string label = 2;
+}
+// 牧场端分类数据同步
+message ClassRequest {
+  string key_word = 1;     // 关键字
+  int32 pasture_id = 2;    // 牧场id
+  int32 parent_id = 3;    // 一类id
+  string parent_name = 4; // 一类名称
+  string name = 5;     // 分类名称
+  string number = 6;    // 分类编号
+  IsShow.Kind is_show = 7;  // 是否展示
 }

+ 41 - 0
http/handler/pasture/pasture.go

@@ -0,0 +1,41 @@
+package pasture
+
+import (
+	"kpt-tmr-group/http/middleware"
+	"kpt-tmr-group/pkg/apierr"
+	"kpt-tmr-group/pkg/ginutil"
+	"kpt-tmr-group/pkg/valid"
+	operationPb "kpt-tmr-group/proto/go/backend/operation"
+	"net/http"
+
+	"github.com/gin-gonic/gin"
+)
+
+// ClassSync 牧场分类数据同步
+func ClassSync(c *gin.Context) {
+	var req operationPb.ClassRequest
+	if err := ginutil.BindProto(c, &req); err != nil {
+		apierr.AbortBadRequest(c, http.StatusBadRequest, err)
+		return
+	}
+
+	if err := valid.ValidateStruct(&req,
+		valid.Field(&req.KeyWord, valid.Required),
+		valid.Field(&req.PastureId, valid.Required),
+		valid.Field(&req.ParentId, valid.Required),
+	); err != nil {
+		apierr.AbortBadRequest(c, http.StatusBadRequest, err)
+		return
+	}
+
+	if err := middleware.Dependency(c).StoreEventHub.OpsService.CategoryData(c, &req); err != nil {
+		apierr.ClassifiedAbort(c, err)
+		return
+	}
+
+	ginutil.JSONResp(c, &operationPb.CommonOK{
+		Code: http.StatusOK,
+		Msg:  "ok",
+		Data: &operationPb.Success{Success: true},
+	})
+}

+ 17 - 0
http/route/pasture.go

@@ -0,0 +1,17 @@
+package route
+
+import (
+	"kpt-tmr-group/http/handler/pasture"
+
+	"github.com/gin-gonic/gin"
+)
+
+func PastureAPI(opts ...func(engine *gin.Engine)) func(s *gin.Engine) {
+	return func(s *gin.Engine) {
+		for _, opt := range opts {
+			opt(s)
+		}
+
+		s.POST("/group/class/sync", pasture.ClassSync)
+	}
+}

+ 1 - 0
http/route/route.go

@@ -9,6 +9,7 @@ func HTTPServerRoute(opts ...func(engine *gin.Engine)) func(s *gin.Engine) {
 		SystemAPI(opts...),
 		DebugAPI(opts...),
 		OpsAPI(opts...),
+		PastureAPI(opts...),
 	}
 
 	return func(s *gin.Engine) {

+ 15 - 0
model/cattle_category.go

@@ -68,3 +68,18 @@ func (c *CattleCategory) ToPb() *operationPb.AddCattleCategoryRequest {
 		CreatedAt:  uint32(c.CreatedAt),
 	}
 }
+
+func NewPastureCattleCategory(req *operationPb.ClassRequest, pastureDetail *GroupPasture) *CattleCategory {
+	return &CattleCategory{
+		ParentId:    operationPb.CattleCategoryParent_Kind(req.ParentId),
+		ParentName:  req.ParentName,
+		PastureId:   int64(req.PastureId),
+		PastureName: pastureDetail.Name,
+		Name:        req.Name,
+		Number:      req.Number,
+		IsShow:      req.IsShow,
+		IsDelete:    operationPb.IsShow_NO,
+		DataSource:  operationPb.DataSource_FROM_PASTURE,
+		Remarks:     "牧场端数据同步",
+	}
+}

+ 23 - 8
model/forage_category.go

@@ -57,14 +57,29 @@ func (f ForageCategorySlice) ToPB() []*operationPb.AddForageCategoryRequest {
 	return res
 }
 
-func (c *ForageCategory) ToPb() *operationPb.AddForageCategoryRequest {
+func (f *ForageCategory) ToPb() *operationPb.AddForageCategoryRequest {
 	return &operationPb.AddForageCategoryRequest{
-		Id:         uint32(c.Id),
-		Name:       c.Name,
-		Number:     c.Number,
-		ParentId:   c.ParentId,
-		ParentName: c.ParentName,
-		IsShow:     c.IsShow,
-		CreatedAt:  uint32(c.CreatedAt),
+		Id:         uint32(f.Id),
+		Name:       f.Name,
+		Number:     f.Number,
+		ParentId:   f.ParentId,
+		ParentName: f.ParentName,
+		IsShow:     f.IsShow,
+		CreatedAt:  uint32(f.CreatedAt),
+	}
+}
+
+func NewPastureForageCategory(req *operationPb.ClassRequest, pastureDetail *GroupPasture) *ForageCategory {
+	return &ForageCategory{
+		ParentId:    operationPb.ForageCategoryParent_Kind(req.ParentId),
+		ParentName:  req.ParentName,
+		PastureId:   int64(req.PastureId),
+		PastureName: pastureDetail.Name,
+		Name:        req.Name,
+		Number:      req.Number,
+		IsShow:      req.IsShow,
+		IsDelete:    operationPb.IsShow_NO,
+		DataSource:  operationPb.DataSource_FROM_PASTURE,
+		Remarks:     "牧场端数据同步",
 	}
 }

+ 9 - 4
module/backend/interface.go

@@ -43,10 +43,11 @@ func NewStoreEntry(cfg *config.AppConfig, Db *kptstore.DB) *StoreEntry {
 
 //go:generate mockgen -destination mock/kptservice.go -package kptservicemock kpt-tmr-group/module/backend KptService
 type KptService interface {
-	PastureService   // 牧场相关操作
-	SystemService    // 系统相关操作
-	WxAppletService  // 小程序相关
-	StatisticService // 统计分析
+	PastureService     // 牧场相关操作
+	SystemService      // 系统相关操作
+	WxAppletService    // 小程序相关
+	StatisticService   // 统计分析
+	PastureSyncService // 牧场端数据同步
 }
 
 type PastureService interface {
@@ -158,3 +159,7 @@ type StatisticService interface {
 type WxAppletService interface {
 	GetOpenId(ctx context.Context, jsCode string) (*operationPb.WxOpenId, error)
 }
+
+type PastureSyncService interface {
+	CategoryData(ctx context.Context, req *operationPb.ClassRequest) error
+}

+ 34 - 0
module/backend/pasture_sync_service.go

@@ -0,0 +1,34 @@
+package backend
+
+import (
+	"context"
+	"kpt-tmr-group/model"
+	"kpt-tmr-group/pkg/xerr"
+	operationPb "kpt-tmr-group/proto/go/backend/operation"
+)
+
+const (
+	FeedCategory = "feed"
+	CowCategory  = "cow"
+)
+
+func (s *StoreEntry) CategoryData(ctx context.Context, req *operationPb.ClassRequest) error {
+
+	pastureDateil, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
+	if err != nil {
+		return xerr.WithStack(err)
+	}
+	switch req.KeyWord {
+	case FeedCategory:
+		newFeedData := model.NewPastureForageCategory(req, pastureDateil)
+		if err := s.DB.Model(new(model.ForageCategory)).Create(newFeedData).Error; err != nil {
+			return xerr.WithStack(err)
+		}
+	case CowCategory:
+		newCattleData := model.NewPastureCattleCategory(req, pastureDateil)
+		if err := s.DB.Model(new(model.CattleCategory)).Create(newCattleData).Error; err != nil {
+			return xerr.WithStack(err)
+		}
+	}
+	return nil
+}

+ 172 - 47
proto/go/backend/operation/pasture.pb.go

@@ -2570,6 +2570,102 @@ func (x *FormulaOptionEnum) GetLabel() string {
 	return ""
 }
 
+// 牧场端分类数据同步
+type ClassRequest struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	KeyWord    string      `protobuf:"bytes,1,opt,name=key_word,json=keyWord,proto3" json:"key_word,omitempty"`                                  // 关键字
+	PastureId  int32       `protobuf:"varint,2,opt,name=pasture_id,json=pastureId,proto3" json:"pasture_id,omitempty"`                           // 牧场id
+	ParentId   int32       `protobuf:"varint,3,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`                              // 一类id
+	ParentName string      `protobuf:"bytes,4,opt,name=parent_name,json=parentName,proto3" json:"parent_name,omitempty"`                         // 一类名称
+	Name       string      `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`                                                       // 分类名称
+	Number     string      `protobuf:"bytes,6,opt,name=number,proto3" json:"number,omitempty"`                                                   // 分类编号
+	IsShow     IsShow_Kind `protobuf:"varint,7,opt,name=is_show,json=isShow,proto3,enum=backend.operation.IsShow_Kind" json:"is_show,omitempty"` // 是否展示
+}
+
+func (x *ClassRequest) Reset() {
+	*x = ClassRequest{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_backend_operation_pasture_proto_msgTypes[34]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *ClassRequest) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ClassRequest) ProtoMessage() {}
+
+func (x *ClassRequest) ProtoReflect() protoreflect.Message {
+	mi := &file_backend_operation_pasture_proto_msgTypes[34]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use ClassRequest.ProtoReflect.Descriptor instead.
+func (*ClassRequest) Descriptor() ([]byte, []int) {
+	return file_backend_operation_pasture_proto_rawDescGZIP(), []int{34}
+}
+
+func (x *ClassRequest) GetKeyWord() string {
+	if x != nil {
+		return x.KeyWord
+	}
+	return ""
+}
+
+func (x *ClassRequest) GetPastureId() int32 {
+	if x != nil {
+		return x.PastureId
+	}
+	return 0
+}
+
+func (x *ClassRequest) GetParentId() int32 {
+	if x != nil {
+		return x.ParentId
+	}
+	return 0
+}
+
+func (x *ClassRequest) GetParentName() string {
+	if x != nil {
+		return x.ParentName
+	}
+	return ""
+}
+
+func (x *ClassRequest) GetName() string {
+	if x != nil {
+		return x.Name
+	}
+	return ""
+}
+
+func (x *ClassRequest) GetNumber() string {
+	if x != nil {
+		return x.Number
+	}
+	return ""
+}
+
+func (x *ClassRequest) GetIsShow() IsShow_Kind {
+	if x != nil {
+		return x.IsShow
+	}
+	return IsShow_INVALID
+}
+
 var File_backend_operation_pasture_proto protoreflect.FileDescriptor
 
 var file_backend_operation_pasture_proto_rawDesc = []byte{
@@ -3027,8 +3123,23 @@ var file_backend_operation_pasture_proto_rawDesc = []byte{
 	0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
 	0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12,
 	0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
-	0x6c, 0x61, 0x62, 0x65, 0x6c, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x3b, 0x6f, 0x70, 0x65, 0x72, 0x61,
-	0x74, 0x69, 0x6f, 0x6e, 0x50, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x6c, 0x61, 0x62, 0x65, 0x6c, 0x22, 0xeb, 0x01, 0x0a, 0x0c, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x52,
+	0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x77, 0x6f,
+	0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x57, 0x6f, 0x72,
+	0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x73, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x69, 0x64, 0x18,
+	0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x73, 0x74, 0x75, 0x72, 0x65, 0x49, 0x64,
+	0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20,
+	0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a,
+	0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12,
+	0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
+	0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x07, 0x69, 0x73,
+	0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x62, 0x61,
+	0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
+	0x49, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x2e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x06, 0x69, 0x73, 0x53,
+	0x68, 0x6f, 0x77, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x3b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
+	0x6f, 0x6e, 0x50, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -3043,7 +3154,7 @@ func file_backend_operation_pasture_proto_rawDescGZIP() []byte {
 	return file_backend_operation_pasture_proto_rawDescData
 }
 
-var file_backend_operation_pasture_proto_msgTypes = make([]protoimpl.MessageInfo, 34)
+var file_backend_operation_pasture_proto_msgTypes = make([]protoimpl.MessageInfo, 35)
 var file_backend_operation_pasture_proto_goTypes = []interface{}{
 	(*AddPastureRequest)(nil),            // 0: backend.operation.AddPastureRequest
 	(*SearchPastureRequest)(nil),         // 1: backend.operation.SearchPastureRequest
@@ -3079,48 +3190,49 @@ var file_backend_operation_pasture_proto_goTypes = []interface{}{
 	(*IsShowEnum)(nil),                   // 31: backend.operation.IsShowEnum
 	(*FormulaTypeEnum)(nil),              // 32: backend.operation.FormulaTypeEnum
 	(*FormulaOptionEnum)(nil),            // 33: backend.operation.FormulaOptionEnum
-	(IsShow_Kind)(0),                     // 34: backend.operation.IsShow.Kind
-	(*PaginationModel)(nil),              // 35: backend.operation.PaginationModel
-	(CattleCategoryParent_Kind)(0),       // 36: backend.operation.CattleCategoryParent.Kind
-	(ForageCategoryParent_Kind)(0),       // 37: backend.operation.ForageCategoryParent.Kind
-	(ForageSource_Kind)(0),               // 38: backend.operation.ForageSource.Kind
-	(ForagePlanType_Kind)(0),             // 39: backend.operation.ForagePlanType.Kind
-	(JumpDelaType_Kind)(0),               // 40: backend.operation.JumpDelaType.Kind
-	(FormulaType_Kind)(0),                // 41: backend.operation.FormulaType.Kind
+	(*ClassRequest)(nil),                 // 34: backend.operation.ClassRequest
+	(IsShow_Kind)(0),                     // 35: backend.operation.IsShow.Kind
+	(*PaginationModel)(nil),              // 36: backend.operation.PaginationModel
+	(CattleCategoryParent_Kind)(0),       // 37: backend.operation.CattleCategoryParent.Kind
+	(ForageCategoryParent_Kind)(0),       // 38: backend.operation.ForageCategoryParent.Kind
+	(ForageSource_Kind)(0),               // 39: backend.operation.ForageSource.Kind
+	(ForagePlanType_Kind)(0),             // 40: backend.operation.ForagePlanType.Kind
+	(JumpDelaType_Kind)(0),               // 41: backend.operation.JumpDelaType.Kind
+	(FormulaType_Kind)(0),                // 42: backend.operation.FormulaType.Kind
 }
 var file_backend_operation_pasture_proto_depIdxs = []int32{
-	34, // 0: backend.operation.AddPastureRequest.is_show:type_name -> backend.operation.IsShow.Kind
-	35, // 1: backend.operation.SearchPastureRequest.pagination:type_name -> backend.operation.PaginationModel
+	35, // 0: backend.operation.AddPastureRequest.is_show:type_name -> backend.operation.IsShow.Kind
+	36, // 1: backend.operation.SearchPastureRequest.pagination:type_name -> backend.operation.PaginationModel
 	3,  // 2: backend.operation.SearchPastureResponse.data:type_name -> backend.operation.SearchPastureData
 	0,  // 3: backend.operation.SearchPastureData.list:type_name -> backend.operation.AddPastureRequest
-	34, // 4: backend.operation.IsShowGroupPasture.is_show:type_name -> backend.operation.IsShow.Kind
-	36, // 5: backend.operation.AddCattleCategoryRequest.parent_id:type_name -> backend.operation.CattleCategoryParent.Kind
-	34, // 6: backend.operation.AddCattleCategoryRequest.is_show:type_name -> backend.operation.IsShow.Kind
-	34, // 7: backend.operation.IsShowCattleCategory.is_show:type_name -> backend.operation.IsShow.Kind
-	34, // 8: backend.operation.SearchCattleCategoryRequest.is_show:type_name -> backend.operation.IsShow.Kind
-	35, // 9: backend.operation.SearchCattleCategoryRequest.pagination:type_name -> backend.operation.PaginationModel
+	35, // 4: backend.operation.IsShowGroupPasture.is_show:type_name -> backend.operation.IsShow.Kind
+	37, // 5: backend.operation.AddCattleCategoryRequest.parent_id:type_name -> backend.operation.CattleCategoryParent.Kind
+	35, // 6: backend.operation.AddCattleCategoryRequest.is_show:type_name -> backend.operation.IsShow.Kind
+	35, // 7: backend.operation.IsShowCattleCategory.is_show:type_name -> backend.operation.IsShow.Kind
+	35, // 8: backend.operation.SearchCattleCategoryRequest.is_show:type_name -> backend.operation.IsShow.Kind
+	36, // 9: backend.operation.SearchCattleCategoryRequest.pagination:type_name -> backend.operation.PaginationModel
 	10, // 10: backend.operation.SearchCattleCategoryResponse.data:type_name -> backend.operation.SearchCattleCategoryData
 	6,  // 11: backend.operation.SearchCattleCategoryData.list:type_name -> backend.operation.AddCattleCategoryRequest
-	37, // 12: backend.operation.AddForageCategoryRequest.parent_id:type_name -> backend.operation.ForageCategoryParent.Kind
-	34, // 13: backend.operation.AddForageCategoryRequest.is_show:type_name -> backend.operation.IsShow.Kind
-	34, // 14: backend.operation.IsShowForageCategory.is_show:type_name -> backend.operation.IsShow.Kind
-	34, // 15: backend.operation.SearchForageCategoryRequest.is_show:type_name -> backend.operation.IsShow.Kind
-	35, // 16: backend.operation.SearchForageCategoryRequest.pagination:type_name -> backend.operation.PaginationModel
+	38, // 12: backend.operation.AddForageCategoryRequest.parent_id:type_name -> backend.operation.ForageCategoryParent.Kind
+	35, // 13: backend.operation.AddForageCategoryRequest.is_show:type_name -> backend.operation.IsShow.Kind
+	35, // 14: backend.operation.IsShowForageCategory.is_show:type_name -> backend.operation.IsShow.Kind
+	35, // 15: backend.operation.SearchForageCategoryRequest.is_show:type_name -> backend.operation.IsShow.Kind
+	36, // 16: backend.operation.SearchForageCategoryRequest.pagination:type_name -> backend.operation.PaginationModel
 	15, // 17: backend.operation.SearchForageCategoryResponse.data:type_name -> backend.operation.SearchForageCategoryData
 	11, // 18: backend.operation.SearchForageCategoryData.list:type_name -> backend.operation.AddForageCategoryRequest
-	38, // 19: backend.operation.AddForageRequest.forage_source_id:type_name -> backend.operation.ForageSource.Kind
-	39, // 20: backend.operation.AddForageRequest.plan_type_id:type_name -> backend.operation.ForagePlanType.Kind
-	40, // 21: backend.operation.AddForageRequest.jump_delay:type_name -> backend.operation.JumpDelaType.Kind
-	34, // 22: backend.operation.AddForageRequest.confirm_start:type_name -> backend.operation.IsShow.Kind
-	34, // 23: backend.operation.AddForageRequest.jmp:type_name -> backend.operation.IsShow.Kind
-	34, // 24: backend.operation.AddForageRequest.is_show:type_name -> backend.operation.IsShow.Kind
-	34, // 25: backend.operation.SearchForageListRequest.is_show:type_name -> backend.operation.IsShow.Kind
-	40, // 26: backend.operation.SearchForageListRequest.jump_delay:type_name -> backend.operation.JumpDelaType.Kind
-	35, // 27: backend.operation.SearchForageListRequest.pagination:type_name -> backend.operation.PaginationModel
+	39, // 19: backend.operation.AddForageRequest.forage_source_id:type_name -> backend.operation.ForageSource.Kind
+	40, // 20: backend.operation.AddForageRequest.plan_type_id:type_name -> backend.operation.ForagePlanType.Kind
+	41, // 21: backend.operation.AddForageRequest.jump_delay:type_name -> backend.operation.JumpDelaType.Kind
+	35, // 22: backend.operation.AddForageRequest.confirm_start:type_name -> backend.operation.IsShow.Kind
+	35, // 23: backend.operation.AddForageRequest.jmp:type_name -> backend.operation.IsShow.Kind
+	35, // 24: backend.operation.AddForageRequest.is_show:type_name -> backend.operation.IsShow.Kind
+	35, // 25: backend.operation.SearchForageListRequest.is_show:type_name -> backend.operation.IsShow.Kind
+	41, // 26: backend.operation.SearchForageListRequest.jump_delay:type_name -> backend.operation.JumpDelaType.Kind
+	36, // 27: backend.operation.SearchForageListRequest.pagination:type_name -> backend.operation.PaginationModel
 	19, // 28: backend.operation.ForageListSortRequest.list:type_name -> backend.operation.ForageListSort
 	22, // 29: backend.operation.SearchForageListResponse.data:type_name -> backend.operation.SearchForageList
 	16, // 30: backend.operation.SearchForageList.list:type_name -> backend.operation.AddForageRequest
-	34, // 31: backend.operation.IsShowForage.is_show:type_name -> backend.operation.IsShow.Kind
+	35, // 31: backend.operation.IsShowForage.is_show:type_name -> backend.operation.IsShow.Kind
 	25, // 32: backend.operation.ForageEnumListResponse.data:type_name -> backend.operation.ForageEnumList
 	26, // 33: backend.operation.ForageEnumList.forage_source:type_name -> backend.operation.ForageSourceEnum
 	27, // 34: backend.operation.ForageEnumList.forage_plan_type:type_name -> backend.operation.ForagePlanTypeEnum
@@ -3137,18 +3249,19 @@ var file_backend_operation_pasture_proto_depIdxs = []int32{
 	33, // 45: backend.operation.ForageEnumList.price_materials_type:type_name -> backend.operation.FormulaOptionEnum
 	33, // 46: backend.operation.ForageEnumList.jump_type:type_name -> backend.operation.FormulaOptionEnum
 	33, // 47: backend.operation.ForageEnumList.statistics_type:type_name -> backend.operation.FormulaOptionEnum
-	38, // 48: backend.operation.ForageSourceEnum.value:type_name -> backend.operation.ForageSource.Kind
-	39, // 49: backend.operation.ForagePlanTypeEnum.value:type_name -> backend.operation.ForagePlanType.Kind
-	40, // 50: backend.operation.JumpDelaTypeEnum.value:type_name -> backend.operation.JumpDelaType.Kind
-	36, // 51: backend.operation.CattleParentCategoryEnum.value:type_name -> backend.operation.CattleCategoryParent.Kind
-	37, // 52: backend.operation.ForageParentCategoryEnum.value:type_name -> backend.operation.ForageCategoryParent.Kind
-	34, // 53: backend.operation.IsShowEnum.value:type_name -> backend.operation.IsShow.Kind
-	41, // 54: backend.operation.FormulaTypeEnum.value:type_name -> backend.operation.FormulaType.Kind
-	55, // [55:55] is the sub-list for method output_type
-	55, // [55:55] is the sub-list for method input_type
-	55, // [55:55] is the sub-list for extension type_name
-	55, // [55:55] is the sub-list for extension extendee
-	0,  // [0:55] is the sub-list for field type_name
+	39, // 48: backend.operation.ForageSourceEnum.value:type_name -> backend.operation.ForageSource.Kind
+	40, // 49: backend.operation.ForagePlanTypeEnum.value:type_name -> backend.operation.ForagePlanType.Kind
+	41, // 50: backend.operation.JumpDelaTypeEnum.value:type_name -> backend.operation.JumpDelaType.Kind
+	37, // 51: backend.operation.CattleParentCategoryEnum.value:type_name -> backend.operation.CattleCategoryParent.Kind
+	38, // 52: backend.operation.ForageParentCategoryEnum.value:type_name -> backend.operation.ForageCategoryParent.Kind
+	35, // 53: backend.operation.IsShowEnum.value:type_name -> backend.operation.IsShow.Kind
+	42, // 54: backend.operation.FormulaTypeEnum.value:type_name -> backend.operation.FormulaType.Kind
+	35, // 55: backend.operation.ClassRequest.is_show:type_name -> backend.operation.IsShow.Kind
+	56, // [56:56] is the sub-list for method output_type
+	56, // [56:56] is the sub-list for method input_type
+	56, // [56:56] is the sub-list for extension type_name
+	56, // [56:56] is the sub-list for extension extendee
+	0,  // [0:56] is the sub-list for field type_name
 }
 
 func init() { file_backend_operation_pasture_proto_init() }
@@ -3567,6 +3680,18 @@ func file_backend_operation_pasture_proto_init() {
 				return nil
 			}
 		}
+		file_backend_operation_pasture_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*ClassRequest); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
 	}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
@@ -3574,7 +3699,7 @@ func file_backend_operation_pasture_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_backend_operation_pasture_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   34,
+			NumMessages:   35,
 			NumExtensions: 0,
 			NumServices:   0,
 		},