package com.zbf.web.controller.system;

import com.zbf.common.core.controller.BaseController;
import com.zbf.common.core.domain.AjaxResult;
import com.zbf.common.core.page.TableDataInfo;
import com.zbf.system.domain.AppVersions;
import com.zbf.system.mapper.AppVersionsMapper;
import com.zbf.system.service.IAppVersionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/system/app")
public class AppVerController extends BaseController {


    @Autowired
    private AppVersionsMapper appVersionsMapper;


    @GetMapping("/ver")
    public AjaxResult list(AppVersions appVersions) {
        AppVersions ver = appVersionsMapper.selectOne(null);

        if (ver != null) {
            if (ver.getHversion().equals(ver.getVersion())) {
                return AjaxResult.warn("暂无更新");
            }
        }
        return AjaxResult.success(ver);

    }

}



