<?php

namespace app\workerapi\controller;

use app\workerapi\logic\MasterWorkerAgreeLogic;

class MasterWorkerAgreeController extends BaseApiController
{

    /**
     * 我的协议列表
     * @return \think\response\Json
     */
    public function agreement()
    {
        $result = [
            [
                'type'=>'master_service',
                'value'=>'服务合作协议'
            ],
            [
                'type'=>'master_bill',
                'value'=>'开票授权协议'
            ],
            [
                'type'=>'master_privacy',
                'value'=>'隐私政策'
            ],
            [
                'type'=>'master_allow',
                'value'=>'工程师软件许可协议'
            ],
        ];
        return $this->data($result);
    }

    /**
     * 协议详情
     * @return \think\response\Json
     */
    public function agreement_detail()
    {
        $type = $this->request->get('type/s', '');
        $result = MasterWorkerAgreeLogic::getAgreeByType($type);
        return $this->data($result);
    }

}