Compare commits

...

3 Commits

Author SHA1 Message Date
0d933e09d4 1.修改pom插件版本 2025-07-01 21:38:55 +08:00
01b880e90c 1.修改主播查询 xml,添加 logback 日志配置 2025-07-01 21:03:12 +08:00
bcb3157faa 1.添加主播 UID字段 2025-07-01 16:57:18 +08:00
10 changed files with 86 additions and 18 deletions

View File

@@ -12,8 +12,8 @@
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
<groupId>com.yupi</groupId> <groupId>com.yupi</groupId>
<artifactId>springboot-init</artifactId> <artifactId>crawl-client</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>1.0</version>
<name>springboot-init</name> <name>springboot-init</name>
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
@@ -145,8 +145,8 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<source>11</source> <source>17</source>
<target>11</target> <target>17</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@@ -33,6 +33,5 @@ public interface NewHostsMapper extends BaseMapper<NewHosts> {
Page<NewHostsVO> selectPageByCondition(@Param("page") Page<NewHostsVO> page, @Param("hostInfoDTO") HostInfoDTO hostInfoDTO); Page<NewHostsVO> selectPageByCondition(@Param("page") Page<NewHostsVO> page, @Param("hostInfoDTO") HostInfoDTO hostInfoDTO);
List<SevenDaysData> selectSevenDaysData(HistoryDataDTO historyDataDTO);
} }

View File

@@ -84,4 +84,5 @@ public class NewHostsVO {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime; private Date createTime;
private String uid;
} }

View File

@@ -21,5 +21,4 @@ public interface HostInfoService extends IService<NewHosts> {
Page<NewHostsVO> getConditionHosts(HostInfoDTO hostInfoDTO); Page<NewHostsVO> getConditionHosts(HostInfoDTO hostInfoDTO);
List<SevenDaysData> getSevenDaysData(HistoryDataDTO historyDataDTO);
} }

View File

@@ -44,9 +44,5 @@ public class HostInfoServiceImpl extends ServiceImpl<NewHostsMapper, NewHosts> i
return newHostsMapper.selectPageByCondition(page, hostInfoDTO); return newHostsMapper.selectPageByCondition(page, hostInfoDTO);
} }
@Override
public List<SevenDaysData> getSevenDaysData(HistoryDataDTO historyDataDTO) {
List<SevenDaysData> data = newHostsMapper.selectSevenDaysData(historyDataDTO);
return data;
}
} }

View File

@@ -22,7 +22,8 @@ public class SystemTenantServiceImpl extends ServiceImpl<SystemTenantMapper, Sys
@Override @Override
public Long getTenantIdByName(String name) { public Long getTenantIdByName(String name) {
QueryWrapper<SystemTenant> queryWrapper = new QueryWrapper<>(); QueryWrapper<SystemTenant> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("name",name); queryWrapper.eq("name",name)
.eq("deleted",false );
SystemTenant systemTenant = baseMapper.selectOne(queryWrapper); SystemTenant systemTenant = baseMapper.selectOne(queryWrapper);
if (systemTenant == null){ if (systemTenant == null){
throw new BusinessException(ErrorCode.TENANT_NAME_NOT_EXISTS); throw new BusinessException(ErrorCode.TENANT_NAME_NOT_EXISTS);

View File

@@ -8,7 +8,7 @@ spring:
# todo 需替换配置 # todo 需替换配置
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://47.79.98.113:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true url: jdbc:mysql://localhost:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
username: root username: root
password: 123asd password: 123asd
# Redis 配置 # Redis 配置

View File

@@ -6,7 +6,7 @@ spring:
name: springboot-init name: springboot-init
# 默认 dev 环境 # 默认 dev 环境
profiles: profiles:
active: prod active: dev
# 支持 swagger3 # 支持 swagger3
mvc: mvc:
pathmatch: pathmatch:

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds">
<!-- 日志上下文名称 -->
<contextName>TK-DataSave</contextName>
<!-- 日志输出格式 -->
<property name="PATTERN_DEFAULT" value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} | %highlight(${LOG_LEVEL_PATTERN:-%5p} ${PID:- }) | %boldYellow(%thread) %boldGreen(%-40.40logger{39}) | %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%ex}"/>
<property name="FILE_PATTERN" value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} | ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } | %thread %-40.40logger{39} | %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%ex}"/>
<!-- <property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n"/>-->
<!-- 日志文件路径 -->
<property name="LOG_FILE_PATH" value="${LOG_FILE:-${user.dir}}/tk-data-user"/>
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${PATTERN_DEFAULT}</pattern>
</encoder>
</appender>
<!-- 文件输出 (滚动策略: 按时间) -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_FILE_PATH}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_FILE_PATH}-%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>7</maxHistory>
<totalSizeCap>10MB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>${FILE_PATTERN}</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<!-- 开发环境配置 -->
<springProfile name="dev">
<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE"/>
</root>
<!-- 项目包日志级别 -->
<logger name="com.yupi.springbootinit" level="DEBUG" additivity="false">
<appender-ref ref="STDOUT"/>
</logger>
<!-- MyBatis日志级别 -->
<logger name="com.baomidou.mybatisplus" level="INFO"/>
</springProfile>
<!-- 生产环境配置 -->
<springProfile name="prod">
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
<!-- 项目包日志级别 -->
<logger name="com.yupi.springbootinit" level="INFO" additivity="false">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</logger>
<!-- 第三方框架日志级别 -->
<logger name="org.springframework" level="WARN"/>
<logger name="com.baomidou.mybatisplus" level="WARN"/>
<logger name="org.redisson" level="WARN"/>
</springProfile>
</configuration>

