package org.springblade.modules.app.web;

import org.springblade.common.auth.permission.DisableLoginVerify;
import com.wn.common.controller.BaseController;
import com.wn.common.datamodel.ResultDTO;
import org.springblade.modules.app.common.dto.AppVersionDTO;
import org.springblade.modules.app.common.query.LatestAppVersionQuery;
import org.springblade.modules.app.manager.AppVersionManager;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * app版本管理表 控制器
 * </p>
 *
 * @author huyinuo
 * @since 2022-02-24
 */
@RestController
@RequestMapping("app/app/version")
public class AppVersionController extends BaseController {

    @Autowired
    private AppVersionManager appVersionManger;

    @GetMapping("/latest")
    //@ApiOperation(value = "查询最新app版本信息")
    @DisableLoginVerify
    public ResponseEntity<ResultDTO<AppVersionDTO>> latestAppVersion(LatestAppVersionQuery latestAppVersionQuery) {
        return success(appVersionManger.latestVersion(latestAppVersionQuery));
    }
}
