添加bootstrap后台模板

master
10295 7 years ago
parent e73354701b
commit 7a28ff4209
  1. 9
      core/src/main/java/core/aop/Advice.java
  2. 4
      core/src/main/java/core/aop/Advisor.java
  3. 14
      core/src/main/java/core/config/HibernateConfig.java
  4. 6
      core/src/main/java/core/dao/BaseDao.java
  5. 42
      core/src/main/java/core/model/AbstractModel.java
  6. 58
      core/src/main/java/core/service/BaseService.java
  7. 2
      core/src/main/java/core/util/DBAction.java
  8. 18
      core/src/main/java/org/pqh/core/annotation/EnableWebCrawlerConfiguration.java
  9. 13
      core/src/main/java/org/pqh/core/model/AbstractModel.java
  10. 48
      core/src/main/java/org/pqh/core/service/BaseService.java
  11. 11
      core/src/main/java/org/pqh/core/util/LogManger.java
  12. 14
      web/pom.xml
  13. 32
      web/src/main/java/org/pqh/config/SpringConfig.java
  14. 29
      web/src/main/java/org/pqh/controller/BaseController.java
  15. 20
      web/src/main/java/web/config/AbstractWebConfig.java
  16. 36
      web/src/main/java/web/config/SpringConfig.java
  17. 12
      web/src/main/java/web/controller/AdminController.java
  18. 31
      web/src/main/java/web/controller/BaseController.java
  19. 17
      web/src/main/java/web/controller/CommentController.java
  20. 286
      web/src/main/java/web/model/CidEntity.java
  21. 382
      web/src/main/java/web/model/DataEntity.java
  22. 4
      web/src/main/java/web/model/ScheduledTaskEntity.java
  23. 4
      web/src/main/java/web/model/TaskEntity.java
  24. 2
      web/src/main/java/web/thrift/QryResult.java
  25. 2
      web/src/main/java/web/thrift/QueryImp.java
  26. 2
      web/src/main/java/web/thrift/TestQry.java
  27. 2
      web/src/main/java/web/thrift/ThriftClientDemo.java
  28. 2
      web/src/main/java/web/thrift/ThriftServerDemo.java
  29. 18
      web/src/main/java/web/util/DynamicTimer.java
  30. 20
      web/src/main/resources/config.properties
  31. 15
      web/src/main/webapp/WEB-INF/jsp/index.jsp
  32. 4
      web/src/main/webapp/WEB-INF/jsp/menu.jsp
  33. 13
      web/src/main/webapp/index.html
  34. 4
      web/src/main/webapp/pages/blank.html
  35. 4
      web/src/main/webapp/pages/buttons.html
  36. 4
      web/src/main/webapp/pages/flot.html
  37. 4
      web/src/main/webapp/pages/forms.html
  38. 4
      web/src/main/webapp/pages/grid.html
  39. 4
      web/src/main/webapp/pages/icons.html
  40. 4
      web/src/main/webapp/pages/index.html
  41. 2
      web/src/main/webapp/pages/login.html
  42. 4
      web/src/main/webapp/pages/notifications.html
  43. 4
      web/src/main/webapp/pages/panels-wells.html
  44. 4
      web/src/main/webapp/pages/tables.html
  45. 4
      web/src/main/webapp/pages/typography.html

