40 lines
794 B
PHP
40 lines
794 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Wx;
|
|
|
|
use App\BaseApp\BaseController;
|
|
use App\Service\wx\WxAddressService;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
/**
|
|
* 小程序收货地址
|
|
*/
|
|
class AddressController extends BaseController
|
|
{
|
|
protected array $exceptRoute = ['option'];
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->service = WxAddressService::getInstance();
|
|
}
|
|
|
|
/**
|
|
* 默认地址
|
|
* @Method GET
|
|
*/
|
|
public function defaultOne(): JsonResponse
|
|
{
|
|
return jok($this->service->defaultOne());
|
|
}
|
|
|
|
/**
|
|
* 设为默认
|
|
* @Method POST
|
|
*/
|
|
public function setDefault(): JsonResponse
|
|
{
|
|
return jok($this->service->setDefault((int) request()->post('id', 0)), '已设为默认');
|
|
}
|
|
}
|