Przeglądaj źródła

'增加对接前必看文档'

lh 3 lat temu
rodzic
commit
d678e72790
1 zmienionych plików z 29 dodań i 211 usunięć
  1. 29 211
      src/Controllers/CompanyAuth/BaiDuAccountController.php

+ 29 - 211
src/Controllers/CompanyAuth/BaiDuAccountController.php

@@ -16,215 +16,33 @@ use General\Services\ChargeReport\BaiDuAccountService;
  */
  */
 class BaiDuAccountController extends Controller
 class BaiDuAccountController extends Controller
 {
 {
-    /**
-     * @apiDefine BaiDuAdAccount 百度广告账号
-     */
-//
-//    use BaseAuthConfig;
-//
-//    private $service;
-//
-//    public function __construct()
-//    {
-//        $this->service = new BaiDuAccountService;
-//    }
-//
-//    /**
-//     * @api {post} company/auth/baiduAdAccount/add 添加百度广告账号
-//     * @apiVersion 1.0.0
-//     * @apiName addBaiDuAdAccount
-//     * @apiGroup BaiDuAdAccount
-//     * @apiParam {String} app_id 分配好的{app_id}
-//     * @apiParam {String} nonce_str 随机字符串
-//     * @apiParam {String} timestamp 时间戳
-//     * @apiParam {String} sign 签名 规则同微信支付签名MD5(排序好的请求字符串&key=分配好的{app_secret})
-//     * @apiParam {String} phone 手机号
-//     * @apiParam {String} account_name 百度广告账号名称
-//     * @apiParam {String} token 百度广告账号授权token
-//     * @apiError {int}         code 状态码
-//     * @apiError {String}      msg  信息
-//     * @apiErrorExample {json} Error-Response:
-//     * HTTP/1.1 200 OK
-//     * [
-//     *   {
-//     *        'code' : 10030,
-//     *        'msg' : '未授权!'
-//     *   },
-//     *   {
-//     *        'code' : 10031,
-//     *        'msg' : 'IP未授权!'
-//     *   },
-//     *   {
-//     *        'code' : 10032,
-//     *        'msg' : '授权时间已过期!'
-//     *   },
-//     *   {
-//     *        'code' : 10033,
-//     *        'msg' : '授权签名错误!'
-//     *   },
-//     *   {
-//     *        'code' : 10034,
-//     *        'msg' : '查询数据为空!'
-//     *   },
-//     *   {
-//     *        'code' : 10035,
-//     *        'msg' : '查询数据时间长度不能超过30天!'
-//     *   },
-//     *   {
-//     *        'code' : 1002,
-//     *        'msg' : '查询参数错误!'
-//     *   },
-//     * ]
-//     * @apiSuccess {int}         code 状态码
-//     * @apiSuccess {String}      msg  信息
-//     * @apiSuccess {Object}      data 结果集
-//     * @apiSuccess {Int}         id 账号ID
-//     * @apiSuccessExample {json} Success-Response:
-//     * HTTP/1.1 200 OK
-//     *   {
-//     *       "code": 0,
-//     *       "msg": "",
-//     *       "data": [
-//     *           {
-//     *               "id": 130,
-//     *           }
-//     *       ]
-//     *   }
-//     */
-//    public function addBaiDuAdAccount(BaiDuAccountRequest $request)
-//    {
-//        $result = $this->service->addBaiduAdAccount($request->all());
-//        return response()->success([
-//            'id' => $result->id,
-//        ]);
-//    }
-//
-//    /**
-//     * @api {post} company/auth/baiduAdAccount/del 删除百度广告账号
-//     * @apiVersion 1.0.0
-//     * @apiName delBaiDuAdAccount
-//     * @apiGroup BaiDuAdAccount
-//     * @apiParam {String} app_id 分配好的{app_id}
-//     * @apiParam {String} nonce_str 随机字符串
-//     * @apiParam {String} timestamp 时间戳
-//     * @apiParam {String} sign 签名 规则同微信支付签名MD5(排序好的请求字符串&key=分配好的{app_secret})
-//     * @apiParam {String} phone 手机号
-//     * @apiParam {Int} id 账号ID
-//     * @apiError {int}         code 状态码
-//     * @apiError {String}      msg  信息
-//     * @apiErrorExample {json} Error-Response:
-//     * HTTP/1.1 200 OK
-//     * [
-//     *   {
-//     *        'code' : 10030,
-//     *        'msg' : '未授权!'
-//     *   },
-//     *   {
-//     *        'code' : 10031,
-//     *        'msg' : 'IP未授权!'
-//     *   },
-//     *   {
-//     *        'code' : 10032,
-//     *        'msg' : '授权时间已过期!'
-//     *   },
-//     *   {
-//     *        'code' : 10033,
-//     *        'msg' : '授权签名错误!'
-//     *   },
-//     *   {
-//     *        'code' : 10034,
-//     *        'msg' : '查询数据为空!'
-//     *   },
-//     *   {
-//     *        'code' : 10035,
-//     *        'msg' : '查询数据时间长度不能超过30天!'
-//     *   },
-//     *   {
-//     *        'code' : 1002,
-//     *        'msg' : '查询参数错误!'
-//     *   },
-//     * ]
-//     * @apiSuccess {int}         code 状态码
-//     * @apiSuccess {String}      msg  信息
-//     * @apiSuccess {Object}      data 结果集
-//     * @apiSuccess {Int}         id 账号ID
-//     * @apiSuccessExample {json} Success-Response:
-//     * HTTP/1.1 200 OK
-//     *   {
-//     *       "code": 0,
-//     *       "msg": "",
-//     *       "data": [
-//     *       ]
-//     *   }
-//     */
-//    public function delBaiDuAdAccount(DelBaiDuAccountRequest $request)
-//    {
-//        $this->service->delBaiduAdAccount($request->all());
-//        return response()->success();
-//    }
-//
-//    /**
-//     * @api {post} company/auth/baiDuAdAccount 获取百度广告账号
-//     * @apiVersion 1.0.0
-//     * @apiName baiDuAdAccount
-//     * @apiGroup BaiDuAdAccount
-//     * @apiParam {String} app_id 分配好的{app_id}
-//     * @apiParam {String} nonce_str 随机字符串
-//     * @apiParam {String} timestamp 时间戳
-//     * @apiParam {String} sign 签名 规则同微信支付签名MD5(排序好的请求字符串&key=分配好的{app_secret})
-//     * @apiParam {String} phone 手机号
-//     * @apiError {int}         code 状态码
-//     * @apiError {String}      msg  信息
-//     * @apiErrorExample {json} Error-Response:
-//     * HTTP/1.1 200 OK
-//     * [
-//     *   {
-//     *        'code' : 10030,
-//     *        'msg' : '未授权!'
-//     *   },
-//     *   {
-//     *        'code' : 10031,
-//     *        'msg' : 'IP未授权!'
-//     *   },
-//     *   {
-//     *        'code' : 10032,
-//     *        'msg' : '授权时间已过期!'
-//     *   },
-//     *   {
-//     *        'code' : 10033,
-//     *        'msg' : '授权签名错误!'
-//     *   },
-//     *   {
-//     *        'code' : 10034,
-//     *        'msg' : '查询数据为空!'
-//     *   },
-//     *   {
-//     *        'code' : 10035,
-//     *        'msg' : '查询数据时间长度不能超过30天!'
-//     *   },
-//     *   {
-//     *        'code' : 1002,
-//     *        'msg' : '查询参数错误!'
-//     *   },
-//     * ]
-//     * @apiSuccess {int}         code 状态码
-//     * @apiSuccess {String}      msg  信息
-//     * @apiSuccess {Object}      data 结果集
-//     * @apiSuccess {Int}         id 账号ID
-//     * @apiSuccess {String} account_name 百度广告账号名称
-//     * @apiSuccess {String} token 百度广告账号授权token
-//     * @apiSuccessExample {json} Success-Response:
-//     * HTTP/1.1 200 OK
-//     *   {
-//     *       "code": 0,
-//     *       "msg": "",
-//     *       "data": [
-//     *       ]
-//     *   }
-//     */
-//    public function baiDuAdAccount(BaiDuAccountQueryRequest $request)
-//    {
-//        $result = $this->service->findBaiduAdAccounts($request->get('phone'));
-//        return response()->success(collectionTransform(new BaiDuAdAccountTransformer, $result));
-//    }
+
+    use BaseAuthConfig;
+
+    private $service;
+
+    public function __construct()
+    {
+        $this->service = new BaiDuAccountService;
+    }
+
+    public function addBaiDuAdAccount(BaiDuAccountRequest $request)
+    {
+        $result = $this->service->addBaiduAdAccount($request->all());
+        return response()->success([
+            'id' => $result->id,
+        ]);
+    }
+
+    public function delBaiDuAdAccount(DelBaiDuAccountRequest $request)
+    {
+        $this->service->delBaiduAdAccount($request->all());
+        return response()->success();
+    }
+
+    public function baiDuAdAccount(BaiDuAccountQueryRequest $request)
+    {
+        $result = $this->service->findBaiduAdAccounts($request->get('phone'));
+        return response()->success(collectionTransform(new BaiDuAdAccountTransformer, $result));
+    }
 }
 }