|
|
@@ -176,6 +176,30 @@ func (c *EngineClient) GenerateToPath(xmlfile string,dest_path string) {
|
|
|
|
|
|
func (c *EngineClient) Generate(xmlfile string) {
|
|
|
c.GenerateToPath(xmlfile, "")
|
|
|
+ c.GenSwagger(xmlfile)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *EngineClient) GenSwagger(xmlfile string){
|
|
|
+ server := "http://swagger.qianqiusoft.com"
|
|
|
+ server += "/api/v1/upload"
|
|
|
+
|
|
|
+ request, err := newfileUploadRequest(server, nil, "xmlfile", xmlfile)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ }
|
|
|
+ client := &http.Client{}
|
|
|
+ resp, err := client.Do(request)
|
|
|
+ if err != nil{
|
|
|
+ fmt.Println("===========================================================================>", err.Error())
|
|
|
+ }else{
|
|
|
+ defer resp.Body.Close()
|
|
|
+ bytess, err := ioutil.ReadAll(resp.Body)
|
|
|
+ if err != nil{
|
|
|
+ fmt.Println("=======================================>ioutil.ReadAll error", err.Error())
|
|
|
+ }else{
|
|
|
+ fmt.Println("=======================================>", string(bytess))
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|