Alamofire源碼解讀系列(十)之序列化(ResponseSerialization)

本篇主要講解Alamofire中如何把服務(wù)器返回的數(shù)據(jù)序列化

前言

和前邊的文章不同, 在這一篇中卤恳,我想從程序的設(shè)計層次上解讀ResponseSerialization這個文件酝静。更直觀的去探討該功能是如何一步一步實現(xiàn)的览祖。當(dāng)然靡努,有一個不好的地方摊崭,跟數(shù)學(xué)問題一樣讼油,我們事先知道了結(jié)果,因此這是一個已知結(jié)果推到過程的問題爽室。

在之前Alamofire的源碼解讀文章中汁讼,我們已經(jīng)知道了:對于響應(yīng)感興趣的Request類型是DataRequest和DownloadRequest淆攻。我們下邊所有的設(shè)計都是針對這兩個類型的請求的阔墩。

不序列化的設(shè)計

我們先從最簡單的事情著手。如果我發(fā)起了一個請求瓶珊,我肯定希望知道請求的結(jié)果啸箫,那么就會有下邊這樣的偽代碼:

dataRequest.request().response{ ResponseObj in }
downloadRequest.request().response{ ResponseObj in }

上邊的偽代碼中的response函數(shù)是請求的回調(diào)函數(shù),ResponseObj是對服務(wù)器返回的數(shù)據(jù)的一個抽象伞芹。這就完成了最基本的需求忘苛。

默認(rèn)情況下我們可能希望回調(diào)函數(shù)會在主線程調(diào)用蝉娜,但是對于某些特定的功能,還是應(yīng)該增加對多線程的支持扎唾,因此我們把上邊的代碼做一下擴展:

dataRequest.request().response(queue 回調(diào)函數(shù))
downloadRequest.request().response(queue 回調(diào)函數(shù))

給response函數(shù)增加一個參數(shù)召川,這個參數(shù)用來決定回調(diào)函數(shù)會在哪個線程被調(diào)用。這里的回調(diào)函數(shù)會給我們一個需要的結(jié)果胸遇,在Alamofire中荧呐,DataRequest對應(yīng)的結(jié)果是DefaultDataResponse,DownloadRequest對應(yīng)的結(jié)果是DefaultDownloadResponse纸镊。

因此倍阐,我們把上邊的偽代碼還原成Alamfire中的函數(shù)就是:

@discardableResult
    public func response(queue: DispatchQueue? = nil, completionHandler: @escaping (DefaultDataResponse) -> Void) -> Self {
        delegate.queue.addOperation {
            (queue ?? DispatchQueue.main).async {
                var dataResponse = DefaultDataResponse(
                    request: self.request,
                    response: self.response,
                    data: self.delegate.data,
                    error: self.delegate.error,
                    timeline: self.timeline
                )

                dataResponse.add(self.delegate.metrics)

                completionHandler(dataResponse)
            }
        }

        return self
    }
 @discardableResult
    public func response(
        queue: DispatchQueue? = nil,
        completionHandler: @escaping (DefaultDownloadResponse) -> Void)
        -> Self
    {
        delegate.queue.addOperation {
            (queue ?? DispatchQueue.main).async {
                var downloadResponse = DefaultDownloadResponse(
                    request: self.request,
                    response: self.response,
                    temporaryURL: self.downloadDelegate.temporaryURL,
                    destinationURL: self.downloadDelegate.destinationURL,
                    resumeData: self.downloadDelegate.resumeData,
                    error: self.downloadDelegate.error,
                    timeline: self.timeline
                )

                downloadResponse.add(self.delegate.metrics)

                completionHandler(downloadResponse)
            }
        }

        return self
    }

這兩個函數(shù)都是把先創(chuàng)建Response對象,然后把這些操作放入到delegate的隊列中逗威,當(dāng)請求完成后再執(zhí)行這些operation峰搪。

需要序列化