@ -1,6 +1,7 @@
package org.pqh.core.aop;
package core.aop;
import org.pqh.core.util.LogManger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.stereotype.Component;
@ -11,8 +12,8 @@ import java.util.Arrays;
* Created by reborn on 2017/8/3.
*/
@Component
public class Advice implements MethodBeforeAdvice,LogManger {
public class Advice implements MethodBeforeAdvice {
private Logger log=LogManager.getLogger();
@Override
public void before(Method method, Object[] objects, Object o) throws Throwable {
log.info("类:" + o.getClass() + ",方法:" + method.getName() + "被调用,传入参数:" + Arrays.asList(objects));

@ -1,7 +1,7 @@
package org.pqh.core.aop;
package core.aop;
import core.dao.BaseDao;
import org.aopalliance.aop.Advice;
import org.pqh.core.dao.BaseDao;
import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor;
import org.springframework.stereotype.Component;

@ -1,8 +1,9 @@
package org.pqh.core.config;
package core.config;
import com.alibaba.druid.pool.DruidDataSource;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.hibernate.SessionFactory;
import org.pqh.core.util.LogManger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -19,7 +20,9 @@ import java.util.Properties;
*/
@Configuration
@EnableTransactionManagement
public class HibernateConfig implements LogManger{
public class HibernateConfig{
private Logger log=LogManager.getLogger();
@Value("${hibernate.dialect}")
private String dialect;
@ -31,10 +34,10 @@ public class HibernateConfig implements LogManger{
private String username;
@Value("${hibernate.connection.password}")
private String password;
@Value("${sessionFactory.scan:org.pqh.model}")
@Value("${sessionFactory.scan:web.model}")
private String packagesToScan[];
private LocalSessionFactoryBean sessionFactoryBean;
public static LocalSessionFactoryBean sessionFactoryBean;
private DruidDataSource druidDataSource(){
DruidDataSource dataSource=new DruidDataSource();
@ -62,6 +65,7 @@ public class HibernateConfig implements LogManger{
return sessionFactoryBean.getObject();
}
@Bean("transactionManager")
public HibernateTransactionManager hibernateTransactionManager() {
HibernateTransactionManager hibernateTransactionManager=new HibernateTransactionManager();

@ -1,13 +1,12 @@
package org.pqh.core.dao;
package core.dao;
import core.model.AbstractModel;
import org.hibernate.SessionFactory;
import org.pqh.core.model.AbstractModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate5.HibernateTemplate;
import org.springframework.stereotype.Repository;
import javax.transaction.Transactional;
import java.io.Serializable;
/**
@ -15,7 +14,6 @@ import java.io.Serializable;
*/
@Repository
@Transactional
public class BaseDao extends HibernateTemplate{
@Autowired

@ -0,0 +1,42 @@
package core.model;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.Serializable;
/**
* Created by reborn on 2017/8/3.
*/
public abstract class AbstractModel {
protected Logger log=LogManager.getLogger();
public abstract Serializable primaryKey();
public abstract String tableNote();
private static ObjectMapper objectMapper=new ObjectMapper();
public Serializable[] checkeds;
public Serializable[] getCheckeds() {
return checkeds;
}
public void setCheckeds(Serializable[] checkeds) {
this.checkeds = checkeds;
}
@Override
public String toString() {
try {
return objectMapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
log.info(e);
return super.toString();
}
}
}

@ -0,0 +1,58 @@
package core.service;
import core.dao.BaseDao;
import core.model.AbstractModel;
import core.util.DBAction;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.Serializable;
/**
* Created by reborn on 2017/7/28.
*/
@Service
public class BaseService {
protected Logger log=LogManager.getLogger();
@Resource
private BaseDao baseDao;
public<T extends AbstractModel> String curd(DBAction action, T command) {
Class<T> tClass = (Class<T>) command.getClass();
try {
switch (action) {
case C:
case U:
baseDao.saveOrUpdate(command);
break;
case R:
if(command.primaryKey()!=null) {
T model = baseDao.get(tClass, command.primaryKey());
return model == null ? "找不到主键=" + command.primaryKey() + "" : model.toString();
}else{
throw new RuntimeException(command.getClass()+".primaryKey()方法返回null");
}
case D:
if(command.getCheckeds()==null) {
baseDao.delete(tClass, command.primaryKey());
}else{
for (Serializable checked:command.getCheckeds()){
baseDao.delete(tClass,checked);
}
}
break;
}
return action.getEn() + " success";
} catch (Exception e) {
log.error((command.tableNote()==null?command.getClass():command.tableNote()) + "进行" + action.getCh() + "操作失败,原因是:" + e.getMessage());
}
return action.getEn() + " fail";
}
}

@ -1,4 +1,4 @@
package org.pqh.core.util;
package core.util;
/**
* Created by reborn on 2017/8/2.

@ -1,18 +0,0 @@
package org.pqh.core.annotation;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.PropertySource;
import java.lang.annotation.*;
/**
* 爬虫注入组件
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
@Documented
@PropertySource("classpath:config.properties")
@ComponentScan("org.pqh.core")
public @interface EnableWebCrawlerConfiguration {
}

@ -1,13 +0,0 @@
package org.pqh.core.model;
import java.io.Serializable;
/**
* Created by reborn on 2017/8/3.
*/
public abstract class AbstractModel {
public abstract Serializable primaryKey();
public abstract String tableNote();
}

@ -1,48 +0,0 @@
package org.pqh.core.service;
import org.pqh.core.dao.BaseDao;
import org.pqh.core.model.AbstractModel;
import org.pqh.core.util.DBAction;
import org.pqh.core.util.LogManger;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* Created by reborn on 2017/7/28.
*/
@Service
public class BaseService<T extends AbstractModel> implements LogManger {
@Resource
private BaseDao baseDao;
public String curd(DBAction action, T command) {
Class<T> tClass = (Class<T>) command.getClass();
try {
switch (action) {
case C:
case U:
baseDao.saveOrUpdate(command);
break;
case R:
T model = baseDao.load(tClass, command.primaryKey());
return model == null ? "找不到主键=" + command.primaryKey() + "" : model.toString();
case D:
baseDao.delete(tClass, command.primaryKey());
break;
}
return action.getEn() + " success";
} catch (Exception e) {
log.error(command.tableNote() + "进行" + action.getCh() + "操作失败,原因是:" + e.getMessage());
}
return action.getEn() + " fail";
}
public List<T> loadAll(Class <T> tClass){
return baseDao.loadAll(tClass);
}
}

@ -1,11 +0,0 @@
package org.pqh.core.util;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* Created by reborn on 2017/9/19.
*/
public interface LogManger {
Logger log=LogManager.getLogger();
}

@ -129,6 +129,20 @@
<version>${thrift.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>Webcrawler</finalName>

@ -1,32 +0,0 @@
package org.pqh.config;
import org.pqh.core.annotation.EnableWebCrawlerConfiguration;
import org.springframework.context.annotation.*;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* Created by reborn on 2017/7/28.
*/
@EnableWebMvc
@ComponentScan({"${spring.scan:org.pqh.controller}"})
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableWebCrawlerConfiguration
public class SpringConfig implements WebMvcConfigurer {
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
registry.jsp("/WEB-INF/jsp/",".jsp");
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
String paths[]=new String[]{"dist","js","less","pages","vendor"};
// for(String path:paths){
// registry.addResourceHandler("/"+path+"/**").addResourceLocations("/"+path+"/");
// }
}
}

@ -1,29 +0,0 @@
package org.pqh.controller;
import org.pqh.core.model.AbstractModel;
import org.pqh.core.service.BaseService;
import org.pqh.core.util.DBAction;
import org.pqh.core.util.LogManger;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
/**
* Created by reborn on 2017/9/14.
*/
public class BaseController<T extends AbstractModel> implements LogManger{
@Resource
protected BaseService<T> baseService;
@ResponseBody
@RequestMapping(value = "{action}", produces = "text/html;charset=UTF-8")
public String curd(@PathVariable DBAction action, T model) {
log.info(model.tableNote() + "进行" + action.getCh() + "操作请求");
return baseService.curd(action, model);
}
}

@ -1,7 +1,7 @@
package org.pqh.config;
package web.config;
import com.alibaba.druid.support.http.StatViewServlet;
import org.pqh.core.util.LogManger;
import org.springframework.orm.hibernate5.support.OpenSessionInViewFilter;
import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
@ -12,7 +12,7 @@ import java.util.EnumSet;
* Created by reborn on 2017/7/28.
*/
public class AbstractWebConfig extends AbstractAnnotationConfigDispatcherServletInitializer implements LogManger {
public class AbstractWebConfig extends AbstractAnnotationConfigDispatcherServletInitializer {
private String encoding ="UTF-8";
@ -23,7 +23,7 @@ public class AbstractWebConfig extends AbstractAnnotationConfigDispatcherServlet
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class[0];
return new Class[]{SpringConfig.class};
}
@Override
@ -33,14 +33,20 @@ public class AbstractWebConfig extends AbstractAnnotationConfigDispatcherServlet
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
log.info("onStartup");
servletContext.log(AbstractWebConfig.class+".onStartup(ServletContext servletContext)");
super.onStartup(servletContext);
FilterRegistration.Dynamic dynamic=super.registerServletFilter(servletContext,new CharacterEncodingFilter(encoding));
dynamic.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST),true,"/*");
FilterRegistration.Dynamic characterEncodingFilter=super.registerServletFilter(servletContext,new CharacterEncodingFilter(encoding));
characterEncodingFilter.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST),true,"/*");
FilterRegistration.Dynamic openSessionInViewFilter=super.registerServletFilter(servletContext,new OpenSessionInViewFilter());
openSessionInViewFilter.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST),true,"/*");
ServletRegistration.Dynamic servlet=servletContext.addServlet("DruidStatView", StatViewServlet.class);
servlet.addMapping("/druid/*");
}
}

@ -0,0 +1,36 @@
package web.config;
import core.config.HibernateConfig;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.PropertySource;
import org.springframework.orm.hibernate5.support.OpenSessionInViewInterceptor;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* Created by reborn on 2017/7/28.
*/
@EnableWebMvc
@PropertySource("classpath:config.properties")
@ComponentScan({"${spring.scan}"})
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class SpringConfig implements WebMvcConfigurer {
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
registry.jsp("/WEB-INF/jsp/",".jsp");
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
OpenSessionInViewInterceptor interceptor=new OpenSessionInViewInterceptor();
interceptor.setSessionFactory(HibernateConfig.sessionFactoryBean.getObject());
registry.addWebRequestInterceptor(interceptor);
}
}

@ -1,6 +1,5 @@
package org.pqh.controller;
package web.controller;
import org.pqh.core.util.LogManger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -8,9 +7,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
* Created by reborn on 2017/9/14.
*/
@Controller
public class AdminController implements LogManger{
public class AdminController extends BaseController{
@RequestMapping({"indexAction"})
@RequestMapping({"index"})
private String index(){
log.info("进入首页");
return "index";
@ -26,9 +25,4 @@ public class AdminController implements LogManger{
return "test2";
}
@RequestMapping("menu")
private String menu(){
return "menu";
}
}

@ -0,0 +1,31 @@
package web.controller;
import core.model.AbstractModel;
import core.service.BaseService;
import core.util.DBAction;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
/**
* Created by reborn on 2017/9/14.
*/
public class BaseController<T extends AbstractModel>{
protected Logger log=LogManager.getLogger();
@Resource
protected BaseService baseService;
@ResponseBody
@RequestMapping(value = "{action}", produces = "application/json;charset=UTF-8")
public String curd(@PathVariable DBAction action, T model) {
log.info((model.tableNote()==null?model.getClass():model.tableNote()) + "进行" + action.getCh() + "操作请求");
return baseService.curd(action, model);
}
}

@ -0,0 +1,17 @@
package web.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import web.model.DataEntity;
@Controller
@RequestMapping("/comment")
public class CommentController extends BaseController<DataEntity>{
@RequestMapping(value = "find",produces = "application/json;charset=UTF-8")
public String get(DataEntity dataEntity){
return "";
}
}

@ -0,0 +1,286 @@
package web.model;
import core.model.AbstractModel;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;
@Entity
@Table(name = "cid", schema = "bilibili", catalog = "")
public class CidEntity extends AbstractModel {
private int cid;
private Integer maxlimit;
private Integer chatid;
private String server;
private String vtype;
private String oriurl;
private Integer aid;
private Integer typeid;
private Integer pid;
private Integer click;
private Integer favourites;
private Integer credits;
private Integer coins;
private Integer fwClick;
private String duration;
private String arctype;
private Integer danmu;
private Integer bottom;
private Integer sinapi;
private String acceptguest;
private String acceptaccel;
@Id
@Column(name = "cid")
public int getCid() {
return cid;
}
public void setCid(int cid) {
this.cid = cid;
}
@Basic
@Column(name = "maxlimit")
public Integer getMaxlimit() {
return maxlimit;
}
public void setMaxlimit(Integer maxlimit) {
this.maxlimit = maxlimit;
}
@Basic
@Column(name = "chatid")
public Integer getChatid() {
return chatid;
}
public void setChatid(Integer chatid) {
this.chatid = chatid;
}
@Basic
@Column(name = "server")
public String getServer() {
return server;
}
public void setServer(String server) {
this.server = server;
}
@Basic
@Column(name = "vtype")
public String getVtype() {
return vtype;
}
public void setVtype(String vtype) {
this.vtype = vtype;
}
@Basic
@Column(name = "oriurl")
public String getOriurl() {
return oriurl;
}
public void setOriurl(String oriurl) {
this.oriurl = oriurl;
}
@Basic
@Column(name = "aid")
public Integer getAid() {
return aid;
}
public void setAid(Integer aid) {
this.aid = aid;
}
@Basic
@Column(name = "typeid")
public Integer getTypeid() {
return typeid;
}
public void setTypeid(Integer typeid) {
this.typeid = typeid;
}
@Basic
@Column(name = "pid")
public Integer getPid() {
return pid;
}
public void setPid(Integer pid) {
this.pid = pid;
}
@Basic
@Column(name = "click")
public Integer getClick() {
return click;
}
public void setClick(Integer click) {
this.click = click;
}
@Basic
@Column(name = "favourites")
public Integer getFavourites() {
return favourites;
}
public void setFavourites(Integer favourites) {
this.favourites = favourites;
}
@Basic
@Column(name = "credits")
public Integer getCredits() {
return credits;
}
public void setCredits(Integer credits) {
this.credits = credits;
}
@Basic
@Column(name = "coins")
public Integer getCoins() {
return coins;
}
public void setCoins(Integer coins) {
this.coins = coins;
}
@Basic
@Column(name = "fw_click")
public Integer getFwClick() {
return fwClick;
}
public void setFwClick(Integer fwClick) {
this.fwClick = fwClick;
}
@Basic
@Column(name = "duration")
public String getDuration() {
return duration;
}
public void setDuration(String duration) {
this.duration = duration;
}
@Basic
@Column(name = "arctype")
public String getArctype() {
return arctype;
}
public void setArctype(String arctype) {
this.arctype = arctype;
}
@Basic
@Column(name = "danmu")
public Integer getDanmu() {
return danmu;
}
public void setDanmu(Integer danmu) {
this.danmu = danmu;
}
@Basic
@Column(name = "bottom")
public Integer getBottom() {
return bottom;
}
public void setBottom(Integer bottom) {
this.bottom = bottom;
}
@Basic
@Column(name = "sinapi")
public Integer getSinapi() {
return sinapi;
}
public void setSinapi(Integer sinapi) {
this.sinapi = sinapi;
}
@Basic
@Column(name = "acceptguest")
public String getAcceptguest() {
return acceptguest;
}
public void setAcceptguest(String acceptguest) {
this.acceptguest = acceptguest;
}
@Basic
@Column(name = "acceptaccel")
public String getAcceptaccel() {
return acceptaccel;
}
public void setAcceptaccel(String acceptaccel) {
this.acceptaccel = acceptaccel;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CidEntity cidEntity = (CidEntity) o;
return cid == cidEntity.cid &&
Objects.equals(maxlimit, cidEntity.maxlimit) &&
Objects.equals(chatid, cidEntity.chatid) &&
Objects.equals(server, cidEntity.server) &&
Objects.equals(vtype, cidEntity.vtype) &&
Objects.equals(oriurl, cidEntity.oriurl) &&
Objects.equals(aid, cidEntity.aid) &&
Objects.equals(typeid, cidEntity.typeid) &&
Objects.equals(pid, cidEntity.pid) &&
Objects.equals(click, cidEntity.click) &&
Objects.equals(favourites, cidEntity.favourites) &&
Objects.equals(credits, cidEntity.credits) &&
Objects.equals(coins, cidEntity.coins) &&
Objects.equals(fwClick, cidEntity.fwClick) &&
Objects.equals(duration, cidEntity.duration) &&
Objects.equals(arctype, cidEntity.arctype) &&
Objects.equals(danmu, cidEntity.danmu) &&
Objects.equals(bottom, cidEntity.bottom) &&
Objects.equals(sinapi, cidEntity.sinapi) &&
Objects.equals(acceptguest, cidEntity.acceptguest) &&
Objects.equals(acceptaccel, cidEntity.acceptaccel);
}
@Override
public int hashCode() {
return Objects.hash(cid, maxlimit, chatid, server, vtype, oriurl, aid, typeid, pid, click, favourites, credits, coins, fwClick, duration, arctype, danmu, bottom, sinapi, acceptguest, acceptaccel);
}
@Override
public Serializable primaryKey() {
return getCid();
}
@Override
public String tableNote() {
return null;
}
}

@ -0,0 +1,382 @@
package web.model;
import core.model.AbstractModel;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;
@Entity
@Table(name = "data", schema = "bilibili", catalog = "")
public class DataEntity extends AbstractModel {
private int cid;
private Integer aid;
private Byte dpDoneMp4;
private String letvVu;
private Byte dpDoneFlv;
private Integer uploadMeta;
private String type;
private Integer vp;
private Integer upload;
private String author;
private String cover;
private String title;
private Integer page;
private Integer dispatch;
private String vid;
private String backupVid;
private Integer files;
private Integer dispatchServers;
private String cache;
private Integer storageServer;
private Byte dpDone;
private Double duration;
private Integer mid;
private Byte dpDoneHdmp4;
private Integer letvVid;
private Integer storage;
private String letvAddr;
private String subtitle;
private CidEntity cidEntity;
@Id
@Column(name = "cid")
public int getCid() {
return cid;
}
public void setCid(int cid) {
this.cid = cid;
}
@Basic
@Column(name = "aid")
public Integer getAid() {
return aid;
}
public void setAid(Integer aid) {
this.aid = aid;
}
@Basic
@Column(name = "dp_done_mp4")
public Byte getDpDoneMp4() {
return dpDoneMp4;
}
public void setDpDoneMp4(Byte dpDoneMp4) {
this.dpDoneMp4 = dpDoneMp4;
}
@Basic
@Column(name = "letv_vu")
public String getLetvVu() {
return letvVu;
}
public void setLetvVu(String letvVu) {
this.letvVu = letvVu;
}
@Basic
@Column(name = "dp_done_flv")
public Byte getDpDoneFlv() {
return dpDoneFlv;
}
public void setDpDoneFlv(Byte dpDoneFlv) {
this.dpDoneFlv = dpDoneFlv;
}
@Basic
@Column(name = "upload_meta")
public Integer getUploadMeta() {
return uploadMeta;
}
public void setUploadMeta(Integer uploadMeta) {
this.uploadMeta = uploadMeta;
}
@Basic
@Column(name = "type")
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Basic
@Column(name = "vp")
public Integer getVp() {
return vp;
}
public void setVp(Integer vp) {
this.vp = vp;
}
@Basic
@Column(name = "upload")
public Integer getUpload() {
return upload;
}
public void setUpload(Integer upload) {
this.upload = upload;
}
@Basic
@Column(name = "author")
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
@Basic
@Column(name = "cover")
public String getCover() {
return cover;
}
public void setCover(String cover) {
this.cover = cover;
}
@Basic
@Column(name = "title")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Basic
@Column(name = "page")
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
@Basic
@Column(name = "dispatch")
public Integer getDispatch() {
return dispatch;
}
public void setDispatch(Integer dispatch) {
this.dispatch = dispatch;
}
@Basic
@Column(name = "vid")
public String getVid() {
return vid;
}
public void setVid(String vid) {
this.vid = vid;
}
@Basic
@Column(name = "backup_vid")
public String getBackupVid() {
return backupVid;
}
public void setBackupVid(String backupVid) {
this.backupVid = backupVid;
}
@Basic
@Column(name = "files")
public Integer getFiles() {
return files;
}
public void setFiles(Integer files) {
this.files = files;
}
@Basic
@Column(name = "dispatch_servers")
public Integer getDispatchServers() {
return dispatchServers;
}
public void setDispatchServers(Integer dispatchServers) {
this.dispatchServers = dispatchServers;
}
@Basic
@Column(name = "cache")
public String getCache() {
return cache;
}
public void setCache(String cache) {
this.cache = cache;
}
@Basic
@Column(name = "storage_server")
public Integer getStorageServer() {
return storageServer;
}
public void setStorageServer(Integer storageServer) {
this.storageServer = storageServer;
}
@Basic
@Column(name = "dp_done")
public Byte getDpDone() {
return dpDone;
}
public void setDpDone(Byte dpDone) {
this.dpDone = dpDone;
}
@Basic
@Column(name = "duration")
public Double getDuration() {
return duration;
}
public void setDuration(Double duration) {
this.duration = duration;
}
@Basic
@Column(name = "mid")
public Integer getMid() {
return mid;
}
public void setMid(Integer mid) {
this.mid = mid;
}
@Basic
@Column(name = "dp_done_hdmp4")
public Byte getDpDoneHdmp4() {
return dpDoneHdmp4;
}
public void setDpDoneHdmp4(Byte dpDoneHdmp4) {
this.dpDoneHdmp4 = dpDoneHdmp4;
}
@Basic
@Column(name = "letv_vid")
public Integer getLetvVid() {
return letvVid;
}
public void setLetvVid(Integer letvVid) {
this.letvVid = letvVid;
}
@Basic
@Column(name = "storage")
public Integer getStorage() {
return storage;
}
public void setStorage(Integer storage) {
this.storage = storage;
}
@Basic
@Column(name = "letv_addr")
public String getLetvAddr() {
return letvAddr;
}
public void setLetvAddr(String letvAddr) {
this.letvAddr = letvAddr;
}
@Basic
@Column(name = "subtitle")
public String getSubtitle() {
return subtitle;
}
public void setSubtitle(String subtitle) {
this.subtitle = subtitle;
}
@OneToOne
@JoinColumn(name = "cid")
public CidEntity getCidEntity() {
return cidEntity;
}
public void setCidEntity(CidEntity cidEntity) {
this.cidEntity = cidEntity;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DataEntity that = (DataEntity) o;
return cid == that.cid &&
Objects.equals(aid, that.aid) &&
Objects.equals(dpDoneMp4, that.dpDoneMp4) &&
Objects.equals(letvVu, that.letvVu) &&
Objects.equals(dpDoneFlv, that.dpDoneFlv) &&
Objects.equals(uploadMeta, that.uploadMeta) &&
Objects.equals(type, that.type) &&
Objects.equals(vp, that.vp) &&
Objects.equals(upload, that.upload) &&
Objects.equals(author, that.author) &&
Objects.equals(cover, that.cover) &&
Objects.equals(title, that.title) &&
Objects.equals(page, that.page) &&
Objects.equals(dispatch, that.dispatch) &&
Objects.equals(vid, that.vid) &&
Objects.equals(backupVid, that.backupVid) &&
Objects.equals(files, that.files) &&
Objects.equals(dispatchServers, that.dispatchServers) &&
Objects.equals(cache, that.cache) &&
Objects.equals(storageServer, that.storageServer) &&
Objects.equals(dpDone, that.dpDone) &&
Objects.equals(duration, that.duration) &&
Objects.equals(mid, that.mid) &&
Objects.equals(dpDoneHdmp4, that.dpDoneHdmp4) &&
Objects.equals(letvVid, that.letvVid) &&
Objects.equals(storage, that.storage) &&
Objects.equals(letvAddr, that.letvAddr) &&
Objects.equals(subtitle, that.subtitle);
}
@Override
public int hashCode() {
return Objects.hash(cid, aid, dpDoneMp4, letvVu, dpDoneFlv, uploadMeta, type, vp, upload, author, cover, title, page, dispatch, vid, backupVid, files, dispatchServers, cache, storageServer, dpDone, duration, mid, dpDoneHdmp4, letvVid, storage, letvAddr, subtitle);
}
@Override
public Serializable primaryKey() {
return getCid();
}
@Override
public String tableNote() {
return null;
}
}

@ -1,6 +1,6 @@
package org.pqh.model;
package web.model;
import org.pqh.core.model.AbstractModel;
import core.model.AbstractModel;
import javax.persistence.*;
import java.io.Serializable;

@ -1,6 +1,6 @@
package org.pqh.model;
package web.model;
import org.pqh.core.model.AbstractModel;
import core.model.AbstractModel;
import javax.persistence.*;
import java.io.Serializable;

@ -4,7 +4,7 @@
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.pqh.thrift;
package web.thrift;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-04-28")

@ -1,4 +1,4 @@
package org.pqh.thrift;
package web.thrift;
import org.apache.thrift.TException;

@ -4,7 +4,7 @@
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.pqh.thrift;
package web.thrift;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-04-28")

@ -1,4 +1,4 @@
package org.pqh.thrift;
package web.thrift;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;

@ -1,4 +1,4 @@
package org.pqh.thrift;
package web.thrift;
import org.apache.thrift.TProcessorFactory;
import org.apache.thrift.protocol.TBinaryProtocol;

@ -1,18 +1,19 @@
package org.pqh.util;
package web.util;
import core.dao.BaseDao;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.pqh.core.service.BaseService;
import org.pqh.core.util.LogManger;
import org.pqh.model.ScheduledTaskEntity;
import org.pqh.model.TaskEntity;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.scheduling.TriggerContext;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.scheduling.config.TriggerTask;
import org.springframework.scheduling.support.CronTrigger;
import org.springframework.stereotype.Component;
import web.model.ScheduledTaskEntity;
import web.model.TaskEntity;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
@ -25,14 +26,15 @@ import java.util.List;
* 动态定时器任务管理类
*/
@Component
public class DynamicTimer extends ScheduledTaskRegistrar implements LogManger {
public class DynamicTimer extends ScheduledTaskRegistrar {
private Logger log=LogManager.getLogger();
@Resource
private BaseService<ScheduledTaskEntity> baseService;
private BaseDao baseDao;
@PostConstruct
public void init(){
List<ScheduledTaskEntity> taskList=baseService.loadAll(ScheduledTaskEntity.class);
List<ScheduledTaskEntity> taskList=baseDao.loadAll(ScheduledTaskEntity.class);
for(ScheduledTaskEntity task:taskList){
addTriggerTask(task);
}

@ -1,8 +1,16 @@
#-----------------------hibernate\u914D\u7F6E-----------------------------
#-----------------------hibernateÅäÖÃ-----------------------------
hibernate.dialect=org.hibernate.dialect.MySQL57Dialect
hibernate.connection.driver_class=com.mysql.cj.jdbc.Driver
hibernate.connection.url=jdbc:mysql://127.0.0.1:3306/webcrawler?serverTimezone=UTC
hibernate.connection.username=bilibili
hibernate.connection.password=2233
#-----------------------DruidDataSource\u914D\u7F6E-----------------------
druid.maxActive=20
hibernate.connection.url=jdbc:mysql://mikuhime.xyz:3306/bilibili?serverTimezone=UTC
hibernate.connection.username=sukura
hibernate.connection.password=@
#Êý¾ÝÔ´2
hibernate.dialect2=org.hibernate.dialect.MySQL57Dialect
hibernate.connection.driver_class2=com.mysql.cj.jdbc.Driver
hibernate.connection.url2=jdbc:mysql://mikuhime.xyz:3306/bilibili?serverTimezone=UTC
hibernate.connection.username2=sukura
hibernate.connection.password2=@
#-----------------------DruidDataSourceÅäÖÃ-----------------------
druid.maxActive=20
spring.scan=core,web

@ -26,13 +26,12 @@
$("a[data-id="+menu_id+"]>b").click();
});
$("#chooseTab").on("click","b",function () {
ele=$("#"+$(this).parent().data("id"));
$("#chooseTab").on("click","button",function () {
ele=$("#"+$(this).find("a").data("id"));
ele.show();
ele.siblings().hide();
button=$(this).parents("button");
button.addClass("btn-default");
button.siblings().removeClass("btn-default");
$(this).addClass("btn-default");
$(this).siblings().removeClass("btn-default");
});
$("#chooseTab").on("click","i",function () {
@ -57,7 +56,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="indexAction.do">WebCrawler</a>
<a class="navbar-brand" href="/index.do">WebCrawler</a>
</div>
<!-- /.navbar-header -->
@ -279,10 +278,6 @@
<div id="page-wrapper">
<div class="row">
<div class="panel-body">
<%--<p >--%>
<%--<button type="button" href="test2.do" class="btn btn-outline btn-info">Info</button>--%>
<%--<button type="button" href="test.do" class="btn btn-outline btn-info">Info</button>--%>
<%--</p>--%>
<ul id="chooseTab" class="nav navbar-top-links">
</ul>

@ -28,10 +28,10 @@
<!-- /input-group -->
</li>
<li>
<a data-href="test.do" data-id="menu_222" data-name="AAA"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
<a data-href="/test.do" data-id="menu_222" data-name="AAA"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a data-href="test2.do" data-id="menu_333" data-name="BBB"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
<a data-href="/test2.do" data-id="menu_333" data-name="BBB"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="/pages/tables.html"><i class="fa fa-table fa-fw"></i> Tables</a>

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
location.href='/index.do'
</script>
</head>
<body>
</body>
</html>

@ -45,7 +45,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/indexAction.do">SB Admin v2.0</a>
<a class="navbar-brand" href="/index.do">SB Admin v2.0</a>
</div>
<!-- /.navbar-header -->
@ -274,7 +274,7 @@
<!-- /input-group -->
</li>
<li>
<a href="/indexAction.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
<a href="/index.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>

@ -48,7 +48,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/indexAction.do">SB Admin v2.0</a>
<a class="navbar-brand" href="/index.do">SB Admin v2.0</a>
</div>
<!-- /.navbar-header -->
@ -277,7 +277,7 @@
<!-- /input-group -->
</li>
<li>
<a href="/indexAction.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
<a href="/index.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>

@ -48,7 +48,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/indexAction.do">SB Admin v2.0</a>
<a class="navbar-brand" href="/index.do">SB Admin v2.0</a>
</div>
<!-- /.navbar-header -->
@ -277,7 +277,7 @@
<!-- /input-group -->
</li>
<li>
<a href="/indexAction.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
<a href="/index.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>

@ -45,7 +45,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/indexAction.do">SB Admin v2.0</a>
<a class="navbar-brand" href="/index.do">SB Admin v2.0</a>
</div>
<!-- /.navbar-header -->
@ -274,7 +274,7 @@
<!-- /input-group -->
</li>
<li>
<a href="/indexAction.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
<a href="/index.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>

@ -45,7 +45,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/indexAction.do">SB Admin v2.0</a>
<a class="navbar-brand" href="/index.do">SB Admin v2.0</a>
</div>
<!-- /.navbar-header -->
@ -274,7 +274,7 @@
<!-- /input-group -->
</li>
<li>
<a href="/indexAction.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
<a href="/index.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>

@ -45,7 +45,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/indexAction.do">SB Admin v2.0</a>
<a class="navbar-brand" href="/index.do">SB Admin v2.0</a>
</div>
<!-- /.navbar-header -->
@ -274,7 +274,7 @@
<!-- /input-group -->
</li>
<li>
<a href="/indexAction.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
<a href="/index.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>

@ -48,7 +48,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/indexAction.do">SB Admin v2.0</a>
<a class="navbar-brand" href="/index.do">SB Admin v2.0</a>
</div>
<!-- /.navbar-header -->
@ -277,7 +277,7 @@
<!-- /input-group -->
</li>
<li>
<a href="/indexAction.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
<a href="/index.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>

@ -56,7 +56,7 @@
</label>
</div>
<!-- Change this to a button or input when using this as a form -->
<a href="/indexAction.do" class="btn btn-lg btn-success btn-block">Login</a>
<a href="/index.do" class="btn btn-lg btn-success btn-block">Login</a>
</fieldset>
</form>
</div>

@ -45,7 +45,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/indexAction.do">SB Admin v2.0</a>
<a class="navbar-brand" href="/index.do">SB Admin v2.0</a>
</div>
<!-- /.navbar-header -->
@ -274,7 +274,7 @@
<!-- /input-group -->
</li>
<li>
<a href="/indexAction.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
<a href="/index.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>

@ -45,7 +45,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/indexAction.do">SB Admin v2.0</a>
<a class="navbar-brand" href="/index.do">SB Admin v2.0</a>
</div>
<!-- /.navbar-header -->
@ -274,7 +274,7 @@
<!-- /input-group -->
</li>
<li>
<a href="/indexAction.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
<a href="/index.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>

@ -51,7 +51,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/indexAction.do">SB Admin v2.0</a>
<a class="navbar-brand" href="/index.do">SB Admin v2.0</a>
</div>
<!-- /.navbar-header -->
@ -280,7 +280,7 @@
<!-- /input-group -->
</li>
<li>
<a href="/indexAction.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
<a href="/index.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>

@ -45,7 +45,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/indexAction.do">SB Admin v2.0</a>
<a class="navbar-brand" href="/index.do">SB Admin v2.0</a>
</div>
<!-- /.navbar-header -->
@ -274,7 +274,7 @@
<!-- /input-group -->
</li>
<li>
<a href="/indexAction.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
<a href="/index.do"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>

Loading…
Cancel
Save