Commit 5be98e14 authored by 王源's avatar 王源 🎧

删除无用

parent fa68d075
...@@ -24,12 +24,12 @@ class BaseService ...@@ -24,12 +24,12 @@ class BaseService
* @param $id * @param $id
* @return Model | array * @return Model | array
*/ */
public function find($id) protected function find($id)
{ {
$model = $this->model->find($id); $model = $this->model->find($id);
if (!$model) { // if (!$model) {
return Helper::fail('', '数据不存在', 404); // return Helper::fail('', '数据不存在', 404);
} // }
return $model; return $model;
} }
...@@ -41,6 +41,9 @@ class BaseService ...@@ -41,6 +41,9 @@ class BaseService
public function get($id) public function get($id)
{ {
$model = $this->find($id); $model = $this->find($id);
if (!$model) {
return Helper::fail('', '数据不存在', 404);
}
return Helper::success($model); return Helper::success($model);
} }
......
<?php
/**
* Created by PhpStorm.
* User: 王源
* Date: 2020/1/9
* Time: 15:07
*/
namespace Meibuyu\Micro\Service\Interfaces;
interface AuthServiceInterface
{
/**
* 登录
* @param array $params
* @return mixed
*/
public function login(array $params);
/**
* 登出
* @return mixed
*/
public function logout();
/**
* 获取单个数据
* @param $id
* @return mixed
*/
public function get($id);
/**
* 更新数据
* @param $id
* @param array $params
* @return mixed
*/
public function update($id, $params);
}
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 to comment