milk.go 687 B

12345678910111213141516171819202122232425262728293031
  1. package milk
  2. import (
  3. "kpt-pasture/http/middleware"
  4. "net/http"
  5. operationPb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/operation"
  6. "gitee.com/xuyiping_admin/pkg/apierr"
  7. "gitee.com/xuyiping_admin/pkg/ginutil"
  8. "github.com/gin-gonic/gin"
  9. )
  10. func ProcessOriginal(c *gin.Context) {
  11. // 获取请求体数据
  12. body, err := c.GetRawData()
  13. if err != nil {
  14. apierr.ClassifiedAbort(c, err)
  15. return
  16. }
  17. err = middleware.Dependency(c).StoreEventHub.OpsService.MilkHallOriginal(c, body)
  18. if err != nil {
  19. apierr.ClassifiedAbort(c, err)
  20. return
  21. }
  22. ginutil.JSONResp(c, &operationPb.CommonOK{
  23. Code: http.StatusOK,
  24. Msg: "ok",
  25. Data: &operationPb.Success{Success: true},
  26. })
  27. }