From ad0509164df5dd946d743a9bda5b4b9ebe95d8a3 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Thu, 5 Aug 2021 08:00:25 -0500 Subject: [PATCH] Implement photon art table and enemy data table. Fix endpoints --- ngsplanner_schema.sql | 7 +++---- ngsplanner_seed.sql | 8 ++++---- server.js | 12 ++++++++++++ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ngsplanner_schema.sql b/ngsplanner_schema.sql index 1d8b7ea..d596372 100644 --- a/ngsplanner_schema.sql +++ b/ngsplanner_schema.sql @@ -248,7 +248,7 @@ CREATE TABLE "augment_type" ( "icon" text ); -CREATE TABLE "weapon_skill" ( +CREATE TABLE "photon_art" ( "id" SERIAL UNIQUE PRIMARY KEY, "name" text, "weapon_type_id" int, @@ -257,8 +257,7 @@ CREATE TABLE "weapon_skill" ( "pp" int, "frames" int, "dps" int, - "description" text, - "skill_dependency" text + "property" int ); CREATE TABLE "enemy_data" ( @@ -298,4 +297,4 @@ ALTER TABLE "augment" ADD FOREIGN KEY ("augment_type_id") REFERENCES "augment_ty ALTER TABLE "database_audit" ADD FOREIGN KEY ("users_id") REFERENCES "users" ("id"); -ALTER TABLE "weapon_skill" ADD FOREIGN KEY ("weapon_type_id") REFERENCES "weapon_type" ("id"); +ALTER TABLE "photon_art" ADD FOREIGN KEY ("weapon_type_id") REFERENCES "weapon_type" ("id"); diff --git a/ngsplanner_seed.sql b/ngsplanner_seed.sql index cab282e..7d6e10d 100644 --- a/ngsplanner_seed.sql +++ b/ngsplanner_seed.sql @@ -241,10 +241,10 @@ insert into database_audit(action,table_name,row_name,row_id,old_value,new_value insert into database_audit(action,table_name,row_name,row_id,old_value,new_value,date,users_id) values('UPDATE','skill_data','mel_dmg',1,'0.01','0','2018-07-17 19:45+00',(select id from users where username='sigonasr3' limit 1)); -insert into weapon_skill(name,weapon_type_id,potency,power_distribution,pp,frames,dps,description,skill_dependency) - values('Normal Attack Lv1',(select id from weapon_type where name='Twin Dagger' limit 1),100,0.45,2,20,270,''); -insert into weapon_skill(name,weapon_type_id,potency,power_distribution,pp,frames,dps,description,skill_dependency) - values('Spin Counter',(select id from weapon_type where name='Twin Dagger' limit 1),100,3,8,38,521,''); +insert into photon_art(name,weapon_type_id,potency,power_distribution,pp,frames,dps) + values('Normal Attack Lv1',(select id from weapon_type where name='Twin Dagger' limit 1),100,0.45,2,20,270); +insert into photon_art(name,weapon_type_id,potency,power_distribution,pp,frames,dps) + values('Spin Counter',(select id from weapon_type where name='Twin Dagger' limit 1),100,3,8,38,521); insert into enemy_data(level,def,atk) values(1,450,900); diff --git a/server.js b/server.js index b07ac19..6dce3ad 100644 --- a/server.js +++ b/server.js @@ -82,6 +82,12 @@ const ENDPOINTDATA=[ optionalfields:["icon"], excludedfields:[] //Fields to not output in GET. }, + { + endpoint:"photon_art", + requiredfields:["name","weapon_type_id","potency","dps"], + optionalfields:["power_distribution","pp","frames"], + excludedfields:[] //Fields to not output in GET. + }, { endpoint:"armor", requiredfields:["name","rarity","level_req","def"], @@ -136,6 +142,12 @@ const ENDPOINTDATA=[ optionalfields:["icon"], excludedfields:[] //Fields to not output in GET. }, + { + endpoint:"enemy_data", + requiredfields:["level","def","atk"], + optionalfields:[], + excludedfields:[] //Fields to not output in GET. + }, { endpoint:"food", requiredfields:["name"],