12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- package handler
- import (
- "kpt-pasture/http/middleware"
- "net/http"
- pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
- "gitee.com/xuyiping_admin/pkg/apierr"
- operationPb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/operation"
- "gitee.com/xuyiping_admin/pkg/ginutil"
- "github.com/gin-gonic/gin"
- )
- func CowNeckRingBound(c *gin.Context) {
- pagination := &pasturePb.PaginationModel{
- Page: int32(c.GetInt(middleware.Page)),
- PageSize: int32(c.GetInt(middleware.PageSize)),
- PageOffset: int32(c.GetInt(middleware.PageOffset)),
- }
- if err := middleware.BackendOperation(c).OpsService.CowNeckRingNumberBound(c, pagination); err != nil {
- apierr.ClassifiedAbort(c, err)
- return
- }
- ginutil.JSONResp(c, &operationPb.CommonOK{
- Code: http.StatusOK,
- Msg: "ok",
- Data: &operationPb.Success{Success: true},
- })
- }
- func UpdateCowPen(c *gin.Context) {
- pagination := &pasturePb.PaginationModel{
- Page: int32(c.GetInt(middleware.Page)),
- PageSize: int32(c.GetInt(middleware.PageSize)),
- PageOffset: int32(c.GetInt(middleware.PageOffset)),
- }
- if err := middleware.BackendOperation(c).OpsService.UpdateCowPen(c, pagination); err != nil {
- apierr.ClassifiedAbort(c, err)
- return
- }
- ginutil.JSONResp(c, &operationPb.CommonOK{
- Code: http.StatusOK,
- Msg: "ok",
- Data: &operationPb.Success{Success: true},
- })
- }
|