2024-10-07 15:25:13 +05:30
|
|
|
package controller
|
|
|
|
|
|
|
|
import (
|
2024-10-07 16:26:41 +05:30
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"elasticstream/source"
|
2024-10-07 15:25:13 +05:30
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Ack(c *gin.Context) {
|
2024-10-07 16:26:41 +05:30
|
|
|
var req source.Position
|
2024-10-07 15:25:13 +05:30
|
|
|
|
2024-10-07 16:26:41 +05:30
|
|
|
err := c.BindJSON(&req)
|
|
|
|
if err != nil {
|
|
|
|
c.Status(http.StatusBadRequest)
|
|
|
|
return
|
|
|
|
}
|
2024-10-07 15:25:13 +05:30
|
|
|
|
2024-10-07 16:26:41 +05:30
|
|
|
err = client.Ack(c, req)
|
2024-10-07 15:25:13 +05:30
|
|
|
if err != nil {
|
|
|
|
c.Status(http.StatusInternalServerError)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
c.Status(http.StatusOK)
|
|
|
|
}
|