package com.nexo.model.wechat.controller;

import com.nexo.model.wechat.service.IWechatConfigService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/config")
public class IWechatConfigController {

    @Resource
    IWechatConfigService wechatConfigService;

    // 获取程序公告
    @GetMapping("/notice")
    public String notice() {
        return wechatConfigService.notice();
    }

    // 获取程序版本
    @GetMapping("/version")
    public String version() {
        return wechatConfigService.geyConfig("tool_version");
    }

    // 获取个微下载地址
    @GetMapping("/downloadWechat")
    public String downloadWechat() {
        return wechatConfigService.geyConfig("wechat_download_addrs");
    }
    // 获取个微下载地址
    @GetMapping("/downloadWXWork")
    public String downloadWXWork() {
        return wechatConfigService.geyConfig("wxwork_download_addrs");
    }

    // 获取个微下载地址
    @GetMapping("/updata")
    public String updata() {
        return wechatConfigService.geyConfig("new_version_dow_url");
    }

}
