You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 satır
965B

  1. package main
  2. import (
  3. "os"
  4. )
  5. // a description of
  6. type chatProcedure struct {
  7. init func(*openIDSessionData) //house keeping
  8. clean func(*openIDSessionData) //house keeping
  9. start func(*openIDSessionData, InWechatMsg) //for first message
  10. serve func(*openIDSessionData, InWechatMsg) //for all subsequent message
  11. summary func(*openIDSessionData) //after all message has been done
  12. intro func(*openIDSessionData) //initial text/video/voice introduction
  13. }
  14. //AllProc all procedure that we implemented
  15. var AllProc = map[string]chatProcedure{}
  16. func initAllProc() {
  17. AllProc["Dummy"] = procDummy
  18. //Simple Echo Proc
  19. AllProc["Echo"] = procEcho
  20. //Get Basic UserInfo
  21. AllProc["GetUserBasicInfo"] = procGetBasicUserInfo
  22. }
  23. func getProcedurePath(openID, ProcedureName string) (path string) {
  24. path = procedureDir + string(os.PathSeparator) + ProcedureName + string(os.PathSeparator) + openID + ".json"
  25. ensurePathExist(path)
  26. return
  27. }