那么問題就來了,在未序列化的基礎(chǔ)上應(yīng)該如何添加序列化功能?在Alamofire源碼解讀系列(九)之響應(yīng)封裝(Response)這一篇文章中我們知道針對序列化的Response有兩個封裝:DataResponse和DownloadResponse。他們都是struct眯勾,是純正的存儲設(shè)計屬性形导。和DefaultDataResponse,DefaultDownloadResponse最大的不同饵骨,其內(nèi)部多了一個Result的封裝。不明白Result的朋友可以去看看這篇文章Alamofire源碼解讀系列(五)之結(jié)果封裝(Result).

因此只要在上邊的response方法中添加一個參數(shù)就行,這個參數(shù)的任務(wù)就是完成數(shù)據(jù)的序列化春锋。此時我們說的系列化就是指可以把響應(yīng)數(shù)據(jù)生成Result的功能。因為DataResponse和DownloadResponse的初始化離不開這個參數(shù)差凹。

偽代碼如下:

dataRequest.request().response(queue 序列化者 回調(diào)函數(shù))
downloadRequest.request().response(queue 序列化者 回調(diào)函數(shù))

我們之所以把data和download的請求每次都分開來設(shè)計期奔,原因是因為這兩個不同的請求得到的響應(yīng)不一樣。download可以從一個URL中獲取數(shù)據(jù)危尿,而data不行呐萌。

那么重點來了,序列化者的任務(wù)是把數(shù)據(jù)轉(zhuǎn)換成Result谊娇。因此我們可以把這個序列化者設(shè)計成一個類或者結(jié)構(gòu)體肺孤,里邊提供一個轉(zhuǎn)換的方法就行了。這也是最正常不過的思想济欢。但是在swift中我們應(yīng)該轉(zhuǎn)變思維赠堵。swift跟oc不一樣。

我們不應(yīng)該把系列化者用一個固定的對象封死法褥。這個時候就是協(xié)議大顯身手的時刻了茫叭。既然序列化者需要一個函數(shù),那么我們就設(shè)計一個包含該函數(shù)的協(xié)議半等。這一切的思想應(yīng)該是從高層到底層的過度的揍愁。因此協(xié)議就是下邊的代碼:

/// The type in which all data response serializers must conform to in order to serialize a response.
public protocol DataResponseSerializerProtocol {
    /// The type of serialized object to be created by this `DataResponseSerializerType`.
    associatedtype SerializedObject

    /// A closure used by response handlers that takes a request, response, data and error and returns a result.
    var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result<SerializedObject> { get }
}
/// The type in which all download response serializers must conform to in order to serialize a response.
public protocol DownloadResponseSerializerProtocol {
    /// The type of serialized object to be created by this `DownloadResponseSerializerType`.
    associatedtype SerializedObject

    /// A closure used by response handlers that takes a request, response, url and error and returns a result.
    var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result<SerializedObject> { get }
}

SerializedObject定義了要序列化后的對象類型呐萨,這么寫的原因也是因為后邊序列成Data,JOSN莽囤,String等等的需求谬擦。在回到序列者的問題上,只要實現(xiàn)了這些協(xié)議就行朽缎,序列者應(yīng)該是一個存儲屬性怯屉,用序列化函數(shù)作為參數(shù)來初始化:

/// A generic `DataResponseSerializerType` used to serialize a request, response, and data into a serialized object.
public struct DataResponseSerializer<Value>: DataResponseSerializerProtocol {
    /// The type of serialized object to be created by this `DataResponseSerializer`.
    public typealias SerializedObject = Value

    /// A closure used by response handlers that takes a request, response, data and error and returns a result.
    public var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result<Value>

    /// Initializes the `ResponseSerializer` instance with the given serialize response closure.
    ///
    /// - parameter serializeResponse: The closure used to serialize the response.
    ///
    /// - returns: The new generic response serializer instance.
    public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result<Value>) {
        self.serializeResponse = serializeResponse
    }
}
/// A generic `DownloadResponseSerializerType` used to serialize a request, response, and data into a serialized object.
public struct DownloadResponseSerializer<Value>: DownloadResponseSerializerProtocol {
    /// The type of serialized object to be created by this `DownloadResponseSerializer`.
    public typealias SerializedObject = Value

    /// A closure used by response handlers that takes a request, response, url and error and returns a result.
    public var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result<Value>

