service_provider.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import request from "@/utils/request";
  2. export interface ServiceProviderTable {
  3. id?: number;
  4. name?: string;
  5. scopeLabel?: string;
  6. appId?: string;
  7. serverUrl?: string;
  8. signType?: string;
  9. format?: string;
  10. charset?: string;
  11. providerStatus?: string;
  12. description?: string;
  13. appPrivateKeyHint?: string;
  14. alipayPublicKeyHint?: string;
  15. createdTime?: string;
  16. updatedTime?: string;
  17. }
  18. export interface ServiceProviderListResult {
  19. total: number;
  20. items: ServiceProviderTable[];
  21. }
  22. export interface ServiceProviderCreateForm {
  23. name: string;
  24. scopeLabel: string;
  25. appId: string;
  26. appPrivateKey: string;
  27. alipayPublicKey: string;
  28. serverUrl?: string;
  29. signType?: string;
  30. format?: string;
  31. charset?: string;
  32. description?: string;
  33. }
  34. export interface ServiceProviderUpdateForm {
  35. name?: string;
  36. scopeLabel?: string;
  37. appId?: string;
  38. appPrivateKey?: string;
  39. alipayPublicKey?: string;
  40. serverUrl?: string;
  41. signType?: string;
  42. format?: string;
  43. charset?: string;
  44. description?: string;
  45. }
  46. export interface ServiceProviderOption {
  47. id: number;
  48. name: string;
  49. scopeLabel: string;
  50. }
  51. const API = {
  52. list: (params: any) =>
  53. request.get("/system/service-provider/list", { params }),
  54. detail: (id: number) =>
  55. request.get(`/system/service-provider/detail/${id}`),
  56. create: (data: ServiceProviderCreateForm) =>
  57. request.post("/system/service-provider/create", data),
  58. update: (id: number, data: ServiceProviderUpdateForm) =>
  59. request.put(`/system/service-provider/update/${id}`, data),
  60. delete: (ids: number[]) =>
  61. request.delete("/system/service-provider/delete", { data: ids }),
  62. toggle: (id: number) =>
  63. request.patch(`/system/service-provider/toggle/${id}`),
  64. options: () =>
  65. request.get("/system/service-provider/options"),
  66. };
  67. export default API;