mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-10-30 02:13:10 +08:00
建立项目与数据库
This commit is contained in:
27
bookshelfplus/src/main/java/plus/bookshelf/App.java
Normal file
27
bookshelfplus/src/main/java/plus/bookshelf/App.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package plus.bookshelf;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* Hello world!
|
||||
*
|
||||
*/
|
||||
@SpringBootApplication(scanBasePackages = { "plus.bookshelf" })
|
||||
@RestController
|
||||
@MapperScan("plus.bookshelf.mapper")
|
||||
public class App
|
||||
{
|
||||
public static void main( String[] args )
|
||||
{
|
||||
System.out.println( "Hello World!" );
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping("/")
|
||||
public String Home() {
|
||||
return "首页";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package plus.bookshelf.Common.Enum;
|
||||
|
||||
public enum BookOrigin {
|
||||
ORIGIN("原版电子书"),
|
||||
SCAN("扫描版"),
|
||||
WORD("文字版"), // 大部分是手机版的电子书重新制作成为PDF的
|
||||
HEELP_DOCUMENT("帮助文档"),
|
||||
OTHER("其他");
|
||||
|
||||
private BookOrigin(String intro) {
|
||||
this.intro = intro;
|
||||
}
|
||||
|
||||
private String intro;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package plus.bookshelf.Common.Enum;
|
||||
|
||||
public enum FileFormatEnum {
|
||||
PDF("pdf", "PDF文件"),
|
||||
MOBI("mobi", "mobi文件"),
|
||||
EPUB("epub", "epub电子书文件"),
|
||||
TXT("txt", "文本文档"),
|
||||
CHM("chm", "CHM帮助文档"),
|
||||
AZW3("azw3", "azw3文件"),
|
||||
DOC("doc", "Word文档"),
|
||||
DOCX("docx", "Word文档");
|
||||
|
||||
private FileFormatEnum(String ext, String extIntro) {
|
||||
this.ext = ext;
|
||||
this.extIntro = extIntro;
|
||||
}
|
||||
|
||||
private String ext;
|
||||
private String extIntro;
|
||||
|
||||
public String getExt() {
|
||||
return ext;
|
||||
}
|
||||
|
||||
public String getExtIntro() {
|
||||
return extIntro;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package plus.bookshelf.Common.Enum;
|
||||
|
||||
public enum FileStorageMediumEnum {
|
||||
LOCAL (10000, "本地"),
|
||||
BAIDU_NETDISK (20001, "百度网盘"),
|
||||
ALIYUN_DRIVE (20002, "阿里网盘");
|
||||
|
||||
private FileStorageMediumEnum(int storageMediumIndex, String storageMediumDisplayName) {
|
||||
this.storageMediumIndex = storageMediumIndex;
|
||||
this.storageMediumDisplayName = storageMediumDisplayName;
|
||||
}
|
||||
private Integer storageMediumIndex;
|
||||
private String storageMediumDisplayName;
|
||||
|
||||
public Integer getStorageMediumIndex() {
|
||||
return storageMediumIndex;
|
||||
}
|
||||
|
||||
public String getStorageMediumDisplayName() {
|
||||
return storageMediumDisplayName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package plus.bookshelf.Common.Enum;
|
||||
|
||||
public enum Language {
|
||||
SIMPLIFIED_CHINESE(1000, "简体中文"),
|
||||
ENGLISH(1001, "English"),
|
||||
TRADITIONAL_CHINESE(1001, "繁体中文");
|
||||
|
||||
private Language(Integer langId, String langName) {
|
||||
this.langId = langId;
|
||||
this.langName = langName;
|
||||
}
|
||||
|
||||
private Integer langId;
|
||||
private String langName;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package plus.bookshelf.Service.Model.Book;
|
||||
|
||||
public class AuthorModel {
|
||||
// 作者Id
|
||||
Integer id;
|
||||
|
||||
// 作者姓名
|
||||
String name;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package plus.bookshelf.Service.Model.Book;
|
||||
|
||||
import plus.bookshelf.Common.Enum.Language;
|
||||
import plus.bookshelf.Service.Model.Category.CategoryModel;
|
||||
|
||||
public class BookModel {
|
||||
|
||||
// 书籍id
|
||||
Integer id;
|
||||
|
||||
// 书名
|
||||
String bookName;
|
||||
|
||||
// 书籍简介
|
||||
String description;
|
||||
|
||||
// 作者姓名
|
||||
AuthorModel[] author;
|
||||
|
||||
//书籍所属分类
|
||||
CategoryModel category;
|
||||
|
||||
// 出版社
|
||||
PublishingHouseModel publishingHouse;
|
||||
|
||||
// 语言
|
||||
Language language;
|
||||
|
||||
// 来源(版权)信息
|
||||
String copyright;
|
||||
|
||||
// 是否删除
|
||||
Boolean isDelete;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package plus.bookshelf.Service.Model.Book;
|
||||
|
||||
public class PublishingHouseModel {
|
||||
// 出版社Id
|
||||
Integer id;
|
||||
|
||||
// 出版社名称
|
||||
String name;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package plus.bookshelf.Service.Model.Book;
|
||||
|
||||
public class ThumbnailModel {
|
||||
|
||||
// 书籍缩略图Id
|
||||
Integer id;
|
||||
|
||||
// 缩略图路径
|
||||
String path;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package plus.bookshelf.Service.Model.Category;
|
||||
|
||||
public class CategoryModel {
|
||||
|
||||
// 分类名称
|
||||
Integer id;
|
||||
|
||||
// 分类名称
|
||||
Integer name;
|
||||
|
||||
// 分类简介
|
||||
Integer description;
|
||||
|
||||
|
||||
Boolean isShow;
|
||||
|
||||
// 分类显示顺序
|
||||
Integer order;
|
||||
|
||||
// 分类级别 0为一级分类, 1为二级分类...
|
||||
Integer level;
|
||||
|
||||
// 所属父分类Id
|
||||
Integer parentId;
|
||||
|
||||
// 父分类
|
||||
CategoryModel parent;
|
||||
|
||||
// 子分类集合
|
||||
CategoryModel[] children;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package plus.bookshelf.Service.Model.File;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import plus.bookshelf.Common.Enum.BookOrigin;
|
||||
import plus.bookshelf.Common.Enum.FileFormatEnum;
|
||||
import plus.bookshelf.Service.Model.Book.ThumbnailModel;
|
||||
|
||||
public class FileModel {
|
||||
|
||||
// 文件Id
|
||||
Integer id;
|
||||
|
||||
// 关联的书籍Id
|
||||
Integer bookId;
|
||||
|
||||
// 文件名 (用于展示给用户的文件名,不含扩展名)
|
||||
String fileDisplayName;
|
||||
|
||||
// 文件存储名称 (文件的实际文件名,含扩展名)
|
||||
String fileName;
|
||||
|
||||
// 文件格式
|
||||
FileFormatEnum fileFormat;
|
||||
|
||||
// 总页数
|
||||
Integer numberOfPages;
|
||||
|
||||
// 是否含有水印
|
||||
Boolean watermark;
|
||||
|
||||
// 是否有广告
|
||||
Boolean advertising;
|
||||
|
||||
// 文件来源 电子版/扫描版
|
||||
BookOrigin bookOrigin;
|
||||
|
||||
// 缩略图
|
||||
ThumbnailModel thumbnail;
|
||||
|
||||
// 文件创建时间
|
||||
DateTime fileCreateAt;
|
||||
|
||||
// 文件修改时间
|
||||
DateTime fileModifiedAt;
|
||||
|
||||
// 文件大小
|
||||
long fileSize;
|
||||
|
||||
// 文件哈希 - MD5
|
||||
String hashMd5;
|
||||
|
||||
// 文件哈希 - SHA1
|
||||
String hashSha1;
|
||||
|
||||
// 文件哈希 - SHA256
|
||||
String hashSha256;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package plus.bookshelf.Service.Model.File;
|
||||
|
||||
import plus.bookshelf.Common.Enum.FileStorageMediumEnum;
|
||||
|
||||
public class FileObjectModel {
|
||||
|
||||
// 文件存储介质Id
|
||||
private Integer id;
|
||||
|
||||
// 存储的文件Id
|
||||
private Integer fileId;
|
||||
|
||||
// 文件存储介质类型
|
||||
FileStorageMediumEnum storageMediumType;
|
||||
|
||||
// 文件地址
|
||||
// 如果是网盘就是分享链接,如果是本地存储就是文件路径
|
||||
String filePath;
|
||||
|
||||
// 如果文件有压缩,那么就是压缩包密码
|
||||
String filePwd;
|
||||
|
||||
// 文件提取码
|
||||
String fileShareCode;
|
||||
|
||||
// 附加字段(JSON存储)
|
||||
Object additionalFields;
|
||||
}
|
||||
Reference in New Issue
Block a user