Browse Source

服务配置

dumingliang 1 month ago
parent
commit
29d1d6c2f0

+ 4 - 2
ruoyi-auth/src/main/resources/bootstrap.yml

@@ -12,12 +12,14 @@ spring:
     active: dev
   cloud:
     nacos:
+      username: nacos
+      password: Nacos./1601
       discovery:
         # 服务注册地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
       config:
         # 配置中心地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
         # 配置文件格式
         file-extension: yml
         # 共享配置

+ 0 - 1
ruoyi-gateway/pom.xml

@@ -21,7 +21,6 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-gateway</artifactId>
         </dependency>
-
         <!-- SpringCloud Alibaba Nacos -->
         <dependency>
             <groupId>com.alibaba.cloud</groupId>

+ 5 - 3
ruoyi-gateway/src/main/resources/bootstrap.yml

@@ -12,12 +12,14 @@ spring:
     active: dev
   cloud:
     nacos:
+      username: nacos
+      password: Nacos./1601
       discovery:
         # 服务注册地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
       config:
         # 配置中心地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
         # 配置文件格式
         file-extension: yml
         # 共享配置
@@ -33,7 +35,7 @@ spring:
       datasource:
         ds1:
           nacos:
-            server-addr: 192.168.0.146:8848
+            server-addr: 192.168.0.144:8848
             dataId: sentinel-ruoyi-gateway
             groupId: DEFAULT_GROUP
             data-type: json

+ 2 - 2
ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml

@@ -14,10 +14,10 @@ spring:
     nacos:
       discovery:
         # 服务注册地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
       config:
         # 配置中心地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
         # 配置文件格式
         file-extension: yml
         # 共享配置

+ 2 - 2
ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml

@@ -14,10 +14,10 @@ spring:
     nacos:
       discovery:
         # 服务注册地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
       config:
         # 配置中心地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
         # 配置文件格式
         file-extension: yml
         # 共享配置

+ 2 - 2
ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml

@@ -14,10 +14,10 @@ spring:
     nacos:
       discovery:
         # 服务注册地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
       config:
         # 配置中心地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
         # 配置文件格式
         file-extension: yml
         # 共享配置

+ 4 - 1
ruoyi-modules/ruoyi-system/pom.xml

@@ -40,7 +40,10 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-actuator</artifactId>
         </dependency>
-        
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+        </dependency>
         <!-- Mysql Connector -->
         <dependency>
             <groupId>com.mysql</groupId>

+ 4 - 2
ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml

@@ -12,12 +12,14 @@ spring:
     active: dev
   cloud:
     nacos:
+      username: nacos
+      password: Nacos./1601
       discovery:
         # 服务注册地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
       config:
         # 配置中心地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
         # 配置文件格式
         file-extension: yml
         # 共享配置

+ 24 - 0
ruoyi-modules/ruoyi-system/src/test/java/com/ruoyi/system/SpringbootTest.java

@@ -0,0 +1,24 @@
+package com.ruoyi.system;
+
+import com.ruoyi.system.api.domain.SysDept;
+import com.ruoyi.system.mapper.SysDeptMapper;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@SpringBootTest
+public class SpringbootTest {
+
+    @Resource
+    private SysDeptMapper sysDeptMapper;
+
+    @Test
+    public void testInsert() {
+        SysDept sysDept = new SysDept();
+        List<SysDept> reports = sysDeptMapper.selectDeptList(sysDept);
+        System.out.println(reports);
+    }
+}

+ 10 - 2
ruoyi-modules/tba-rtwq/pom.xml

@@ -40,13 +40,21 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-actuator</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+        </dependency>
         <!-- Mysql Connector -->
         <dependency>
             <groupId>com.mysql</groupId>
             <artifactId>mysql-connector-j</artifactId>
         </dependency>
-
+        <!-- DM8驱动包 -->
+        <dependency>
+            <groupId>com.dameng</groupId>
+            <artifactId>DmJdbcDriver18</artifactId>
+            <version>8.1.3.140</version>
+        </dependency>
         <!-- RuoYi Common DataSource -->
         <dependency>
             <groupId>com.ruoyi</groupId>

+ 203 - 0
ruoyi-modules/tba-rtwq/src/main/java/com/ruoyi/rtwq/domain/PtReport.java

