diff --git a/IdentityService/.idea/misc.xml b/IdentityService/.idea/misc.xml index 5b6a5c4a919497ee5068af0f48f2f2c4b7ef18ab..02ee41745424ca787b338c8fc8f1dfde29e95cb3 100644 --- a/IdentityService/.idea/misc.xml +++ b/IdentityService/.idea/misc.xml @@ -10,7 +10,7 @@ </list> </option> </component> - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8 (1)" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/out" /> </component> </project> \ No newline at end of file diff --git a/IdentityService/.idea/sqldialects.xml b/IdentityService/.idea/sqldialects.xml new file mode 100644 index 0000000000000000000000000000000000000000..3f4de674cd595c1d52b4f2584163f2741133a506 --- /dev/null +++ b/IdentityService/.idea/sqldialects.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="SqlDialectMappings"> + <file url="file://$PROJECT_DIR$/data/db_ojek_account.sql" dialect="MySQL" /> + </component> +</project> \ No newline at end of file diff --git a/IdentityService/.idea/vcs.xml b/IdentityService/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..6c0b8635858dc7ad44b93df54b762707ce49eefc --- /dev/null +++ b/IdentityService/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$/.." vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/WebService/.idea/inspectionProfiles/Project_Default.xml b/WebService/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000000000000000000000000000000000000..f71f4c39f3bf30c6e03cf8f27f7ed52bf4062746 --- /dev/null +++ b/WebService/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ +<component name="InspectionProjectProfileManager"> + <profile version="1.0"> + <option name="myName" value="Project Default" /> + <inspection_tool class="ValidExternallyBoundObject" enabled="false" level="ERROR" enabled_by_default="false" /> + </profile> +</component> \ No newline at end of file diff --git a/WebService/.idea/misc.xml b/WebService/.idea/misc.xml index 5d75313a92f4b42c84bffcebe4e77f3e195d0696..cb0f292cab4d8456cfef480a525a5da502bf3f92 100644 --- a/WebService/.idea/misc.xml +++ b/WebService/.idea/misc.xml @@ -1,12 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> - <component name="EntryPointsManager"> - <entry_points version="2.0" /> - </component> <component name="ProjectKey"> <option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" /> </component> - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8 (1)" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/out" /> </component> </project> \ No newline at end of file diff --git a/WebService/src/com/informatika/ojek/webservice/Account.java b/WebService/src/com/informatika/ojek/webservice/Account.java index 0a981260fb8863133276e33120ec541797612f8d..dd347f8ca6864f9576f91466b979c1e770b9ba66 100644 --- a/WebService/src/com/informatika/ojek/webservice/Account.java +++ b/WebService/src/com/informatika/ojek/webservice/Account.java @@ -8,10 +8,10 @@ public class Account { private String password; private String phone; private String photo; - private boolean is_driver; + private boolean isDriver; - public Account(int _id, String _name, String _username, String _email, String _password, String _phone, String _photo, Boolean _is_driver){ + public Account(int _id, String _name, String _username, String _email, String _password, String _phone, String _photo, Boolean _isDriver){ id = _id; name = _name; username = _username; @@ -19,8 +19,7 @@ public class Account { password = _password; phone = _phone; photo = _photo; - is_driver = _is_driver; - + isDriver = _isDriver; } public int getId() { @@ -79,12 +78,12 @@ public class Account { this.photo = photo; } - public boolean isIs_driver() { - return is_driver; + public boolean isIsDriver() { + return isDriver; } - public void setIs_driver(boolean is_driver) { - this.is_driver = is_driver; + public void setIsDriver(boolean isDriver) { + this.isDriver = isDriver; } diff --git a/WebService/src/com/informatika/ojek/webservice/IProfile.java b/WebService/src/com/informatika/ojek/webservice/IProfile.java index bf681ebbb5d0bebd92a3a62546bec7a3a697a166..9720857f8de92b5dc8d64280bbf2493a8e33fdd7 100644 --- a/WebService/src/com/informatika/ojek/webservice/IProfile.java +++ b/WebService/src/com/informatika/ojek/webservice/IProfile.java @@ -11,8 +11,8 @@ import javax.jws.soap.SOAPBinding.Style; public interface IProfile { @WebMethod public Account getActiveUser(String access_token); @WebMethod public String[] getLocation(String access_token); - @WebMethod public void addPreferredLocation(String access_token, String location); - @WebMethod public void delPreferredLocation(String access_token, String location); - @WebMethod public void updatePreferredLocation(String access_token, String old_location, String new_location); - @WebMethod public void updateProfile(String access_token, String name, String phone, Boolean is_driver, String photo); + @WebMethod public boolean addPreferredLocation(String access_token, String location); + @WebMethod public boolean delPreferredLocation(String access_token, String location); + @WebMethod public boolean updatePreferredLocation(String access_token, String old_location, String new_location); + @WebMethod public boolean updateProfile(String access_token, String name, String phone, Boolean is_driver, String photo); } \ No newline at end of file diff --git a/WebService/src/com/informatika/ojek/webservice/Main.java b/WebService/src/com/informatika/ojek/webservice/Main.java index 2100d3f41023afae8f5201667af72ab20a0d8e6b..4fb270237ebd0e7372032e807643af275cd8de12 100644 --- a/WebService/src/com/informatika/ojek/webservice/Main.java +++ b/WebService/src/com/informatika/ojek/webservice/Main.java @@ -7,7 +7,7 @@ public class Main{ public static void main(String[] args) { Endpoint.publish("http://localhost:9999/ws/profile", new Profile()); - Endpoint.publish("http://localhost:9999/ws/Order", new Order()); + Endpoint.publish("http://localhost:9999/ws/order", new Order()); } diff --git a/WebService/src/com/informatika/ojek/webservice/Profile.java b/WebService/src/com/informatika/ojek/webservice/Profile.java index f92f77aafc3cc78bc292707aa59dd64dc1e85055..dd0662bd43590b5dc3e4502a870b64dd82a6ad7b 100644 --- a/WebService/src/com/informatika/ojek/webservice/Profile.java +++ b/WebService/src/com/informatika/ojek/webservice/Profile.java @@ -3,25 +3,72 @@ package com.informatika.ojek.webservice; import javax.jws.WebService; //Service Implementation -@WebService(endpointInterface = "com.informatika.ojek.webservice.IOrder") +@WebService(endpointInterface = "com.informatika.ojek.webservice.IProfile") public class Profile implements IProfile { - @Override public Account getActiveUser(String access_token){ - return null; + @Override public Account getActiveUser(String accessToken){ + boolean isTokenValid = true; //request identity service + int id = 1; //request identity service + if (isTokenValid) { + String name = "Diki Ardian"; + String username = "dikiardian"; + String email = "diki@gmail.com"; + String password = "12345"; + String phone = "081234"; + String photo = "photo.jpg"; + boolean isDriver = true; + return new Account(id, name, username, email, password, phone, photo, isDriver); + } else { + return null; + } } - @Override public String[] getLocation(String access_token){ - return null; + @Override public String[] getLocation(String accessToken) { + boolean isTokenValid = true; //request identity service; + int id = 1; //request identity service + if (isTokenValid) { + //QUERY getLocation + return new String[]{"a", "b"}; + } else { + return null; + } } - @Override public void addPreferredLocation(String access_token, String location){ - + @Override public boolean addPreferredLocation(String accessToken, String location){ + boolean isTokenValid = true; //request identity service; + int id = 1; //request identity service + if (isTokenValid) { + //QUERY addLocation + return true; + } else { + return false; + } } - @Override public void delPreferredLocation(String access_token, String location){ - + @Override public boolean delPreferredLocation(String accessToken, String location){ + boolean isTokenValid = true; //request identity service; + int id = 1; //request identity service + if (isTokenValid) { + //QUERY delLocation + return true; + } else { + return false; + } } - @Override public void updatePreferredLocation(String access_token, String old_location, String new_location){ - + @Override public boolean updatePreferredLocation(String accessToken, String oldLocation, String newLocation){ + boolean isTokenValid = true; //request identity service; + int id = 1; //request identity service + if (isTokenValid) { + //QUERY updateLocation + return true; + } else { + return false; + } } - @Override public void updateProfile(String access_token, String name, String phone, Boolean is_driver, String photo){ - + @Override public boolean updateProfile(String accessToken, String name, String phone, Boolean isDriver, String photo){ + boolean isTokenValid = true; //request identity service; + int id = 1; //request identity service + if (isTokenValid) { + //QUERY updateProfile + return true; + } else { + return false; + } } - } \ No newline at end of file