zjh
2024-11-28 5d42284e6f7f0c887fbb78605a17d13015342a52
zjh20241128
1个文件已修改
50 ■■■■■ 已修改文件
ltkj-admin/src/main/java/com/ltkj/web/jmreport/JimuController.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/jmreport/JimuController.java
@@ -1,7 +1,9 @@
package com.ltkj.web.jmreport;
import com.ltkj.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.omg.CORBA.Environment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -9,6 +11,13 @@
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import static jdk.nashorn.internal.runtime.regexp.joni.Config.log;
/**
 * @Company: 西安路泰科技有限公司
@@ -18,9 +27,46 @@
@RestController
@RequestMapping("/report/jmreport")
@Api(tags = "PC端 积木报表接口集")
@Slf4j
public class JimuController {
    @Value("${jimu.path}")
    private String value;
//    @Value("${jimu.path}")
    private static  String value;
    private static String CONFIG_PATH;
    @Value ("${config.properties}")
    public void setConfigPath(String path) {
        CONFIG_PATH = path;
        try {
            FileInputStream inputStream = new FileInputStream(CONFIG_PATH);
            Properties props = new Properties();
            props.load(inputStream);
            value= props.getProperty("jmurl");
        } catch (IOException throwables) {
            throwables.printStackTrace();
        }
    }
//    static  {
//       Properties props = new Properties();
//       try {
//           // 从文件中读取配置信息
//           FileInputStream fis = null;
//           try {
//               fis = new FileInputStream("D:\\ltkjprojectconf\\sfconfig.properties");
//           } catch (FileNotFoundException e) {
//               e.printStackTrace();
//           }
//           props.load(fis);
//           fis.close();
//           // 获取属性值并赋值
//       } catch (Exception e) {
//           log.info("数据库连接失败  请联系管理员!");
//           e.printStackTrace();
//       }
//       value= props.getProperty("jmurl");
//    }
    @GetMapping("/index")
    @ApiOperation(value = "index")