                         tagPath += funcName
                     }
                     
-                }else {
-                    
-                    let pathesName = generatePathComponent(pathName: path, tagName: tag).enumerated().map({ (offset, elem) -> String in
+                }
+                else {
+                    
+                    let pathesComponent = generatePathComponent(pathName: path, tagName: tag)
+                    
+                    let pathesName = pathesComponent.enumerated().map({ (offset, elem) -> String in
                         if offset == 0 {
                             return elem
                         }

                        print(structObjectCode)
                        print("🍎----------------------------🍎")
                        
                        try? structObjectCode.write(toFile: "/Users/Binglin/Documents/MyselfProjects/JSONFactory/CodeFactory/Entity/\(entityName).swift", atomically: true, encoding: String.Encoding.utf8)
                    }
                    
                }

                    
                    tagPath += pathCode
                    
                    let serviceFuncName = pathesComponent.map{ $0.capitalized }.joined()
                

                    serviceImplCode += "\n"
                    serviceImplCode += whiteTab
                    serviceImplCode += "public func \(pathObj.method)\(serviceFuncName)("
                    
                    var paramsBuilder = "\n" + whiteTab + whiteTab
                    
                    paramsBuilder += "var params: [String: Any] = [:]\n"
                    
                    if let parameters = pathObj.operation?.parameters {
                        
                        
                        let paramObjects = parameters.filter({ (obj) -> Bool in
                            
                            if let `in` = obj.in {
                                return `in` == .query
                            }
                            return false
                        })
                        
                        let funcParameter = paramObjects.flatMap({ (obj) -> String? in
                            guard let name = obj.name, let type = obj.type?.swiftType() else {
                                return nil
                            }
                            
                            return name + ": " + type
                        })
                        
                        serviceImplCode += funcParameter.joined(separator: ", ")
                        
                        paramObjects.forEach({ (obj) in
                            
                            if let name = obj.name {
                                paramsBuilder += whiteTab
                                paramsBuilder += whiteTab
                                paramsBuilder += "params[\"\(name)\"] = \(name)\n"
                            }
                        })
                    }
                    
                    serviceImplCode += ") -> SignalProducer<Any, NSError> {"
                    serviceImplCode += whiteTab
                    serviceImplCode += paramsBuilder
                    serviceImplCode += whiteTab
                    serviceImplCode += whiteTab
                    serviceImplCode += "return request(path: .\(pathesName), method: .\(pathObj.method), parameters: params)"
                    serviceImplCode += "\n"
                    serviceImplCode += whiteTab
                    serviceImplCode += "}\n\n"
                    
                    
                    print("✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨\n")
                    print(serviceImplCode)
                    print("✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨\n")
                    
                }
            }
            
            tagPath += "}"
//            print("✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨\n")
//            print(tagPath)
            
            tagPath += "\n\n\n"
            
            serviceImplCode += "}"
            
            tagPath += serviceImplCode
//            tagPath += "}\n"
            
            
            
            do {
