question.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import request from '@/utils/request'
  2. // 查询问答列-问题列表
  3. export function listQuestion(query) {
  4. return request({
  5. url: '/asking/question/list',
  6. method: 'get',
  7. params: query
  8. })
  9. }
  10. // 查询问答列-问题详细
  11. export function getQuestion(id) {
  12. return request({
  13. url: '/asking/question/' + id,
  14. method: 'get'
  15. })
  16. }
  17. // 新增问答列-问题
  18. export function addQuestion(data) {
  19. return request({
  20. url: '/asking/question',
  21. method: 'post',
  22. data: data
  23. })
  24. }
  25. // 新增问答列-答案
  26. export function addAnswer(data) {
  27. return request({
  28. url: '/asking/answer',
  29. method: 'post',
  30. data: data
  31. })
  32. }
  33. // 修改问答列-问题
  34. export function updateQuestion(data) {
  35. return request({
  36. url: '/asking/question',
  37. method: 'put',
  38. data: data
  39. })
  40. }
  41. //修改是否展示
  42. export function updateWhetherShow(data) {
  43. return request({
  44. url: '/asking/question/updateWhetherShow',
  45. method: 'put',
  46. data: data
  47. })
  48. }
  49. // 删除问答列-问题
  50. export function delQuestion(id) {
  51. return request({
  52. url: '/asking/question/' + id,
  53. method: 'delete'
  54. })
  55. }
  56. // 删除问答列-答案
  57. export function delAnswer(id) {
  58. return request({
  59. url: '/asking/answer/' + id,
  60. method: 'delete'
  61. })
  62. }
  63. //查询类型配置
  64. export function listType(query) {
  65. return request({
  66. url: '/asking/question/typeList',
  67. method: 'get',
  68. params: query
  69. })
  70. }
  71. // 审核
  72. export function through(data) {
  73. return request({
  74. url: '/asking/question/through',
  75. method: 'put',
  76. data: data
  77. })
  78. }