<commit_before>//
//  CAlamofireManager.swift
//  RRArt-Swift
//
//  Created by wtj on 16/4/27.
//  Copyright © 2016年 com.yibei.renrenmeishu. All rights reserved.
//

import UIKit
import SVProgressHUD

let kShopProductsClassinfoUrl =  "http://app.renrenmeishu.com:20100/v1/products/classinfo"

private let instance = CAlamofireManager()

class CAlamofireManager: NSObject {
    
    class var shareTools:CAlamofireManager{
        
        return instance
        
    }
    
    /**
     商城首页数据
     */
    func tMallHomeDataRequest(param:[String:AnyObject]?,complectionHandler: HTTPRequestHandler?) -> Void {
        
        var params = ["limit":20,"sortby":"Sortid","order":"desc"]
        SVProgressHUD.showWithStatus("正在加载...")
        
        if param != nil{
            for (key,value) in param! {
                params[key] = (value as! NSObject)
            }
        }
        
        CAlamofireClient.shareClient.dataRequest(method: .GET, urlString: kShopProductsClassinfoUrl, parameter: params, complectionHandler: { (responseObject) in
            
            SVProgressHUD.showSuccessWithStatus("加载成功")
            complectionHandler!(responseObject: responseObject!["ClassInfo"])
            
        }) { (error) in<commit_msg>我又不知道该什么东西了<commit_after>//
//  CAlamofireManager.swift
//  RRArt-Swift
//
//  Created by wtj on 16/4/27.
//  Copyright © 2016年 com.yibei.renrenmeishu. All rights reserved.
//

import UIKit
import SVProgressHUD

let kShopProductsClassinfoUrl =  "http://app.renrenmeishu.com:20100/v1/products/classinfo"

private let instance = CAlamofireManager()

class CAlamofireManager: NSObject {
    
    class var shareTools:CAlamofireManager{
        
        return instance
        
    }
    
    /**
     商城首页数据
     */
    func tMallHomeDataRequest(param:[String:AnyObject]?,complectionHandler: HTTPRequestHandler?) -> Void {
        SVProgressHUD.showWithStatus("正在加载...")
        var params = ["limit":20,"sortby":"Sortid","order":"desc"]
        if param != nil{
            for (key,value) in param! {
                params[key] = (value as! NSObject)
            }
        }
        
        CAlamofireClient.shareClient.dataRequest(method: .GET, urlString: kShopProductsClassinfoUrl, parameter: params, complectionHandler: { (responseObject) in
            
            SVProgressHUD.showSuccessWithStatus("加载成功")
            complectionHandler!(responseObject: responseObject!["ClassInfo"])
            
        }) { (error) in
{'fraction_non_alphanumeric': 0.11290322580645161, 'fraction_numerical': 0.013709677419354839, 'mean_word_length': 2.4602510460251046, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5047838', 'n_tokens_mistral': 813, 'n_tokens_neox': 792, 'n_words': 135}