<commit_before>//
//  PetSubTypeViewController.swift
//  HiChongSwift
//
//  Created by eagle on 14/12/24.
//  Copyright (c) 2014年 多思科技. All rights reserved.
//

import UIKit

class PetSubTypeViewController: UITableViewController {
    
    weak var delegate: PetCateFilterDelegate?
    weak var root: UIViewController?
    
    var parentID: String?
    
    private var subTypeInfo: LCYPetSubTypeBase?

    override func viewDidLoad() {
        super.viewDidLoad()

        // Uncomment the following line to preserve selection between presentations
        // self.clearsSelectionOnViewWillAppear = false

        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem()
        
        if let uid = parentID{
            let parameter = ["f_id": uid]
            LCYNetworking.sharedInstance.POST(LCYApi.PetSubType, parameters: parameter, success: { [weak self] (object) -> Void in
                self?.subTypeInfo = LCYPetSubTypeBase.modelObjectWithDictionary(object)
                self?.tableView.reloadData()
                return
            }, failure: { [weak self](error) -> Void in
                self?.alert("您的网络状态不给力哟")
                return
            })
        } else {
            alert("内部错误，请退回重试")
        }
        
        tableView.backgroundColor = UIColor.LCYThemeColor()
        
        navigationItem.title = "分类"

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
<commit_msg>强制修改了犬类的排序<commit_after>//
//  PetSubTypeViewController.swift
//  HiChongSwift
//
//  Created by eagle on 14/12/24.
//  Copyright (c) 2014年 多思科技. All rights reserved.
//

import UIKit

class PetSubTypeViewController: UITableViewController {
    
    weak var delegate: PetCateFilterDelegate?
    weak var root: UIViewController?
    
    var parentID: String?
    
    private var subTypeInfo: LCYPetSubTypeBase?

    override func viewDidLoad() {
        super.viewDidLoad()

        // Uncomment the following line to preserve selection between presentations
        // self.clearsSelectionOnViewWillAppear = false

        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem()
        
        if let uid = parentID{
            let parameter = ["f_id": uid]
            LCYNetworking.sharedInstance.POST(LCYApi.PetSubType, parameters: parameter, success: { [weak self] (object) -> Void in
                var info = LCYPetSubTypeBase.modelObjectWithDictionary(object)
                if info.childStyle.count == 3 {
                    info.childStyle = (info.childStyle as [LCYPetSubTypeChildStyle]).sorted({
                        func toSortInt(name: String) -> Int {
                            if name == "大型犬" {
                                return 3
                            } else if name == "中型犬" {
                                return 2
                            } else {
                                return 1
                            }
                        }
                        let first = toSortInt($0.name)
                        let second = toSortInt($1.name)
                        return first > second
                    })
                }
                self?.subTypeInfo = info
                self?.tableView.reloadData()
                return
            }, failure: { [weak self](error) -> Void in
                self?.alert("您的网络状态不给力哟")
                return
            })
        } else {
            alert("内部错误，请退回重试")
        }
        
        tableView.backgroundColor = UIColor.LCYThemeColor()
        
        navigationItem.title = "分类"

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

{'fraction_non_alphanumeric': 0.08094059405940594, 'fraction_numerical': 0.006435643564356435, 'mean_word_length': 1.6585526315789474, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 9, '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': '7309564', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1072, 'n_words': 267}