Initial qiwei secondary development handoff
This commit is contained in:
27
helper/wxwork_instance_http.go
Normal file
27
helper/wxwork_instance_http.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import "net/http"
|
||||
|
||||
func handleWxWorkNewInstance(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodPost {
|
||||
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
bundle := resolveDLLBundle()
|
||||
if bundle.HelperPath == "" {
|
||||
sendJSONResponse(w, http.StatusInternalServerError, map[string]interface{}{
|
||||
"success": false,
|
||||
"message": "helper DLL is unavailable: " + bundle.Message,
|
||||
})
|
||||
return
|
||||
}
|
||||
result, err := startAdditionalWxWorkInstance(bundle.HelperPath)
|
||||
if err != nil {
|
||||
sendJSONResponse(w, http.StatusInternalServerError, map[string]interface{}{
|
||||
"success": false,
|
||||
"message": err.Error(),
|
||||
})
|
||||
return
|
||||
}
|
||||
sendJSONResponse(w, http.StatusOK, result)
|
||||
}
|
||||
Reference in New Issue
Block a user