package ink.wgink.login.base.controller.route.config;

import ink.wgink.interfaces.app.IAppSignBaseService;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.login.base.service.IDingDingService;
import ink.wgink.login.base.service.IUKeyService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: ConfigRouteController
 * @Description: 配置
 * @Author: WangGeng
 * @Date: 2021/2/25 21:44
 * @Version: 1.0
 **/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "配置路由")
@Controller
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/config")
public class ConfigRouteController {

    @Autowired(required = false)
    private IUKeyService uKeyService;
    @Autowired(required = false)
    private IDingDingService dingDingService;
    @Autowired(required = false)
    private IAppSignBaseService appSignBaseService;

    @GetMapping("update")
    public ModelAndView update() {
        ModelAndView mv = new ModelAndView("config/update");
        if (uKeyService != null) {
            mv.addObject("uKeyLogin", "uKeyLogin");
        }
        if (dingDingService != null) {
            mv.addObject("dingDingScanLogin", "dingDingScanLogin");
        }
        if (appSignBaseService != null) {
            mv.addObject("appLogin", "appLogin");
        }
        return mv;
    }

}
