Browse Source

revise proc interface to include sessionData

master
Patrick Peng Sun 8 years ago
parent
commit
2dcd2f58f4
5 changed files with 25 additions and 24 deletions
  1. +7
    -7
      procDummy.go
  2. +6
    -6
      procEcho.go
  3. +6
    -6
      procGetBasicUserInfo.go
  4. +4
    -4
      procedure.go
  5. +2
    -1
      serveCommand.go

+ 7
- 7
procDummy.go View File

dummyInto, dummyInto,
} }


func dummyInit() {
func dummyInit(ss *openIDSessionData) {


} }


func dummyClean() {
func dummyClean(ss *openIDSessionData) {


} }
func dummyStart(*openIDSessionData, InWechatMsg) {
func dummyStart(ss *openIDSessionData, in InWechatMsg) {


} }


func dummyServe(*openIDSessionData, InWechatMsg) {
func dummyServe(ss *openIDSessionData, in InWechatMsg) {


} }
func dummySummary() {
func dummySummary(ss *openIDSessionData) {


} }


func dummyInto() {
func dummyInto(ss *openIDSessionData) {


}
}

+ 6
- 6
procEcho.go View File

echoInto, echoInto,
} }


func echoInit() {
func echoInit(ss *openIDSessionData) {


} }


func echoClean() {
func echoClean(ss *openIDSessionData) {


} }
func echoStart(*openIDSessionData, InWechatMsg) {
func echoStart(ss *openIDSessionData, in InWechatMsg) {


} }


func echoServe(*openIDSessionData, InWechatMsg) {
func echoServe(ss *openIDSessionData, in InWechatMsg) {


} }
func echoSummary() {
func echoSummary(ss *openIDSessionData) {


} }


func echoInto() {
func echoInto(ss *openIDSessionData) {


} }

+ 6
- 6
procGetBasicUserInfo.go View File

getBasicUserInfoInto, getBasicUserInfoInto,
} }


func getBasicUserInfoInit() {
func getBasicUserInfoInit(ss *openIDSessionData) {


} }


func getBasicUserInfoClean() {
func getBasicUserInfoClean(ss *openIDSessionData) {


} }
func getBasicUserInfoStart(*openIDSessionData, InWechatMsg) {
func getBasicUserInfoStart(ss *openIDSessionData, in InWechatMsg) {


} }


func getBasicUserInfoServe(*openIDSessionData, InWechatMsg) {
func getBasicUserInfoServe(ss *openIDSessionData, in InWechatMsg) {


} }
func getBasicUserInfoSummary() {
func getBasicUserInfoSummary(ss *openIDSessionData) {


} }


func getBasicUserInfoInto() {
func getBasicUserInfoInto(ss *openIDSessionData) {


} }

+ 4
- 4
procedure.go View File



// a description of // a description of
type chatProcedure struct { type chatProcedure struct {
init func() //house keeping
clean func() //house keeping
init func(*openIDSessionData) //house keeping
clean func(*openIDSessionData) //house keeping


start func(*openIDSessionData, InWechatMsg) //for first message start func(*openIDSessionData, InWechatMsg) //for first message
serve func(*openIDSessionData, InWechatMsg) //for all subsequent message serve func(*openIDSessionData, InWechatMsg) //for all subsequent message
summary func() //after all message has been done
intro func() //initial text/video/voice introduction
summary func(*openIDSessionData) //after all message has been done
intro func(*openIDSessionData) //initial text/video/voice introduction
} }


//AllProc all procedure that we implemented //AllProc all procedure that we implemented

+ 2
- 1
serveCommand.go View File

} }


func cmdEcho(ss *openIDSessionData, in InWechatMsg) (processed bool) { func cmdEcho(ss *openIDSessionData, in InWechatMsg) (processed bool) {
procEcho.init()
in.immediateResponse("请输入不同类型的微信信息,比如文字,图片,视频,地址,链接,我们将原样回应您")
procEcho.init(ss)
procEcho.start(ss, in) procEcho.start(ss, in)
return return
} }

Loading…
Cancel
Save