更新若干功能
This commit is contained in:
39
app/Http/Controllers/Wx/AddressController.php
Normal file
39
app/Http/Controllers/Wx/AddressController.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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)), '已设为默认');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user