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/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/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..bb999ba --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/SysCarMapper.java @@ -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 { + 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..f3f63a5 --- /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.vo.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..d82d485 --- /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.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 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..8ac80be --- /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: 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 + 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..6d98419 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/resources/mapper/SysCarMapper.xml @@ -0,0 +1,41 @@ + + + + + + + + diff --git a/cloud-modules/cloud-modules-template/pom.xml b/cloud-modules/cloud-modules-template/pom.xml new file mode 100644 index 0000000..94c2990 --- /dev/null +++ b/cloud-modules/cloud-modules-template/pom.xml @@ -0,0 +1,107 @@ + + + 4.0.0 + + com.muyu + cloud-modules + 3.6.3 + + + cloud-modules-template + + + 17 + 17 + UTF-8 + + + + + + + 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-xxl + + + + com.muyu + cloud-common-rabbit + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + diff --git a/cloud-modules/cloud-modules-template/src/main/java/com/template/TemplateApplication.java b/cloud-modules/cloud-modules-template/src/main/java/com/template/TemplateApplication.java new file mode 100644 index 0000000..7100318 --- /dev/null +++ b/cloud-modules/cloud-modules-template/src/main/java/com/template/TemplateApplication.java @@ -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); + + } + +} diff --git a/cloud-modules/cloud-modules-template/src/main/java/com/template/controller/DataTypeController.java b/cloud-modules/cloud-modules-template/src/main/java/com/template/controller/DataTypeController.java new file mode 100644 index 0000000..1bd0a74 --- /dev/null +++ b/cloud-modules/cloud-modules-template/src/main/java/com/template/controller/DataTypeController.java @@ -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> dataTypeList() { + return Result.success(dataTypeService.dataTypeList()); + } + +} diff --git a/cloud-modules/cloud-modules-template/src/main/java/com/template/controller/MessageTemplateTypeController.java b/cloud-modules/cloud-modules-template/src/main/java/com/template/controller/MessageTemplateTypeController.java new file mode 100644 index 0000000..a988756 --- /dev/null +++ b/cloud-modules/cloud-modules-template/src/main/java/com/template/controller/MessageTemplateTypeController.java @@ -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> messageTemplateTypeList() { + List list = messageTemplateTypeService.messageTemplateTypeList(); + return Result.success(list,"查询成功"); + } + + /** + * 添加 + * @param messageTemplateType + * @return + */ + @PostMapping("/addMessageType") + public Result addMessageType(@RequestBody MessageTemplateType messageTemplateType) { + return Result.success(messageTemplateTypeService.addMessageType(messageTemplateType)); + } + + /** + * 基础类型 + * @param templatedId + * @param code + * @return + */ + @PostMapping("/findvehicleFoundationData") + public Result> 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> 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> finddeviceStatusData(@RequestParam("templatedId") Integer templatedId,@RequestParam("code") String code) { + return Result.success(messageTemplateTypeService.finddeviceStatusData(templatedId,code)); + } + +} diff --git a/cloud-modules/cloud-modules-template/src/main/java/com/template/controller/TemplateController.java b/cloud-modules/cloud-modules-template/src/main/java/com/template/controller/TemplateController.java new file mode 100644 index 0000000..e1e30e7 --- /dev/null +++ b/cloud-modules/cloud-modules-template/src/main/java/com/template/controller/TemplateController.java @@ -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> templateList() { + return Result.success(templateService.templateList()); + } + + + +} diff --git a/cloud-modules/cloud-modules-template/src/main/java/com/template/domain/DataType.java b/cloud-modules/cloud-modules-template/src/main/java/com/template/domain/DataType.java new file mode 100644 index 0000000..e165524 --- /dev/null +++ b/cloud-modules/cloud-modules-template/src/main/java/com/template/domain/DataType.java @@ -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; + + + +} diff --git a/cloud-modules/cloud-modules-template/src/main/java/com/template/domain/MessageTemplateType.java b/cloud-modules/cloud-modules-template/src/main/java/com/template/domain/MessageTemplateType.java new file mode 100644 index 0000000..aa8eadf --- /dev/null +++ b/cloud-modules/cloud-modules-template/src/main/java/com/template/domain/MessageTemplateType.java @@ -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; +} diff --git a/cloud-modules/cloud-modules-template/src/main/java/com/template/domain/Template.java b/cloud-modules/cloud-modules-template/src/main/java/com/template/domain/Template.java new file mode 100644 index 0000000..c4798f8 --- /dev/null +++ b/cloud-modules/cloud-modules-template/src/main/java/com/template/domain/Template.java @@ -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; +} diff --git a/cloud-modules/cloud-modules-template/src/main/java/com/template/mapper/DataTypeMapper.java b/cloud-modules/cloud-modules-template/src/main/java/com/template/mapper/DataTypeMapper.java new file mode 100644 index 0000000..396004c --- /dev/null +++ b/cloud-modules/cloud-modules-template/src/main/java/com/template/mapper/DataTypeMapper.java @@ -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 dataTypeList(); + +} diff --git a/cloud-modules/cloud-modules-template/src/main/java/com/template/mapper/MessageTemplateTypeMapper.java b/cloud-modules/cloud-modules-template/src/main/java/com/template/mapper/MessageTemplateTypeMapper.java new file mode 100644 index 0000000..914e938 --- /dev/null +++ b/cloud-modules/cloud-modules-template/src/main/java/com/template/mapper/MessageTemplateTypeMapper.java @@ -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 messageTemplateTypeList(); + + List finddeviceStatusData(@Param("templatedId") Integer templatedId, @Param("code") String code); + + List findvehicleFoundationData(@Param("templatedId") Integer templatedId, @Param("code") String code); + + List findvehicleData(@Param("templatedId") Integer templatedId, @Param("code") String code); + +} diff --git a/cloud-modules/cloud-modules-template/src/main/java/com/template/mapper/TemplateMapper.java b/cloud-modules/cloud-modules-template/src/main/java/com/template/mapper/TemplateMapper.java new file mode 100644 index 0000000..7bba63c --- /dev/null +++ b/cloud-modules/cloud-modules-template/src/main/java/com/template/mapper/TemplateMapper.java @@ -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