@@ -0,0 +1,203 @@
+package com.ruoyi.rtwq.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class PtReport implements Serializable {
+    private String code;
+
+    private String title;
+
+    private String cate;
+
+    private String url;
+
+    private String note;
+
+    private String status;
+
+    private String supply;
+
+    private String pubUser;
+
+    private String style;
+
+    private String type;
+
+    private String database;
+
+    private String sql;
+
+    private String listSql;
+
+
+    public String getStyle() {
+        return style;
+    }
+
+    public void setStyle(String style) {
+        this.style = style;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getDatabase() {
+        return database;
+    }
+
+    public void setDatabase(String database) {
+        this.database = database;
+    }
+
+    public String getSql() {
+        return sql;
+    }
+
+    public void setSql(String sql) {
+        this.sql = sql;
+    }
+
+    public String getListSql() {
+        return listSql;
+    }
+
+    public void setListSql(String listSql) {
+        this.listSql = listSql;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
+    private Date pubTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code == null ? null : code.trim();
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title == null ? null : title.trim();
+    }
+
+    public String getCate() {
+        return cate;
+    }
+
+    public void setCate(String cate) {
+        this.cate = cate == null ? null : cate.trim();
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url == null ? null : url.trim();
+    }
+
+    public String getNote() {
+        return note;
+    }
+
+    public void setNote(String note) {
+        this.note = note == null ? null : note.trim();
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status == null ? null : status.trim();
+    }
+
+    public String getSupply() {
+        return supply;
+    }
+
+    public void setSupply(String supply) {
+        this.supply = supply == null ? null : supply.trim();
+    }
+
+    public String getPubUser() {
+        return pubUser;
+    }
+
+    public void setPubUser(String pubUser) {
+        this.pubUser = pubUser == null ? null : pubUser.trim();
+    }
+
+    public Date getPubTime() {
+        return pubTime;
+    }
+
+    public void setPubTime(Date pubTime) {
+        this.pubTime = pubTime;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", code=").append(code);
+        sb.append(", title=").append(title);
+        sb.append(", cate=").append(cate);
+        sb.append(", url=").append(url);
+        sb.append(", note=").append(note);
+        sb.append(", status=").append(status);
+        sb.append(", supply=").append(supply);
+        sb.append(", pubUser=").append(pubUser);
+        sb.append(", pubTime=").append(pubTime);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+
+
+    private String fileId;
+
+    private String filePath;
+
+    private String fileViewname;
+
+    public String getFileId() {
+        return fileId;
+    }
+
+    public void setFileId(String fileId) {
+        this.fileId = fileId;
+    }
+
+    public String getFilePath() {
+        return filePath;
+    }
+
+    public void setFilePath(String filePath) {
+        this.filePath = filePath;
+    }
+
+    public String getFileViewname() {
+        return fileViewname;
+    }
+
+    public void setFileViewname(String fileViewname) {
+        this.fileViewname = fileViewname;
+    }
+}

+ 22 - 0
ruoyi-modules/tba-rtwq/src/main/java/com/ruoyi/rtwq/mapper/PtReportMapper.java

@@ -0,0 +1,22 @@
+package com.ruoyi.rtwq.mapper;
+
+
+import com.ruoyi.common.datasource.annotation.Master;
+import com.ruoyi.rtwq.domain.PtReport;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Master
+@Mapper
+public interface PtReportMapper {
+    int insert(PtReport bao);
+
+    List<PtReport> selectAll(PtReport pt);
+
+    int update(PtReport pt);
+
+    int delete(String code);
+
+
+}

+ 4 - 2
ruoyi-modules/tba-rtwq/src/main/resources/bootstrap.yml

@@ -12,12 +12,14 @@ spring:
     active: dev
   cloud:
     nacos:
+      username: nacos
+      password: Nacos./1601
       discovery:
         # 服务注册地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
       config:
         # 配置中心地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
         # 配置文件格式
         file-extension: yml
         # 共享配置

+ 82 - 0
ruoyi-modules/tba-rtwq/src/main/resources/mapper/rtwq/PtReportMapper.xml

@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ruoyi.rtwq.mapper.PtReportMapper">
+    <resultMap id="BaseResultMap" type="com.ruoyi.rtwq.domain.PtReport">
+        <id column="CODE" jdbcType="VARCHAR" property="code"/>
+        <result column="TITLE" jdbcType="VARCHAR" property="title"/>
+        <result column="CATE" jdbcType="VARCHAR" property="cate"/>
+        <result column="URL" jdbcType="VARCHAR" property="url"/>
+        <result column="NOTE" jdbcType="VARCHAR" property="note"/>
+        <result column="STATUS" jdbcType="VARCHAR" property="status"/>
+        <result column="SUPPLY" jdbcType="VARCHAR" property="supply"/>
+        <result column="PUB_USER" jdbcType="VARCHAR" property="pubUser"/>
+        <result column="PUB_TIME" jdbcType="TIMESTAMP" property="pubTime"/>
+
+        <result column="TYPE" jdbcType="VARCHAR" property="type"/>
+        <result column="DATABASE" jdbcType="VARCHAR" property="database"/>
+        <result column="SQL" jdbcType="VARCHAR" property="sql"/>
+        <result column="LIST_SQL" jdbcType="TIMESTAMP" property="listSql"/>
+        <result column="STYLE" jdbcType="TIMESTAMP" property="style"/>
+
+        <result column="FILE_ID" property="fileId"/>
+        <result column="FILE_PATH" property="filePath"/>
+        <result column="FILE_VIEWNAME" property="fileViewname"/>
+
+        <!-- private String fileId;
+
+private String filePath;
+
+private String fileSavename;-->
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        CODE
+        , TITLE, CATE, URL, NOTE, STATUS, SUPPLY, PUB_USER, PUB_TIME , TYPE  , DATABASE , SQL  , LIST_SQL , STYLE
+    </sql>
+
+    <insert id="insert" parameterType="com.ruoyi.rtwq.domain.PtReport">
+        INSERT INTO PT_REPORT(CODE, TITLE, CATE, URL, NOTE, STATUS, SUPPLY, PUB_USER, PUB_TIME, TYPE, DATABASE, SQL,
+                              LIST_SQL, STYLE)
+        VALUES (#{code}, #{title}, #{cate}, #{url}, #{note}, #{status}, #{supply}, #{pubUser}, #{pubTime},
+                #{type}, #{database}, #{sql}, #{listSql}, #{style})
+    </insert>
+
+    <select id="selectAll" parameterType="com.ruoyi.rtwq.domain.PtReport" resultMap="BaseResultMap">
+        select
+        r.CODE, r.TITLE, r.CATE, r.URL, r.NOTE, r.STATUS, r.SUPPLY, r.PUB_USER, r.PUB_TIME,
+        f.FILE_ID , f.FILE_PATH , f.FILE_VIEWNAME , r.TYPE , r.DATABASE , r.SQL , r.LIST_SQL , r.STYLE
+        from PT_REPORT r left join PT_REPORT_FILE f on r.CODE = f.CODE
+        <where>
+            <if test="code != null and code != ''">
+                and r.CODE = #{code}
+            </if>
+            <if test="cate != null and cate != ''">
+                and r.CATE = #{cate}
+            </if>
+        </where>
+    </select>
+
+    <update id="update" parameterType="com.ruoyi.rtwq.domain.PtReport">
+        update PT_REPORT
+        set TITLE    =#{title},
+            CATE     = #{cate},
+            URL      = #{url},
+            NOTE     = #{note},
+            STATUS   = #{status},
+            SUPPLY   = #{supply},
+            PUB_USER = #{pubUser},
+            PUB_TIME = #{pubTime},
+            TYPE     = #{type},
+            DATABASE = #{database},
+            SQL      = #{sql},
+            LIST_SQL = #{listSql},
+            STYLE    = #{style}
+        where CODE = #{code}
+    </update>
+
+    <delete id="delete" parameterType="com.ruoyi.rtwq.domain.PtReport">
+        delete
+        from PT_REPORT
+        where code = #{code}
+    </delete>
+</mapper>

+ 0 - 117
ruoyi-modules/tba-rtwq/src/main/resources/mapper/system/SysConfigMapper.xml

@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ruoyi.system.mapper.SysConfigMapper">
-    
-    <resultMap type="SysConfig" id="SysConfigResult">
-    	<id     property="configId"      column="config_id"      />
-        <result property="configName"    column="config_name"    />
-        <result property="configKey"     column="config_key"     />
-        <result property="configValue"   column="config_value"   />
-        <result property="configType"    column="config_type"    />
-        <result property="createBy"      column="create_by"      />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"      column="update_by"      />
-        <result property="updateTime"    column="update_time"    />
-    </resultMap>
-    
-    <sql id="selectConfigVo">
-        select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark 
-		from sys_config
-    </sql>
-    
-    <!-- 查询条件 -->
-	<sql id="sqlwhereSearch">
-		<where>
-			<if test="configId !=null">
-				and config_id = #{configId}
-			</if>
-			<if test="configKey !=null and configKey != ''">
-				and config_key = #{configKey}
-			</if>
-		</where>
-	</sql>
-    
-    <select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
-        <include refid="selectConfigVo"/>
-        <include refid="sqlwhereSearch"/>
-    </select>
-    
-    <select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
-        <include refid="selectConfigVo"/>
-        <where>
-			<if test="configName != null and configName != ''">
-				AND config_name like concat('%', #{configName}, '%')
-			</if>
-			<if test="configType != null and configType != ''">
-				AND config_type = #{configType}
-			</if>
-			<if test="configKey != null and configKey != ''">
-				AND config_key like concat('%', #{configKey}, '%')
-			</if>
-			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
-				and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
-			</if>
-			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-				and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
-			</if>
-		</where>
-    </select>
-    
-    <select id="selectConfigById" parameterType="Long" resultMap="SysConfigResult">
-        <include refid="selectConfigVo"/>
-        where config_id = #{configId}
-    </select>
-    
-    <select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
-        <include refid="selectConfigVo"/>
-        where config_key = #{configKey} limit 1
-    </select>
-    
-    <insert id="insertConfig" parameterType="SysConfig">
-        insert into sys_config (
-			<if test="configName != null and configName != '' ">config_name,</if>
-			<if test="configKey != null and configKey != '' ">config_key,</if>
-			<if test="configValue != null and configValue != '' ">config_value,</if>
-			<if test="configType != null and configType != '' ">config_type,</if>
-			<if test="createBy != null and createBy != ''">create_by,</if>
-			<if test="remark != null and remark != ''">remark,</if>
- 			create_time
-        )values(
-			<if test="configName != null and configName != ''">#{configName},</if>
-			<if test="configKey != null and configKey != ''">#{configKey},</if>
-			<if test="configValue != null and configValue != ''">#{configValue},</if>
-			<if test="configType != null and configType != ''">#{configType},</if>
-			<if test="createBy != null and createBy != ''">#{createBy},</if>
-			<if test="remark != null and remark != ''">#{remark},</if>
- 			sysdate()
-		)
-    </insert>
-	 
-    <update id="updateConfig" parameterType="SysConfig">
-        update sys_config 
-        <set>
-            <if test="configName != null and configName != ''">config_name = #{configName},</if>
-            <if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
-            <if test="configValue != null and configValue != ''">config_value = #{configValue},</if>
-            <if test="configType != null and configType != ''">config_type = #{configType},</if>
-            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
-            <if test="remark != null">remark = #{remark},</if>
- 			update_time = sysdate()
-        </set>
-        where config_id = #{configId}
-    </update>
-	
-    <delete id="deleteConfigById" parameterType="Long">
-        delete from sys_config where config_id = #{configId}
-    </delete>
-    
-    <delete id="deleteConfigByIds" parameterType="Long">
-        delete from sys_config where config_id in 
-        <foreach item="configId" collection="array" open="(" separator="," close=")">
-        	#{configId}
-        </foreach>
-    </delete>
-    
-</mapper>

+ 22 - 0
ruoyi-modules/tba-rtwq/src/test/java/com/ruoyi/rtwq/SpringbootTest.java

@@ -0,0 +1,22 @@
+package com.ruoyi.rtwq;
+
+import com.ruoyi.rtwq.domain.PtReport;
+import com.ruoyi.rtwq.mapper.PtReportMapper;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import javax.annotation.Resource;
+import java.util.List;
+@SpringBootTest
+public class SpringbootTest {
+
+    @Resource
+    private PtReportMapper ptReportMapper;
+
+    @Test
+    public void testInsert() {
+        PtReport ptReport = new PtReport();
+        List<PtReport> reports = ptReportMapper.selectAll(ptReport);
+        System.out.println(reports);
+    }
+}

+ 4 - 2
ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml

@@ -12,12 +12,14 @@ spring:
     active: dev
   cloud:
     nacos:
+      username: nacos
+      password: Nacos./1601
       discovery:
         # 服务注册地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
       config:
         # 配置中心地址
-        server-addr: 192.168.0.146:8848
+        server-addr: 192.168.0.144:8848
         # 配置文件格式
         file-extension: yml
         # 共享配置