数据库脚本文件

master
luffy9412 7 years ago
parent abb186c9d3
commit 2630ded478
  1. 292
      init/db.sql
  2. 14
      src/main/resources/log4j2.xml
  3. 13
      src/test/java/JunitTest.java

@ -0,0 +1,292 @@
create table aid
(
aid int not null
primary key,
tid int null,
typename varchar(255) null,
arctype varchar(255) null,
play int null,
review int null,
video_review int null,
favorites int null,
title varchar(255) null,
allow_bp int null,
allow_feed int null,
allow_download int null,
description varchar(500) null,
tag varchar(255) null,
pic varchar(255) null,
author varchar(255) null,
mid int null,
face varchar(255) null,
pages int null,
instant_server varchar(255) null,
created int null,
created_at varchar(255) null,
credit int null,
coins int null,
spid int null,
src varchar(255) null,
cid int null,
partname varchar(255) null,
offsite varchar(255) null,
typename2 varchar(255) null,
partid int null,
sp_title varchar(255) null,
season_id int null,
season_index varchar(255) null,
season_episode varchar(255) null,
bangumi_id int null
)
;
create table aidcid
(
aid int not null,
cid int not null,
partid int not null,
partname varchar(255) null,
primary key (aid, partid)
)
;
create table avcount
(
date date not null,
count int null
)
;
create table avplay
(
title varchar(255) not null,
play int(255) null,
timestamp datetime not null,
ranking int null,
primary key (title, timestamp)
)
;
create table baiduyun
(
id int not null auto_increment
primary key,
url varchar(50) null,
password varchar(4) null,
`desc` varchar(100) null,
constraint baiduyun_url_uindex
unique (url)
)
;
create table bangumi
(
bangumi_id int not null
primary key,
season_id int null,
title varchar(255) null,
allow_download varchar(255) null
)
;
create table cid
(
cid int not null
primary key,
maxlimit int null,
chatid int null,
server varchar(255) null,
vtype varchar(255) null,
oriurl varchar(255) null,
aid int null,
typeid int null,
pid int null,
click int null,
favourites int null,
credits int null,
coins int null,
fw_click int(255) null,
duration varchar(255) null,
arctype varchar(255) null,
danmu int null,
bottom int null,
sinapi int null,
acceptguest varchar(255) null,
acceptaccel varchar(255) null
)
;
create table data
(
cid int not null
primary key,
aid int null,
dp_done_mp4 tinyint(1) null,
letv_vu varchar(255) null,
dp_done_flv tinyint(1) null,
upload_meta int null,
type varchar(255) null,
vp int null,
upload int null,
author varchar(255) null,
cover varchar(255) null,
title varchar(255) null,
page int null,
dispatch int null,
vid varchar(255) null,
backup_vid varchar(255) null,
files int null,
dispatch_servers int null,
cache varchar(255) null,
storage_server int null,
dp_done tinyint(1) null,
duration float null,
mid int null,
dp_done_hdmp4 tinyint(1) null,
letv_vid int null,
storage int null,
letv_addr varchar(255) null,
subtitle varchar(255) null
)
;
create table dispatch_servers
(
is_active int null,
description varchar(255) null,
done int null,
state varchar(255) null,
done_at datetime null,
create_at datetime null,
dms_id int null,
server int null,
format varchar(255) null,
`create` int null,
cid int not null,
id int not null,
primary key (id, cid)
)
;
create table files
(
filesize mediumtext null,
`order` int null,
md5 varchar(255) null,
path varchar(255) null,
length int null,
storage_state int null,
format varchar(255) null,
cid int not null,
id int not null,
primary key (id, cid)
)
;
create table node_server
(
sid varchar(255) null,
server_id varchar(255) null,
perferred_zones varchar(255) null,
domain varchar(255) null,
allow_upload varchar(255) null,
ip varchar(255) null,
node_id varchar(255) null,
cid int not null,
id int not null,
primary key (id, cid)
)
;
create table param
(
`key` varchar(255) not null
primary key,
value varchar(1024) null,
`desc` varchar(255) null
)
;
create table save
(
id int not null,
bilibili varchar(20) null,
lastUpdateTime timestamp null,
latest tinyint(1) null
)
;
create table testjson
(
jackson json null
)
;
create table tsdm
(
animeName varchar(50) not null
primary key,
tsdmUrl varchar(512) null,
playTime date null,
updateTime varchar(30) null,
copyright varchar(20) null,
lastUpdateTime varchar(100) null
)
;
create table upload
(
encode_server varchar(255) null,
done int null,
state varchar(255) null,
create_at datetime null,
done_at datetime null,
uploaded int null,
`convert` int null,
error_reason varchar(255) null,
ip varchar(255) null,
timestamp int null,
filename varchar(255) null,
uploaded_at datetime null,
convert_at datetime null,
node_server int null,
cid int not null
primary key
)
;
create table upload_meta
(
storage_server int null,
done int null,
done_at datetime null,
create_at datetime null,
storage_state int null,
format varchar(255) null,
vp int null,
`create` int null,
cid int not null,
id int not null,
primary key (cid, id)
)
;
create table vstorage
(
id int not null
primary key,
code int null
)
;
create view as
SELECT
`c`.`aid` AS `aid`,
`c`.`cid` AS `cid`,
`c`.`pid` AS `pid`,
`c`.`typeid` AS `typeid`,
`d`.`title` AS `title`,
`d`.`subtitle` AS `subtitle`
FROM (`bilibili`.`cid` `c`
JOIN `bilibili`.`data` `d` ON (((`c`.`cid` = `d`.`cid`) AND ((`c`.`typeid` = 32) OR (`c`.`typeid` = 33)))));

