1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- 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 CowNeckRingBound2(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.CowNeckRingNumberBound2(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},
- })
- }
|