index.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 deleteNotifyTemplateApi = async (id: number) => {
  36. return await request.delete({ url: '/system/notify-template/delete?id=' + id })
  37. }
  38. // 发送站内信
  39. export const sendNotify = (data: NotifySendReqVO) => {
  40. return request.post({ url: '/system/notify-template/send-notify', data })
  41. }