@ -7,17 +7,23 @@
<Console name="STDOUT" target="SYSTEM_OUT"> <Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="${pattern}"></PatternLayout> <PatternLayout pattern="${pattern}"></PatternLayout>
</Console> </Console>
<File name="File" fileName="logs/info.log" bufferedIO="true" immediateFlush="true"> <File name="File_debug" fileName="logs/debug.log" bufferedIO="true" immediateFlush="true">
<PatternLayout pattern="${pattern}"></PatternLayout>
</File>
<File name="File_info" fileName="logs/info.log" bufferedIO="true" immediateFlush="true">
<PatternLayout pattern="${pattern}"></PatternLayout> <PatternLayout pattern="${pattern}"></PatternLayout>
</File> </File>
</Appenders> </Appenders>
<Loggers> <Loggers>
<Logger name="org.apache.logging.log4j.test1" level="debug" additivity="false"> <Logger name="test1" level="debug" additivity="false">
<AppenderRef ref="STDOUT"/> <AppenderRef ref="STDOUT"/>
</Logger> </Logger>
<Logger name="org.apache.logging.log4j.test2" level="debug" additivity="false"> <Logger name="test2" level="debug" additivity="false">
<AppenderRef ref="File"/> <AppenderRef ref="File_debug"/>
</Logger>
<Logger name="test3" level="info" additivity="false">
<AppenderRef ref="File_info"/>
</Logger> </Logger>
<Root level="info"> <Root level="info">
<AppenderRef ref="STDOUT"/> <AppenderRef ref="STDOUT"/>

@ -13,18 +13,21 @@ import java.net.URISyntaxException;
public class JunitTest { public class JunitTest {
private static final boolean flag=init(); // private static final boolean flag=init();
private static final Logger rootLogger= LogManager.getLogger(); private static final Logger rootLogger= LogManager.getLogger();
private static final Logger consoleLogger= LogManager.getLogger("log1"); private static final Logger consoleLogger= LogManager.getLogger("log1");
private static final Logger loggerFile= LogManager.getLogger("log2"); private static final Logger loggerFile= LogManager.getLogger("log2");
public static void main(String[] args) { public static void main(String[] args) {
rootLogger.info("rootLogger"); // rootLogger.info("rootLogger");
consoleLogger.info("consoleLogger"); // consoleLogger.info("consoleLogger");
loggerFile.info("loggerFile"); // loggerFile.info("loggerFile");
LogManager.getLogger("test1").info("test1");
LogManager.getLogger("test2").info("test2");
LogManager.getLogger("test3").info("test3");
LogManager.getLogger().info("test4");
// Collection<org.apache.logging.log4j.core.Logger> loggers=loggerContext.getLoggers(); // Collection<org.apache.logging.log4j.core.Logger> loggers=loggerContext.getLoggers();
// for(org.apache.logging.log4j.core.Logger logger:loggers){ // for(org.apache.logging.log4j.core.Logger logger:loggers){

Loading…
Cancel
Save