From b3a4f08fb3464ecaf405c0be9053d9657bd5f098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E8=8B=B1=E6=9D=B0?= <327782001@qq.com> Date: Sat, 15 Jul 2023 12:46:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../springbootkwan/config/MyInterceptor.java | 8 +- .../springbootkwan/config/RedisConfig.java | 4 +- .../entity/AdsDimFinancialYearWeekInfo.java | 84 +++---------------- src/main/resources/application.yaml | 4 +- src/main/resources/logback-spring.xml | 83 ++++++------------ 5 files changed, 51 insertions(+), 132 deletions(-) diff --git a/src/main/java/com/kwan/springbootkwan/config/MyInterceptor.java b/src/main/java/com/kwan/springbootkwan/config/MyInterceptor.java index 9b0d45c..9225864 100644 --- a/src/main/java/com/kwan/springbootkwan/config/MyInterceptor.java +++ b/src/main/java/com/kwan/springbootkwan/config/MyInterceptor.java @@ -1,5 +1,6 @@ package com.kwan.springbootkwan.config; +import lombok.extern.slf4j.Slf4j; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; @@ -13,21 +14,22 @@ import javax.servlet.http.HttpServletResponse; * @version : 2.2.0 * @date : 2022/12/19 16:14 */ +@Slf4j public class MyInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - System.out.println("MyInterceptor>>>>>>>>>preHandle"); + log.info("MyInterceptor>>>>>>>>>preHandle"); return true; } @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { - System.out.println("MyInterceptor>>>>>>>>>postHandle"); + log.info("MyInterceptor>>>>>>>>>postHandle"); } @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { - System.out.println("MyInterceptor>>>>>>>>>afterCompletion"); + log.info("MyInterceptor>>>>>>>>>afterCompletion"); } } diff --git a/src/main/java/com/kwan/springbootkwan/config/RedisConfig.java b/src/main/java/com/kwan/springbootkwan/config/RedisConfig.java index 1c18b95..f69421f 100644 --- a/src/main/java/com/kwan/springbootkwan/config/RedisConfig.java +++ b/src/main/java/com/kwan/springbootkwan/config/RedisConfig.java @@ -3,6 +3,7 @@ package com.kwan.springbootkwan.config; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; @@ -10,13 +11,14 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer; +@Slf4j @Configuration public class RedisConfig { @Bean @SuppressWarnings("all") public RedisTemplate redisTemplate(RedisConnectionFactory factory) { - System.out.println("==================自定义的redisTemplate实例化了==================="); + log.info("==================自定义的redisTemplate实例化了==================="); RedisTemplate template = new RedisTemplate(); template.setConnectionFactory(factory); Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class); diff --git a/src/main/java/com/kwan/springbootkwan/entity/AdsDimFinancialYearWeekInfo.java b/src/main/java/com/kwan/springbootkwan/entity/AdsDimFinancialYearWeekInfo.java index 888c300..3effae9 100644 --- a/src/main/java/com/kwan/springbootkwan/entity/AdsDimFinancialYearWeekInfo.java +++ b/src/main/java/com/kwan/springbootkwan/entity/AdsDimFinancialYearWeekInfo.java @@ -1,92 +1,34 @@ package com.kwan.springbootkwan.entity; - -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.extension.activerecord.Model; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import java.util.Date; - -@TableName(value = "ads_dim_financial_year_week_info") +@Data @ApiModel(value = "财年周") public class AdsDimFinancialYearWeekInfo extends Model { - //财年 + @TableId + @ApiModelProperty(value = "财年") private Integer financialYear; - //第n财年周 + @ApiModelProperty(value = "第n财年周") private Integer financialYearWeek; - //财年开始日期 + @ApiModelProperty(value = "财年开始日期") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date financialYearStart; - //财年结束日期 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") + @ApiModelProperty(value = "财年结束日期") private Date financialYearEnd; - //周开始 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") + @ApiModelProperty(value = "周开始") private Date weekStartDay; - //周结束 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") + @ApiModelProperty(value = "周结束") private Date weekEndDay; - //财年周所在季节区间,0:跨9月1号,1:3月到8月,2:9月到2月 + @ApiModelProperty(value = "财年周所在季节区间,0:跨9月1号,1:3月到8月,2:9月到2月 ") private Integer weekInSeason; - - - public Integer getFinancialYear() { - return financialYear; - } - - public void setFinancialYear(Integer financialYear) { - this.financialYear = financialYear; - } - - public Integer getFinancialYearWeek() { - return financialYearWeek; - } - - public void setFinancialYearWeek(Integer financialYearWeek) { - this.financialYearWeek = financialYearWeek; - } - - public Date getFinancialYearStart() { - return financialYearStart; - } - - public void setFinancialYearStart(Date financialYearStart) { - this.financialYearStart = financialYearStart; - } - - public Date getFinancialYearEnd() { - return financialYearEnd; - } - - public void setFinancialYearEnd(Date financialYearEnd) { - this.financialYearEnd = financialYearEnd; - } - - public Date getWeekStartDay() { - return weekStartDay; - } - - public void setWeekStartDay(Date weekStartDay) { - this.weekStartDay = weekStartDay; - } - - public Date getWeekEndDay() { - return weekEndDay; - } - - public void setWeekEndDay(Date weekEndDay) { - this.weekEndDay = weekEndDay; - } - - public Integer getWeekInSeason() { - return weekInSeason; - } - - public void setWeekInSeason(Integer weekInSeason) { - this.weekInSeason = weekInSeason; - } - -} - +} \ No newline at end of file diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 7c3e1b0..b6639c8 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -59,13 +59,15 @@ spring: # url: jdbc:mysql://localhost:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai url: jdbc:mysql://120.79.36.53:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai username: root -# password: 716288qwe + # password: 716288qwe password: 15671628341Qwe. ali-ds: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://120.79.36.53:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai username: root password: 15671628341Qwe. +seata: + tx-service-group: default_tx_group #seata: diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index 86327aa..bb4e498 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -1,69 +1,40 @@ - + + + + - - - - - - - - - - - ../logs/springboot-mybatis.log + - - %date [%level] [%thread] %logger{60} [%file : %line] %msg%n - - UTF-8 + ${console.log.pattern} + ${log.charset} - - - - ../logs/springboot-mybatis.log.%d{yyyy-MM-dd}.log - - 30 - - 10GB - - - - - ../logs/error.log - - %date [%level] [%thread] %logger{60} [%file : %line] %msg%n - - UTF-8 - - - - - ../logs/error.%d{yyyy-MM-dd}.log - + + logs/SpringBoot-kwan.log + + + logs/SpringBoot-kwan-%d{yyyy-MM-dd}.%i.log + + 128MB 30 - - 10GB + 20GB - - - ERROR - - ACCEPT - - DENY - + + ${file.log.pattern} + ${log.charset} + - + + + - - - - - + + + - \ No newline at end of file -- GitLab