service.hbs 478 B

123456789101112131415161718192021222324252627
  1. import * as api from './api'
  2. export const use{{pascalCase name}}Service = () => {
  3. const create = (data: any) => {
  4. return api.create(data)
  5. }
  6. const update = (data: any) => {
  7. return api.update(data)
  8. }
  9. const del = (data: any) => {
  10. return api.del(data)
  11. }
  12. const find = (data: any) => {
  13. return api.find(data)
  14. }
  15. const getList = (data: any) => {
  16. return api.getList(data)
  17. }
  18. return {
  19. create,
  20. update,
  21. del,
  22. getList,
  23. find
  24. }
  25. }