add search method
This commit is contained in:
1
main.go
1
main.go
@@ -76,6 +76,7 @@ func main() {
|
|||||||
mainGroup.GET("/persons/docs", personal_information.GetPDDocs)
|
mainGroup.GET("/persons/docs", personal_information.GetPDDocs)
|
||||||
mainGroup.GET("/persons/:id", personal_information.GetPD)
|
mainGroup.GET("/persons/:id", personal_information.GetPD)
|
||||||
mainGroup.POST("/persons", personal_information.CreatePD)
|
mainGroup.POST("/persons", personal_information.CreatePD)
|
||||||
|
mainGroup.POST("/persons/search", personal_information.SearchPD)
|
||||||
|
|
||||||
// Contacts
|
// Contacts
|
||||||
mainGroup.POST("/contacts", personal_information.CreateContacts)
|
mainGroup.POST("/contacts", personal_information.CreateContacts)
|
||||||
|
|||||||
@@ -56,6 +56,20 @@ func CreatePD(c echo.Context) error {
|
|||||||
|
|
||||||
return c.Blob(resp.StatusCode, resp.Header.Get("Content-Type"), data)
|
return c.Blob(resp.StatusCode, resp.Header.Get("Content-Type"), data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SearchPD(c echo.Context) error {
|
||||||
|
data, err, resp := api.PostRequest(
|
||||||
|
config.Env.MSHosts.PersonsHost+"/persons/search/",
|
||||||
|
c.Request().Body,
|
||||||
|
c.Request().Header)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return c.NoContent(http.StatusBadGateway)
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.Blob(resp.StatusCode, resp.Header.Get("Content-Type"), data)
|
||||||
|
}
|
||||||
|
|
||||||
func CreateDocuments(c echo.Context) error {
|
func CreateDocuments(c echo.Context) error {
|
||||||
data, err, resp := api.PostRequest(
|
data, err, resp := api.PostRequest(
|
||||||
config.Env.MSHosts.PersonsHost+"/documents/",
|
config.Env.MSHosts.PersonsHost+"/documents/",
|
||||||
|
|||||||
Reference in New Issue
Block a user