视频 查看集 和 集数列表 拆分2
配置日志
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
#logging:
|
||||
# file:
|
||||
# name: logs/duanju.log
|
||||
# 日志配置
|
||||
logging:
|
||||
file:
|
||||
name: logs/duanju.log
|
||||
config: classpath:logback.xml
|
||||
|
||||
# Tomcat
|
||||
server:
|
||||
@@ -27,25 +30,6 @@ pagehelper:
|
||||
supportMethodsArguments: true
|
||||
params:
|
||||
count: countSql
|
||||
#mybatis-plus:
|
||||
# mapper-locations: classpath*:/mapper/**/*.xml
|
||||
# #实体扫描,多个package用逗号或者分号分隔
|
||||
# typeAliasesPackage: com.sqx.modules.*.entity
|
||||
# global-config:
|
||||
# #数据库相关配置
|
||||
# db-config:
|
||||
# #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
|
||||
# id-type: AUTO
|
||||
# logic-delete-value: -1
|
||||
# logic-not-delete-value: 0
|
||||
# banner: false
|
||||
# #原生配置
|
||||
# configuration:
|
||||
# map-underscore-to-camel-case: true
|
||||
# cache-enabled: false
|
||||
# call-setters-on-nulls: true
|
||||
# jdbc-type-for-null: 'null'
|
||||
## log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
sqx:
|
||||
redis:
|
||||
|
||||
46
src/main/resources/logback.xml
Normal file
46
src/main/resources/logback.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<contextName>logback</contextName>
|
||||
<!-- 打印控制台格式 -->
|
||||
<!--%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||
<property name="p_console"
|
||||
value="%green(%d) | %highlight(%-5level) [%thread] %yellow(%c) %cyan([%L]) -| %X{messageId} %msg %n"/>
|
||||
<!--写入文件格式-->
|
||||
<property name="p_file" value="%d | %-5level [%thread] %c [%L] -| %X{messageId} %msg %n"/>
|
||||
<!--输出到控制台-->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${p_console}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!--按天生成日志-->
|
||||
<appender name="logFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>logs/duanju.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--生成日志文件名称-->
|
||||
<fileNamePattern>logs/duanju.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<!--日志文件保留天数-->
|
||||
<MaxHistory>30</MaxHistory>
|
||||
<maxFileSize>100MB</maxFileSize>
|
||||
</rollingPolicy>
|
||||
<!-- 日志输出格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${p_file}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- 配置一些第三方包的日志过滤级别,用于避免刷屏 -->
|
||||
<!-- 日志级别排序为: TRACE < DEBUG < INFO < WARN < ERROR-->
|
||||
<!-- WARN [main] org.mybatis.spring.mapper.ClassPathMapperScanner-->
|
||||
<!-- INFO [main] org.apache.shardingsphere.core.log.ConfigurationLogger-->
|
||||
|
||||
<logger name="org.springframework.context.support" level="WARN"/>
|
||||
<logger name="org.apache.shardingsphere" level="WARN"/>
|
||||
<logger name="org.mybatis.spring.mapper.ClassPathMapperScanner" level="ERROR"/>
|
||||
<logger name="com.zaxxer.hikari" level="WARN"/>
|
||||
<!-- 输出日志 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="console"/>
|
||||
<appender-ref ref="logFile"/>
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -3,13 +3,14 @@
|
||||
<mapper namespace="com.sqx.modules.course.dao.CourseDetailsDao">
|
||||
|
||||
<select id="courseSets" resultType="com.sqx.modules.course.vo.CourseDetailsSetVo">
|
||||
select c.course_id as courseId
|
||||
, c.course_details_id as courseDetailsId
|
||||
, c.course_details_name as courseDetailsName
|
||||
, c.price as countPrice
|
||||
, ifnull(#{price}, 0, #{price}) as price
|
||||
, ifnull(#{wholesalePrice}, 0, #{wholesalePrice}) as wholesalePrice
|
||||
, IF(#{isPrice}, c.is_price, 2) AS isPrice
|
||||
select c.course_id as courseId
|
||||
, c.course_details_id as courseDetailsId
|
||||
, c.course_details_name as courseDetailsName
|
||||
, c.price as countPrice
|
||||
, c.sort as sort
|
||||
, ifnull(#{price}, 0) as price
|
||||
, ifnull(#{wholesalePrice}, 0) as wholesalePrice
|
||||
, IF(#{isPrice} = 1, c.is_price, 2) AS isPrice
|
||||
from course_details c
|
||||
where c.course_id = #{courseId}
|
||||
order by c.sort asc
|
||||
@@ -22,7 +23,8 @@
|
||||
, c.title_img as titleImg
|
||||
, c.video_url as videoUrl
|
||||
, c.good_num as goodNum
|
||||
, ifnull(#{collect}, 0, 1) as isCollect
|
||||
, c.sort as sort
|
||||
, IF(#{collect} = 1, 1, 0) AS isCollect
|
||||
from course_details c
|
||||
where c.course_id = #{courseId}
|
||||
and sort > #{starSort}
|
||||
|
||||
Reference in New Issue
Block a user