Automation init...1
This commit is contained in:
parent
a83c1629cc
commit
80a4f4ade4
@ -2,12 +2,13 @@
|
||||
|
||||
namespace App\Controllers\CLI;
|
||||
|
||||
use App\Libraries\YamapLibrary;
|
||||
use App\Models\Mangboard\BoardModel;
|
||||
|
||||
use App\Libraries\YamapLibrary;
|
||||
use App\Libraries\MyWebLibrary;
|
||||
use App\Libraries\MyStorage\FileLibrary;
|
||||
use App\Libraries\MyCrawlerLibrary;
|
||||
use App\Libraries\Mangboard\GalleryBoardLibrary;
|
||||
use App\Libraries\Mangboard\BoardLibrary;
|
||||
use App\Entities\Mangboard\BoardEntity;
|
||||
use App\Controllers\BaseController;
|
||||
|
||||
@ -17,8 +18,7 @@ class Crawler extends BaseController
|
||||
{
|
||||
try {
|
||||
$isDebug = in_array("debug", $params);
|
||||
$nickname = getenv("yamap.view.default.nickname");
|
||||
//Yamap사이트에서 자유게시판에서 최근 게시물 데이터 가져오기
|
||||
//1.Yamap사이트에서 자유게시판에서 최근 게시물 데이터 가져오기
|
||||
if (!in_array("skip_build", $params)) {
|
||||
$myWeb = new MyWebLibrary(getenv('yamap.host.url'));
|
||||
$storage = new FileLibrary(WRITEPATH . "uploads");
|
||||
@ -44,7 +44,7 @@ class Crawler extends BaseController
|
||||
// }
|
||||
//3. 망보드 일반게시판에 게시물 등록 처리
|
||||
if (!in_array("skip_create", $params)) {
|
||||
$board = new GalleryBoardLibrary();
|
||||
$board = new BoardLibrary(new BoardModel(getenv("crawler.yamap.registration.table")));
|
||||
$board->setDebug($isDebug);
|
||||
|
||||
//미디어관련정보 entity에 넣기
|
||||
|
||||
@ -5,10 +5,10 @@ namespace App\Libraries\Mangboard;
|
||||
use App\Libraries\CommonLibrary;
|
||||
use App\Entities\Mangboard\BoardEntity;
|
||||
|
||||
abstract class BoardLibrary extends CommonLibrary
|
||||
class BoardLibrary extends CommonLibrary
|
||||
{
|
||||
private $_model = null;
|
||||
protected function __construct($model)
|
||||
public function __construct($model)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_model = $model;
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Libraries\Mangboard;
|
||||
|
||||
use App\Models\Mangboard\GalleryBoardModel;
|
||||
|
||||
class GalleryBoardLibrary extends BoardLibrary
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(new GalleryBoardModel());
|
||||
}
|
||||
protected function getModel(): GalleryBoardModel
|
||||
{
|
||||
return parent::getModel();
|
||||
}
|
||||
}
|
||||
@ -5,14 +5,16 @@ namespace App\Models\Mangboard;
|
||||
use App\Models\CommonModel;
|
||||
use App\Entities\Mangboard\BoardEntity;
|
||||
|
||||
abstract class BoardModel extends CommonModel
|
||||
class BoardModel extends CommonModel
|
||||
{
|
||||
// protected $table = 'mb_board_free';
|
||||
protected $primaryKey = 'pid';
|
||||
protected $returnType = BoardEntity::class;
|
||||
|
||||
protected function __construct(array $fields = [])
|
||||
public function __construct(string $table)
|
||||
{
|
||||
$fields = ["title", "user_name", "data_type", "editor_type", "content", ...$fields];
|
||||
$this->table = $table;
|
||||
$fields = ["title", "user_name", "data_type", "editor_type", "content"];
|
||||
parent::__construct($fields);
|
||||
}
|
||||
public function getTitleField(): string
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Mangboard;
|
||||
|
||||
use App\Models\CommonModel;
|
||||
|
||||
class GalleryBoardModel extends BoardModel
|
||||
{
|
||||
protected $table = 'mb_gallery_general';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([]);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user