dao.go 701 B

123456789101112131415161718192021222324252627282930
  1. package sobot
  2. import (
  3. "go-common/app/service/main/workflow/conf"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. // Dao it
  7. type Dao struct {
  8. c *conf.Config
  9. ticketInfoURL string
  10. ticketAddURL string
  11. ticketModifyURL string
  12. replyAddURL string
  13. // sobot httpclient
  14. httpSobot *bm.Client
  15. }
  16. // New Dao
  17. func New(c *conf.Config) (d *Dao) {
  18. d = &Dao{
  19. c: c,
  20. httpSobot: bm.NewClient(c.HTTPClient.Sobot),
  21. ticketInfoURL: c.Host.ServiceURI + _sobotTicketInfoURL,
  22. ticketAddURL: c.Host.ServiceURI + _sobotAddTicketURL,
  23. ticketModifyURL: c.Host.ServiceURI + _sobotTicketModifyURL,
  24. replyAddURL: c.Host.ServiceURI + _sobotAddReplyURL,
  25. }
  26. return
  27. }