index.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import request from '@/config/axios'
  2. export interface NotifyTemplateVO {
  3. id?: number
  4. name: string
  5. nickname: string
  6. code: string
  7. content: string
  8. type?: number
  9. params: string
  10. status: number
  11. remark: string
  12. }
  13. export interface NotifySendReqVO {
  14. userId: number | null
  15. templateCode: string
  16. templateParams: Map<String, Object>
  17. }
  18. // 查询站内信模板列表
  19. export const getNotifyTemplatePage = async (params: PageParam) => {
  20. return await request.get({ url: '/system/notify-template/page', params })
  21. }
  22. // 查询站内信模板详情
  23. export const getNotifyTemplate = async (id: number) => {
  24. return await request.get({ url: '/system/notify-template/get?id=' + id })
  25. }
  26. // 新增站内信模板
  27. export const createNotifyTemplate = async (data: NotifyTemplateVO) => {
  28. return await request.post({ url: '/system/notify-template/create', data })
  29. }
  30. // 修改站内信模板
  31. export const updateNotifyTemplate = async (data: NotifyTemplateVO) => {
  32. return await request.put({ url: '/system/notify-template/update', data })
  33. }
  34. // 删除站内信模板
  35. export const deleteNotifyTemplate = async (id: number) => {
  36. return await request.delete({ url: '/system/notify-template/delete?id=' + id })
  37. }
  38. // 批量删除站内信模板
  39. export const deleteNotifyTemplateList = async (ids: number[]) => {
  40. return await request.delete({ url: '/system/notify-template/delete-list', params: { ids: ids.join(',') } })
  41. }
  42. // 发送站内信
  43. export const sendNotify = (data: NotifySendReqVO) => {
  44. return request.post({ url: '/system/notify-template/send-notify', data })
  45. }