package com.backendsys.modules;

import com.backendsys.modules.common.config.security.annotations.Anonymous;
import com.backendsys.modules.common.config.security.utils.HttpRequestUtil;
import com.backendsys.utils.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PublicController {

    @Autowired
    private CommonUtil commonUtil;

    @Autowired
    private HttpRequestUtil httpRequestUtil;

    @Anonymous
    @GetMapping("/api/ip")
    public String getIP() {
        return httpRequestUtil.getIpAddr();
    }

    @Anonymous
    @GetMapping("/api/version")
    public String getVersion() {
        return commonUtil.getPushVersion();
    }

}
