Commit e5c586ed by 杨树贤

修改所有的服务请求为POST

parent b7ed8dd7
......@@ -16,7 +16,7 @@ class ExchangeSettingsApiController extends Controller
public function exchangeSettingListApi(Request $request, ExchangeSettingService $service)
{
$data = $service->getExchangeSettingList('/exchange_settings?' . urldecode(http_build_query($request->all())));
$data = $service->getExchangeSettingList('/exchange_settings/list?' . urldecode(http_build_query($request->all())));
$data = $this->transformer($data);
return $this->apiReturn(0, 'ok', [
......@@ -40,21 +40,21 @@ class ExchangeSettingsApiController extends Controller
public function storeExchangeSettingApi(ExchangeSettingApiRequest $request, ExchangeSettingService $service)
{
$result = $service->storeExchangeSetting('/exchange_settings', $request->all());
$result = $service->storeExchangeSetting('/exchange_settings/add', $request->all());
return $result;
}
public function updateExchangeSettingApi(ExchangeSettingApiRequest $request, ExchangeSettingService $service)
{
$result = $service->updateExchangeSetting('/exchange_settings/' . $request->id, $request->all());
$result = $service->updateExchangeSetting('/exchange_settings/update?id=' . $request->id, $request->all());
return $result;
}
public function deleteExchangeSettingApi(Request $request, ExchangeSettingService $service)
{
$result = $service->deleteExchangeSetting('/exchange_settings/' . $request->id);
$result = $service->deleteExchangeSetting('/exchange_settings/delete?id=' . $request->id);
return $result;
}
......@@ -63,7 +63,7 @@ class ExchangeSettingsApiController extends Controller
{
$id = $request->id;
$status = $request->status;
$path = '/exchange_settings/' . $id;
$path = '/exchange_settings/update?id=' . $id;
$result = $this->service->changeExchangeSettingStatus($path, ['status' => $status]);
return $result;
......
......@@ -20,7 +20,7 @@ class IntegralsApiController extends Controller
public function integralListApi(Request $request, IntegralService $service)
{
$data = $service->getIntegralList('/integrals?' . urldecode(http_build_query($request->all())));
$data = $service->getIntegralList('/integrals/list?' . urldecode(http_build_query($request->all())));
$data = $this->transformer($data);
return $this->apiReturn(0, 'ok', [
......@@ -45,21 +45,21 @@ class IntegralsApiController extends Controller
public function storeIntegralApi(IntegralApiRequest $request, IntegralService $service)
{
$result = $service->storeIntegral('/integrals', $request->all());
$result = $service->storeIntegral('/integrals/add', $request->all());
return $result;
}
public function updateIntegralApi(IntegralApiRequest $request, IntegralService $service)
{
$result = $service->updateIntegral('/integrals/' . $request->id, $request->all());
$result = $service->updateIntegral('/integrals/update?id=' . $request->id, $request->all());
return $result;
}
public function deleteIntegralApi(Request $request, IntegralService $service)
{
$result = $service->deleteIntegral('/integrals/' . $request->id);
$result = $service->deleteIntegral('/integrals/delete?id=' . $request->id);
return $result;
}
......@@ -68,7 +68,7 @@ class IntegralsApiController extends Controller
{
$id = $request->id;
$status = $request->status;
$path = 'integrals/' . $id;
$path = 'integrals/update?id=' . $id;
$result = $this->service->changeIntegralStatus($path, ['status' => $status]);
return $result;
......
......@@ -62,8 +62,7 @@ class UserExchangesApiController extends Controller
{
$id = $request->id;
$status = $request->status;
$path = 'user_exchanges/' . $id;
$result = $this->service->changeUserExchangeStatus($path, ['status' => $status]);
$result = $this->service->changeUserExchangeStatus($id, ['status' => $status]);
return $result;
}
......
......@@ -48,7 +48,7 @@ class UserIntegralsApiController extends Controller
{
$id = $request->id;
$status = $request->status;
$path = 'user_integrals/' . $id;
$path = 'user_integrals/update?id=' . $id;
$result = $this->service->changeUserIntegralStatus($path, ['status' => $status]);
return $result;
......
......@@ -56,7 +56,7 @@ class ExchangeSettingsController extends Controller
public function updateExchangeSetting(Request $request)
{
$this->data['title'] = '修改红包配置';
$exchangeSetting = $this->service->getExchangeSetting('/exchange_settings/' . $request->id);
$exchangeSetting = $this->service->getExchangeSetting('/exchange_settings/info?id=' . $request->id);
$this->data['exchangeSetting'] = $exchangeSetting['data'];
return $this->view();
......
......@@ -45,7 +45,7 @@ class IntegralBillsController extends Controller
$integralService = new IntegralService();
//获取红包列表做tab项
$integrals = array_get($integralService->getIntegralList('/integrals'), 'data');
$integrals = array_get($integralService->getIntegralList('/integrals/list'), 'data');
$this->data['integrals'] = $integrals;
......
......@@ -9,9 +9,10 @@ use Illuminate\Http\Request;
class IntegralsController extends Controller
{
private $service;
private $service;
public function __construct(IntegralService $service) {
public function __construct(IntegralService $service)
{
$this->service = $service;
}
......@@ -57,7 +58,7 @@ class IntegralsController extends Controller
public function updateIntegral(Request $request)
{
$this->data['title'] = '修改红包';
$integral = $this->service->getIntegral('/integrals/' . $request->id);
$integral = $this->service->getIntegral('/integrals/info?id=' . $request->id);
$this->data['integral'] = $integral['data'];
return $this->view();
......
......@@ -6,17 +6,17 @@ class ExchangeSettingService extends BaseService
{
public function getExchangeSetting($path)
{
return $this->apiGet($path);
return $this->apiPost($path);
}
public function getExchangeSettingList($path)
{
return $this->apiGet($path);
return $this->apiPost($path);
}
public function deleteExchangeSetting($path)
{
return $this->apiDelete($path);
return $this->apiPost($path);
}
public function storeExchangeSetting($path, $data)
......@@ -26,12 +26,12 @@ class ExchangeSettingService extends BaseService
public function updateExchangeSetting($path, $data)
{
return $this->apiPatch($path, $data);
return $this->apiPost($path, $data);
}
public function changeExchangeSettingStatus($path, $data = [])
{
return $this->apiPatch($path, $data);
return $this->apiPost($path, $data);
}
public function batchUpdateStatus($path, $data = [])
......
......@@ -8,8 +8,8 @@ class IntegralBillService extends BaseService
{
public function getIntegralBillList($params)
{
$path = '/integral_bills?' . http_build_query($params);
$path = '/integral_bills/list?' . http_build_query($params);
return $this->apiGet($path);
return $this->apiPost($path);
}
}
\ No newline at end of file
......@@ -8,17 +8,17 @@ class IntegralService extends BaseService
{
public function getIntegral($path)
{
return $this->apiGet($path);
return $this->apiPost($path);
}
public function getIntegralList($path)
{
return $this->apiGet($path);
return $this->apiPost($path);
}
public function deleteIntegral($path)
{
return $this->apiDelete($path);
return $this->apiPost($path);
}
public function storeIntegral($path, $data)
......@@ -28,12 +28,12 @@ class IntegralService extends BaseService
public function updateIntegral($path, $data)
{
return $this->apiPatch($path, $data);
return $this->apiPost($path, $data);
}
public function changeIntegralStatus($path, $data = [])
{
return $this->apiPatch($path, $data);
return $this->apiPost($path, $data);
}
public function batchUpdateStatus($path, $data = [])
......
......@@ -10,20 +10,21 @@ class UserExchangeService extends BaseService
{
public function getUserExchange($userId)
{
$path = '/user_exchanges/' . $userId;
$path = '/user_exchanges/info?id=' . $userId;
return $this->apiGet($path);
return $this->apiPost($path);
}
public function getUserExchangeList($params)
{
$path = '/user_exchanges?' . http_build_query($params);
return $this->apiGet($path);
$path = '/user_exchanges/list?' . http_build_query($params);
return $this->apiPost($path);
}
public function changeUserExchangeStatus($path, $data = [])
public function changeUserExchangeStatus($id, $data = [])
{
return $this->apiPatch($path, $data);
$path = 'user_exchanges/update?id=' . $id;
return $this->apiPost($path, $data);
}
public function batchUpdateStatus($path, $data = [])
......
......@@ -10,16 +10,16 @@ class UserIntegralService extends BaseService
{
public function getUserIntegral($userId)
{
$path = '/user_integrals/' . $userId;
$path = '/user_integrals/info?id=' . $userId;
return $this->apiGet($path);
return $this->apiPost($path);
}
public function getUserIntegralList($params)
{
$path = '/user_integrals?' . http_build_query($params);
$path = '/user_integrals/list?' . http_build_query($params);
return $this->apiGet($path);
return $this->apiPost($path);
}
public function getUsersFromRedis($userIds = [])
......@@ -43,7 +43,7 @@ class UserIntegralService extends BaseService
public function changeUserIntegralStatus($path, $data = [])
{
return $this->apiPatch($path, $data);
return $this->apiPost($path, $data);
}
public function batchUpdateStatus($path, $data = [])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment