记开发个人图书收藏清单小程序开发(三)DB设计

时间:2021-06-14 15:53:40

主要是参考豆瓣的图书查询接口:

https://api.douban.com/v2/book/isbn/:9780132350884

返回内容如下:

 {
"rating": {
"max": 10,
"numRaters": 361,
"average": "8.8",
"min": 0
},
"subtitle": "A Handbook of Agile Software Craftsmanship",
"author": [
"Robert C. Martin"
],
"pubdate": "2008-8-11",
"tags": [
{
"count": 295,
"name": "编程",
"title": "编程"
},
{
"count": 257,
"name": "programming",
"title": "programming"
},
{
"count": 150,
"name": "软件开发",
"title": "软件开发"
},
{
"count": 109,
"name": "程序设计",
"title": "程序设计"
},
{
"count": 100,
"name": "计算机",
"title": "计算机"
},
{
"count": 87,
"name": "软件工程",
"title": "软件工程"
},
{
"count": 66,
"name": "敏捷开发",
"title": "敏捷开发"
},
{
"count": 55,
"name": "agile",
"title": "agile"
}
],
"origin_title": "",
"image": "https://img3.doubanio.com/view/subject/m/public/s29624974.jpg",
"binding": "Paperback",
"translator": [ ],
"catalog": "",
"pages": "464",
"images": {
"small": "https://img3.doubanio.com/view/subject/s/public/s29624974.jpg",
"large": "https://img3.doubanio.com/view/subject/l/public/s29624974.jpg",
"medium": "https://img3.doubanio.com/view/subject/m/public/s29624974.jpg"
},
"alt": "https://book.douban.com/subject/3032825/",
"id": "3032825",
"publisher": "Prentice Hall",
"isbn10": "0132350882",
"isbn13": "9780132350884",
"title": "Clean Code",
"url": "https://api.douban.com/v2/book/3032825",
"alt_title": "",
"author_intro": "Robert C. “Uncle Bob” Martin has been a software professional since 1970 and an international software consultant since 1990. He is founder and president of Object Mentor, Inc., a team of experienced consultants who mentor their clients worldwide in the fields of C++, Java, C#, Ruby, OO, Design Patterns, UML, Agile Methodologies, and eXtreme programming.",
"summary": "Even bad code can function. But if code isn’t clean, it can bring a development organization to its knees. Every year, countless hours and significant resources are lost because of poorly written code. But it doesn’t have to be that way.
Noted software expert Robert C. Martin presents a revolutionary paradigm with Clean Code: A Handbook of Agile Software Craftsmanship. Martin has teamed up with his colleagues from Object Mentor to distill their best agile practice of cleaning code “on the fly” into a book that will instill within you the values of a software craftsman and make you a better programmer—but only if you work at it.
What kind of work will you be doing? You’ll be reading code—lots of code. And you will be challenged to think about what’s right about that code, and what’s wrong with it. More importantly, you will be challenged to reassess your professional values and your commitment to your craft.
Clean Code is divided into three parts. The first describes the principles, patterns, and practices of writing clean code. The second part consists of several case studies of increasing complexity. Each case study is an exercise in cleaning up code—of transforming a code base that has some problems into one that is sound and efficient. The third part is the payoff: a single chapter containing a list of heuristics and “smells” gathered while creating the case studies. The result is a knowledge base that describes the way we think when we write, read, and clean code.
Readers will come away from this book understanding
How to tell the difference between good and bad code
How to write good code and how to transform bad code into good code
How to create good names, good functions, good objects, and good classes
How to format code for maximum readability
How to implement complete error handling without obscuring code logic
How to unit test and practice test-driven development
This book is a must for any developer, software engineer, project manager, team lead, or systems analyst with an interest in producing better code.",
"price": "USD 49.99"
}

豆瓣图书查询返回内容

刚才出去拿纱窗了,等晚上设计DB的时候继续更新。

基于豆瓣API获取的Response信息,所以抽取如下信息:

豆瓣图书API信息
字段名称 豆瓣字段 字段描述
Title title  
SubTitle subtitle  
Authors author  
Translator translator  
ISBN13 isbn13  
ISBN10 isbn10  
AuthorIntro author_intro  
Summary summary  
Publisher publisher  
Binding binding  
OriginTitle origin_title  
Pages pages  
ImageUrl image  
Pubdate pubdate  
Catalog catalog  
Tags tags  

拆分如上字段出来。

......

因为在看世界杯,所以设计有点断断续续的,放出DB的Diagram:

记开发个人图书收藏清单小程序开发(三)DB设计

记开发个人图书收藏清单小程序开发(三)DB设计

当前的逻辑应该是没有问题了,现在需要丰富的是DB的内容,以及每条线的发展设计。

顺便放出几个Type的Script:

 CREATE FUNCTION [core].[Matter#Type] ()
RETURNS TABLE
WITH SCHEMABINDING, ENCRYPTION
AS RETURN
(
select 1 as _Book
, 2 as _ShelfBook
, 4 as _BookList
)
 CREATE FUNCTION [core].[Party#Type] ()
RETURNS TABLE
WITH SCHEMABINDING, ENCRYPTION
AS RETURN
(
select 1 as _Administrator
, 4 as _User
---------------------------------------
, 16 as _Shelf
)
 CREATE FUNCTION [base].[BookInfo#Type] ()
RETURNS TABLE
WITH SCHEMABINDING, ENCRYPTION
AS RETURN
(
select 1 as _Summary
, 2 as _Catalog
, 4 as _AuthorIntro
)

好的,今天就先到这吧。