<?php

namespace App\Generated\V1_1\Messages\AdminPartner;

use Kamicloud\StubApi\Concerns\ValueHelper;
use Kamicloud\StubApi\Http\Messages\Message;
use Kamicloud\StubApi\Utils\Constants;
use App\Generated\V1_1\DTOs\PageDTO;
use App\Generated\V1_1\DTOs\AdminPartnerDTO;

class LowListMessage extends Message
{
    use ValueHelper;

    protected $pages;
    protected $page;
    protected $partners;

    /**
     * 页码
     * @return int|null
     */
    public function getPages()
    {
        return $this->pages;
    }

    public function requestRules()
    {
        return [
            ['pages', 'pages', 'bail|nullable|integer', Constants::INTEGER | Constants::OPTIONAL, null],
        ];
    }

    public function responseRules()
    {
        return [
            ['page', 'page', PageDTO::class, Constants::MODEL, null],
            ['partners', 'partners', AdminPartnerDTO::class, Constants::MODEL | Constants::ARRAY, null],
        ];
    }

    public function setResponse($page, $partners)
    {
        $this->page = $page;
        $this->partners = $partners;
    }

}
