muyu-apiserver/gateway/internal/handler/crm/relation/listRelationHistoryHandler.go

31 lines
721 B
Go
Raw Permalink Normal View History

package relation
import (
"net/http"
"muyu-apiserver/gateway/internal/logic/crm/relation"
"muyu-apiserver/gateway/internal/svc"
"muyu-apiserver/gateway/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)
func ListRelationHistoryHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.CrmRelationHistoryReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := relation.NewListRelationHistoryLogic(r.Context(), svcCtx)
resp, err := l.ListRelationHistory(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}