<?php

namespace app\common\listener\activity;

use app\common\model\school\activity\order\Order;
use app\common\model\school\MessageConfig;

class OrderHook
{

    // 订单创建成功前（订单计算）

    public function activityOrderCreateBefore(&$params)
    {
        ['user_id'=>$user_id, 'activity_id'=>$activity_id,'num'=>$num,'param'=>$param, 'order_no'=>$order_no, 'price_info'=>$price_info] = $params;
    }


    // 订单创建成功后
    public function activityOrderCreateAfter(&$params)
    {
        ["order"=>$order] = $params;

        $order = Order::where("id" , $order["id"])->find();

        $detail = $order->detail;
        $user = $order->user;
        //记录订单日志
        $mini_type = "activity_order";
        $to_id = $order["user_id"];
        $status ="order";
        $params=[
            "event"=>"activity_order_create_after",
            "order_id"=>$order["id"],
            "order_no"=>$order["order_no"],
            "activity_id"=>$order["activity_id"],
            "title"=>$detail["title"],
            "images"=>$detail["images"],
        ];
        $param = [
            "title"=>$detail["title"],
            "order_no" => $order["order_no"],
            "nickname" => $user["nickname"],
            "realname" => $user["realname"],
            "mobile" => $user["mobile"],
            "price" => $order["totalprice"],
            "payprice" => $order["payprice"],
            "real_refundprice" => $order["real_refundprice"],
            "sub_refundprice" => $order["sub_refundprice"],
            "reason" => $order["reason"],
            "auth_reason" => $order["auth_reason"],
            "address"=>$detail["address"]."(".$detail["address_detail"].")",
            "start_time" => date("Y-m-d H:i",$detail["start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "end_time" =>   date("Y-m-d H:i",$detail["end_time"]),
            "sign_start_time" => date("Y-m-d H:i",$detail["sign_start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "sign_end_time" =>   date("Y-m-d H:i",$detail["sign_end_time"]),
        ];

        (new MessageConfig())
            ->setTemplate($params["event"])
            ->setTemplateData($param)
            ->setToUid($to_id)
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();


    }






    // 订单支付成功后
    public function activityOrderPayedAfter(&$params)
    {
        ["order"=>$order] = $params;

        $order = Order::where("id" , $order["id"])->find();
        $detail = $order->detail;
        $user = $order->user;

        //记录订单日志
        $mini_type = "activity_order";
        $to_id = $order["user_id"];
        $status ="order";
        $params=[
            "event"=>"activity_order_payed_after",
            "order_id"=>$order["id"],
            "order_no"=>$order["order_no"],
            "activity_id"=>$order["activity_id"],
            "title"=>$detail["title"],
            "images"=>$detail["images"],
        ];
        $param = [
            "title"=>$detail["title"],
            "order_no" => $order["order_no"],
            "nickname" => $user["nickname"],
            "realname" => $user["realname"],
            "mobile" => $user["mobile"],
            "price" => $order["totalprice"],
            "payprice" => $order["payprice"],
            "real_refundprice" => $order["real_refundprice"],
            "sub_refundprice" => $order["sub_refundprice"],
            "reason" => $order["reason"],
            "auth_reason" => $order["auth_reason"],
            "address"=>$detail["address"]."(".$detail["address_detail"].")",
            "start_time" => date("Y-m-d H:i",$detail["start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "end_time" =>   date("Y-m-d H:i",$detail["end_time"]),
            "sign_start_time" => date("Y-m-d H:i",$detail["sign_start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "sign_end_time" =>   date("Y-m-d H:i",$detail["sign_end_time"]),
        ];

        //发用户
        (new MessageConfig)
            ->setTemplate($params["event"]."_user")
            ->setTemplateData($param)
            ->setToUid($to_id)
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();
        //发所有核销员

            (new MessageConfig)
                ->setTemplate($params["event"]."_verification")
                ->setTemplateData($param)
                ->setToUid($detail["user_id"])
                ->setMessageStatus($status)
                ->setMessageMiniType($mini_type)
                ->setMessageParams($params)
                ->sendMessage();



    }


    public function activityOrderVerificationAfter(&$params)
    {
        ["order"=>$order] = $params;

        $order = Order::where("id" , $order["id"])->find();

        $detail = $order->detail;
        $user = $order->user;
        //记录订单日志
        $mini_type = "activity_order";
        $to_id = $order["user_id"];
        $status ="order";
        $params=[
            "event"=>"activity_order_verification_after",
            "order_id"=>$order["id"],
            "order_no"=>$order["order_no"],
            "activity_id"=>$order["activity_id"],
            "title"=>$detail["title"],
            "images"=>$detail["images"],
        ];
        $param = [
            "title"=>$detail["title"],
            "order_no" => $order["order_no"],
            "nickname" => $user["nickname"],
            "realname" => $user["realname"],
            "mobile" => $user["mobile"],
            "price" => $order["totalprice"],
            "payprice" => $order["payprice"],
            "real_refundprice" => $order["real_refundprice"],
            "sub_refundprice" => $order["sub_refundprice"],
            "reason" => $order["reason"],
            "auth_reason" => $order["auth_reason"],
            "address"=>$detail["address"]."(".$detail["address_detail"].")",
            "start_time" => date("Y-m-d H:i",$detail["start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "end_time" =>   date("Y-m-d H:i",$detail["end_time"]),
            "sign_start_time" => date("Y-m-d H:i",$detail["sign_start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "sign_end_time" =>   date("Y-m-d H:i",$detail["sign_end_time"]),
        ];

        (new MessageConfig)
            ->setTemplate($params["event"])
            ->setTemplateData($param)
            ->setToUid($to_id)
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();



    }







    // 订单核销完成后
    public function activityOrderFinishAfter(&$params)
    {
        ['order' => $order] = $params;


        $order = Order::where("id" , $order["id"])->find();
        $detail = $order->detail;
        $user = $order->user;
        //记录订单日志
        $mini_type = "activity_order";
        $to_id = $order["user_id"];
        $status ="order";
        $params=[
            "event"=>"activity_order_finish_after",
            "order_id"=>$order["id"],
            "order_no"=>$order["order_no"],
            "activity_id"=>$order["activity_id"],
            "title"=>$detail["title"],
            "images"=>$detail["images"],
        ];
        $param = [
            "title"=>$detail["title"],
            "order_no" => $order["order_no"],
            "nickname" => $user["nickname"],
            "realname" => $user["realname"],
            "mobile" => $user["mobile"],
            "price" => $order["totalprice"],
            "payprice" => $order["payprice"],
            "real_refundprice" => $order["real_refundprice"],
            "sub_refundprice" => $order["sub_refundprice"],
            "reason" => $order["reason"],
            "auth_reason" => $order["auth_reason"],
            "address"=>$detail["address"]."(".$detail["address_detail"].")",
            "start_time" => date("Y-m-d H:i",$detail["start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "end_time" =>   date("Y-m-d H:i",$detail["end_time"]),
            "sign_start_time" => date("Y-m-d H:i",$detail["sign_start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "sign_end_time" =>   date("Y-m-d H:i",$detail["sign_end_time"]),
        ];

        //发用户
        (new MessageConfig)
            ->setTemplate($params["event"]."_user")
            ->setTemplateData($param)
            ->setToUid($to_id)
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();
        //发所有核销员
            (new MessageConfig)
                ->setTemplate($params["event"]."_verification")
                ->setTemplateData($param)
                ->setToUid($detail["user_id"])
                ->setMessageStatus($status)
                ->setMessageMiniType($mini_type)
                ->setMessageParams($params)
                ->sendMessage();

    }




    // 订单取消成功后
    public function activityOrderCancelAfter(&$params)
    {
        ["order"=>$order] = $params;

        $order = Order::where("id" , $order["id"])->find();

        $detail = $order->detail;
        $user = $order->user;
        //记录订单日志
        $mini_type = "activity_order";
        $to_id = $order["user_id"];
        $status ="order";
        $params=[
            "event"=>"activity_order_cancel_after",
            "order_id"=>$order["id"],
            "order_no"=>$order["order_no"],
            "activity_id"=>$order["activity_id"],
            "title"=>$detail["title"],
            "images"=>$detail["images"],
        ];
        $param = [
            "title"=>$detail["title"],
            "order_no" => $order["order_no"],
            "nickname" => $user["nickname"],
            "realname" => $user["realname"],
            "mobile" => $user["mobile"],
            "price" => $order["totalprice"],
            "payprice" => $order["payprice"],
            "real_refundprice" => $order["real_refundprice"],
            "sub_refundprice" => $order["sub_refundprice"],
            "reason" => $order["reason"],
            "auth_reason" => $order["auth_reason"],
            "address"=>$detail["address"]."(".$detail["address_detail"].")",
            "start_time" => date("Y-m-d H:i",$detail["start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "end_time" =>   date("Y-m-d H:i",$detail["end_time"]),
            "sign_start_time" => date("Y-m-d H:i",$detail["sign_start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "sign_end_time" =>   date("Y-m-d H:i",$detail["sign_end_time"]),
        ];

        (new MessageConfig)
            ->setTemplate($params["event"])
            ->setTemplateData($param)
            ->setToUid($to_id)
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();

    }




    // 新活动订单售后退款发起
    public function activityOrderAuthFailAfter(&$params)
    {
        ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params;


        $order = Order::where("id" , $order["id"])->find();
        $detail = $order->detail;
        $user = $order->user;
        //记录订单日志
        $mini_type = "activity_order";
        $to_id = $order["user_id"];
        $status ="order";
        $params=[
            "event"=>"activity_order_auth_fail_after",
            "order_id"=>$order["id"],
            "order_no"=>$order["order_no"],
            "activity_id"=>$order["activity_id"],
            "title"=>$detail["title"],
            "images"=>$detail["images"],
        ];
        $param = [
            "title"=>$detail["title"],
            "order_no" => $order["order_no"],
            "nickname" => $user["nickname"],
            "realname" => $user["realname"],
            "mobile" => $user["mobile"],
            "price" => $order["totalprice"],
            "payprice" => $order["payprice"],
            "real_refundprice" => $order["real_refundprice"],
            "sub_refundprice" => $order["sub_refundprice"],
            "reason" => $order["reason"],
            "auth_reason" => $order["auth_reason"],
            "address"=>$detail["address"]."(".$detail["address_detail"].")",
            "start_time" => date("Y-m-d H:i",$detail["start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "end_time" =>   date("Y-m-d H:i",$detail["end_time"]),
            "sign_start_time" => date("Y-m-d H:i",$detail["sign_start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "sign_end_time" =>   date("Y-m-d H:i",$detail["sign_end_time"]),
        ];

        //发用户
        (new MessageConfig)
            ->setTemplate($params["event"]."_user")
            ->setTemplateData($param)
            ->setToUid($to_id)
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();
        //发所有核销员
        (new MessageConfig)
            ->setTemplate($params["event"]."_verification")
            ->setTemplateData($param)
            ->setToUid($detail["user_id"])
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();

    }







    // 订单退款成功
    public function activityOrderRefundSuccessAfter(&$params)
    {
        ["order"=>$order] = $params;

        $order = Order::where("id" , $order["id"])->find();

        $detail = $order->detail;
        $user = $order->user;
        //记录订单日志
        $mini_type = "activity_order";
        $to_id = $order["user_id"];
        $status ="order";
        $params=[
            "event"=>"activity_order_refund_success_after",
            "order_id"=>$order["id"],
            "order_no"=>$order["order_no"],
            "activity_id"=>$order["activity_id"],
            "title"=>$detail["title"],
            "images"=>$detail["images"],
        ];
        $param = [
            "title"=>$detail["title"],
            "order_no" => $order["order_no"],
            "nickname" => $user["nickname"],
            "realname" => $user["realname"],
            "mobile" => $user["mobile"],
            "price" => $order["totalprice"],
            "payprice" => $order["payprice"],
            "real_refundprice" => $order["real_refundprice"],
            "sub_refundprice" => $order["sub_refundprice"],
            "reason" => $order["reason"],
            "auth_reason" => $order["auth_reason"],
            "address"=>$detail["address"]."(".$detail["address_detail"].")",
            "start_time" => date("Y-m-d H:i",$detail["start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "end_time" =>   date("Y-m-d H:i",$detail["end_time"]),
            "sign_start_time" => date("Y-m-d H:i",$detail["sign_start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "sign_end_time" =>   date("Y-m-d H:i",$detail["sign_end_time"]),
        ];

        (new MessageConfig)
            ->setTemplate($params["event"])
            ->setTemplateData($param)
            ->setToUid($to_id)
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();


    }





    // 订单支付成功后
    public function activityOrderRefundFailAfter(&$params)
    {
        ["order"=>$order] = $params;

        $order = Order::where("id" , $order["id"])->find();
        $detail = $order->detail;
        $user = $order->user;

        //记录订单日志
        $mini_type = "activity_order";
        $to_id = $order["user_id"];
        $status ="order";
        $params=[
            "event"=>"activity_order_refund_fail_after",
            "order_id"=>$order["id"],
            "order_no"=>$order["order_no"],
            "activity_id"=>$order["activity_id"],
            "title"=>$detail["title"],
            "images"=>$detail["images"],
        ];
        $param = [
            "title"=>$detail["title"],
            "order_no" => $order["order_no"],
            "nickname" => $user["nickname"],
            "realname" => $user["realname"],
            "mobile" => $user["mobile"],
            "price" => $order["totalprice"],
            "payprice" => $order["payprice"],
            "real_refundprice" => $order["real_refundprice"],
            "sub_refundprice" => $order["sub_refundprice"],
            "reason" => $order["reason"],
            "auth_reason" => $order["auth_reason"],
            "address"=>$detail["address"]."(".$detail["address_detail"].")",
            "start_time" => date("Y-m-d H:i",$detail["start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "end_time" =>   date("Y-m-d H:i",$detail["end_time"]),
            "sign_start_time" => date("Y-m-d H:i",$detail["sign_start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "sign_end_time" =>   date("Y-m-d H:i",$detail["sign_end_time"]),
        ];

        //发用户
        (new MessageConfig)
            ->setTemplate($params["event"]."_user")
            ->setTemplateData($param)
            ->setToUid($to_id)
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();
        //发所有核销员

        (new MessageConfig)
            ->setTemplate($params["event"]."_verification")
            ->setTemplateData($param)
            ->setToUid($detail["user_id"])
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();



    }






    // 订单申请售后成功
    public function activityOrderAfterSalesAfter(&$params)
    {
        ["order"=>$order] = $params;

        $order = Order::where("id" , $order["id"])->find();

        $detail = $order->detail;
        $user = $order->user;
        //记录订单日志
        $mini_type = "activity_order";
        $to_id = $order["user_id"];
        $status ="order";
        $params=[
            "event"=>"activity_order_after_sales_after",
            "order_id"=>$order["id"],
            "order_no"=>$order["order_no"],
            "activity_id"=>$order["activity_id"],
            "title"=>$detail["title"],
            "images"=>$detail["images"],
        ];
        $param = [
            "title"=>$detail["title"],
            "order_no" => $order["order_no"],
            "nickname" => $user["nickname"],
            "realname" => $user["realname"],
            "mobile" => $user["mobile"],
            "price" => $order["totalprice"],
            "payprice" => $order["payprice"],
            "real_refundprice" => $order["real_refundprice"],
            "sub_refundprice" => $order["sub_refundprice"],
            "reason" => $order["reason"],
            "auth_reason" => $order["auth_reason"],
            "address"=>$detail["address"]."(".$detail["address_detail"].")",
            "start_time" => date("Y-m-d H:i",$detail["start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "end_time" =>   date("Y-m-d H:i",$detail["end_time"]),
            "sign_start_time" => date("Y-m-d H:i",$detail["sign_start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "sign_end_time" =>   date("Y-m-d H:i",$detail["sign_end_time"]),
        ];

        //发用户
        (new MessageConfig)
            ->setTemplate($params["event"]."_user")
            ->setTemplateData($param)
            ->setToUid($to_id)
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();
        //发所有核销员
        (new MessageConfig)
            ->setTemplate($params["event"]."_verification")
            ->setTemplateData($param)
            ->setToUid($detail["user_id"])
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();


    }





    // 订单售后同意
    public function activityOrderShopConfirmAfter(&$params)
    {
        ["order"=>$order] = $params;

        $order = Order::where("id" , $order["id"])->find();

        $detail = $order->detail;
        $user = $order->user;
        //记录订单日志
        $mini_type = "activity_order";
        $to_id = $order["user_id"];
        $status ="order";
        $params=[
            "event"=>"activity_order_shop_confirm_after",
            "order_id"=>$order["id"],
            "order_no"=>$order["order_no"],
            "activity_id"=>$order["activity_id"],
            "title"=>$detail["title"],
            "images"=>$detail["images"],
        ];
        $param = [
            "title"=>$detail["title"],
            "order_no" => $order["order_no"],
            "nickname" => $user["nickname"],
            "realname" => $user["realname"],
            "mobile" => $user["mobile"],
            "price" => $order["totalprice"],
            "payprice" => $order["payprice"],
            "real_refundprice" => $order["real_refundprice"],
            "sub_refundprice" => $order["sub_refundprice"],
            "first_refundprice" => $order["first_refundprice"],
            "total_refundprice" => $order["total_refundprice"],
            "reason" => $order["reason"],
            "auth_reason" => $order["auth_reason"],
            "address"=>$detail["address"]."(".$detail["address_detail"].")",
            "start_time" => date("Y-m-d H:i",$detail["start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "end_time" =>   date("Y-m-d H:i",$detail["end_time"]),
            "sign_start_time" => date("Y-m-d H:i",$detail["sign_start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "sign_end_time" =>   date("Y-m-d H:i",$detail["sign_end_time"]),
        ];

        //发用户
        (new MessageConfig)
            ->setTemplate($params["event"])
            ->setTemplateData($param)
            ->setToUid($to_id)
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();

    }





    // 订单售后拒绝
    public function activityOrderShopRejectAfter(&$params)
    {
        ["order"=>$order] = $params;

        $order = Order::where("id" , $order["id"])->find();

        $detail = $order->detail;
        $user = $order->user;
        //记录订单日志
        $mini_type = "activity_order";
        $to_id = $order["user_id"];
        $status ="order";
        $params=[
            "event"=>"activity_order_shop_reject_after",
            "order_id"=>$order["id"],
            "order_no"=>$order["order_no"],
            "activity_id"=>$order["activity_id"],
            "title"=>$detail["title"],
            "images"=>$detail["images"],
        ];
        $param = [
            "title"=>$detail["title"],
            "order_no" => $order["order_no"],
            "nickname" => $user["nickname"],
            "realname" => $user["realname"],
            "mobile" => $user["mobile"],
            "price" => $order["totalprice"],
            "payprice" => $order["payprice"],
            "real_refundprice" => $order["real_refundprice"],
            "sub_refundprice" => $order["sub_refundprice"],
            "total_refundprice" => $order["total_refundprice"],
            "reason" => $order["reason"],
            "auth_reason" => $order["auth_reason"],
            "address"=>$detail["address"]."(".$detail["address_detail"].")",
            "start_time" => date("Y-m-d H:i",$detail["start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "end_time" =>   date("Y-m-d H:i",$detail["end_time"]),
            "sign_start_time" => date("Y-m-d H:i",$detail["sign_start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "sign_end_time" =>   date("Y-m-d H:i",$detail["sign_end_time"]),
        ];

        //发用户
        (new MessageConfig)
            ->setTemplate($params["event"])
            ->setTemplateData($param)
            ->setToUid($to_id)
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();

    }






    // 订单售后超时自动拒绝
    public function activityOrderTimeoutRejectAfter(&$params)
    {
        ["order"=>$order] = $params;

        $order = Order::where("id" , $order["id"])->find();

        $detail = $order->detail;
        $user = $order->user;
        //记录订单日志
        $mini_type = "activity_order";
        $to_id = $order["user_id"];
        $status ="order";
        $params=[
            "event"=>"activity_order_timeout_reject_after",
            "order_id"=>$order["id"],
            "order_no"=>$order["order_no"],
            "activity_id"=>$order["activity_id"],
            "title"=>$detail["title"],
            "images"=>$detail["images"],
        ];
        $param = [
            "title"=>$detail["title"],
            "order_no" => $order["order_no"],
            "nickname" => $user["nickname"],
            "realname" => $user["realname"],
            "mobile" => $user["mobile"],
            "price" => $order["totalprice"],
            "payprice" => $order["payprice"],
            "real_refundprice" => $order["real_refundprice"],
            "sub_refundprice" => $order["sub_refundprice"],
            "total_refundprice" => $order["total_refundprice"],
            "reason" => $order["reason"],
            "auth_reason" => $order["auth_reason"],
            "address"=>$detail["address"]."(".$detail["address_detail"].")",
            "start_time" => date("Y-m-d H:i",$detail["start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "end_time" =>   date("Y-m-d H:i",$detail["end_time"]),
            "sign_start_time" => date("Y-m-d H:i",$detail["sign_start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
            "sign_end_time" =>   date("Y-m-d H:i",$detail["sign_end_time"]),
        ];

        //发用户
        (new MessageConfig)
            ->setTemplate($params["event"])
            ->setTemplateData($param)
            ->setToUid($to_id)
            ->setMessageStatus($status)
            ->setMessageMiniType($mini_type)
            ->setMessageParams($params)
            ->sendMessage();

    }






}