wx_refresh_handler.go 599 B

12345678910111213141516171819202122232425262728293031
  1. package WorkPhone
  2. import (
  3. "net/http"
  4. "github.com/zeromicro/go-zero/rest/httpx"
  5. "wechat-api/internal/logic/WorkPhone"
  6. "wechat-api/internal/svc"
  7. )
  8. // swagger:route post /workphone/wxaccount/refresh WorkPhone WxRefresh
  9. //
  10. //
  11. //
  12. // Responses:
  13. // 200: BaseMsgResp
  14. func WxRefreshHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
  15. return func(w http.ResponseWriter, r *http.Request) {
  16. l := WorkPhone.NewWxRefreshLogic(r.Context(), svcCtx)
  17. resp, err := l.WxRefresh()
  18. if err != nil {
  19. httpx.ErrorCtx(r.Context(), w, err)
  20. } else {
  21. httpx.OkJsonCtx(r.Context(), w, resp)
  22. }
  23. }
  24. }