<?php

namespace SRVX\Api\Controllers\Alipay;

use SRVX\Api\Controllers\ControllerBase;
use SRVX\Msg;
use SRVX\Service\AliBPass\demo\AliEcoService;


class BPassController extends ControllerBase
{

    public function initialize()
    {
        parent::initialize();
    }

    public function AlipayPlanetEcocampusApiRosterSignUpInfoAction()
    {
        if ($this->request->isPost()) {
            $args = $this->request->getJsonRawBody(true);

            $result = (new AliEcoService())->alipayPlanetEcocampusApiRosterSignUpInfo(
                $args["face_uid"],$args["parent_uid"],
                $args["parent_logon_id"], $args["roster_name"],
                $args["out_roster_code"], $args["school_code"], $args["school_name"],
                $args["face_open_status"], $args["scan_face_pay_status"]
            );

            if (!$result["status"]) {
                $this->api(Msg::NewError($result["data"]["code"] ?? 500, $result["msg"]));
            }
            $this->api($result["data"]);
        } else {
            $this->api(Msg::NewError(500, '提交方式错误！'));
        }
    }

}