View File

@@ -38,6 +38,7 @@
<result column="hosts_kind" jdbcType="VARCHAR" property="hostsKind" /> <result column="hosts_kind" jdbcType="VARCHAR" property="hostsKind" />
<result column="online_fans" jdbcType="INTEGER" property="onlineFans"/> <result column="online_fans" jdbcType="INTEGER" property="onlineFans"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="uid" jdbcType="VARCHAR" property="uid" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
@@ -245,7 +246,7 @@
<select id="selectPageByCondition" resultMap="HostInfoVo"> <select id="selectPageByCondition" resultMap="HostInfoVo">
select ns.id,hosts_id, hosts_level, hosts_coins, Invitation_type, fans, fllowernum, select ns.id,hosts_id, hosts_level, hosts_coins, Invitation_type, fans, fllowernum,
yesterday_coins,ns.create_time, country, online_fans,hosts_kind from server_new_hosts ns left join server_country_info ci ON ns.country = ci.country_name yesterday_coins,ns.create_time, country, online_fans,hosts_kind, uid from server_new_hosts ns left join server_country_info ci ON ns.country = ci.country_name
where ns.tenant_id=#{hostInfoDTO.tenantId} where ns.tenant_id=#{hostInfoDTO.tenantId}
<!-- 主播国家筛选 --> <!-- 主播国家筛选 -->
<if test="hostInfoDTO.country!= '' and hostInfoDTO.country != null"> <if test="hostInfoDTO.country!= '' and hostInfoDTO.country != null">
@@ -316,12 +317,12 @@
<!-- 排序类型 --> <!-- 排序类型 -->
order by order by
<choose> <choose>
<!-- 传空和默认的情况下按照时间降序排序 --> <!-- 传空和默认的情况下按照时间降序排序 -->
<when test="hostInfoDTO.sortName == '' or hostInfoDTO.sortName == null"> <when test="hostInfoDTO.sortName == '' and hostInfoDTO.sortName == null">
ns.create_time desc ns.create_time desc
</when> </when>
<!-- sortNmae 有值的情况下排序 --> <!-- sortNmae 有值的情况下排序 -->
<when test="hostInfoDTO.sortName != null or hostInfoDTO.sort != null "> <when test="hostInfoDTO.sortName != null and hostInfoDTO.sort != null ">
<if test="hostInfoDTO.sortName == 'createTime' and hostInfoDTO.sort != null"> <if test="hostInfoDTO.sortName == 'createTime' and hostInfoDTO.sort != null">
ns.create_time ${hostInfoDTO.sort} ns.create_time ${hostInfoDTO.sort}
</if> </if>
@@ -346,6 +347,9 @@
ns.online_fans ${hostInfoDTO.sort} ns.online_fans ${hostInfoDTO.sort}
</if> </if>
</when> </when>
<otherwise>
ns.create_time desc
</otherwise>
</choose> </choose>
</select> </select>