package org.dromara.web.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.utils.DateUtils;
import org.dromara.common.core.utils.SpringUtils;
import org.dromara.common.core.utils.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 首页
 *
 * @author shihongwei
 */
@SaIgnore
@RequiredArgsConstructor
@RestController
public class IndexController {

    /**
     * 访问首页，提示语
     */
    @GetMapping("/")
    public R<?> index() {
        java.util.Map<String, Object> data = new java.util.HashMap<>();
        data.put("app", SpringUtils.getApplicationName());
        data.put("message", StringUtils.format("欢迎使用{}后端服务(wcx)", SpringUtils.getApplicationName()));
        data.put("author", "shihongwei(178899525@qq.com)");
        data.put("version", "1.0.0");
        data.put("time", DateUtils.getTime());
        return R.ok(data);
    }

}
