package com.usky.agbox.controller.web;


import com.usky.agbox.domain.PatrolInspectionAgbox;
import com.usky.agbox.service.PatrolInspectionAgboxService;
import com.usky.common.core.bean.ApiResult;
import com.usky.common.core.bean.CommonPage;
import com.usky.common.log.annotation.Log;
import com.usky.common.log.enums.BusinessType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author han
 * @since 2024-05-23
 */
@RestController
@RequestMapping("/patrolInspectionAgbox")
public class PatrolInspectionAgboxController {
    @Autowired
    private PatrolInspectionAgboxService patrolInspectionAgboxService;

    /**
     * 修改
     * @param patrolInspectionAgbox
     * @return
     */
    @PutMapping("/update")
    public ApiResult<Void> update(@RequestBody PatrolInspectionAgbox patrolInspectionAgbox){
        patrolInspectionAgboxService.update(patrolInspectionAgbox);
        return ApiResult.success();
    }

    /**
     * 分页
     * @param current
     * @param size
     * @return
     */
    @GetMapping("/page")
    public ApiResult<CommonPage<PatrolInspectionAgbox>> page(@RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
                                                             @RequestParam(value = "size", required = false, defaultValue = "10") Integer size)
    {
        return ApiResult.success(patrolInspectionAgboxService.page(current,size));
    }
}

