Commit 8eb5e694 by 杨树贤

完成红包活动列表接口

parent 94cbd61d
...@@ -7,7 +7,8 @@ SYSTEM_CODE=09 ...@@ -7,7 +7,8 @@ SYSTEM_CODE=09
SYSTEM_NAME=商品Api SYSTEM_NAME=商品Api
ELK_NAME=ic_welfare_api ELK_NAME=ic_welfare_api
GoodsInfoUrl=http://192.168.2.232:61009 BaseUrl=http://192.168.10.10:61009
#BaseUrl=http://ic_server_welfare.test
ES_URL=http://soapi.icsales.com:8001 ES_URL=http://soapi.icsales.com:8001
authapi=http://authapi.icsales.cc authapi=http://authapi.icsales.cc
......
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Services\IntegralService;
use App\Services\UserIntegralService;
class IntegralsController extends Controller
{
private $service;
public function __construct(IntegralService $service)
{
$this->service = $service;
}
public function index(Request $request, UserIntegralService $userIntegralService)
{
$map = ['is_api' => 1];
$result = $this->service->getIntegralList($map);
$userIntegral = $userIntegralService->getUserIntegral(['id' => 96]);
if ($userIntegral) {
$result['integral'] = $userIntegral['data']['integral'];
}
return $this->Export(0, 'ok', $result);
}
}
\ No newline at end of file
<?php
namespace App\Services;
class IntegralService
{
public function getIntegralList($map = [])
{
$url = config('website.BaseUrl') . '/integrals/list';
$result = reportCurl($url, $map, true);
$result = json_decode($result, true);
return $result;
}
}
\ No newline at end of file
<?php
namespace App\Services;
class UserIntegralService
{
public function getUserIntegral($map = [])
{
$url = config('website.BaseUrl') . '/user_integrals/info';
$result = reportCurl($url, $map, true);
$result = json_decode($result, true);
return $result;
}
}
\ No newline at end of file
...@@ -7,23 +7,29 @@ ...@@ -7,23 +7,29 @@
*/ */
return [ return [
'SystemCode'=>env('SYSTEM_CODE','00'),//系统编码,需要在tapd维护,请勿占用已使用的编码 'SystemCode' => env('SYSTEM_CODE', '00'),//系统编码,需要在tapd维护,请勿占用已使用的编码
'SystemName'=>env('SYSTEM_NAME','这家伙没设置系统'),//系统名称 'SystemName' => env('SYSTEM_NAME', '这家伙没设置系统'),//系统名称
'GoodsInfoUrl' => env('GoodsInfoUrl',''), 'BaseUrl' => env('BaseUrl', ''),
'ES_URL' => env('ES_URL'), 'ES_URL' => env('ES_URL'),
'authapi' => env('authapi'), 'authapi' => env('authapi'),
'allow_origin'=>[ 'allow_origin' => [
'http://home.icsales.cc', 'http://home.icsales.cc',
'http://search.icsales.cc', 'http://search.icsales.cc',
'http://loss.liexin.net', 'http://loss.liexin.net',
], ],
'language'=>[ 'language' => [
'' '',
], ],
'upload_goods_num'=>200, 'upload_goods_num' => 200,
'upload_goods_title'=>[ 'upload_goods_title' => [
'*型号','*品牌','封装','库存','单价','币种(人民币/美金)','*货期(现货/货期)' '*型号',
'*品牌',
'封装',
'库存',
'单价',
'币种(人民币/美金)',
'*货期(现货/货期)',
], ],
'UploadKey' => 'fh6y5t4rr351d2c3bryi',//api的秘钥 'UploadKey' => 'fh6y5t4rr351d2c3bryi',//api的秘钥
'UploadUrl' => 'http://api.liexin.com/oss/upload',//上传OSS地址 'UploadUrl' => 'http://api.liexin.com/oss/upload',//上传OSS地址
]; ];
\ No newline at end of file
...@@ -15,19 +15,22 @@ $router->get('/', function () use ($router) { ...@@ -15,19 +15,22 @@ $router->get('/', function () use ($router) {
return $router->app->version(); return $router->app->version();
}); });
$router->group(['middleware' => ['web','login']], function ()use($router) { $router->group(['middleware' => ['web', 'login']], function () use ($router) {
$router->get('/goods/add', 'ApiController@AddGoods'); $router->get('/goods/add', 'ApiController@AddGoods');
$router->get('/goods/info', 'ApiController@GoodsInfo'); $router->get('/goods/info', 'ApiController@GoodsInfo');
$router->get('/goods/save', 'ApiController@SaveGoods'); $router->get('/goods/save', 'ApiController@SaveGoods');
$router->get('/goods/status', 'ApiController@GoodsStatus'); $router->get('/goods/status', 'ApiController@GoodsStatus');
$router->get('/goods/count', 'ApiController@MysqlGoodsCount'); $router->get('/goods/count', 'ApiController@MysqlGoodsCount');
$router->post('/goods/upload', 'ApiController@UploadGoods'); $router->post('/goods/upload', 'ApiController@UploadGoods');
$router->options('/goods/upload', 'ApiController@UploadGoods');//前端插件需要这个请求 $router->options('/goods/upload', 'ApiController@UploadGoods');//前端插件需要这个请求
$router->get('/goods/upload/list', 'ApiController@UploadGoodsList'); $router->get('/goods/upload/list', 'ApiController@UploadGoodsList');
}); });
$router->group(['middleware' => 'web'], function ()use($router) { $router->group(['middleware' => 'web'], function () use ($router) {
$router->post('/oss/upload', 'OssController@upload'); $router->post('/oss/upload', 'OssController@upload');
$router->get('/goods/search', 'ApiController@GoodsInfo'); $router->get('/goods/search', 'ApiController@GoodsInfo');
}); });
//$router->get('crossdomain.xml', 'ApiController@crossdomain');
\ No newline at end of file //红包活动信息
$router->get('/integrals/list', 'IntegralsController@index');
\ No newline at end of file
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