蛋蛋星球 后台端
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

hdl_customer_service.go 3.3 KiB

4 settimane fa
4 settimane fa
4 settimane fa
4 settimane fa
4 settimane fa
4 settimane fa
4 settimane fa
4 settimane fa
4 settimane fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. package im
  2. import (
  3. "applet/app/e"
  4. md "applet/app/md/im"
  5. svc "applet/app/svc/im"
  6. "github.com/gin-gonic/gin"
  7. )
  8. // PageCustomerService
  9. // @Summary Im-客服(列表)
  10. // @Tags 客服
  11. // @Description 客服(列表)
  12. // @Accept json
  13. // @Produce json
  14. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  15. // @param req body md.PageCustomerServiceReq true "相关参数"
  16. // @Success 200 {object} md.GetBasicResp "设置列表"
  17. // @Failure 400 {object} md.Response "具体错误"
  18. // @Router /api/im/pageCustomerService [POST]
  19. func PageCustomerService(c *gin.Context) {
  20. var req *md.PageCustomerServiceReq
  21. if err1 := c.ShouldBindJSON(&req); err1 != nil {
  22. e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
  23. return
  24. }
  25. err, resp := svc.PageCustomerService(*req)
  26. if err != nil {
  27. e.OutErr(c, e.ERR, err.Error())
  28. return
  29. }
  30. e.OutSuc(c, resp, nil)
  31. }
  32. // AddCustomerService
  33. // @Summary Im-客服(新增)
  34. // @Tags 客服
  35. // @Description 客服(新增)
  36. // @Accept json
  37. // @Produce json
  38. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  39. // @param req body md.AddCustomerServiceReq true "相关参数"
  40. // @Success 200 {string} "success"
  41. // @Failure 400 {object} md.Response "具体错误"
  42. // @Router /api/im/addCustomerService [post]
  43. func AddCustomerService(c *gin.Context) {
  44. var req *md.AddCustomerServiceReq
  45. if err1 := c.ShouldBindJSON(&req); err1 != nil {
  46. e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
  47. return
  48. }
  49. err := svc.AddCustomerService(*req)
  50. if err != nil {
  51. e.OutErr(c, e.ERR, err.Error())
  52. return
  53. }
  54. e.OutSuc(c, "success", nil)
  55. }
  56. // SetCustomerServiceState
  57. // @Summary Im-客服(更新状态)
  58. // @Tags 客服
  59. // @Description 客服(更新状态)
  60. // @Accept json
  61. // @Produce json
  62. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  63. // @param req body md.SetCustomerServiceStateReq true "相关参数"
  64. // @Success 200 {string} "success"
  65. // @Failure 400 {object} md.Response "具体错误"
  66. // @Router /api/im/setCustomerServiceState [post]
  67. func SetCustomerServiceState(c *gin.Context) {
  68. var req *md.SetCustomerServiceStateReq
  69. if err1 := c.ShouldBindJSON(&req); err1 != nil {
  70. e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
  71. return
  72. }
  73. err := svc.SetCustomerServiceState(*req)
  74. if err != nil {
  75. e.OutErr(c, e.ERR, err.Error())
  76. return
  77. }
  78. e.OutSuc(c, "success", nil)
  79. }
  80. // UpdateCustomerServiceMemo
  81. // @Summary Im-客服(编辑备注)
  82. // @Tags 客服
  83. // @Description 客服(编辑备注)
  84. // @Accept json
  85. // @Produce json
  86. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  87. // @param req body md.UpdateCustomerServiceMemoReq true "相关参数"
  88. // @Success 200 {string} "success"
  89. // @Failure 400 {object} md.Response "具体错误"
  90. // @Router /api/im/updateCustomerServiceMemo [post]
  91. func UpdateCustomerServiceMemo(c *gin.Context) {
  92. var req *md.UpdateCustomerServiceMemoReq
  93. if err1 := c.ShouldBindJSON(&req); err1 != nil {
  94. e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
  95. return
  96. }
  97. err := svc.UpdateCustomerServiceMemo(*req)
  98. if err != nil {
  99. e.OutErr(c, e.ERR, err.Error())
  100. return
  101. }
  102. e.OutSuc(c, "success", nil)
  103. }