package com.czg.controller.user;

import com.czg.resp.CzgResult;
import com.czg.system.dto.VersionDTO;
import com.czg.system.service.VersionService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author GYJoker
 */
@RestController
@RequestMapping("/user/version")
public class UserVersionController {
    @Resource
    private VersionService versionService;

    /**
     * 获取版本信息
     * @param source 渠道
     * @param type 类型
     * @return VersionDTO
     */
    @GetMapping("/info/{source}/{type}")
    public CzgResult<VersionDTO> getVersionInfo(@PathVariable("source") String source, @PathVariable("type") String type) {
        return versionService.getVersionInfo(source, type);
    }
}
