|
SPEC
drop table if exists Question;
drop table if exists DefaultAnswer;
drop table if exists AnswerSet;
drop table if exists AnswerSetDetail;
drop table if exists AnswerDig;
create table Question #裝網友問的問題
( questionNo bigint not null auto_increment,
subject text , #要問的主題
responsible text , #要負責的人
diggs int default 0, #分數
createTime datetime, #insert時時間
primary key (questionNo));
create table DefaultAnswer #預設的回答
( answerNo bigint not null auto_increment,
answerType int, #回答的類型
answerText text, #要負責的人
primary key (answerNo));
#answerType : 1 for 開場廢話 , 2 for 推諉廢話 , 3 for 解決方案廢話 , 0 for 惱羞成怒廢話
create table AnswerSet #裝網友挑的回答
( answerSetNo bigint not null auto_increment,
questionNo bigint, #問題的編號
answerText text, #要負責的人
createTime datetime, #insert時時間
primary key (answerSetNo));
create table AnswerSetDetail #把各個回答給記錄下來
( answerSetNo bigint not null,
seqNo int not null, #流水號
answerNo bigint not null, #對應到DefaultAnswer
primary key (answerSetNo,seqNo));
create table AnswerDig #大家對於回答的投票
( answerDigNo bigint not null,
answerSetNo bigint,
dig int, #1 for dig, -1 for bury
createTime datetime, #insert時時間
primary key (answerDigNo));
問題回答模式
取亂數,隨機決定兩種模式
mode 1 : 直接return #惱羞成怒廢話
mode 2 : 開場廢話 + 我想,關於『Question.subject',我個人也很關心。 +
推諉廢話 +我想這個問題呢,+
if AnswerSet.responsible is not null
{
AnswerSet.responsible + 要負起完全的責任。
}else if Question.responsible is not null
{
Question.responsible + 要負起完全的責任。
}
+ 解決方案廢話
create table Scenario(
scenarioNo bigint auto_increment,
prefix text,
postfix text,
primary key (scenarioNo ));
|