Skip to content
Lin Liu edited this page Oct 11, 2013 · 18 revisions

1. System Architecture

TODO

2. Controller && Action

Admin

  • BookController
    • listAction
      • Description: 书籍管理列表
      • Template: book-list.phtml
  • CatalogueController
    • editAction
      • Description: 书籍目录修改页面
      • Template: catalogue-edit.phtml
    • editItemAction
      • Description: 修改书籍某一目录项的文章(增删文章)
      • Template: catalogue-edit-item.phtml
  • ArticleController
    • editAction
      • Description: 文章修改、新增页面
      • Template: article-edit.phtml

Front

  • BookController
    • listAction
      • Description: 书籍管理列表
      • Template: book-list.phtml
    • viewAction
      • Description: 书籍目录查看页面(书籍简介、目录)
      • Template: book-view.phtml
  • ArticleController
    • viewAction
      • Description: 文章查看
      • Template: article-view.phtml

3. Blocks

TODO

4. APIs

TODO

5. Main logic flow chart

TODO

6. Database

Tabel book

Description Field Type Length Default value More
Unique ID id unsigned int 10 NULL Unique, Not null, auto_increment
Book Title title varchar 255 ' ' Not null
Book Cover cover_url varchar 255 ' ' Nullable
Book Introduction introduction text ' ' Nullable
Catalogue ID catalogue_id unsigned int 10 NULL Not null

Table catalogue

Description Field Type Length Default value More
Unique ID id unsigned int 10 NULL Unique, Not null, auto_increment
Catalogue Data data text '' Nullable

注:目录表参考了pi的 ****_core_navigation_node表,其中的 data 字段用来存储目录,其树形结构是用json数据来描述的。

Table calalogue_rel_article

Description Field Type Length Default value More
Unique ID id unsigned int 10 NULL Unique, Not null, auto_increment
Book ID book_id unsigned int 10 Not null
Catalogue ID catalogue_id unsigned int 10 Not null
Article ID catalogue_id unsigned int 10 Not null

Table article

Description Field Type Length Default value More
Unique ID id unsigned int 10 NULL Unique, Not null, auto_increment
Article Title title varchar 255 ' ' Not null
Article Meta Type meta_type varchar 32 ' ' Nullable
Article Content content text ' ' Nullable

SQL

CREATE TABLE `{book}` (
  `id`              int(10) unsigned                NOT NULL AUTO_INCREMENT,
  `title`           varchar(255)                    NOT NULL,
  `cover_url`       varchar(255)                    NULL, 
  `introduction`    text                            NULL,
  `catalogue_id`    int(10) unsigned                NULL,
  PRIMARY KEY       (`id`) 
);

CREATE TABLE `{catalogue}` (
  `id`              int(10) unsigned                NOT NULL AUTO_INCREMENT,
  `data`            text                            NULL,
 PRIMARY KEY        (`id`)
);

CREATE TABLE `{catalogue_rel_article}` (
  `id`              int(10) unsigned               NOT NULL AUTO_INCREMENT,
  `book_id`         int(10) unsigned               NOT NULL,
  `cata_data_id`    int(10) unsigned               NOT NULL,
  `article_id`      int(10) unsigned               NOT NULL,
 PRIMARY KEY        (`id`)
);

CREATE TABLE `{article}` (
  `id`              int(10) unsigned                NOT NULL AUTO_INCREMENT,
  `title`           varchar(255)                    NOT NULL,
  `content`         text                            NULL, 
  `meta_type`       varchar(32)                     NULL, 
  PRIMARY KEY       (`id`)
);

7. System Component

TODO

8. Configuration

TODO

Clone this wiki locally