    /// Initializes the `ResponseSerializer` instance with the given serialize response closure.
    ///
    /// - parameter serializeResponse: The closure used to serialize the response.
    ///
    /// - returns: The new generic response serializer instance.
    public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result<Value>) {
        self.serializeResponse = serializeResponse
    }
}
  @discardableResult
    public func response<T: DataResponseSerializerProtocol>(
        queue: DispatchQueue? = nil,
        responseSerializer: T,
        completionHandler: @escaping (DataResponse<T.SerializedObject>) -> Void)
        -> Self
    {
        delegate.queue.addOperation {
            /// 這里就調(diào)用了responseSerializer保存的系列化函數(shù),函數(shù)調(diào)用后會得到result
            let result = responseSerializer.serializeResponse(
                self.request,
                self.response,
                self.delegate.data,
                self.delegate.error
            )

            /// 這里一定要記得饵沧,DataResponse是一個結(jié)構(gòu)體锨络,是專門為了純存儲數(shù)據(jù)的,這里是調(diào)用了結(jié)構(gòu)體的初始化方法創(chuàng)建了一個新的DataResponse實例
            var dataResponse = DataResponse<T.SerializedObject>(
                request: self.request,
                response: self.response,
                data: self.delegate.data,
                result: result,
                timeline: self.timeline
            )

            dataResponse.add(self.delegate.metrics)

            (queue ?? DispatchQueue.main).async { completionHandler(dataResponse) }
        }

        return self
    }
    
 

   @discardableResult
    public func response<T: DownloadResponseSerializerProtocol>(
        queue: DispatchQueue? = nil,
        responseSerializer: T,
        completionHandler: @escaping (DownloadResponse<T.SerializedObject>) -> Void)
        -> Self
    {
        delegate.queue.addOperation {
            let result = responseSerializer.serializeResponse(
                self.request,
                self.response,
                self.downloadDelegate.fileURL,
                self.downloadDelegate.error
            )

            var downloadResponse = DownloadResponse<T.SerializedObject>(
                request: self.request,
                response: self.response,
                temporaryURL: self.downloadDelegate.temporaryURL,
                destinationURL: self.downloadDelegate.destinationURL,
                resumeData: self.downloadDelegate.resumeData,
                result: result,
                timeline: self.timeline
            )

            downloadResponse.add(self.delegate.metrics)

            (queue ?? DispatchQueue.main).async { completionHandler(downloadResponse) }
        }

        return self
    }

擴展

其實狼牺,代碼到了這里羡儿,基本的功能已經(jīng)完成了80%。如果要把data序列成string是钥,只需要創(chuàng)建一個data序列者就好了掠归,但是這樣的設(shè)計用起來很麻煩,因為還要書寫序列成Result的函數(shù)悄泥,這些函數(shù)往往都是一樣的虏冻,要么把這些函數(shù)提前定義出來,要么把這些函數(shù)封裝起來弹囚。

按照Alamofire的設(shè)計厨相,是把這些函數(shù)封裝起來的。你可以這么使用:

dataRequest.request().responseString(queue 回調(diào)函數(shù))
dataRequest.request().responseJSON(queue 回調(diào)函數(shù))

通過特性的函數(shù)來獲取序列化后的response鸥鹉。

responseData

responseData是把數(shù)據(jù)序列化為Data類型蛮穿。也就是Result<Data>。

生成DataRequest的序列者:

 /// Creates a response serializer that returns the associated data as-is.
    ///
    /// - returns: A data response serializer.
    public static func dataResponseSerializer() -> DataResponseSerializer<Data> {
        /// 可以看出這么寫也是可以的毁渗,這個方法要做分解才能理解践磅,不然很容易讓人迷惑,DataResponseSerializer的初始化需要一個ResponseSerializer函數(shù)灸异,那么這個函數(shù)是什么呢府适?就是大括號內(nèi)部的這個閉包,我們通過下邊的代碼就得到了一個DataResponseSerializer肺樟,這個DataResponseSerializer內(nèi)部保存著一個函數(shù)檐春,函數(shù)的作用就是根據(jù)參數(shù),最終解析出Result<Data>
//        return DataResponseSerializer { (_, response, data, error) -> Result<Data> in
//            return Request.serializeResponseData(response: response, data: data, error: error)
//        }
        return DataResponseSerializer { _, response, data, error in
            return Request.serializeResponseData(response: response, data: data, error: error)
        }
    }

