diff --git a/app/Controllers/CLI/Mangboard/MangboardController.php b/app/Controllers/CLI/Mangboard/MangboardController.php new file mode 100644 index 0000000..29f2026 --- /dev/null +++ b/app/Controllers/CLI/Mangboard/MangboardController.php @@ -0,0 +1,19 @@ +session = \Config\Services::session(); + } +} diff --git a/app/Controllers/CLI/Mangboard/UserController.php b/app/Controllers/CLI/Mangboard/UserController.php index b80d122..18a2710 100644 --- a/app/Controllers/CLI/Mangboard/UserController.php +++ b/app/Controllers/CLI/Mangboard/UserController.php @@ -8,7 +8,7 @@ use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; use Psr\Log\LoggerInterface; -class UserController extends BaseController +class UserController extends MangboardController { private $_model = null; public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) diff --git a/app/Entities/Mangboard/MangboardEntity.php b/app/Entities/Mangboard/MangboardEntity.php new file mode 100644 index 0000000..02b8a0a --- /dev/null +++ b/app/Entities/Mangboard/MangboardEntity.php @@ -0,0 +1,16 @@ +getPK()}:{$this->getID()}:{$this->getName()}"; @@ -18,15 +14,14 @@ class UserEntity extends Entity { return $this->attributes['pid']; } - public function getID() - { - return $this->attributes['user_id']; - } public function getName() { return $this->attributes['user_name']; } - + public function getID() + { + return $this->attributes['user_id']; + } public function getPoint() { return $this->attributes['user_point']; diff --git a/app/Models/Mangboard/BaseModel.php b/app/Models/Mangboard/MangboardModel.php similarity index 98% rename from app/Models/Mangboard/BaseModel.php rename to app/Models/Mangboard/MangboardModel.php index 8869abf..20c0074 100644 --- a/app/Models/Mangboard/BaseModel.php +++ b/app/Models/Mangboard/MangboardModel.php @@ -4,7 +4,7 @@ namespace App\Models\Mangboard; use CodeIgniter\Model; -class BaseModel extends Model +class MangboardModel extends Model { protected $table = ''; protected $primaryKey = ''; diff --git a/app/Models/Mangboard/UserModel.php b/app/Models/Mangboard/UserModel.php index e7c3ebd..594db45 100644 --- a/app/Models/Mangboard/UserModel.php +++ b/app/Models/Mangboard/UserModel.php @@ -4,7 +4,7 @@ namespace App\Models\Mangboard; use App\Entities\Mangboard\UserEntity; -class UserModel extends BaseModel +class UserModel extends MangboardModel { protected $table = 'mb_users'; protected $primaryKey = 'pid';