DokiDoki1103 / tikuAdapter

大学生网课题库接口适配器:将不同的题库整合为一个API接口。
MIT License
230 stars 22 forks source link

。。。我不知道是不是bug我不太会用go貌似是数据库初始化有问题? #36

Closed guowang23333 closed 2 months ago

guowang23333 commented 2 months ago

E:\1w\tikuAdapter-main>tikuAdapter.exe [SYS] 2024/08/06 - 23:46:42 | 无法读取配置文件: Config File "config" Not Found in "[E:\1w\tikuAdapter-main]",将以默认 配置启动

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:32 [0.005ms] [rows:-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="tiku"

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:103 [0.511ms] [rows:2] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "tiku" AND sql IS NOT NULL order by type = "table" desc

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:111 [0.000ms] [rows:-] SELECT * FROM tiku LIMIT 1

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:20 [0.000ms] [rows:1] PRAGMA foreign_keys

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:344 [0.000ms] [rows:-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "tiku" AND name = "tiku"

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:389 [1.037ms] [rows:0] CREATE TABLE tiku__temp (id int(11),question longtext NOT NULL,type int(11) NOT NULL,options longtext NOT NULL,answer longtext NOT NULL,plat int(11) NOT NULL,hash char(32) NOT NULL,course_name varchar(255),extra text,PRIMARY KEY (id))

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] INSERT INTO tiku__temp(id,question,type,options,answer,plat,hash,course_name,extra) SELECT id,question,type,options,answer,plat,hash,course_name,extra FROM tiku

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] DROP TABLE tiku

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] ALTER TABLE tiku__temp RENAME TO tiku

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:20 [0.508ms] [rows:1] PRAGMA foreign_keys

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:344 [0.000ms] [rows:-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "tiku" AND name = "tiku"

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:389 [0.510ms] [rows:0] CREATE TABLE tiku__temp (id int(11),question longtext NOT NULL,type int(11) NOT NULL,options longtext NOT NULL,answer longtext NOT NULL,plat int(11) NOT NULL,hash char(32) NOT NULL,course_name varchar(255),extra text,PRIMARY KEY (id))

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] INSERT INTO tiku__temp(id,question,type,options,answer,plat,hash,course_name,extra) SELECT id,question,type,options,answer,plat,hash,course_name,extra FROM tiku

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.513ms] [rows:0] DROP TABLE tiku

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] ALTER TABLE tiku__temp RENAME TO tiku

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:20 [0.000ms] [rows:1] PRAGMA foreign_keys

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:344 [0.000ms] [rows:-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "tiku" AND name = "tiku"

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:389 [0.512ms] [rows:0] CREATE TABLE tiku__temp (id int(11),question longtext NOT NULL,type int(11) NOT NULL,options longtext NOT NULL,answer longtext NOT NULL,plat int(11) NOT NULL,hash char(32) NOT NULL,course_name varchar(255),extra text,PRIMARY KEY (id))

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] INSERT INTO tiku__temp(id,question,type,options,answer,plat,hash,course_name,extra) SELECT id,question,type,options,answer,plat,hash,course_name,extra FROM tiku

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.510ms] [rows:0] DROP TABLE tiku

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] ALTER TABLE tiku__temp RENAME TO tiku

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:287 [0.000ms] [rows:-] SELECT count(*) FROM sqlite_master WHERE type = "index" AND tbl_name = "tiku" AND name = "hash_index"

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:268 [1.994ms] [rows:0] CREATE UNIQUE INDEX hash_index ON tiku(hash)

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:32 [0.000ms] [rows:-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="users"

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:103 [0.000ms] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "users" AND sql IS NOT NULL order by type = "table" desc

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:111 [0.000ms] [rows:-] SELECT * FROM users LIMIT 1

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:20 [0.000ms] [rows:1] PRAGMA foreign_keys

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:344 [0.000ms] [rows:-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "users" AND name = "users"

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:389 [0.582ms] [rows:0] CREATE TABLE users__temp (id int(11),username varchar(255),password varchar(255),perms varchar(255),parent_id int(11),nickname varchar(255),PRIMARY KEY (id))

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:1] INSERT INTO users__temp(id,username,password,perms,parent_id,nickname) SELECT id,username,password,perms,parent_id,nickname FROM users

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.514ms] [rows:1] DROP TABLE users

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:1] ALTER TABLE users__temp RENAME TO users

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:20 [0.000ms] [rows:1] PRAGMA foreign_keys

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:344 [0.000ms] [rows:-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "users" AND name = "users"

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:389 [0.000ms] [rows:1] CREATE TABLE users__temp (id int(11),username varchar(255),password varchar(255),perms varchar(255),parent_id int(11),nickname varchar(255),PRIMARY KEY (id))

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:1] INSERT INTO users__temp(id,username,password,perms,parent_id,nickname) SELECT id,username,password,perms,parent_id,nickname FROM users

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:1] DROP TABLE users

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.510ms] [rows:1] ALTER TABLE users__temp RENAME TO users

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:32 [0.000ms] [rows:-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="logs"

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:103 [0.000ms] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "logs" AND sql IS NOT NULL order by type = "table" desc

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:111 [0.000ms] [rows:-] SELECT * FROM logs LIMIT 1

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:20 [0.000ms] [rows:1] PRAGMA foreign_keys

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:344 [0.000ms] [rows:-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "logs" AND name = "logs"

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:389 [0.508ms] [rows:1] CREATE TABLE logs__temp (id int(11),qid int(11) NOT NULL,old_answer longtext NOT NULL,new_answer longtext NOT NULL,user_id int(11) NOT NULL,create_time datetime NOT NULL,action tinyint(4) NOT NULL,PRIMARY KEY (id))

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] INSERT INTO logs__temp(id,qid,old_answer,new_answer,user_id,create_time,action) SELECT id,qid,old_answer,new_answer,user_id,create_time,action FROM logs

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.504ms] [rows:0] DROP TABLE logs

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] ALTER TABLE logs__temp RENAME TO logs

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:20 [0.000ms] [rows:1] PRAGMA foreign_keys

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:344 [0.000ms] [rows:-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "logs" AND name = "logs"

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:389 [0.000ms] [rows:0] CREATE TABLE logs__temp (id int(11),qid int(11) NOT NULL,old_answer longtext NOT NULL,new_answer longtext NOT NULL,user_id int(11) NOT NULL,create_time datetime NOT NULL,action tinyint(4) NOT NULL,PRIMARY KEY (id))

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] INSERT INTO logs__temp(id,qid,old_answer,new_answer,user_id,create_time,action) SELECT id,qid,old_answer,new_answer,user_id,create_time,action FROM logs

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] DROP TABLE logs

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.508ms] [rows:0] ALTER TABLE logs__temp RENAME TO logs

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:20 [0.000ms] [rows:1] PRAGMA foreign_keys

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:344 [0.000ms] [rows:-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "logs" AND name = "logs"

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:389 [0.574ms] [rows:0] CREATE TABLE logs__temp (id int(11),qid int(11) NOT NULL,old_answer longtext NOT NULL,new_answer longtext NOT NULL,user_id int(11) NOT NULL,create_time datetime NOT NULL,action tinyint(4) NOT NULL,PRIMARY KEY (id))

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] INSERT INTO logs__temp(id,qid,old_answer,new_answer,user_id,create_time,action) SELECT id,qid,old_answer,new_answer,user_id,create_time,action FROM logs

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] DROP TABLE logs

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.509ms] [rows:0] ALTER TABLE logs__temp RENAME TO logs

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:20 [0.000ms] [rows:1] PRAGMA foreign_keys

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:344 [0.000ms] [rows:-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "logs" AND name = "logs"

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:389 [0.509ms] [rows:0] CREATE TABLE logs__temp (id int(11),qid int(11) NOT NULL,old_answer longtext NOT NULL,new_answer longtext NOT NULL,user_id int(11) NOT NULL,create_time datetime NOT NULL,action tinyint(4) NOT NULL,PRIMARY KEY (id))

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] INSERT INTO logs__temp(id,qid,old_answer,new_answer,user_id,create_time,action) SELECT id,qid,old_answer,new_answer,user_id,create_time,action FROM logs

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.503ms] [rows:0] DROP TABLE logs

2024/08/06 23:46:42 /home/runner/go/pkg/mod/github.com/glebarez/sqlite@v1.10.0/migrator.go:399 [0.000ms] [rows:0] ALTER TABLE logs__temp RENAME TO logs

2024/08/06 23:46:42 /home/runner/work/tikuAdapter/tikuAdapter/internal/dao/users.gen.go:268 constraint failed: UNIQUE constraint failed: users.id (1555) [0.000ms] [rows:0] INSERT INTO users (username,password,perms,parent_id,nickname,id) VALUES ("admin","123456","",0,"管理员",1) RETURNING id [FATAL] 2024/08/06 - 23:46:42 | [bucket name len is between [3-63],now is 0]

guowang23333 commented 2 months ago

替换到beta12解决问题,可能是beta13 数据库有问题?我不太了解 我是在无数据库的情况下创建的

DokiDoki1103 commented 2 months ago

[FATAL] 2024/08/06 - 23:46:42 | [bucket name len is between [3-63],now is 0] 阿里云 配置有误则启动失败,应该没配置的情况下不加载oss,我来修复

DokiDoki1103 commented 2 months ago

fix: https://github.com/DokiDoki1103/tikuAdapter/releases/tag/v0.1.0-beta.16