tree.go 977 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package bus
  2. import (
  3. "infish.cn/comm"
  4. )
  5. type TreeAddDefMatgroupReq struct {
  6. DbName string
  7. UserId string
  8. Name string
  9. }
  10. type TreeRemoveDefMatgroupReq struct {
  11. DbId string
  12. DefineId string
  13. }
  14. type TreeAddDefineResp struct {
  15. Host string
  16. DbId string
  17. DefineId string
  18. Collection string
  19. }
  20. // 对queentree数据操作
  21. func TreeAddDefineMeshpack(DbName, UserId, Name string) (resp *TreeAddDefineResp, err error) {
  22. req := &TreeAddDefMatgroupReq{DbName: DbName, UserId: UserId, Name: Name}
  23. out := &TreeAddDefineResp{}
  24. // 调用queentree包中的接口
  25. err = NatsCenter.RequestPackApi("tree.define.add.meshpack", req, out, &comm.RequestOptions{
  26. DeployPack: "queentree",
  27. })
  28. return out, err
  29. }
  30. func TreeRemoveDefineMeshpack(DbId, defineId string) error {
  31. req := &TreeRemoveDefMatgroupReq{DbId: DbId, DefineId: defineId}
  32. return NatsCenter.RequestPackApi("tree.define.remove.meshpack", req, nil, &comm.RequestOptions{
  33. DeployPack: "queentree",
  34. })
  35. }