CREATE TABLE books (
isbn VARCHAR(14) NOT NULL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
+ subtitle VARCHAR(255),
volume INTEGER,
series VARCHAR(255),
author VARCHAR(127),
setup.haml # setup book parameter view
```
+<div style="page-break-before:always"></div>
+
## テーブル設計
### ユーザ管理テーブル (users)
| 項番 | カラム名 | 型 | 属性 | 概要 |
-| --: | --- | --- | --- | --- |
+| --: | --- | --- | --- | --- |
| 1 | user_id | INTEGER | NOT NULL, AUTO_INCREMENT, PRIMARY KEY | ユーザID |
| 2 | user_name | VARCHAR(10) | NOT NULL, UNIQUE | ユーザ名 |
| 3 | full_name | VARCHAR(127) | | ユーザフルネーム |
| 6 | update_at | DATETIME | NOT NULL | 更新日時 |
注: isdn + user_id で複合キーとする。
-
### 書影管理テーブル (book\_covers)
| 項番 | カラム名 | 型 | 属性 | 概要 |
| --: | --- | --- | --- | --- |
[openBD](https://openbd.jp)
#### API仕様
- * 書誌情報取得:
- /get?isbn=ISBN,ISBN
- * 収録範囲の取得:
- /coverage
- * JSONスキーマの取得:
- /schema
+* 書誌情報の取得:
+ `/get?isbn=ISBN,ISBN`
+* 収録範囲の取得:
+ `/coverage`
+* JSONスキーマの取得:
+ `/schema`
@id = id
@username = user.full_name
@book_info = Hash.new
+ @update_f = book_update_f
rescue UserAccount::NotFoundInstanceError
raise WebError.new(status: 404, message: "ユーザ情報が存在しません。")
end
@id = id
@username = user.full_name
@book_info = BookManager.getBookCollect(isbn, id)
+ @update_f = book_update_f
rescue UserAccount::NotFoundInstanceError
raise WebError.new(status: 404, message: "ユーザ情報が存在しません。")
end
# 蔵書の登録/編集 (POST)
# @post_param isbn [String] ISBN
# @post_param title [String] 書名
+ # @post_param subtitle [String] 副題
# @post_param volume [Integer] 巻数
# @post_param series [String] 単行本シリーズ
# @post_param author [String] 著者
search_type: SEARCH_ON_BOOKS,
isbn: book.isbn,
title: book.title,
+ subtitle: book.subtitle,
volume: book.volume,
series: book.series,
author: book.author,
{
isbn: book[:isbn],
title: book[:title],
+ subtitle: book[:subtitle],
volume: book[:volume],
series: book[:series],
author: book[:author],
書名
%td
#{book_title}
+ - if book_info[:subtitle] != nil and book_info[:subtitle] != ""
+ %tr
+ %th
+ 副題
+ %td
+ #{book_info[:subtitle]}
- if book_info[:series] != nil and book_info[:series] != ""
%tr
%th
巻数:
%input{ :name => 'volume', :type => 'text', :class => 'input_text', :id => 'volume', :size => 3, :value => book_info[:volume]}
+ .item
+ %label{ :for => 'subtitle' }
+ %span
+ 副題:
+ %input{ :name => 'subtitle', :type => 'text', :class => 'input_text', :id => 'subtitle', :value => book_info[:subtitle]}
+
.item
%label{ :for => 'series' }
%span