print.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package api
  2. import (
  3. "github.com/gin-gonic/gin"
  4. )
  5. func Printr(c *gin.Context, apictx *ApiSession) (interface{}, error) {
  6. // products := []*model.ProductBill{}
  7. // repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
  8. // CollectName: repo.CollectionBillProduct,
  9. // Query: repo.Map{"isAck": nil},
  10. // Project: []string{"isAck"},
  11. // }, &products)
  12. // fmt.Println(len(products))
  13. // for _, product := range products {
  14. // fmt.Println(product.Id.Hex())
  15. // fmt.Println(product.IsAck)
  16. // notAck := false
  17. // repo.RepoUpdateSetDocsProps(apictx.CreateRepoCtx(), &repo.DocFilterOptions{
  18. // CollectName: repo.CollectionBillProduct,
  19. // Query: repo.Map{"isAck": nil},
  20. // }, &model.ProductBill{IsAck: &notAck})
  21. // }
  22. // return products, nil
  23. // produces := []*model.ProduceBill{}
  24. // repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
  25. // CollectName: repo.CollectionBillProduce,
  26. // Query: repo.Map{"isAck": nil},
  27. // Project: []string{"isAck"},
  28. // }, &produces)
  29. // for _, produce := range produces {
  30. // fmt.Println(produce.Id.Hex())
  31. // fmt.Println(produce.IsAck)
  32. // notAck := false
  33. // repo.RepoUpdateSetDocsProps(apictx.CreateRepoCtx(), &repo.DocFilterOptions{
  34. // CollectName: repo.CollectionBillProduce,
  35. // Query: repo.Map{"isAck": nil},
  36. // }, &model.ProduceBill{IsAck: &notAck})
  37. // }
  38. // return produces, nil
  39. // purchases := []*model.PurchaseBill{}
  40. // repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
  41. // CollectName: repo.CollectionBillPurchase,
  42. // Query: repo.Map{"isAck": nil},
  43. // Project: []string{"isAck"},
  44. // }, &purchases)
  45. // for _, purchase := range purchases {
  46. // fmt.Println(purchase.Id.Hex())
  47. // fmt.Println(purchase.IsAck)
  48. // notAck := false
  49. // repo.RepoUpdateSetDocsProps(apictx.CreateRepoCtx(), &repo.DocFilterOptions{
  50. // CollectName: repo.CollectionBillPurchase,
  51. // Query: repo.Map{"isAck": nil},
  52. // }, &model.PurchaseBill{IsAck: &notAck})
  53. // }
  54. // return purchases, nil
  55. return nil, nil
  56. }