Browse Source

pasture: 优化牧场添加

Yi 1 year ago
parent
commit
de56412653

+ 0 - 3
http/handler/statistic/analysis.go

@@ -231,7 +231,6 @@ func SearchPriceStatistics(c *gin.Context) {
 func SearchFeedStatistics(c *gin.Context) {
 	var req operationPb.SearchFeedStatisticsRequest
 	if err := ginutil.BindProto(c, &req); err != nil {
-		fmt.Println("=======001======", err)
 		apierr.AbortBadRequest(c, http.StatusBadRequest, err)
 		return
 	}
@@ -241,7 +240,6 @@ func SearchFeedStatistics(c *gin.Context) {
 		valid.Field(&req.PastureId, valid.Required),
 		valid.Field(&req.StartTime, valid.Required),
 	); err != nil {
-		fmt.Println("=======002======", err)
 		apierr.AbortBadRequest(c, http.StatusBadRequest, err)
 		return
 	}
@@ -254,7 +252,6 @@ func SearchFeedStatistics(c *gin.Context) {
 
 	res, err := middleware.BackendOperation(c).OpsService.SearchFeedStatistics(c, &req)
 	if err != nil {
-		fmt.Println("=======003======", err)
 		apierr.ClassifiedAbort(c, err)
 		return
 	}

+ 2 - 1
model/forage.go

@@ -12,7 +12,7 @@ type Forage struct {
 	Name               string                          `json:"name"`
 	CategoryId         int64                           `json:"category_id"`
 	CategoryName       string                          `json:"category_name"`
-	MaterialType       int64                           `json:"material_type"`
+	MaterialType       int32                           `json:"material_type"`
 	UniqueEncode       string                          `json:"unique_encode"`
 	ForageSourceId     operationPb.ForageSource_Kind   `json:"forage_source_id"`
 	ForageSourceName   string                          `json:"forage_source_name"`
@@ -51,6 +51,7 @@ func NewForage(req *operationPb.AddForageRequest) *Forage {
 		ForageSourceName:   req.ForageSourceName,
 		PlanTypeId:         req.PlanTypeId,
 		PlanTypeName:       req.PlanTypeName,
+		MaterialType:       req.MaterialType,
 		SmallMaterialScale: req.SmallMaterialScale,
 		AllowError:         int64(req.AllowError),
 		PackageWeight:      int64(req.PackageWeight),

+ 1 - 1
model/group_pasture.go

@@ -195,7 +195,6 @@ func (p *PastureClient) GetToken() error {
 		return xerr.WithStack(err)
 	}
 
-	fmt.Println("===body==========", string(b))
 	req, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(b))
 	if err != nil {
 		zaplog.Error("PastureClient", zap.Any("GetToken", err))
@@ -233,6 +232,7 @@ func (g GroupPastureSlice) ToPB() []*operationPb.AddPastureRequest {
 			ManagerUser:     v.ManagerUser,
 			ManagerPhone:    v.ManagerPhone,
 			Address:         v.Address,
+			Domain:          v.Domain,
 			IsShow:          v.IsShow,
 			CreatedAt:       int32(v.CreatedAt),
 			CreatedAtFormat: time.Unix(v.CreatedAt, 0).Format(LayoutTime),

+ 1 - 0
module/backend/pasture_service.go

@@ -540,6 +540,7 @@ func (s *StoreEntry) EditForage(ctx context.Context, req *operationPb.AddForageR
 		Name:               req.Name,
 		CategoryId:         int64(req.CategoryId),
 		CategoryName:       req.CategoryName,
+		MaterialType:       req.MaterialType,
 		UniqueEncode:       req.UniqueEncode,
 		ForageSourceId:     req.ForageSourceId,
 		PlanTypeId:         req.PlanTypeId,