Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
晶之木
miaosha
提交
c3288103
M
miaosha
项目概览
晶之木
/
miaosha
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
miaosha
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c3288103
编写于
9月 16, 2018
作者:
Q
qiurunze
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
设计文档
上级
eedcee12
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
199 addition
and
232 deletion
+199
-232
.idea/workspace.xml
.idea/workspace.xml
+150
-95
readme.txt
readme.txt
+0
-137
秒杀设计.md
秒杀设计.md
+49
-0
未找到文件。
.idea/workspace.xml
浏览文件 @
c3288103
...
...
@@ -33,11 +33,11 @@
<entry
key=
"finanacial"
value=
"1"
/>
<entry
key=
"htm"
value=
"10"
/>
<entry
key=
"html"
value=
"12"
/>
<entry
key=
"java"
value=
"16
0
"
/>
<entry
key=
"java"
value=
"16
3
"
/>
<entry
key=
"js"
value=
"1"
/>
<entry
key=
"properties"
value=
"6"
/>
<entry
key=
"ts"
value=
"1"
/>
<entry
key=
"txt"
value=
"
8
"
/>
<entry
key=
"txt"
value=
"
9
"
/>
<entry
key=
"xml"
value=
"3"
/>
</counts>
</usages-collector>
...
...
@@ -45,9 +45,9 @@
<counts>
<entry
key=
"CLASS"
value=
"22"
/>
<entry
key=
"HTML"
value=
"22"
/>
<entry
key=
"JAVA"
value=
"16
0
"
/>
<entry
key=
"JAVA"
value=
"16
3
"
/>
<entry
key=
"JavaScript"
value=
"1"
/>
<entry
key=
"PLAIN_TEXT"
value=
"
9
"
/>
<entry
key=
"PLAIN_TEXT"
value=
"
10
"
/>
<entry
key=
"Properties"
value=
"6"
/>
<entry
key=
"TypeScript"
value=
"1"
/>
<entry
key=
"UML"
value=
"1"
/>
...
...
@@ -84,8 +84,8 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/controller/GoodsController.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
1
"
>
<caret
line=
"
44"
column=
"14"
lean-forward=
"true"
selection-start-line=
"44"
selection-start-column=
"14"
selection-end-line=
"44"
selection-end-column=
"1
4"
/>
<state
relative-caret-position=
"
-1315
"
>
<caret
line=
"
74"
selection-start-line=
"74"
selection-end-line=
"7
4"
/>
<folding>
<element
signature=
"imports"
expanded=
"true"
/>
</folding>
...
...
@@ -94,40 +94,46 @@
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/controller/
Order
Controller.java"
>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/controller/
Login
Controller.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"1
41
"
>
<caret
line=
"
38"
column=
"60"
selection-start-line=
"38"
selection-start-column=
"53"
selection-end-line=
"38"
selection-end-column=
"60
"
/>
<state
relative-caret-position=
"1
32
"
>
<caret
line=
"
18"
column=
"13"
selection-start-line=
"18"
selection-start-column=
"13"
selection-end-line=
"18"
selection-end-column=
"13
"
/>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/
service/OrderService
.java"
>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/
controller/MiaoshaController
.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"286"
>
<caret
line=
"24"
column=
"24"
selection-start-line=
"24"
selection-start-column=
"24"
selection-end-line=
"24"
selection-end-column=
"24"
/>
<state
relative-caret-position=
"-524"
>
<caret
line=
"59"
column=
"54"
selection-start-line=
"59"
selection-start-column=
"54"
selection-end-line=
"59"
selection-end-column=
"54"
/>
<folding>
<element
signature=
"e#1518#1533#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/
controller/MiaoshaController
.java"
>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/
service/MiaoshaService
.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
2
66"
>
<caret
line=
"
59"
column=
"13"
selection-start-line=
"59"
selection-start-column=
"13"
selection-end-line=
"59"
selection-end-column=
"13
"
/>
<state
relative-caret-position=
"
5
66"
>
<caret
line=
"
48"
selection-start-line=
"48"
selection-end-line=
"48
"
/>
<folding>
<element
signature=
"
e#1518#1533#0
"
expanded=
"true"
/>
<element
signature=
"
imports
"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<entry
file=
"
jar://$MAVEN_REPOSITORY$/org/springframework/spring-web/4.3.12.RELEASE/spring-web-4.3.12.RELEASE.jar!/org/springframework/web/bind/annotation/RequestParam.class
"
>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<entry
file=
"
file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/service/MiaoShaUserService.java
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"264"
>
<caret
line=
"26"
column=
"11"
selection-start-line=
"26"
selection-start-column=
"11"
selection-end-line=
"26"
selection-end-column=
"11"
/>
<state
relative-caret-position=
"-1188"
>
<caret
line=
"35"
selection-start-line=
"35"
selection-end-line=
"35"
/>
<folding>
<element
signature=
"imports"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
...
...
@@ -162,7 +168,7 @@
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/access/AccessKey.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"88"
>
...
...
@@ -176,10 +182,10 @@
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"
jar://$MAVEN_REPOSITORY$/org/springframework/spring-web/4.3.12.RELEASE/spring-web-4.3.12.RELEASE.jar!/org/springframework/web/method/support/InvocableHandlerMethod.class
"
>
<entry
file=
"
file://$PROJECT_DIR$/readme.txt
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
171
"
>
<caret
line=
"1
17"
selection-start-line=
"117"
selection-end-line=
"11
7"
/>
<state
relative-caret-position=
"
352
"
>
<caret
line=
"1
21"
column=
"11"
lean-forward=
"true"
selection-end-line=
"13
7"
/>
</state>
</provider>
</entry>
...
...
@@ -267,11 +273,22 @@
<detection-done>
true
</detection-done>
<sorting>
DEFINITION_ORDER
</sorting>
</component>
<component
name=
"MavenProjectNavigator"
>
<treeState>
<expand>
<path>
<item
name=
""
type=
"16c1761:MavenProjectsStructure$RootNode"
/>
<item
name=
"miaosha"
type=
"9519ce18:MavenProjectsStructure$ProjectNode"
/>
</path>
</expand>
<select
/>
</treeState>
</component>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<option
name=
"x"
value=
"1
82
"
/>
<option
name=
"y"
value=
"
64
"
/>
<option
name=
"width"
value=
"13
92
"
/>
<option
name=
"height"
value=
"9
89
"
/>
<option
name=
"x"
value=
"1
30
"
/>
<option
name=
"y"
value=
"
36
"
/>
<option
name=
"width"
value=
"13
84
"
/>
<option
name=
"height"
value=
"9
94
"
/>
</component>
<component
name=
"ProjectInspectionProfilesVisibleTreeState"
>
<entry
key=
"Project Default"
>
...
...
@@ -302,6 +319,50 @@
<item
name=
"miaosha_1"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"miaosha_1"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"miaosha_1"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"miaosha_1"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"src"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"miaosha_1"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"miaosha_1"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"src"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"main"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"miaosha_1"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"miaosha_1"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"src"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"main"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"java"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"miaosha_1"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"miaosha_1"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"src"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"main"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"java"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"miaosha"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"miaosha_1"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"miaosha_1"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"src"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"main"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"java"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"miaosha"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"controller"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"miaosha_1"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"miaosha_1"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"src"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"main"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"java"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"miaosha"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"service"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"miaosha_1"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"Scratches and Consoles"
type=
"1a2a3e82:ScratchProjectViewPane$MyProjectNode"
/>
...
...
@@ -322,7 +383,7 @@
<property
name=
"RequestMappingsPanelWidth2"
value=
"75"
/>
<property
name=
"WebServerToolWindowFactoryState"
value=
"false"
/>
<property
name=
"aspect.path.notification.shown"
value=
"true"
/>
<property
name=
"com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp"
value=
"1537
082793541
"
/>
<property
name=
"com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp"
value=
"1537
108878426
"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$"
/>
<property
name=
"nodejs_interpreter_path.stuck_in_default_project"
value=
"undefined stuck path"
/>
<property
name=
"nodejs_npm_path_reset_for_default_project"
value=
"true"
/>
...
...
@@ -432,12 +493,12 @@
<workItem
from=
"1536888067376"
duration=
"7843000"
/>
<workItem
from=
"1536918768483"
duration=
"15837000"
/>
<workItem
from=
"1536975289539"
duration=
"26867000"
/>
<workItem
from=
"1537060950052"
duration=
"
17485
000"
/>
<workItem
from=
"1537060950052"
duration=
"
23470
000"
/>
</task>
<servers
/>
</component>
<component
name=
"TimeTrackingManager"
>
<option
name=
"totallyTimeSpent"
value=
"
78454
000"
/>
<option
name=
"totallyTimeSpent"
value=
"
84439
000"
/>
</component>
<component
name=
"TodoView"
>
<todo-panel
id=
"selected-file"
>
...
...
@@ -450,8 +511,9 @@
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"-1"
y=
"29"
width=
"1922"
height=
"1025"
extended-state=
"6"
/>
<editor
active=
"true"
/>
<layout>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.24813631"
/>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.24813631"
/>
<window_info
id=
"Structure"
order=
"1"
side_tool=
"true"
weight=
"0.25"
/>
<window_info
id=
"Designer"
order=
"2"
/>
<window_info
id=
"Image Layers"
order=
"3"
/>
...
...
@@ -467,7 +529,7 @@
<window_info
anchor=
"bottom"
id=
"Inspection"
order=
"5"
weight=
"0.4"
/>
<window_info
anchor=
"bottom"
id=
"TODO"
order=
"6"
weight=
"0.32960895"
/>
<window_info
anchor=
"bottom"
id=
"Spring"
order=
"7"
/>
<window_info
a
ctive=
"true"
a
nchor=
"bottom"
id=
"Terminal"
order=
"8"
visible=
"true"
weight=
"0.32960895"
/>
<window_info
anchor=
"bottom"
id=
"Terminal"
order=
"8"
visible=
"true"
weight=
"0.32960895"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"9"
sideWeight=
"0.21352503"
side_tool=
"true"
weight=
"0.4111732"
/>
<window_info
anchor=
"bottom"
id=
"Messages"
order=
"10"
sideWeight=
"0.49946752"
weight=
"0.32960895"
/>
<window_info
anchor=
"bottom"
id=
"Java Enterprise"
order=
"11"
/>
...
...
@@ -478,7 +540,7 @@
<window_info
anchor=
"right"
content_ui=
"combo"
id=
"Hierarchy"
order=
"2"
weight=
"0.25"
/>
<window_info
anchor=
"right"
id=
"Palette"
order=
"3"
/>
<window_info
anchor=
"right"
id=
"Capture Analysis"
order=
"4"
/>
<window_info
anchor=
"right"
id=
"Maven Projects"
order=
"5"
/>
<window_info
anchor=
"right"
id=
"Maven Projects"
order=
"5"
weight=
"0.32985073"
/>
<window_info
anchor=
"right"
id=
"Database"
order=
"6"
/>
<window_info
anchor=
"right"
id=
"Palette	"
order=
"7"
/>
<window_info
anchor=
"right"
id=
"Theme Preview"
order=
"8"
/>
...
...
@@ -613,16 +675,6 @@
</expressions>
</component>
<component
name=
"editorHistoryManager"
>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/config/UserArgumentResolver.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"792"
>
<caret
line=
"51"
selection-start-line=
"51"
selection-end-line=
"51"
/>
<folding>
<element
signature=
"imports"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/service/MiaoshaUserService.java"
/>
<entry
file=
"file://$PROJECT_DIR$/src/main/resources/templates/miaosha_fail.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
...
...
@@ -639,16 +691,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/service/MiaoShaUserService.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"205"
>
<caret
line=
"24"
column=
"20"
lean-forward=
"true"
selection-start-line=
"24"
selection-start-column=
"20"
selection-end-line=
"24"
selection-end-column=
"20"
/>
<folding>
<element
signature=
"imports"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/vo/GoodsDetailVo.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"176"
>
...
...
@@ -698,13 +740,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/readme.txt"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"423"
>
<caret
line=
"116"
column=
"25"
selection-start-line=
"116"
selection-start-column=
"25"
selection-end-line=
"116"
selection-end-column=
"25"
/>
</state>
</provider>
</entry>
<entry
file=
"jar://$MAVEN_REPOSITORY$/org/springframework/amqp/spring-amqp/1.7.4.RELEASE/spring-amqp-1.7.4.RELEASE.jar!/org/springframework/amqp/core/AmqpTemplate.class"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"289"
>
...
...
@@ -912,20 +947,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/service/MiaoshaService.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"240"
>
<caret
line=
"48"
selection-start-line=
"48"
selection-end-line=
"48"
/>
<folding>
<element
signature=
"imports"
expanded=
"true"
/>
<element
signature=
"e#1303#1304#0"
expanded=
"true"
/>
<element
signature=
"e#1368#1369#0"
expanded=
"true"
/>
<element
signature=
"e#1415#1416#0"
expanded=
"true"
/>
<element
signature=
"e#1484#1485#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"jar://$MAVEN_REPOSITORY$/org/springframework/spring-web/4.3.12.RELEASE/spring-web-4.3.12.RELEASE.jar!/org/springframework/web/method/support/InvocableHandlerMethod.class"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"171"
>
...
...
@@ -940,16 +961,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/controller/GoodsController.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"1"
>
<caret
line=
"44"
column=
"14"
lean-forward=
"true"
selection-start-line=
"44"
selection-start-column=
"14"
selection-end-line=
"44"
selection-end-column=
"14"
/>
<folding>
<element
signature=
"imports"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/controller/OrderController.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"141"
>
...
...
@@ -974,16 +985,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/controller/MiaoshaController.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"266"
>
<caret
line=
"59"
column=
"13"
selection-start-line=
"59"
selection-start-column=
"13"
selection-end-line=
"59"
selection-end-column=
"13"
/>
<folding>
<element
signature=
"e#1518#1533#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/access/AccessLimit.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"154"
>
...
...
@@ -1009,6 +1010,60 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/readme.txt"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"352"
>
<caret
line=
"121"
column=
"11"
lean-forward=
"true"
selection-end-line=
"137"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/controller/GoodsController.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-1315"
>
<caret
line=
"74"
selection-start-line=
"74"
selection-end-line=
"74"
/>
<folding>
<element
signature=
"imports"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/controller/LoginController.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"132"
>
<caret
line=
"18"
column=
"13"
selection-start-line=
"18"
selection-start-column=
"13"
selection-end-line=
"18"
selection-end-column=
"13"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/controller/MiaoshaController.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-524"
>
<caret
line=
"59"
column=
"54"
selection-start-line=
"59"
selection-start-column=
"54"
selection-end-line=
"59"
selection-end-column=
"54"
/>
<folding>
<element
signature=
"e#1518#1533#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/service/MiaoshaService.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"566"
>
<caret
line=
"48"
selection-start-line=
"48"
selection-end-line=
"48"
/>
<folding>
<element
signature=
"imports"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/service/MiaoShaUserService.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-1188"
>
<caret
line=
"35"
selection-start-line=
"35"
selection-end-line=
"35"
/>
<folding>
<element
signature=
"imports"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</component>
<component
name=
"masterDetails"
>
<states>
...
...
readme.txt
已删除
100644 → 0
浏览文件 @
eedcee12
Springboot 秒杀设计:
一: springboot 环境搭建
① 集成thymleaf + result 结果封装
② 集成Mybatis + Druid(可以做数据监控)
③ 集成 Jedis + redis + 通用key封装
二: 登录设计
① 数据库设计
② 明文密码二次md5加密 + 全局异常处理器
③ JRS303参数检验 + 全局异常处理器
④分布式session
三:实现秒杀功能
① 秒杀数据库设计
② 商品列表页设计
③ 商品详情页设计
④ 订单详情页
四 : 压测jmeter
① jmeter压测入门
② 自定义变量与用户测试
③ 页面优化技术
五:缓存优化提高效率
① 页面优化+ url缓存+对象缓存
② 页面静态化
③ 静态资源
④ cdn优化
六:接口优化
① redis预减少库存访问
② 内存标记减少redis访问
③ rabbitmq安装与springboot集成 ,队列缓冲,异步下单,增强用户体验
④rabbitmq异步下单
⑤ 访问Nginx水平扩展
七: 安全优化接口安全
① 秒杀地址隐藏
② 数学公式验证码
③ 接口防刷限流
如何应对互联网大并发 , 如何利用缓存, 如何使用异步 , 如何编写优雅的代码
一: springboot 环境搭建 (springmvc会有大量的配置)
1. 新建project -- maven -- 选择 maven-archtype-quickstart 项目
2.pom.xml文件
主要的 springboot的pom文件 項目直接导入就可以
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
类的构思讲解:
Result类:
结果类Result 类封装成一个通用类,用一个codemsg错误码来直接返回,不需要每次返回再去new一个对象,按照模块来定义错误码
Redis类:
自己封装的 jedis ,使用它自带的temple总觉得不太好使
1. 添加 jedis 依赖 2.添加 fastjson 依赖 json明文可读
redis 通用缓存类封装 :
接口 -- 抽象类 -- 实现类 (模板模式)
模板模式的优点
①具体细节步骤实现定义在子类中,子类定义详细处理算法是不会改变算法整体结构。
②代码复用的基本技术,在数据库设计中尤为重要。
③存在一种反向的控制结构,通过一个父类调用其子类的操作,通过子类对父类进行扩展增加新的行为,符合“开闭原则”。
缺点: 每个不同的实现都需要定义一个子类,会导致类的个数增加,系统更加庞大。
springboot 注解讲解:
@ConfigurationProperties(prefix="redis") 可以读取以redis配置开头的文件
密码 --MD5 二次明文加密处理 设计
密码设计: MD5(MD5(pass明文 + 固定salt) + salt) 处理
二次MD5:
用户端: PASS = MD5 (明文 + 固定 Salt)
服务端: PASS = MD5(用户输入 + 随机Salt)
Js 前端进行第一个MD5 , 后端进行第二次 , 后端第二次salt随机生成入库,然后登录时取出对比
注解JSR303与自定义注解来完成手机号和登录验证 + 全局异常处理器
分布式session :(处理请求落在不同服务器上)
-- 核心在于把自动生成的token放在缓存当中用来记录用户 (redis + cookie)
登录成功之后给用户生成一个类似于sessionid的东西 token 标识用户写到cookie当中传递给客户端
客户端在随后的访问中都在cookie中上传这个token , 然后在服务端拿到这个token来取到用户信息
把token uuid标识 存到 redis缓存中 ,设置过期时间,然后别的页面访问的时候依旧根据这个cookie token的值拿到用户信息。
页面静态化,前后端分离,唯一索引解决卖超的问题 , 对象级缓存
秒杀页面:
1.数据库2.商品列表页3.商品详情页4.订单详情页
解决超卖问题:
数据库加唯一索引防止用户重复购买
sql加库存数量判断防止库存变成负数 mycat
redis 预减库存减少数据库访问 内存标记减少redis访问 请求先入队列缓冲,异步下单,增强用户体验
接口防刷限流:
如果有缓存的话 这个功能实现起来就和简单,在一个用户访问接口的时候我们把访问次数写到缓存中,在加上一个有效期。
通过拦截器. 做一个注解 @AccessLimit 然后封装这个注解,可以有效的设置每次访问多少次,有效时间是否需要登录!
数据库采用mybatis:
秒杀设计.md
0 → 100644
浏览文件 @
c3288103
### 前言
大家好,之前在公司自己设计并开发了一套完整的秒杀系统,希望和大家分享一下,希望大家能从中收益,如果有意见和好的想法请加我!
QQ:3341386488
邮箱:QiuRunZe_key@163.com
我会不断完善,希望大家有好的想法拉一个分支提高,一起合作!
觉得不错对您有帮助,麻烦右上角点下star以示鼓励!长期维护不易 多次想放弃 坚持是一种信仰 专注是一种态度!
## 秒杀设计整体流程
![
整体流程
](
http://i2.bvimg.com/601558/886c867d6488dfc2.png
)
#### 需注意几点:
1.
如何解决卖超问题
① sql加上判断如果防止数据变为负数
<br>
② 数据库加唯一索引防止用户重复购买
<br>
③ redis预减库存减少数据库访问 内存标记减少redis访问 请求先入队列缓冲,异步下单,增强用户体验
2.
如何解决分布式session
<br>
① 生成一个随机的uuid一类的写回到cookie中
<br>
② redis 内存写入
<br>
③ 下一个页面拿到uuid 内存取对象
3.
如何优雅解决接口防刷限流
<br>
>
如果有缓存的话 这个功能实现起来就和简单,在一个用户访问接口的时候我们把访问次数写到缓存中,在加上一个有效期。
通过拦截器. 做一个注解 @AccessLimit 然后封装这个注解,可以有效的设置每次访问多少次,有效时间是否需要登录!
4.
通用缓存key的封装采用什么设计模式?
<br>
模板模式的优点
<br>
①具体细节步骤实现定义在子类中,子类定义详细处理算法是不会改变算法整体结构。
<br>
②代码复用的基本技术,在数据库设计中尤为重要。
<br>
③存在一种反向的控制结构,通过一个父类调用其子类的操作,通过子类对父类进行扩展增加新的行为,符合“开闭原则”。
<br>
缺点: 每个不同的实现都需要定义一个子类,会导致类的个数增加,系统更加庞大
5.
LVS , tomcat(apr) , keepalive 高可用 ???? 未来更新 ??
<br>
6.
限流算法等未来更新
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录