初始化仓库
parent
dcda4efc7f
commit
f81075ca3c
|
@ -0,0 +1,109 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-modules-car</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
<version>4.1.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 接口模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-rabbit</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
|
||||
</project>
|
|
@ -0,0 +1,26 @@
|
|||
package com.muyu.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.domain.CarType;
|
||||
import com.muyu.service.CarTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/carType")
|
||||
public class CarTypeController {
|
||||
@Autowired
|
||||
private CarTypeService carTypeService;
|
||||
|
||||
|
||||
@GetMapping("/selectCarTypeList")
|
||||
public Result selectCarTypeList(){
|
||||
return Result.success(carTypeService.selectCarTypeList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package com.muyu.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.domain.SysCar;
|
||||
import com.muyu.domain.req.SysCarReq;
|
||||
import com.muyu.service.SysCarService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sysCar")
|
||||
public class SysCarController {
|
||||
@Autowired
|
||||
private SysCarService sysCarService;
|
||||
|
||||
@PostMapping("/selectSysCarVoList")
|
||||
public Result selectSysCarVoList(@RequestBody SysCarReq sysCarReq){
|
||||
return Result.success(sysCarService.selectSysCarVoList(sysCarReq));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/selectSysCarVoById/{id}")
|
||||
public Result selectSysCarVoById(@PathVariable("id") Long id){
|
||||
return Result.success(sysCarService.selectSysCarVoById(id));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/addSysCar")
|
||||
public Result addSysCar(@RequestBody SysCar sysCar){
|
||||
return Result.success(sysCarService.addSysCar(sysCar));
|
||||
}
|
||||
|
||||
@PutMapping("/updateSysCar")
|
||||
public Result updateSysCar(@RequestBody SysCar sysCar){
|
||||
return Result.success(sysCarService.updateSysCar(sysCar));
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("/deleteSysCarById/{id}")
|
||||
public Result deleteSysCarById(@PathVariable("id") Long id){
|
||||
int i = sysCarService.deleteSysCarById(id);
|
||||
return i>0?Result.success():Result.error();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.muyu.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.domain.SysCarLog;
|
||||
import com.muyu.service.SysCarLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sysCarLog")
|
||||
public class SysCarLogController {
|
||||
@Autowired
|
||||
private SysCarLogService sysCarLogService;
|
||||
|
||||
|
||||
@GetMapping("/selectList")
|
||||
public Result selectList(){
|
||||
return Result.success(sysCarLogService.selectList());
|
||||
}
|
||||
|
||||
@GetMapping("/selectList/{id}")
|
||||
public Result selectById(@PathVariable("id") Long id){
|
||||
return Result.success(sysCarLogService.selectById(id));
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.muyu.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.CarType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
public interface CarTypeMapper extends BaseMapper<CarType> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.muyu.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.SysCar;
|
||||
import com.muyu.domain.SysCarLog;
|
||||
|
||||
public interface SysCarLogMapper extends BaseMapper<SysCarLog> {
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.muyu.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.SysCar;
|
||||
import com.muyu.domain.req.SysCarReq;
|
||||
import com.muyu.domain.vo.SysCarVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface SysCarMapper extends BaseMapper<SysCar> {
|
||||
List<SysCarVo> selectSysCarVoList(SysCarReq sysCarReq);
|
||||
|
||||
|
||||
SysCarVo selectSysCarVoById(@Param("id") Long id);
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.muyu.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.domain.CarType;
|
||||
import com.muyu.mapper.CarTypeMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface CarTypeService extends IService<CarType> {
|
||||
List<CarType> selectCarTypeList();
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.muyu.service;
|
||||
|
||||
import com.muyu.domain.SysCarLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SysCarLogService {
|
||||
|
||||
|
||||
List<SysCarLog> selectList();
|
||||
|
||||
SysCarLog selectById(Long id);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.muyu.service;
|
||||
|
||||
import com.muyu.domain.SysCar;
|
||||
import com.muyu.domain.req.SysCarReq;
|
||||
import com.muyu.domain.vo.SysCarVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SysCarService {
|
||||
List<SysCarVo> selectSysCarVoList(SysCarReq sysCarReq);
|
||||
|
||||
SysCarVo selectSysCarVoById(Long id);
|
||||
|
||||
int addSysCar(SysCar sysCar);
|
||||
|
||||
int deleteSysCarById(Long id);
|
||||
|
||||
int updateSysCar(SysCar sysCar);
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.muyu.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.domain.CarType;
|
||||
import com.muyu.mapper.CarTypeMapper;
|
||||
import com.muyu.service.CarTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CarTypeServiceImpl extends ServiceImpl<CarTypeMapper,CarType> implements CarTypeService {
|
||||
@Autowired
|
||||
private CarTypeMapper carTypeMapper;
|
||||
@Override
|
||||
public List<CarType> selectCarTypeList() {
|
||||
QueryWrapper<CarType> carTypeQueryWrapper = new QueryWrapper<>();
|
||||
return carTypeMapper.selectList(carTypeQueryWrapper);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.muyu.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.domain.CarType;
|
||||
import com.muyu.domain.SysCarLog;
|
||||
import com.muyu.mapper.CarTypeMapper;
|
||||
import com.muyu.mapper.SysCarLogMapper;
|
||||
import com.muyu.service.CarTypeService;
|
||||
import com.muyu.service.SysCarLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SysCarLogServiceImpl extends ServiceImpl<SysCarLogMapper, SysCarLog> implements SysCarLogService {
|
||||
@Autowired
|
||||
private SysCarLogMapper sysCarLogMapper;
|
||||
@Override
|
||||
public List<SysCarLog> selectList() {
|
||||
QueryWrapper<SysCarLog> sysCarLogQueryWrapper = new QueryWrapper<>();
|
||||
return sysCarLogMapper.selectList(sysCarLogQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysCarLog selectById(Long id) {
|
||||
return sysCarLogMapper.selectById(id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.muyu.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.domain.SysCar;
|
||||
import com.muyu.domain.req.SysCarReq;
|
||||
import com.muyu.domain.vo.SysCarVo;
|
||||
import com.muyu.mapper.SysCarMapper;
|
||||
import com.muyu.service.SysCarService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SysCarServiceImpl extends ServiceImpl<SysCarMapper,SysCar> implements SysCarService {
|
||||
@Autowired
|
||||
private SysCarMapper sysCarMapper;
|
||||
@Override
|
||||
public List<SysCarVo> selectSysCarVoList(SysCarReq sysCarReq) {
|
||||
return sysCarMapper.selectSysCarVoList(sysCarReq);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysCarVo selectSysCarVoById(Long id) {
|
||||
return sysCarMapper.selectSysCarVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addSysCar(SysCar sysCar) {
|
||||
return sysCarMapper.insert(sysCar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteSysCarById(Long id) {
|
||||
return sysCarMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSysCar(SysCar sysCar) {
|
||||
return sysCarMapper.updateById(sysCar);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,56 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9520
|
||||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 47.101.53.251:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: four
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: cloud-car
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos.addr}
|
||||
# nacos用户名
|
||||
username: ${nacos.user-name}
|
||||
# nacos密码
|
||||
password: ${nacos.password}
|
||||
# 命名空间
|
||||
namespace: ${nacos.namespace}
|
||||
config:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos.addr}
|
||||
# nacos用户名
|
||||
username: ${nacos.user-name}
|
||||
# nacos密码
|
||||
password: ${nacos.password}
|
||||
# 命名空间
|
||||
namespace: ${nacos.namespace}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
# 系统共享配置
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# 系统环境Config共享配置
|
||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# xxl-job 配置文件
|
||||
- application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# rabbit 配置文件
|
||||
- application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.muyu.system.mapper: DEBUG
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-car"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-car"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.sky.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<Pattern>${log.sky.pattern}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="GRPC_LOG"/>
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-car"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.sky.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<Pattern>${log.sky.pattern}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="GRPC_LOG"/>
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,41 @@
|
|||
<?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.muyu.mapper.SysCarMapper">
|
||||
<select id="selectSysCarVoList" resultType="com.muyu.domain.vo.SysCarVo">
|
||||
SELECT * ,car_type.type_name,tb_fence.fence_name
|
||||
FROM `sys_car`
|
||||
LEFT JOIN car_type ON sys_car.car_type_id=car_type.id
|
||||
LEFT JOIN tb_fence ON sys_car.fence_id=tb_fence.fence_id
|
||||
<where>
|
||||
<if test="carVin!=null and carVin!=''">
|
||||
sys_car.car_vin=#{carVin}
|
||||
</if>
|
||||
<if test="state!=null and state!=''">
|
||||
and sys_car.state=#{state}
|
||||
</if>
|
||||
<if test="carMotorManufacturer!=null and carMotorManufacturer!=''">
|
||||
and sys_car.car_motor_manufacturer=#{carMotorManufacturer}
|
||||
</if>
|
||||
<if test="carBatteryManufacturer!=null and carBatteryManufacturer!=''">
|
||||
and sys_car.car_battery_manufacturer=#{carBatteryManufacturer}
|
||||
</if>
|
||||
<if test="carMotorModel!=null and carMotorModel!=''">
|
||||
and sys_car.car_motor_model=#{carMotorModel}
|
||||
</if>
|
||||
<if test="carBatteryModel!=null and carBatteryModel!=''">
|
||||
and sys_car.car_battery_model=#{carBatteryModel}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectSysCarVoById" resultType="com.muyu.domain.vo.SysCarVo">
|
||||
SELECT * ,car_type.type_name,tb_fence.fence_name
|
||||
FROM `sys_car`
|
||||
LEFT JOIN car_type ON sys_car.car_type_id=car_type.id
|
||||
LEFT JOIN tb_fence ON sys_car.fence_id=tb_fence.fence_id
|
||||
where sys_car.id=#{id}
|
||||
</select>
|
||||
</mapper>
|
|
@ -0,0 +1,107 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-modules-template</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 接口模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- XllJob定时任务 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-xxl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-rabbit</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,28 @@
|
|||
package com.template;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.sheep
|
||||
* @Project:cloud-server-c
|
||||
* @name:TemplateApplication
|
||||
* @Date:2024/9/19 21:20
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.template.mapper")
|
||||
public class TemplateApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
SpringApplication.run(TemplateApplication.class, args);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.template.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.template.domain.DataType;
|
||||
import com.template.service.DataTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.sheep.controller
|
||||
* @Project:cloud-server-c
|
||||
* @name:DataTypeController
|
||||
* @Date:2024/9/20 9:15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dataType")
|
||||
public class DataTypeController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private DataTypeService dataTypeService;
|
||||
|
||||
|
||||
@PostMapping("/dataTypeList")
|
||||
public Result<List<DataType>> dataTypeList() {
|
||||
return Result.success(dataTypeService.dataTypeList());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
package com.template.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.template.domain.MessageTemplateType;
|
||||
import com.template.domain.Template;
|
||||
import com.template.service.MessageTemplateTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.sheep.message.controller
|
||||
* @Project:cloud-server-c
|
||||
* @name:MessageTemplateTypeController
|
||||
* @Date:2024/9/19 14:33
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/messageTemplateType")
|
||||
public class MessageTemplateTypeController {
|
||||
|
||||
@Autowired
|
||||
private MessageTemplateTypeService messageTemplateTypeService;
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/messageTemplateTypeList")
|
||||
public Result<List<MessageTemplateType>> messageTemplateTypeList() {
|
||||
List<MessageTemplateType> list = messageTemplateTypeService.messageTemplateTypeList();
|
||||
return Result.success(list,"查询成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param messageTemplateType
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/addMessageType")
|
||||
public Result<Integer> addMessageType(@RequestBody MessageTemplateType messageTemplateType) {
|
||||
return Result.success(messageTemplateTypeService.addMessageType(messageTemplateType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础类型
|
||||
* @param templatedId
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/findvehicleFoundationData")
|
||||
public Result<List<MessageTemplateType>> findvehicleFoundationData(@RequestParam("templatedId") Integer templatedId, @RequestParam("code") String code) {
|
||||
return Result.success(messageTemplateTypeService.findvehicleFoundationData(templatedId,code));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据类型
|
||||
* @param templatedId
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/findvehicleData")
|
||||
public Result<List<MessageTemplateType>> findvehicleData(@RequestParam("templatedId") Integer templatedId,@RequestParam("code") String code) {
|
||||
return Result.success(messageTemplateTypeService.findvehicleData(templatedId,code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备状态
|
||||
* @param templatedId
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/finddeviceStatusData")
|
||||
public Result<List<MessageTemplateType>> finddeviceStatusData(@RequestParam("templatedId") Integer templatedId,@RequestParam("code") String code) {
|
||||
return Result.success(messageTemplateTypeService.finddeviceStatusData(templatedId,code));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.template.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.template.domain.Template;
|
||||
import com.template.service.TemplateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.template.controller
|
||||
* @Project:cloud-server-c
|
||||
* @name:TemplateController
|
||||
* @Date:2024/9/20 12:12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/template")
|
||||
public class TemplateController {
|
||||
|
||||
@Autowired
|
||||
private TemplateService templateService;
|
||||
|
||||
|
||||
@PostMapping("/templateList")
|
||||
public Result<List<Template>> templateList() {
|
||||
return Result.success(templateService.templateList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.template.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.sheep.message.domain
|
||||
* @Project:cloud-server-c
|
||||
* @name:DataType
|
||||
* @Date:2024/9/19 19:32
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DataType implements Serializable{
|
||||
|
||||
/**
|
||||
* 数据类型ID
|
||||
*/
|
||||
private Integer DataTypeId;
|
||||
/**
|
||||
* 数据类型名称
|
||||
*/
|
||||
private String DataTypeName;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package com.template.domain;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.sheep.message.domain
|
||||
* @Project:cloud-server-c
|
||||
* @name:MessageTemplateType
|
||||
* @Date:2024/9/18 21:01
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@TableName(value = "message_template_type",autoResultMap = true)
|
||||
public class MessageTemplateType implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "message_template_type_id",type = IdType.AUTO)
|
||||
private String messageTemplateTypeId;
|
||||
/**
|
||||
* 报文类别
|
||||
*/
|
||||
private String messageClass;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String messageCode;
|
||||
/**
|
||||
*标签
|
||||
*/
|
||||
private String messageField;
|
||||
/**
|
||||
*起始位
|
||||
*/
|
||||
private Integer startIndex;
|
||||
/**
|
||||
*终止位
|
||||
*/
|
||||
private Integer endIndex;
|
||||
/**
|
||||
*数据类型ID
|
||||
*/
|
||||
private Integer dataTypeId;
|
||||
/**
|
||||
* 数据类型名称
|
||||
*/
|
||||
private String dataTypeName;
|
||||
/**
|
||||
*最小值
|
||||
*/
|
||||
private String fixedValue;
|
||||
/**
|
||||
*最大值
|
||||
*/
|
||||
private String rangeValue;
|
||||
/**
|
||||
* 模版ID
|
||||
*/
|
||||
private Integer templateId;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.template.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.template.domain
|
||||
* @Project:cloud-server-c
|
||||
* @name:Template
|
||||
* @Date:2024/9/20 12:04
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Template {
|
||||
|
||||
|
||||
/**
|
||||
* 模版ID
|
||||
*/
|
||||
private Integer templateId;
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Integer houseId;
|
||||
/**
|
||||
* 模版名称
|
||||
*/
|
||||
private String templateName;
|
||||
/**
|
||||
* 模版描述
|
||||
*/
|
||||
private String templateDescribe;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.template.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.template.domain.DataType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.sheep.mapper
|
||||
* @Project:cloud-server-c
|
||||
* @name:DataTypeMapper
|
||||
* @Date:2024/9/20 9:16
|
||||
*/
|
||||
|
||||
public interface DataTypeMapper {
|
||||
|
||||
|
||||
List<DataType> dataTypeList();
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.template.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import com.template.domain.MessageTemplateType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.sheep.message.mapper
|
||||
* @Project:cloud-server-c
|
||||
* @name:MessageTemplateTypeMapper
|
||||
* @Date:2024/9/19 14:35
|
||||
*/
|
||||
|
||||
public interface MessageTemplateTypeMapper {
|
||||
|
||||
|
||||
|
||||
Integer addMessageType(@Param("messageTemplateType") MessageTemplateType messageTemplateType);
|
||||
|
||||
List<MessageTemplateType> messageTemplateTypeList();
|
||||
|
||||
List<MessageTemplateType> finddeviceStatusData(@Param("templatedId") Integer templatedId, @Param("code") String code);
|
||||
|
||||
List<MessageTemplateType> findvehicleFoundationData(@Param("templatedId") Integer templatedId, @Param("code") String code);
|
||||
|
||||
List<MessageTemplateType> findvehicleData(@Param("templatedId") Integer templatedId, @Param("code") String code);
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.template.mapper;
|
||||
|
||||
import com.template.domain.Template;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.template.mapper
|
||||
* @Project:cloud-server-c
|
||||
* @name:TemplateMapper
|
||||
* @Date:2024/9/20 12:13
|
||||
*/
|
||||
@Mapper
|
||||
public interface TemplateMapper {
|
||||
List<Template> templateList();
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.template.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.template.domain.DataType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.sheep.service
|
||||
* @Project:cloud-server-c
|
||||
* @name:DataTypeService
|
||||
* @Date:2024/9/20 9:15
|
||||
*/
|
||||
public interface DataTypeService {
|
||||
|
||||
|
||||
List<DataType> dataTypeList();
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.template.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.template.domain.MessageTemplateType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.sheep.message.service
|
||||
* @Project:cloud-server-c
|
||||
* @name:MessageTemplateTypeService
|
||||
* @Date:2024/9/19 14:34
|
||||
*/
|
||||
public interface MessageTemplateTypeService {
|
||||
|
||||
|
||||
|
||||
Integer addMessageType(MessageTemplateType messageTemplateType);
|
||||
|
||||
List<MessageTemplateType> messageTemplateTypeList();
|
||||
|
||||
List<MessageTemplateType> findvehicleFoundationData(Integer templatedId, String code);
|
||||
|
||||
List<MessageTemplateType> findvehicleData(Integer templatedId, String code);
|
||||
|
||||
List<MessageTemplateType> finddeviceStatusData(Integer templatedId, String code);
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.template.service;
|
||||
|
||||
import com.template.domain.Template;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.template.service
|
||||
* @Project:cloud-server-c
|
||||
* @name:TemplateService
|
||||
* @Date:2024/9/20 12:12
|
||||
*/
|
||||
public interface TemplateService {
|
||||
List<Template> templateList();
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.template.service.impl;
|
||||
import com.template.domain.DataType;
|
||||
import com.template.mapper.DataTypeMapper;
|
||||
import com.template.service.DataTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.sheep.service.impl
|
||||
* @Project:cloud-server-c
|
||||
* @name:DataTypeServiceImpl
|
||||
* @Date:2024/9/20 9:15
|
||||
*/
|
||||
@Service
|
||||
public class DataTypeServiceImpl implements DataTypeService{
|
||||
|
||||
@Autowired
|
||||
private DataTypeMapper dataTypeMapper;
|
||||
|
||||
@Override
|
||||
public List<DataType> dataTypeList() {
|
||||
return dataTypeMapper.dataTypeList();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.template.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.template.domain.MessageTemplateType;
|
||||
import com.template.mapper.MessageTemplateTypeMapper;
|
||||
import com.template.service.MessageTemplateTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.sheep.message.service.impl
|
||||
* @Project:cloud-server-c
|
||||
* @name:MessageTemplateTypeServiceImpl
|
||||
* @Date:2024/9/19 14:34
|
||||
*/
|
||||
@Service
|
||||
public class MessageTemplateTypeServiceImpl implements MessageTemplateTypeService{
|
||||
|
||||
@Autowired
|
||||
private MessageTemplateTypeMapper messageTemplateTypeMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public Integer addMessageType(MessageTemplateType messageTemplateType) {
|
||||
return messageTemplateTypeMapper.addMessageType(messageTemplateType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MessageTemplateType> messageTemplateTypeList() {
|
||||
return messageTemplateTypeMapper.messageTemplateTypeList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MessageTemplateType> findvehicleFoundationData(Integer templatedId, String code) {
|
||||
return messageTemplateTypeMapper.findvehicleFoundationData(templatedId,code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MessageTemplateType> findvehicleData(Integer templatedId, String code) {
|
||||
return messageTemplateTypeMapper.findvehicleData(templatedId,code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MessageTemplateType> finddeviceStatusData(Integer templatedId, String code) {
|
||||
return messageTemplateTypeMapper.finddeviceStatusData(templatedId,code);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.template.service.impl;
|
||||
|
||||
import com.template.domain.Template;
|
||||
import com.template.mapper.TemplateMapper;
|
||||
import com.template.service.TemplateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.template.service.impl
|
||||
* @Project:cloud-server-c
|
||||
* @name:TemplateServiceImp
|
||||
* @Date:2024/9/20 12:12
|
||||
*/
|
||||
@Service
|
||||
public class TemplateServiceImpl implements TemplateService{
|
||||
|
||||
@Autowired
|
||||
private TemplateMapper templateMapper;
|
||||
|
||||
@Override
|
||||
public List<Template> templateList() {
|
||||
return templateMapper.templateList();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,59 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9707
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 47.101.53.251:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: four
|
||||
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
||||
# Spring
|
||||
spring:
|
||||
amqp:
|
||||
deserialization:
|
||||
trust:
|
||||
all: true
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
application:
|
||||
# 应用名称
|
||||
name: cloud-template
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos.addr}
|
||||
# nacos用户名
|
||||
username: ${nacos.user-name}
|
||||
# nacos密码
|
||||
password: ${nacos.password}
|
||||
# 命名空间
|
||||
namespace: ${nacos.namespace}
|
||||
config:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos.addr}
|
||||
# nacos用户名
|
||||
username: ${nacos.user-name}
|
||||
# nacos密码
|
||||
password: ${nacos.password}
|
||||
# 命名空间
|
||||
namespace: ${nacos.namespace}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
# 系统共享配置
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# 系统环境Config共享配置
|
||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# xxl-job 配置文件
|
||||
- application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# rabbit 配置文件
|
||||
- application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
logging:
|
||||
level:
|
||||
com.muyu.system.mapper: DEBUG
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-system"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-system"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.sky.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<Pattern>${log.sky.pattern}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="GRPC_LOG"/>
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-system"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.sky.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<Pattern>${log.sky.pattern}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="GRPC_LOG"/>
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,11 @@
|
|||
<?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.template.mapper.DataTypeMapper">
|
||||
|
||||
<select id="dataTypeList" resultType="com.template.domain.DataType">
|
||||
select * from data_type
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,46 @@
|
|||
<?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.template.mapper.MessageTemplateTypeMapper">
|
||||
<insert id="addMessageType">
|
||||
INSERT INTO `four`.`message_template_type` ( `message_code`, `message_field`, `start_index`, `end_index`, `data_type_id`, `fixed_value`, `range_value`, `template_id`)
|
||||
VALUES ( #{messageCode}, #{messageField}, #{startIndex}, #{endIndex}, #{dataTypeId}, #{fixedValue}, #{rangeValue}, #{templateId});
|
||||
</insert>
|
||||
<select id="messageTemplateTypeList" resultType="com.template.domain.MessageTemplateType">
|
||||
SELECT
|
||||
message_template_type.*,
|
||||
data_type.data_type_name
|
||||
FROM
|
||||
message_template_type
|
||||
LEFT JOIN data_type ON data_type.data_type_id = message_template_type.data_type_id
|
||||
</select>
|
||||
<select id="finddeviceStatusData" resultType="com.template.domain.MessageTemplateType">
|
||||
SELECT
|
||||
message_template_type.*,
|
||||
data_type.data_type_name
|
||||
FROM
|
||||
message_template_type
|
||||
LEFT JOIN data_type ON data_type.data_type_id = message_template_type.data_type_id
|
||||
where message_template_type.template_id=#{templatedId} and message_template_type.message_class=#{code}
|
||||
</select>
|
||||
<select id="findvehicleFoundationData" resultType="com.template.domain.MessageTemplateType">
|
||||
SELECT
|
||||
message_template_type.*,
|
||||
data_type.data_type_name
|
||||
FROM
|
||||
message_template_type
|
||||
LEFT JOIN data_type ON data_type.data_type_id = message_template_type.data_type_id
|
||||
where message_template_type.template_id=#{templatedId} and message_template_type.message_class=#{code}
|
||||
</select>
|
||||
<select id="findvehicleData" resultType="com.template.domain.MessageTemplateType">
|
||||
SELECT
|
||||
message_template_type.*,
|
||||
data_type.data_type_name
|
||||
FROM
|
||||
message_template_type
|
||||
LEFT JOIN data_type ON data_type.data_type_id = message_template_type.data_type_id
|
||||
where message_template_type.template_id=#{templatedId} and message_template_type.message_class=#{code}
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,11 @@
|
|||
<?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.template.mapper.TemplateMapper">
|
||||
|
||||
<select id="templateList" resultType="com.template.domain.Template">
|
||||
select * from t_template
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue