You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
648 B
29 lines
648 B
package handler
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/zeromicro/go-zero/rest/httpx"
|
|
"healthapi/internal/logic"
|
|
"healthapi/internal/svc"
|
|
"healthapi/internal/types"
|
|
"healthapi/pkg/response"
|
|
)
|
|
|
|
func CreateConversationHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
var req types.CreateConversationReq
|
|
if err := httpx.Parse(r, &req); err != nil {
|
|
response.Error(w, err)
|
|
return
|
|
}
|
|
|
|
l := logic.NewCreateConversationLogic(r.Context(), svcCtx)
|
|
resp, err := l.CreateConversation(&req)
|
|
if err != nil {
|
|
response.Error(w, err)
|
|
} else {
|
|
response.Success(w, resp)
|
|
}
|
|
}
|
|
}
|
|
|