package handler import ( "github.com/zeromicro/go-zero/rest/httpx" "net/http" "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/logic" "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/svc" "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/types" ) func commonPhrasesListHandler(ctx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var req types.CommonPhrasesListReq if err := httpx.Parse(r, &req); err != nil { httpx.Error(w, err) return } l := logic.NewCommonPhrasesListLogic(r.Context(), ctx) resp, err := l.CommonPhrasesList(req) if err != nil { httpx.Error(w, err) } else { httpx.OkJson(w, resp) } } }