1234567891011121314151617181920212223242526272829303132333435 |
- package controller
- import (
- "github.com/gin-gonic/gin"
- "iot_manager_service/app/model"
- "iot_manager_service/app/service"
- "net/http"
- )
- // 控制器管理对象
- var Camera = new(cameraCtl)
- type cameraCtl struct{}
- func (c *cameraCtl) Detail(ctx *gin.Context) {
- var req *model.ReqCamera
- if err := ctx.ShouldBind(&req); err != nil {
- ctx.JSON(http.StatusOK, nil)
- return
- }
- }
- func (c *cameraCtl) CreateOrUpdate(ctx *gin.Context) {
- // 参数验证
- var req *model.ReqCamera
- if err := ctx.ShouldBind(&req); err != nil {
- ctx.JSON(http.StatusOK, nil)
- return
- }
- err := service.CameraService.CreateOrUpdate(req)
- if err != nil {
- ctx.JSON(http.StatusOK, nil)
- return
- }
- }
|