apijs.ftl 915 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import request from '@/utils/request'
  2. import Qs from 'qs'
  3. export function list${doName}(query) {
  4. return request({
  5. method: 'post',
  6. params: {
  7. _gp: 'admin.${serviceLowCaseName}',
  8. _mt: 'list',
  9. page: query.page,
  10. limit: query.limit,
  11. ...query
  12. }
  13. })
  14. }
  15. export function create${doName}(data) {
  16. return request({
  17. method: 'post',
  18. data: Qs.stringify({
  19. _gp: 'admin.${serviceLowCaseName}',
  20. _mt: 'create',
  21. ${doName}DTO: JSON.stringify(data)
  22. })
  23. })
  24. }
  25. export function update${doName}(data) {
  26. return request({
  27. method: 'post',
  28. data: Qs.stringify({
  29. _gp: 'admin.${serviceLowCaseName}',
  30. _mt: 'edit',
  31. ${doName}DTO: JSON.stringify(data)
  32. })
  33. })
  34. }
  35. export function delete${doName}(id) {
  36. return request({
  37. method: 'post',
  38. params: {
  39. _gp: 'admin.${serviceLowCaseName}',
  40. _mt: 'delete',
  41. id: id
  42. }
  43. })
  44. }