slelist.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import { AxiosResponse } from 'axios'
  2. import { ContentType, HttpClient, RequestParams } from '/@/api/admin/http-client'
  3. import { HistoricalVersionRecordDto, ProjectGetPageDto } from './slelistDto'
  4. export class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
  5. /**
  6. * 删除项目
  7. * @param value 项目信息对象
  8. */
  9. deleteProject(value: ProjectGetPageDto) {
  10. return this.request({
  11. path: '/api/app/project/delete-project',
  12. method: 'POST',
  13. body: value,
  14. type: ContentType.Json,
  15. format: 'json',
  16. secure: true
  17. })
  18. }
  19. /**
  20. * 查询列表
  21. * @tags
  22. * @name GetList
  23. * @summary 查询列表
  24. * @request POST:'/api/app/project/get-page'
  25. * @secure
  26. */
  27. getList = (data: any, params: RequestParams = {}): any =>
  28. this.request<AxiosResponse, any>({
  29. path: '/api/app/project/get-page',
  30. method: 'POST',
  31. body: data,
  32. type: ContentType.Json,
  33. secure: true,
  34. format: 'json',
  35. ...params
  36. })
  37. /**
  38. * 上传/添加项目
  39. */
  40. uploadProject = (data: ProjectGetPageDto, params: RequestParams = {}) => {
  41. return this.request({
  42. path: '/api/app/project/upload-project',
  43. method: 'POST',
  44. body: data,
  45. type: ContentType.Json,
  46. format: 'json',
  47. ...params
  48. })
  49. }
  50. /**
  51. * 更新项目
  52. */
  53. updateProject = (data: ProjectGetPageDto & { id: string }, params: RequestParams = {}) => {
  54. return this.request({
  55. path: '/api/app/project/update-project',
  56. method: 'POST',
  57. body: data,
  58. type: ContentType.Json,
  59. format: 'json',
  60. ...params
  61. })
  62. }
  63. /** 获取所有项目的主键,项目名称,项目编码 */
  64. getProjectMainInfo = () => {
  65. return this.request({
  66. path: '/api/app/project/get-main-info',
  67. method: 'get',
  68. })
  69. }
  70. /**
  71. * 查询软件历史版本记录
  72. * @tags 软件管理
  73. * @name GetHistoricalVersionRecord
  74. * @summary 通过ID查询历史版本
  75. * @request POST:/api/app/software/get-historical-version-record
  76. * @secure
  77. */
  78. getHistory = (id: number | null, params: RequestParams = {}): Promise<AxiosResponse<HistoricalVersionRecordDto>> => {
  79. const requestData = id !== null ? { id } : {};
  80. return this.request({
  81. path: '/api/app/software/get-historical-version-record',
  82. method: 'POST',
  83. query: requestData,
  84. secure: true,
  85. format: 'json',
  86. ...params
  87. });
  88. }
  89. }