Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
e01a48ff
Commit
e01a48ff
authored
Mar 29, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理
parent
e4673207
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
132 deletions
+68
-132
src/main/java/com/stylefeng/guns/common/annotion/CountStat.java
+0
-19
src/main/java/com/stylefeng/guns/common/page/PageBT.java
+41
-42
src/main/java/com/stylefeng/guns/common/page/PageInfoBT.java
+27
-28
src/main/java/com/stylefeng/guns/core/aop/CountAop.java
+0
-43
No files found.
src/main/java/com/stylefeng/guns/common/annotion/CountStat.java
deleted
100644 → 0
View file @
e4673207
package
com
.
stylefeng
.
guns
.
common
.
annotion
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* 统计系统调用次数的注解
*
* @author fengshuonan
* @date 2017年3月4日 下午11:53:28
*/
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
({
ElementType
.
METHOD
})
public
@interface
CountStat
{
String
[]
value
()
default
{};
}
src/main/java/com/stylefeng/guns/common/page/PageBT.java
View file @
e01a48ff
package
com
.
stylefeng
.
guns
.
common
.
page
;
package
com
.
stylefeng
.
guns
.
common
.
page
;
/**
/**
*
* 分页参数类(for BootStrap Table)
* 分页参数类(for BootStrap Table)
*
*
* @author fengshuonan
* @author fengshuonan
...
@@ -9,58 +8,58 @@ package com.stylefeng.guns.common.page;
...
@@ -9,58 +8,58 @@ package com.stylefeng.guns.common.page;
*/
*/
public
class
PageBT
{
public
class
PageBT
{
private
int
limit
;
// 每页显示个数
private
int
limit
;
// 每页显示个数
private
int
offset
;
// 查询的偏移量(查询的页数 = offset/limit + 1)
private
int
offset
;
// 查询的偏移量(查询的页数 = offset/limit + 1)
private
String
order
;
// 排序方式
private
String
order
;
// 排序方式
public
PageBT
()
{
super
();
}
public
PageBT
(
int
limit
,
int
offset
)
{
super
();
this
.
limit
=
limit
;
this
.
offset
=
offset
;
}
public
int
getLimit
()
{
public
PageBT
()
{
return
limit
;
super
()
;
}
}
public
void
setLimit
(
int
limit
)
{
public
PageBT
(
int
limit
,
int
offset
)
{
this
.
limit
=
limit
;
super
();
}
this
.
limit
=
limit
;
this
.
offset
=
offset
;
}
public
int
getOffse
t
()
{
public
int
getLimi
t
()
{
return
offse
t
;
return
limi
t
;
}
}
public
void
setOffset
(
int
offse
t
)
{
public
void
setLimit
(
int
limi
t
)
{
this
.
offset
=
offse
t
;
this
.
limit
=
limi
t
;
}
}
public
String
getOrder
()
{
public
int
getOffset
()
{
return
order
;
return
offset
;
}
}
public
void
setOrder
(
String
order
)
{
public
void
setOffset
(
int
offset
)
{
this
.
order
=
order
;
this
.
offset
=
offset
;
}
}
public
int
getPageSize
()
{
public
String
getOrder
()
{
return
this
.
limit
;
return
order
;
}
}
public
int
getPageNumber
(
)
{
public
void
setOrder
(
String
order
)
{
return
this
.
offset
/
this
.
limit
+
1
;
this
.
order
=
order
;
}
}
@Override
public
int
getPageSize
()
{
public
String
toString
()
{
return
this
.
limit
;
return
"PageBT [limit="
+
limit
+
", offset="
+
offset
+
", order="
+
order
+
"]"
;
}
}
public
int
getPageNumber
()
{
return
this
.
offset
/
this
.
limit
+
1
;
}
@Override
public
String
toString
()
{
return
"PageBT [limit="
+
limit
+
", offset="
+
offset
+
", order="
+
order
+
"]"
;
}
}
}
src/main/java/com/stylefeng/guns/common/page/PageInfoBT.java
View file @
e01a48ff
...
@@ -5,38 +5,37 @@ import com.baomidou.mybatisplus.plugins.Page;
...
@@ -5,38 +5,37 @@ import com.baomidou.mybatisplus.plugins.Page;
import
java.util.List
;
import
java.util.List
;
/**
/**
*
* 分页结果的封装(for Bootstrap Table)
* 分页结果的封装(for Bootstrap Table)
*
*
* @author fengshuonan
* @author fengshuonan
* @Date 2017年1月22日 下午11:06:41
* @Date 2017年1月22日 下午11:06:41
*/
*/
public
class
PageInfoBT
<
T
>
{
public
class
PageInfoBT
<
T
>
{
// 结果集
// 结果集
private
List
<
T
>
rows
;
private
List
<
T
>
rows
;
// 总数
// 总数
private
long
total
;
private
long
total
;
public
PageInfoBT
(
Page
<
T
>
page
)
{
public
PageInfoBT
(
Page
<
T
>
page
)
{
this
.
rows
=
page
.
getRecords
();
this
.
rows
=
page
.
getRecords
();
this
.
total
=
page
.
getTotal
();
this
.
total
=
page
.
getTotal
();
}
}
public
List
<
T
>
getRows
()
{
public
List
<
T
>
getRows
()
{
return
rows
;
return
rows
;
}
}
public
void
setRows
(
List
<
T
>
rows
)
{
public
void
setRows
(
List
<
T
>
rows
)
{
this
.
rows
=
rows
;
this
.
rows
=
rows
;
}
}
public
long
getTotal
()
{
public
long
getTotal
()
{
return
total
;
return
total
;
}
}
public
void
setTotal
(
long
total
)
{
public
void
setTotal
(
long
total
)
{
this
.
total
=
total
;
this
.
total
=
total
;
}
}
}
}
src/main/java/com/stylefeng/guns/core/aop/CountAop.java
deleted
100644 → 0
View file @
e4673207
package
com
.
stylefeng
.
guns
.
core
.
aop
;
import
com.stylefeng.guns.common.controller.BaseController
;
import
com.stylefeng.guns.core.support.HttpKit
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.springframework.stereotype.Component
;
import
javax.servlet.http.HttpServletRequest
;
/**
* 本系统调用次数的统计
*/
@Aspect
@Component
public
class
CountAop
extends
BaseController
{
private
static
Object
sync
=
new
Object
();
@Pointcut
(
value
=
"@annotation(com.stylefeng.guns.common.annotion.CountStat)"
)
private
void
cutPermission
()
{
}
@Around
(
"cutPermission()"
)
public
Object
around
(
ProceedingJoinPoint
point
)
throws
Throwable
{
HttpServletRequest
request
=
HttpKit
.
getRequest
();
Object
systemCount
=
request
.
getServletContext
().
getAttribute
(
"systemCount"
);
synchronized
(
sync
)
{
if
(
systemCount
==
null
){
request
.
getServletContext
().
setAttribute
(
"systemCount"
,
1
);
}
else
{
request
.
getServletContext
().
setAttribute
(
"systemCount"
,
(
Integer
)
systemCount
+
1
);
}
}
return
point
.
proceed
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment