From a4bef49f4a13cd571b79b15966d5d4392cc7dc7a Mon Sep 17 00:00:00 2001 From: Liu Wu <2780205363@qq.com> Date: Fri, 20 Sep 2024 16:30:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cloud-modules/cloud-modules-car/pom.xml | 109 ++++++++++++++++++ .../java/com/muyu/CarSystemApplication.java | 15 +++ .../muyu/controller/CarTypeController.java | 26 +++++ .../com/muyu/controller/SysCarController.java | 48 ++++++++ .../muyu/controller/SysCarLogController.java | 32 +++++ .../main/java/com/muyu/domain/CarType.java | 19 +++ .../src/main/java/com/muyu/domain/SysCar.java | 38 ++++++ .../main/java/com/muyu/domain/SysCarLog.java | 23 ++++ .../java/com/muyu/domain/req/SysCarReq.java | 18 +++ .../java/com/muyu/domain/resp/SysCarVo.java | 21 ++++ .../java/com/muyu/mapper/CarTypeMapper.java | 9 ++ .../java/com/muyu/mapper/SysCarLogMapper.java | 8 ++ .../java/com/muyu/mapper/SysCarMapper.java | 20 ++++ .../java/com/muyu/service/CarTypeService.java | 13 +++ .../com/muyu/service/SysCarLogService.java | 15 +++ .../java/com/muyu/service/SysCarService.java | 19 +++ .../muyu/service/impl/CarTypeServiceImpl.java | 22 ++++ .../service/impl/SysCarLogServiceImpl.java | 30 +++++ .../muyu/service/impl/SysCarServiceImpl.java | 42 +++++++ .../src/main/resources/banner.txt | 2 + .../src/main/resources/bootstrap.yml | 56 +++++++++ .../src/main/resources/logback/dev.xml | 74 ++++++++++++ .../src/main/resources/logback/prod.xml | 81 +++++++++++++ .../src/main/resources/logback/test.xml | 81 +++++++++++++ .../main/resources/mapper/SysCarMapper.xml | 41 +++++++ cloud-modules/pom.xml | 1 + 26 files changed, 863 insertions(+) create mode 100644 cloud-modules/cloud-modules-car/pom.xml create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/CarSystemApplication.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/CarTypeController.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/SysCarController.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/SysCarLogController.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/CarType.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/SysCar.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/SysCarLog.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/req/SysCarReq.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/resp/SysCarVo.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/CarTypeMapper.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/SysCarLogMapper.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/SysCarMapper.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/CarTypeService.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/SysCarLogService.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/SysCarService.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/CarTypeServiceImpl.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/SysCarLogServiceImpl.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/SysCarServiceImpl.java create mode 100644 cloud-modules/cloud-modules-car/src/main/resources/banner.txt create mode 100644 cloud-modules/cloud-modules-car/src/main/resources/bootstrap.yml create mode 100644 cloud-modules/cloud-modules-car/src/main/resources/logback/dev.xml create mode 100644 cloud-modules/cloud-modules-car/src/main/resources/logback/prod.xml create mode 100644 cloud-modules/cloud-modules-car/src/main/resources/logback/test.xml create mode 100644 cloud-modules/cloud-modules-car/src/main/resources/mapper/SysCarMapper.xml diff --git a/cloud-modules/cloud-modules-car/pom.xml b/cloud-modules/cloud-modules-car/pom.xml new file mode 100644 index 0000000..2bc7c34 --- /dev/null +++ b/cloud-modules/cloud-modules-car/pom.xml @@ -0,0 +1,109 @@ + + + 4.0.0 + + com.muyu + cloud-modules + 3.6.3 + + + cloud-modules-car + + + 17 + 17 + UTF-8 + + + + + + org.springframework.cloud + spring-cloud-starter-bootstrap + 4.1.2 + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + com.mysql + mysql-connector-j + + + + + com.muyu + cloud-common-datasource + + + + + com.muyu + cloud-common-datascope + + + + + com.muyu + cloud-common-log + + + + + com.muyu + cloud-common-api-doc + + + + + com.muyu + cloud-common-rabbit + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + + + diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/CarSystemApplication.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/CarSystemApplication.java new file mode 100644 index 0000000..2594c43 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/CarSystemApplication.java @@ -0,0 +1,15 @@ +package com.muyu; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.openfeign.EnableFeignClients; + +@SpringBootApplication +@EnableFeignClients +@MapperScan(value = "com.muyu.mapper") +public class CarSystemApplication { + public static void main(String[] args) { + SpringApplication.run(CarSystemApplication.class,args); + } +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/CarTypeController.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/CarTypeController.java new file mode 100644 index 0000000..a3cbd9a --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/CarTypeController.java @@ -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()); + } + + + +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/SysCarController.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/SysCarController.java new file mode 100644 index 0000000..8f55852 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/SysCarController.java @@ -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(); + } + + +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/SysCarLogController.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/SysCarLogController.java new file mode 100644 index 0000000..465cff6 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/SysCarLogController.java @@ -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)); + } + + +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/CarType.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/CarType.java new file mode 100644 index 0000000..11989b3 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/CarType.java @@ -0,0 +1,19 @@ +package com.muyu.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "car_type",autoResultMap = true) +public class CarType { + @TableId(value = "id") + private Long id; + private String typeName; + private Long messageId; + +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/SysCar.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/SysCar.java new file mode 100644 index 0000000..573d321 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/SysCar.java @@ -0,0 +1,38 @@ +package com.muyu.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.common.core.web.domain.BaseEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@TableName(value = "sys_car",autoResultMap = true) +public class SysCar extends BaseEntity { + @TableId(value = "id") + private Long id; + private String carVin; + private Long carTypeId; + private String state; + private Long fenceId; + private String carMotorManufacturer; + private String carMotorModel; + private String carBatteryManufacturer; + private String carBatteryModel; + + + + + + + + + + + +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/SysCarLog.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/SysCarLog.java new file mode 100644 index 0000000..62d4dc2 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/SysCarLog.java @@ -0,0 +1,23 @@ +package com.muyu.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "sys_car_log",autoResultMap = true) +public class SysCarLog { + + private String id; + private String carVin; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endTime; +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/req/SysCarReq.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/req/SysCarReq.java new file mode 100644 index 0000000..46acd38 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/req/SysCarReq.java @@ -0,0 +1,18 @@ +package com.muyu.domain.req; + + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class SysCarReq { + private String carVin; + private String carMotorManufacturer; + private String carMotorModel; + private String carBatteryManufacturer; + private String carBatteryModel; +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/resp/SysCarVo.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/resp/SysCarVo.java new file mode 100644 index 0000000..0fae538 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/resp/SysCarVo.java @@ -0,0 +1,21 @@ +package com.muyu.domain.resp; + +import com.muyu.domain.SysCar; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class SysCarVo extends SysCar { + + private String typeName; + private String fenceName; + + + + +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/CarTypeMapper.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/CarTypeMapper.java new file mode 100644 index 0000000..46c09df --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/CarTypeMapper.java @@ -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 { +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/SysCarLogMapper.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/SysCarLogMapper.java new file mode 100644 index 0000000..357deb3 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/SysCarLogMapper.java @@ -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 { +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/SysCarMapper.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/SysCarMapper.java new file mode 100644 index 0000000..e276098 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/SysCarMapper.java @@ -0,0 +1,20 @@ +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.resp.SysCarVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + + +public interface SysCarMapper extends BaseMapper { + List selectSysCarVoList(SysCarReq sysCarReq); + + + SysCarVo selectSysCarVoById(@Param("id") Long id); + +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/CarTypeService.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/CarTypeService.java new file mode 100644 index 0000000..718d461 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/CarTypeService.java @@ -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 { + List selectCarTypeList(); + +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/SysCarLogService.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/SysCarLogService.java new file mode 100644 index 0000000..775e4a5 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/SysCarLogService.java @@ -0,0 +1,15 @@ +package com.muyu.service; + +import com.muyu.domain.SysCarLog; + +import java.util.List; + +public interface SysCarLogService { + + + List selectList(); + + SysCarLog selectById(Long id); + + +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/SysCarService.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/SysCarService.java new file mode 100644 index 0000000..278c008 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/SysCarService.java @@ -0,0 +1,19 @@ +package com.muyu.service; + +import com.muyu.domain.SysCar; +import com.muyu.domain.req.SysCarReq; +import com.muyu.domain.resp.SysCarVo; + +import java.util.List; + +public interface SysCarService { + List selectSysCarVoList(SysCarReq sysCarReq); + + SysCarVo selectSysCarVoById(Long id); + + int addSysCar(SysCar sysCar); + + int deleteSysCarById(Long id); + + int updateSysCar(SysCar sysCar); +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/CarTypeServiceImpl.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/CarTypeServiceImpl.java new file mode 100644 index 0000000..3648d52 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/CarTypeServiceImpl.java @@ -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 implements CarTypeService { +@Autowired +private CarTypeMapper carTypeMapper; + @Override + public List selectCarTypeList() { + QueryWrapper carTypeQueryWrapper = new QueryWrapper<>(); + return carTypeMapper.selectList(carTypeQueryWrapper); + } +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/SysCarLogServiceImpl.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/SysCarLogServiceImpl.java new file mode 100644 index 0000000..4a2d507 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/SysCarLogServiceImpl.java @@ -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 implements SysCarLogService { + @Autowired + private SysCarLogMapper sysCarLogMapper; + @Override + public List selectList() { + QueryWrapper sysCarLogQueryWrapper = new QueryWrapper<>(); + return sysCarLogMapper.selectList(sysCarLogQueryWrapper); + } + + @Override + public SysCarLog selectById(Long id) { + return sysCarLogMapper.selectById(id); + } +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/SysCarServiceImpl.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/SysCarServiceImpl.java new file mode 100644 index 0000000..388674f --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/SysCarServiceImpl.java @@ -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.resp.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 implements SysCarService { + @Autowired + private SysCarMapper sysCarMapper; + @Override + public List 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); + } +} diff --git a/cloud-modules/cloud-modules-car/src/main/resources/banner.txt b/cloud-modules/cloud-modules-car/src/main/resources/banner.txt new file mode 100644 index 0000000..0dd5eee --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/resources/banner.txt @@ -0,0 +1,2 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} diff --git a/cloud-modules/cloud-modules-car/src/main/resources/bootstrap.yml b/cloud-modules/cloud-modules-car/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..fc476a1 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/resources/bootstrap.yml @@ -0,0 +1,56 @@ +# Tomcat +server: + port: 9520 + +# nacos线上地址 +nacos: + addr: 47.101.53.251:8848 + user-name: nacos + password: nacos + namespace: sx + +# 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 + diff --git a/cloud-modules/cloud-modules-car/src/main/resources/logback/dev.xml b/cloud-modules/cloud-modules-car/src/main/resources/logback/dev.xml new file mode 100644 index 0000000..621579c --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/resources/logback/dev.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + diff --git a/cloud-modules/cloud-modules-car/src/main/resources/logback/prod.xml b/cloud-modules/cloud-modules-car/src/main/resources/logback/prod.xml new file mode 100644 index 0000000..2419bf9 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/resources/logback/prod.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + ${log.sky.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + + + ERROR + + ACCEPT + + DENY + + + + + + + + ${log.sky.pattern} + + + + + + + + + + + + + + + + + + + + diff --git a/cloud-modules/cloud-modules-car/src/main/resources/logback/test.xml b/cloud-modules/cloud-modules-car/src/main/resources/logback/test.xml new file mode 100644 index 0000000..2419bf9 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/resources/logback/test.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + ${log.sky.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + + + ERROR + + ACCEPT + + DENY + + + + + + + + ${log.sky.pattern} + + + + + + + + + + + + + + + + + + + + diff --git a/cloud-modules/cloud-modules-car/src/main/resources/mapper/SysCarMapper.xml b/cloud-modules/cloud-modules-car/src/main/resources/mapper/SysCarMapper.xml new file mode 100644 index 0000000..fdfd15b --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/resources/mapper/SysCarMapper.xml @@ -0,0 +1,41 @@ + + + + + + + + diff --git a/cloud-modules/pom.xml b/cloud-modules/pom.xml index 9ed6247..4bcfb77 100644 --- a/cloud-modules/pom.xml +++ b/cloud-modules/pom.xml @@ -11,6 +11,7 @@ cloud-modules-system cloud-modules-gen + cloud-modules-car cloud-modules-file cloud-modules-template cloud-modules-fence