實現(xiàn)DataRequest的responseData函數(shù):

 /// Adds a handler to be called once the request has finished.
    ///
    /// - parameter completionHandler: The code to be executed once the request has finished.
    ///
    /// - returns: The request.
    /// 這個方法就很好裂解了 儡嘶,設(shè)置一個回調(diào)喇聊,當(dāng)請求完成調(diào)用,
    @discardableResult
    public func responseData(
        queue: DispatchQueue? = nil,
        completionHandler: @escaping (DataResponse<Data>) -> Void)
        -> Self
    {
        return response(
            queue: queue,
            responseSerializer: DataRequest.dataResponseSerializer(),
            completionHandler: completionHandler
        )
    }

生成DownloadRequest的序列者:

/// Creates a response serializer that returns the associated data as-is.
    ///
    /// - returns: A data response serializer.
    public static func dataResponseSerializer() -> DownloadResponseSerializer<Data> {
        return DownloadResponseSerializer { _, response, fileURL, error in
            guard error == nil else { return .failure(error!) }

            guard let fileURL = fileURL else {
                return .failure(AFError.responseSerializationFailed(reason: .inputFileNil))
            }

            do {
                let data = try Data(contentsOf: fileURL)
                return Request.serializeResponseData(response: response, data: data, error: error)
            } catch {
                return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL)))
            }
        }
    }

實現(xiàn)DataRequest的responseData函數(shù):

 /// Adds a handler to be called once the request has finished.
    ///
    /// - parameter completionHandler: The code to be executed once the request has finished.
    ///
    /// - returns: The request.
    @discardableResult
    public func responseData(
        queue: DispatchQueue? = nil,
        completionHandler: @escaping (DownloadResponse<Data>) -> Void)
        -> Self
    {
        return response(
            queue: queue,
            responseSerializer: DownloadRequest.dataResponseSerializer(),
            completionHandler: completionHandler
        )
    }

上邊的代碼中值得注意的是:初始化序列者需要的是一個函數(shù)蹦狂,只要把這個函數(shù)看做是一個參數(shù)誓篱,就能明白為什么會這么寫。那么我們更應(yīng)該關(guān)心的是下邊的函數(shù)凯楔,它解釋了如何根據(jù)response: HTTPURLResponse?, data: Data?, error: Error?獲得Result<Data>窜骄。也是序列化Data的核心方法:

    /// Returns a result data type that contains the response data as-is.
    ///
    /// - parameter response: The response from the server.
    /// - parameter data:     The data returned from the server.
    /// - parameter error:    The error already encountered if it exists.
    ///
    /// - returns: The result data type.
    public static func serializeResponseData(response: HTTPURLResponse?, data: Data?, error: Error?) -> Result<Data> {
        guard error == nil else { return .failure(error!) }

        if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(Data()) }

        guard let validData = data else {
            return .failure(AFError.responseSerializationFailed(reason: .inputDataNil))
        }

        return .success(validData)
    }

responseString

responseString跟responseData的套路一模一樣,就不把全部的代碼弄過來了摆屯,以免浪費篇幅邻遏,我們應(yīng)該關(guān)心如何根據(jù)encoding: String.Encoding?,response: HTTPURLResponse?,data: Data?,error: Error?獲得Result<String>。

/// Returns a result string type initialized from the response data with the specified string encoding.
    ///
    /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server
    ///                       response, falling back to the default HTTP default character set, ISO-8859-1.
    /// - parameter response: The response from the server.
    /// - parameter data:     The data returned from the server.
    /// - parameter error:    The error already encountered if it exists.
    ///
    /// - returns: The result data type.
    public static func serializeResponseString(
        encoding: String.Encoding?,
        response: HTTPURLResponse?,
        data: Data?,
        error: Error?)
        -> Result<String>
    {
        guard error == nil else { return .failure(error!) }

        if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success("") }

        guard let validData = data else {
            return .failure(AFError.responseSerializationFailed(reason: .inputDataNil))
        }

        var convertedEncoding = encoding

        if let encodingName = response?.textEncodingName as CFString!, convertedEncoding == nil {
            convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(
                CFStringConvertIANACharSetNameToEncoding(encodingName))
            )
        }

        let actualEncoding = convertedEncoding ?? String.Encoding.isoLatin1

        if let string = String(data: validData, encoding: actualEncoding) {
            return .success(string)
        } else {
            return .failure(AFError.responseSerializationFailed(reason: .stringSerializationFailed(encoding: actualEncoding)))
        }
    }

