This repository has been archived by the owner on May 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
开发者文档.txt
134 lines (110 loc) · 3.4 KB
/
开发者文档.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
*****开发者文档 for Libmanager******
*****作者 : 葛骏(阳泉一中,实际上,本项目中出现的Atlas、ForeverJimmy等名,都是本人网名,为方便,使用IDE的模板自动添加*****
*****架构、文件目录*****
本项目采用Server/Client、三层架构。
Libmanger\ # 项目根目录
Client\ # 存储项目的客户端部分
Python_Client # Python 编写的客户端,只有命令行界面,理论上可以在全平台运行
Server\ # 存储项目的服务端部分
model\ # 模型层,数据库交互
database.py # 提供数据库的操作
utility\ # 业务处理层,集成封装数据库交互
userOperate.py # 提供用户操作
data_operate.py # 提供数据操作
log.py # 提供日志操作
# 其余文件属于表现层,负责直接与用户交互
Libmanager_server.py # 服务端主文件
config.py # 配置文件
database.db # sqlite3 数据库
log.log # 日志文件(直接用notepad++打开即可)
__init__.py # 无需介绍
venv\ # Python环境 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03)
# 内容物不需要管。
../Scripts/python.exe 是python交互环境,可以直接打开运行python代码
sqlite\ # sqlite3 数据库命令行工具,用来调试,可以直接exe运行,也可以在终端中运行。
# http://www.cnblogs.com/hnrainll/archive/2011/04/22/2024627.html
# 上述地址可以找到使用的教程
__init__.py # 这个玩意我不需要介绍
README.md # git 自动生成的玩意
database.bat # 数据库交互脚本
path_deploy.bat # 配置环境变量的脚本
run_server.bat # 直接运行server的脚本
run_client.bat # 直接运行client的脚本
使用教程.txt # 给小白看的的教程
开发者文档.txt # 就是本文件
.gitattributes # git 自动生成的玩意
*****数据库模板*****
带星号的为not null
users 用户
id 自增字段
name 存储用户名*
email 电子邮件地址 唯一*
pwd 密码*
type 用户类型*
0 普通的
1 管理员
2 游客,不允许借书
book_id 借的书id
-1 表示没借
is_login 是否登陆
1 是
0 否
books 书籍
id 自增字段
name 书名*
amount 书籍总量*
remain 剩余书籍量*
is_abled 是否允许借阅*
1 true
0 false
*****操作,参数及返回值*****
1 成功连接
-100 错误的操作类型
-101 数据库其他错误
-102 服务器其他错误
login 登陆 id email pwd
0 成功
-1 密码错误
-2 没有注册
-3 重复登陆
register 注册 name email pwd type
0 成功
-1 重复的电子邮件地址
-2 错误的验证码
logout 注销 id
0 成功
-1 重复注销
borrow_book 借书 id
0 成功
-1 书籍借光
-2 已经借书
-3 用户类型错误
-4 没有书籍
-5 书籍禁止借阅
-6 没有登陆
return_book 还书 id book_id
0 成功
-1 无书可还
-2 没有登陆
ban_user 封禁用户 id ban_id
0 成功
-1 错误的id
-2 已经被封禁
-3 不是管理员
-4 没有登陆
ban_book 封禁书籍 id book_id
0 成功
-1 错误的id
-2 已经被封禁
-3 没有登陆
-4 不是管理员
add_book 添加书籍(收藏量) id book_id book_amount
0 成功
-1 错误的id
-2 没有登陆
-3 不是管理员
add_new_book 添加新书籍 id book_name book_amount is_abled
0 成功
-1 没有登陆
-2 不是管理员
checkbooks 打印所有书籍