Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/lpn520/baishop.git
Browse files Browse the repository at this point in the history
  • Loading branch information
lpn520 committed Aug 17, 2012
2 parents ca726e8 + c54caf6 commit 5ef8d3f
Show file tree
Hide file tree
Showing 16 changed files with 298 additions and 253 deletions.
37 changes: 20 additions & 17 deletions Baishop-manager/WebContent/WEB-INF/view/ass/SysLogger.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Ext.onReady(function() {
remoteSort: true,
idProperty: 'id',
fields: [
'id', 'user', 'source', 'type', 'method', 'args', 'description', 'date'
'id', 'source', 'signature', 'args', 'result', 'description', 'execTime', 'createTime'
],
proxy: {
type: 'jsonp',
Expand All @@ -94,7 +94,7 @@ Ext.onReady(function() {
}
},
sorters: [{
property: 'date',
property: 'createTime',
direction: 'desc'
}],
listeners: {
Expand All @@ -118,14 +118,10 @@ Ext.onReady(function() {
loadMask: true,
store: storeSyslog,
columns:[Ext.create('Ext.grid.RowNumberer'), {
text: '用户名',
dataIndex: 'user',
width: 150,
sortable: true
},{
text: '调用来源',
dataIndex: 'source',
width: 90,
align:'center',
sortable: true,
renderer: function(value, p, record) {
switch(Number(value)){
Expand All @@ -138,29 +134,36 @@ Ext.onReady(function() {
}
}
},{
text: '执行时间',
dataIndex: 'date',
text: '插入时间',
dataIndex: 'createTime',
width: 150,
align:'center',
sortable: true
},{
text: '接口类型名',
dataIndex: 'type',
width: 350,
text: '执行时间(毫秒)',
dataIndex: 'execTime',
width: 100,
align:'center',
sortable: true
},{
text: '方法签名',
dataIndex: 'method',
width: 300,
text: '接口签名',
dataIndex: 'signature',
width: 500,
sortable: true
},{
text: '参数列表',
dataIndex: 'args',
width: 800,
width: 500,
sortable: true
},{
text: '返回值',
dataIndex: 'result',
width: 500,
sortable: true
},{
text: '日志描述',
dataIndex: 'description',
width: 800,
width: 500,
sortable: true
}],
tbar: [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

<resultMap id="resultMap" class="com.baishop.entity.ass.Syslog" >
<result column="id" property="id" jdbcType="BIGINT" />
<result column="user" property="user" jdbcType="VARCHAR" />
<result column="source" property="source" jdbcType="TINYINT" />
<result column="type" property="type" jdbcType="VARCHAR" />
<result column="method" property="method" jdbcType="VARCHAR" />
<result column="signature" property="signature" jdbcType="VARCHAR" />
<result column="args" property="args" jdbcType="VARCHAR" />
<result column="result" property="result" jdbcType="VARCHAR" />
<result column="description" property="description" jdbcType="VARCHAR" />
<result column="date" property="date" jdbcType="TIMESTAMP" />
<result column="exec_time" property="execTime" jdbcType="BIGINT" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
</resultMap>


Expand All @@ -19,28 +19,23 @@
<isNotEmpty prepend="AND" property="id">
id = #id:BIGINT#
</isNotEmpty>
<isNotEmpty prepend="AND" property="user">
user = #user:VARCHAR#
</isNotEmpty>
<isNotEmpty prepend="AND" property="source">
source = #source:TINYINT#
</isNotEmpty>
<isNotEmpty prepend="AND" property="startDate">
<![CDATA[
date >= #startDate:TIMESTAMP#
create_time >= #startDate:TIMESTAMP#
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="endDate">
<![CDATA[
date <= #endDate:TIMESTAMP#
create_time <= #endDate:TIMESTAMP#
]]>
</isNotEmpty>

<!-- 网站关键字查询 -->
<isNotEmpty prepend="and" property="searchKey" close=")" open="(">
user like CONCAT('%',#searchKey:VARCHAR#,'%') or
type like CONCAT('%',#searchKey:VARCHAR#,'%') or
method like CONCAT('%',#searchKey:VARCHAR#,'%') or
signature like CONCAT('%',#searchKey:VARCHAR#,'%') or
description like CONCAT('%',#searchKey:VARCHAR#,'%')
</isNotEmpty>
</dynamic>
Expand All @@ -52,7 +47,7 @@
$sort$
</isNotEmpty>
<isEmpty property="sort" >
date desc
create_time desc
</isEmpty>
</dynamic>
<dynamic prepend="limit">
Expand All @@ -70,7 +65,7 @@


<select id="getSyslog" resultMap="resultMap" parameterClass="hashmap" >
select id, user, source, type, method, args, description, date
select *
from syslog
<include refid="select_where_clause" />
<include refid="select_sort_limit_clause" />
Expand All @@ -86,51 +81,51 @@
<insert id="addSyslog" parameterClass="com.baishop.entity.ass.Syslog" >
insert into syslog
<dynamic prepend="(" >
<isNotNull prepend="," property="user" >
user
</isNotNull>
<isNotNull prepend="," property="source" >
source
</isNotNull>
<isNotNull prepend="," property="type" >
type
</isNotNull>
<isNotNull prepend="," property="method" >
method
<isNotNull prepend="," property="signature" >
signature
</isNotNull>
<isNotNull prepend="," property="args" >
args
</isNotNull>
<isNotNull prepend="," property="result" >
result
</isNotNull>
<isNotNull prepend="," property="description" >
description
</isNotNull>
<isNotNull prepend="," property="date" >
date
<isNotNull prepend="," property="execTime" >
exec_time
</isNotNull>
<isNotNull prepend="," property="createTime" >
create_time
</isNotNull>
)
</dynamic>
values
<dynamic prepend="(" >
<isNotNull prepend="," property="user" >
#user:VARCHAR#
</isNotNull>
<isNotNull prepend="," property="source" >
#source:TINYINT#
</isNotNull>
<isNotNull prepend="," property="type" >
#type:VARCHAR#
</isNotNull>
<isNotNull prepend="," property="method" >
#method:VARCHAR#
<isNotNull prepend="," property="signature" >
#signature:VARCHAR#
</isNotNull>
<isNotNull prepend="," property="args" >
#args:VARCHAR#
</isNotNull>
<isNotNull prepend="," property="result" >
#result:VARCHAR#
</isNotNull>
<isNotNull prepend="," property="description" >
#description:VARCHAR#
</isNotNull>
<isNotNull prepend="," property="date" >
#date:TIMESTAMP#
<isNotNull prepend="," property="execTime" >
#execTime:BIGINT#
</isNotNull>
<isNotNull prepend="," property="createTime" >
#createTime:TIMESTAMP#
</isNotNull>
)
</dynamic>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.baishop.framework.remoting.httpinvoker;

import org.aopalliance.intercept.MethodInvocation;


/**
* 扩展HttpInvokerProxyFactoryBean
Expand All @@ -11,6 +13,17 @@ public class HttpInvokerProxyFactoryBean
private String prefix;


/**
* 重写基类方法,添加计时功能
*/
@Override
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
Object result = super.invoke(methodInvocation);
return result;
}



/**
* 设置URL前缀
* @param prefix URL前缀
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public String getParameter(String name, String charsetName, String defaultValue)
if(StringUtils.isBlank(value))
return defaultValue;

if(StringUtils.isBlank(charsetName))
charsetName = "UTF-8";

return new String(value.getBytes("ISO8859-1"), charsetName);

} catch (UnsupportedEncodingException e) {
Expand Down Expand Up @@ -630,6 +633,5 @@ public Date getDateParameter(String name, String pattern, Date defaultValue) {
return defaultValue;
}
}



}
Loading

0 comments on commit 5ef8d3f

Please sign in to comment.