上邊的代碼中涉及了字符串編碼的知識虐骑,有興趣的朋友可以自己查找資料准验。

responseJSON

responseJSON跟responseData的套路一模一樣,就不把全部的代碼弄過來了廷没,以免浪費篇幅糊饱,我們應(yīng)該關(guān)心如何根據(jù)options: JSONSerialization.ReadingOptions,response: HTTPURLResponse?,data: Data?,error: Error?獲得Result<Any>。

 /// Returns a JSON object contained in a result type constructed from the response data using `JSONSerialization`
    /// with the specified reading options.
    ///
    /// - parameter options:  The JSON serialization reading options. Defaults to `.allowFragments`.
    /// - parameter response: The response from the server.
    /// - parameter data:     The data returned from the server.
    /// - parameter error:    The error already encountered if it exists.
    ///
    /// - returns: The result data type.
    public static func serializeResponseJSON(
        options: JSONSerialization.ReadingOptions,
        response: HTTPURLResponse?,
        data: Data?,
        error: Error?)
        -> Result<Any>
    {
        guard error == nil else { return .failure(error!) }

        if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) }

        guard let validData = data, validData.count > 0 else {
            return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength))
        }

        do {
            let json = try JSONSerialization.jsonObject(with: validData, options: options)
            return .success(json)
        } catch {
            return .failure(AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: error)))
        }
    }

這里之所以使用Any颠黎,是因為JSON可能是字典另锋,也可能是數(shù)組。

responsePropertyList

responsePropertyList跟responseData的套路一模一樣狭归,就不把全部的代碼弄過來了夭坪,以免浪費篇幅,我們應(yīng)該關(guān)心如何根據(jù)options: PropertyListSerialization.ReadOptions,response: HTTPURLResponse?,data: Data?,error: Error?獲得Result<Any>过椎。

/// Returns a plist object contained in a result type constructed from the response data using
    /// `PropertyListSerialization` with the specified reading options.
    ///
    /// - parameter options:  The property list reading options. Defaults to `[]`.
    /// - parameter response: The response from the server.
    /// - parameter data:     The data returned from the server.
    /// - parameter error:    The error already encountered if it exists.
    ///
    /// - returns: The result data type.
    public static func serializeResponsePropertyList(
        options: PropertyListSerialization.ReadOptions,
        response: HTTPURLResponse?,
        data: Data?,
        error: Error?)
        -> Result<Any>
    {
        guard error == nil else { return .failure(error!) }

        if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) }

        guard let validData = data, validData.count > 0 else {
            return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength))
        }

        do {
            let plist = try PropertyListSerialization.propertyList(from: validData, options: options, format: nil)
            return .success(plist)
        } catch {
            return .failure(AFError.responseSerializationFailed(reason: .propertyListSerializationFailed(error: error)))
        }
    }

emptyDataStatusCodes

如果HTTP response code 是204或者205室梅,就表示Data為nil。

/// A set of HTTP response status code that do not contain response data.
private let emptyDataStatusCodes: Set<Int> = [204, 205]

為Request添加Timeline屬性

extension Request {
    var timeline: Timeline {
        let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent()
        let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime

        return Timeline(
            requestStartTime: self.startTime ?? CFAbsoluteTimeGetCurrent(),
            initialResponseTime: initialResponseTime,
            requestCompletedTime: requestCompletedTime,
            serializationCompletedTime: CFAbsoluteTimeGetCurrent()
        )
    }
}

上邊的代碼為Request添加了Timeline屬性疚宇,這是一個計算屬性竞惋,因此在不同的請求階段會獲得不同的取值。

總結(jié)

由于知識水平有限灰嫉,如有錯誤拆宛,還望指出

鏈接

Alamofire源碼解讀系列(一)之概述和使用 簡書-----博客園

Alamofire源碼解讀系列(二)之錯誤處理(AFError) 簡書-----博客園

Alamofire源碼解讀系列(三)之通知處理(Notification) 簡書-----博客園

Alamofire源碼解讀系列(四)之參數(shù)編碼(ParameterEncoding) 簡書-----博客園

Alamofire源碼解讀系列(五)之結(jié)果封裝(Result) 簡書-----博客園

Alamofire源碼解讀系列(六)之Task代理(TaskDelegate) 簡書-----博客園

Alamofire源碼解讀系列(七)之網(wǎng)絡(luò)監(jiān)控(NetworkReachabilityManager) 簡書-----博客園

Alamofire源碼解讀系列(八)之安全策略(ServerTrustPolicy) 簡書-----博客園

Alamofire源碼解讀系列(九)之響應(yīng)封裝(Response) 簡書-----博客園

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市讼撒,隨后出現(xiàn)的幾起案子浑厚,更是在濱河造成了極大的恐慌,老刑警劉巖根盒,帶你破解...
    沈念sama閱讀 207,113評論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件钳幅,死亡現(xiàn)場離奇詭異,居然都是意外死亡炎滞,警方通過查閱死者的電腦和手機敢艰,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,644評論 2 381
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來册赛,“玉大人钠导,你說我怎么就攤上這事震嫉。” “怎么了牡属?”我有些...
    開封第一講書人閱讀 153,340評論 0 344
  • 文/不壞的土叔 我叫張陵票堵,是天一觀的道長。 經(jīng)常有香客問我逮栅,道長悴势,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 55,449評論 1 279
  • 正文 為了忘掉前任措伐,我火速辦了婚禮特纤,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘侥加。我一直安慰自己捧存,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 64,445評論 5 374
  • 文/花漫 我一把揭開白布官硝。 她就那樣靜靜地躺著矗蕊,像睡著了一般。 火紅的嫁衣襯著肌膚如雪氢架。 梳的紋絲不亂的頭發(fā)上傻咖,一...
    開封第一講書人閱讀 49,166評論 1 284
  • 那天,我揣著相機與錄音岖研,去河邊找鬼卿操。 笑死,一個胖子當(dāng)著我的面吹牛孙援,可吹牛的內(nèi)容都是我干的害淤。 我是一名探鬼主播,決...
    沈念sama閱讀 38,442評論 3 401
  • 文/蒼蘭香墨 我猛地睜開眼拓售,長吁一口氣:“原來是場噩夢啊……” “哼窥摄!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起础淤,我...
    開封第一講書人閱讀 37,105評論 0 261
  • 序言:老撾萬榮一對情侶失蹤崭放,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后鸽凶,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體币砂,經(jīng)...
    沈念sama閱讀 43,601評論 1 300
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,066評論 2 325
  • 正文 我和宋清朗相戀三年玻侥,在試婚紗的時候發(fā)現(xiàn)自己被綠了决摧。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 38,161評論 1 334
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖掌桩,靈堂內(nèi)的尸體忽然破棺而出边锁,到底是詐尸還是另有隱情,我是刑警寧澤拘鞋,帶...
    沈念sama閱讀 33,792評論 4 323
  • 正文 年R本政府宣布砚蓬,位于F島的核電站矢门,受9級特大地震影響盆色,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜祟剔,卻給世界環(huán)境...
    茶點故事閱讀 39,351評論 3 307
  • 文/蒙蒙 一隔躲、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧物延,春花似錦宣旱、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,352評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至耗溜,卻和暖如春组力,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背抖拴。 一陣腳步聲響...
    開封第一講書人閱讀 31,584評論 1 261
  • 我被黑心中介騙來泰國打工燎字, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人阿宅。 一個月前我還...
    沈念sama閱讀 45,618評論 2 355
  • 正文 我出身青樓候衍,卻偏偏與公主長得像,于是被迫代替她去往敵國和親洒放。 傳聞我的和親對象是個殘疾皇子蛉鹿,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 42,916評論 2 344

推薦閱讀更多精彩內(nèi)容