repository = $repository; } /** * @return mixed * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author 史晨 * @date 2026/3/20 10:13 * 自提点地址列表 */ public function getList() { $params = request()->get(); $list = $this->repository->adminList($params); return app('json')->success($list); } /** * @return mixed * @author 史晨 * @date 2026/3/20 10:32 * 添加自提点 */ public function add() { $params = request()->post(); $res = $this->repository->add($params); if (!$res) { return app('json')->fail('添加失败'); } return app('json')->success('添加成功'); } /** * @param $id * @return mixed * @author 史晨 * @date 2026/3/20 10:32 * 获取自提点信息 */ public function get($id) { $data = $this->repository->get($id); if (!$data) { return app('json')->fail('获取失败'); } return app('json')->success($data); } /** * @param $id * @return mixed * @author 史晨 * @date 2026/3/20 10:33 * 更新自提点信息 */ public function update($id) { $params = request()->post(); $res = $this->repository->update($id, $params); if (!$res) { return app('json')->fail('添加失败'); } return app('json')->success('添加成功'); } }