50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace app\api\controller\user;
|
|
|
|
use app\api\controller\BaseApiController;
|
|
use app\api\lists\user\UserAddressList;
|
|
use app\api\logic\user\AddressLogic;
|
|
use app\api\validate\UserAddressValidate;
|
|
|
|
|
|
class AddressController extends BaseApiController
|
|
{
|
|
public function lists(){
|
|
return $this->dataLists(new UserAddressList());
|
|
}
|
|
/**
|
|
* @notes 编辑地址
|
|
* @return \support\Response
|
|
* @author likeadmin
|
|
* @date 2024/4/24 10:37
|
|
*/
|
|
public function edit()
|
|
{
|
|
$params = (new UserAddressValidate())->post()->goCheck('edit');
|
|
if(AddressLogic::edit($params)){
|
|
return $this->success('编辑成功');
|
|
}else{
|
|
return $this->fail(AddressLogic::getError());
|
|
}
|
|
}
|
|
/**
|
|
* @notes 获取地址详情
|
|
* @return \support\Response
|
|
* @author likeadmin
|
|
* @date 2024/4/24 10:37
|
|
*/
|
|
public function detail()
|
|
{
|
|
$id = $this->request->get('id');
|
|
$uid = $this->request->get('uid');
|
|
if($id){
|
|
$params = ['id' => $id];
|
|
}
|
|
if($uid){
|
|
$params = ['uid' => $uid];
|
|
}
|
|
return $this->success('获取成功',AddressLogic::detail($params));
|
|
}
|
|
}
|