package com.fdkankan.ucenter.controller.app;

import com.fdkankan.ucenter.common.Result;
import com.fdkankan.ucenter.service.ICameraService;
import com.fdkankan.ucenter.service.ICameraVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ucenter/goods/version")
public class AppApiController {

    @Autowired
    ICameraVersionService cameraVersionService;

    /**
     * 给硬件部接口，不需要拦截
     */
    @GetMapping("/enabled")
    public Result getEnabledCameraVersion(@RequestParam(required = false) String type) {
        return Result.success(cameraVersionService.findByStatus(type));
    }
}
