apiUser.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import { get, post } from "./http";
  2. const prefix = 'devicesApi/user/';
  3. export default user = {
  4. login: (param) => {
  5. return post(prefix + 'login', param);
  6. },
  7. register: (param) => {
  8. return post(prefix + 'register', param);
  9. },
  10. getConmpany: () => {
  11. return get(prefix + 'getFleetCompanyList');
  12. },
  13. getProfile: () => {
  14. return get(prefix + 'getUserDetail', {});
  15. },
  16. setProfile: (params) => {
  17. return post(prefix + 'update', params);
  18. },
  19. setNotifySwitch: (params) => {
  20. return post(prefix + 'updateUserNotifySwitch', params);
  21. },
  22. setNotifyToken: (token) => {
  23. return post(prefix + 'registerGoogleToken', token);
  24. },
  25. getCountryCode: () => {
  26. return get(prefix + 'getCountryCode', {});
  27. },
  28. rateCharge: (params) => {
  29. return post(prefix + 'rating', params);
  30. },
  31. feedback: (params) => {
  32. return post(prefix + 'feedback', params);
  33. },
  34. getTypeOfFeedback: () => {
  35. return get(prefix + 'getTypeOfFeedback', {});
  36. },
  37. getVehicles: () => {
  38. return get(prefix + 'getVehicles', {});
  39. },
  40. getVehicleById: (params) => {
  41. return get(prefix + 'getVehicleById', params);
  42. },
  43. addVehicle: (params) => {
  44. return post(prefix + 'addVehicle', params);
  45. },
  46. updateVehicle: (params) => {
  47. return post(prefix + 'updateVehicle', params);
  48. },
  49. deleteVehicle: (params) => {
  50. return get(prefix + 'delVehicleById', params);
  51. },
  52. getConnectorType: () => {
  53. return get(prefix + 'getConnectorType', {});
  54. },
  55. sendVerificationCode: (email) => {
  56. return get(prefix + 'sendVerificationCode', {email: email});
  57. },
  58. updatePassword: (params) => {
  59. return post(prefix + 'updatePassword', params);
  60. },
  61. getCountryList: () => {
  62. return get('devicesApi/base/getCountries')
  63. }
  64. }