Commit 7d6830e1 authored by Quxl's avatar Quxl

x

parent 9759e6cc
...@@ -4,6 +4,8 @@ import java.util.Date; ...@@ -4,6 +4,8 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -12,6 +14,7 @@ import com.egolm.common.jdbc.JdbcTemplate; ...@@ -12,6 +14,7 @@ import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.LogService; import com.egolm.film.api.service.LogService;
import com.egolm.film.bean.Fc_logs_error; import com.egolm.film.bean.Fc_logs_error;
import com.egolm.film.config.WebMvcConfig;
import com.egolm.film.util.SqlWhere; import com.egolm.film.util.SqlWhere;
@Service @Service
...@@ -30,8 +33,14 @@ public class LogServiceImpl implements LogService { ...@@ -30,8 +33,14 @@ public class LogServiceImpl implements LogService {
@Override @Override
public void saveErrorLog(Throwable ex) { public void saveErrorLog(Throwable ex) {
String requestUri = null;
HttpServletRequest request = WebMvcConfig.getRequest();
if(request != null) {
requestUri = request.getRequestURI().substring(request.getContextPath().length());
}
Fc_logs_error error = new Fc_logs_error(); Fc_logs_error error = new Fc_logs_error();
error.setTitle(ex.getMessage()); error.setTitle(ex.getMessage());
error.setPath(requestUri);
error.setError(this.toStackString(ex).toString()); error.setError(this.toStackString(ex).toString());
error.setCreate_time(new Date()); error.setCreate_time(new Date());
jdbcTemplate.save(error); jdbcTemplate.save(error);
......
...@@ -17,6 +17,9 @@ public class Fc_logs_error implements java.io.Serializable { ...@@ -17,6 +17,9 @@ public class Fc_logs_error implements java.io.Serializable {
@Column(columnDefinition="int(11)") @Column(columnDefinition="int(11)")
private Integer id; private Integer id;
@Column(columnDefinition="varchar(255)")
private String path;
@Column(columnDefinition="text") @Column(columnDefinition="text")
private String title; private String title;
...@@ -35,6 +38,14 @@ public class Fc_logs_error implements java.io.Serializable { ...@@ -35,6 +38,14 @@ public class Fc_logs_error implements java.io.Serializable {
return id; return id;
} }
public void setPath(String path) {
this.path = path;
}
public String getPath() {
return path;
}
public void setTitle(String title) { public void setTitle(String title) {
this.title = title; this.title = title;
} }
......
...@@ -32,7 +32,7 @@ public class Fc_member_film implements java.io.Serializable { ...@@ -32,7 +32,7 @@ public class Fc_member_film implements java.io.Serializable {
@Column(columnDefinition="tinyint(10) COMMENT '类型 1 电影 2电视'") @Column(columnDefinition="tinyint(10) COMMENT '类型 1 电影 2电视'")
private Integer type; private Integer type;
@Column(columnDefinition="bigint(20) unsigned zerofill COMMENT '影片内容分组id'") @Column(columnDefinition="bigint(20) COMMENT '影片内容分组id'")
private Long film_group_id; private Long film_group_id;
@Column(columnDefinition="int(10) COMMENT '影片类型'") @Column(columnDefinition="int(10) COMMENT '影片类型'")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment