first commit

This commit is contained in:
编码猿
2024-09-27 01:06:04 +08:00
commit cbed24c40d
205 changed files with 8732 additions and 0 deletions

View File

@@ -0,0 +1 @@
62bda268-f190-4e44-8b1d-b8b46d220567

View File

@@ -0,0 +1 @@
856beba3-b65b-411b-acd6-af8cce29940b

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Model\Dao;
use BmobObject;
class BmobDao {
protected $bmobObj;
/**
* 向数据库添加一条数据
* @param array $params
* @return mixed
*/
protected function addNewObject (array $params) {
$this->newBmob($params['tableName']);
return $this->bmobObj->create($params['data']);
}
protected function newBmob($tableName = ""): void {
$this->bmobObj = new BmobObject($tableName);
}
}

View File

@@ -0,0 +1,16 @@
<?php
namespace App\Model\Dao;
use Swoft\Bean\Annotation\Mapping\Bean;
/**
* @Bean("CourseDao")
* @package App\Model\Dao
*/
class CourseDao extends BmobDao {
public function addNewCourseDao (array $params) {
return $this->addNewObject($params);
}
}

View File

@@ -0,0 +1 @@
5b1fd486-d467-4fb0-a89d-859fa4aa855f

View File

@@ -0,0 +1,9 @@
<?php
namespace App\Model\Service;
interface CourseInterface {
public function addNewCourse(array $info);
}

View File

@@ -0,0 +1 @@
691c4bfc-2484-4c05-aed5-e2aad8d6115c

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Model\Service\impl;
use App\Model\Service\CourseInterface;
use Swoft\Bean\Annotation\Mapping\Bean;
use Swoft\Bean\Annotation\Mapping\Inject;
/**
* @Bean("CourseService")
*/
class CourseService implements CourseInterface {
/**
* @Inject("CourseDao")
*/
private $CourseDao;
public function addNewCourse(array $info) {
$data = [
"tableName" => "coures",
"data" => $info
];
return $this->CourseDao->addNewCourseDao($data);
}
}