Explorar el Código

修改c端:获取商品列表的接口;初步定义c端企业的接口

15313670163 hace 2 días
padre
commit
214f9cf91b

+ 33 - 1
app/Controller/WebController.php

@@ -1274,9 +1274,41 @@ class WebController extends AbstractController
         return $result['code'] == 200? Result::success($result['data']) : Result::error($result['message']);
     }
     /**
-     * c端-企业 企业列表
+     * c端-企业 模块企业
      * @return array
      */
+    public function getWebsiteCompany(){
+        $requireData = $this->request->all();
+        $validator = $this->validationFactory->make(
+            $requireData,
+            [
+                'level' =>'nullable|integer',
+                'category_id' =>'nullable|integer',
+                'imgnum' =>'required|integer',
+                'page' => 'required|integer',
+                'pageSize' =>'required|integer',
+            ],
+            [
+                'level.required' => '推荐等级不能为空',
+                'level.integer' => '推荐等级必须为整数',
+                'page.required' => '当前页不能为空',
+                'page.integer' => '当前页必须为整数',
+                'pageSize.required' => '每页数量不能为空',
+                'pageSize.integer' => '每页数量必须为整数',
+            ]
+        );
+        if ($validator->fails()){
+            $errorMessage = $validator->errors()->first();
+            return Result::error($errorMessage);
+        }
+        $requireData['user_id'] =  Context::get("UserId")?? 0;
+        $result = $this->newsServiceClient->getWebsiteCompany($requireData);
+        return $result['code'] == 200? Result::success($result['data']) : Result::error($result['message']);
+    }
+    /*
+    *c端-企业 企业列表
+    * @return array
+    */
     public function getWebsiteCompanyList(){
         $requireData = $this->request->all();
         $validator = $this->validationFactory->make(

+ 24 - 0
app/JsonRpc/NewsService.php

@@ -376,4 +376,28 @@ class NewsService extends AbstractServiceClient implements NewsServiceInterface
     {
         return $this->__request(__FUNCTION__, $data);
     }
+    /**
+     * @param array $data
+     * @return mixed
+     */
+    public function getWebsiteCompany(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }
+    /**
+     * @param array $data
+     * @return mixed
+     */
+    public function getWebsiteCompanyInfo(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }
+    /**
+     * @param array $data
+     * @return mixed
+     */
+    public function getWebsiteCompanyList(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }
 }

+ 16 - 0
app/JsonRpc/NewsServiceInterface.php

@@ -216,4 +216,20 @@ interface NewsServiceInterface
      * @return mixed
      */
     public function getWebsiteLevelJob(array $data);
+    /**
+     * @param array $data
+     * @return mixed
+     */
+    public function getWebsiteCompany(array $data);
+    /**
+     * @param array $data
+     * @return mixed
+     */
+    public function getWebsiteCompanyInfo(array $data);
+    /**
+     * @param array $data
+     * @return mixed
+     */
+    public function getWebsiteCompanyList(array $data);
+    
 }

+ 4 - 1
config/api/web.php

@@ -97,7 +97,10 @@ Router::addGroup(
                 // c端-招聘 推荐等级职位
                 Router::get('/getWebsiteLevelJob', [WebController::class, 'getWebsiteLevelJob']);
 
-                // c端  企业列表
+                // c端  
+                // 企业模块
+                Router::get('/getWebsiteCompany', [WebController::class, 'getWebsiteCompany']);
+                // 企业列表
                 Router::get('/getWebsiteCompanyList', [WebController::class, 'getWebsiteCompanyList']);
                 // 企业详情
                 Router::get('/getWebsiteCompanyInfo', [WebController::class, 'getWebsiteCompanyInfo']);