commit dd206ae84d31a6a3b0f16e69cf1be0e36151d9d3 Author: lijie Date: Thu Aug 4 11:43:06 2022 +0800 first diff --git a/uartBackend/.idea/.gitignore b/uartBackend/.idea/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/uartBackend/.idea/compiler.xml b/uartBackend/.idea/compiler.xml new file mode 100644 index 0000000..604c38c --- /dev/null +++ b/uartBackend/.idea/compiler.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uartBackend/.idea/encodings.xml b/uartBackend/.idea/encodings.xml new file mode 100644 index 0000000..0e1c064 --- /dev/null +++ b/uartBackend/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/uartBackend/.idea/jarRepositories.xml b/uartBackend/.idea/jarRepositories.xml new file mode 100644 index 0000000..be5f5c6 --- /dev/null +++ b/uartBackend/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/uartBackend/.idea/misc.xml b/uartBackend/.idea/misc.xml new file mode 100644 index 0000000..4b661a5 --- /dev/null +++ b/uartBackend/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/uartBackend/.idea/vcs.xml b/uartBackend/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/uartBackend/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/uartBackend/.idea/workspace.xml b/uartBackend/.idea/workspace.xml new file mode 100644 index 0000000..216043e --- /dev/null +++ b/uartBackend/.idea/workspace.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1658211017210 + + + 1658716154918 + + + 1659584068592 + + + + + + + + + \ No newline at end of file diff --git a/uartBackend/README.md b/uartBackend/README.md new file mode 100644 index 0000000..9d07aa0 --- /dev/null +++ b/uartBackend/README.md @@ -0,0 +1 @@ +111 \ No newline at end of file diff --git a/uartBackend/pom.xml b/uartBackend/pom.xml new file mode 100644 index 0000000..4e0059d --- /dev/null +++ b/uartBackend/pom.xml @@ -0,0 +1,125 @@ + + + 4.0.0 + + spring-boot-starter-parent + org.springframework.boot + 2.4.5 + + com.topsail + uartBackend + 1.0.0-SNAPSHOT + uartBackend + Demo project for Spring Boot + + + + org.springframework.boot + spring-boot-starter-web + + + + + + org.springframework.boot + spring-boot-starter-jdbc + + + mysql + mysql-connector-java + runtime + + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 2.1.0 + + + + + + org.projectlombok + lombok + 1.18.16 + + + + com.baomidou + mybatis-plus-boot-starter + 3.3.2 + + + mybatis-plus-extension + com.baomidou + + + + + com.baomidou + mybatis-plus-generator + 3.3.0 + + + jsqlparser + com.github.jsqlparser + + + + + org.springframework.boot + spring-boot-starter-aop + + + + org.springframework.boot + spring-boot-starter-validation + + + + + + cn.hutool + hutool-all + 5.7.20 + + + + + + org.freemarker + freemarker + 2.3.30 + + + + com.github.pagehelper + pagehelper-spring-boot-starter + 1.3.0 + + + org.mybatis + mybatis + + + org.mybatis + mybatis-spring + + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + \ No newline at end of file diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/CodeGenerator.java b/uartBackend/src/main/java/com/topsail/uartBackend/CodeGenerator.java new file mode 100644 index 0000000..a7d03b6 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/CodeGenerator.java @@ -0,0 +1,163 @@ +package com.topsail.uartBackend; + +import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.generator.AutoGenerator; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.config.rules.FileType; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Scanner; + +/** + * 代码生成启动类 + */ +public class CodeGenerator { + + /** + *

+ * 读取控制台内容 + *

+ */ + public static String scanner(String tip) { + Scanner scanner = new Scanner(System.in); + StringBuilder help = new StringBuilder(); + help.append("请输入" + tip + ":"); + System.out.println(help.toString()); + if (scanner.hasNext()) { + String ipt = scanner.next(); + if (StringUtils.isNotEmpty(ipt)) { + return ipt; + } + } + throw new MybatisPlusException("请输入正确的" + tip + "!"); + } + + + + public static void main(String[] args) { + + + // 代码生成器 + AutoGenerator mpg = new AutoGenerator(); + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + String projectPath = System.getProperty("user.dir"); + //String projectPath="E:\\topsail_new_git\\test\\sxhy\\sxhyrl";//此处可以编写绝对路径直接到项目 + gc.setOutputDir(projectPath + "/src/main/java"); + gc.setAuthor("lj"); + gc.setOpen(false); //默认true ,是否打开输出目录 + //gc.setFileOverride(false); //默认false ,是否覆盖已生成文件 + gc.setMapperName("%sMapper"); + gc.setXmlName("%sMapper"); + gc.setServiceName("%sService"); + gc.setServiceImplName("%sServiceImpl"); + gc.setControllerName("%sController"); + //gc.setSwagger2(true); //实体属性 Swagger2 注解 + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = new DataSourceConfig(); + dsc.setUrl("jdbc:mysql://rm-2ze77qng1ddlfur9g4o.mysql.rds.aliyuncs.com:3306/bluetooth_uart?useUnicode=true&useSSL=false&characterEncoding=utf8"); + //dsc.setSchemaName("public"); + dsc.setDriverName("com.mysql.jdbc.Driver"); + dsc.setUsername("topsail"); + dsc.setPassword("Topsail2020"); + mpg.setDataSource(dsc); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setParent("com.topsail.uartBackend.uart"); + pc.setController("controller"); + pc.setEntity("entity"); + pc.setService("service"); + pc.setServiceImpl("service.Impl"); + pc.setMapper("mapper"); + mpg.setPackageInfo(pc); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + + // 如果模板引擎是 freemarker + String templatePath = "/templates/mapper.xml.ftl"; + // 如果模板引擎是 velocity + // String templatePath = "/templates/mapper.xml.vm"; + + // 自定义输出配置 + List focList = new ArrayList<>(); + // 自定义配置会被优先输出 + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!! + return projectPath + "/src/main/resources/mapper/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML; + } + }); + + cfg.setFileCreate(new IFileCreate() { + @Override + public boolean isCreate(ConfigBuilder configBuilder, FileType fileType, String filePath) { + // 判断自定义文件夹是否需要创建 + //checkDir("调用默认方法创建的目录,自定义目录用"); + //if (fileType == FileType.MAPPER ||FileType.ENTITY==fileType) { + File file = new File(filePath); + boolean exist = file.exists(); + if(exist){ + if (FileType.ENTITY==fileType) {//重新生成实体类 + // 已经生成 mapper,entity文件判断存在,返回true重新生成 + return new File(filePath).exists(); + }else { + return false;//其他存在的都不重复生成 + } + } + // 不存在的都生成 + return true; + } + }); + cfg.setFileOutConfigList(focList); + mpg.setCfg(cfg); + + // 配置模板 + TemplateConfig templateConfig = new TemplateConfig(); + //指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别 + // templateConfig.setEntity("templates/entity2.java"); + // templateConfig.setService(); + templateConfig.setController("/templates/controller"); + //templateConfig.setService("");//这样配置指的是不生成此文件 + templateConfig.setService("/templates/service"); + templateConfig.setServiceImpl("/templates/serviceImpl"); + templateConfig.setEntity("/templates/entity"); + templateConfig.setMapper("/templates/mapper"); + //templateConfig.setXml( "/templates/mapper.xml"); + templateConfig.setXml(null); + mpg.setTemplate(templateConfig); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setNaming(NamingStrategy.underline_to_camel); + strategy.setColumnNaming(NamingStrategy.underline_to_camel); + strategy.setEntityLombokModel(true); + strategy.setRestControllerStyle(true); + //strategy.setInclude(scanner("表名,多个英文逗号分割").split(",")); + strategy.setInclude(new String[]{"command_collection","command_type","device_command","device_config_detail","command_detail"}); + strategy.setControllerMappingHyphenStyle(true); + strategy.setTablePrefix(pc.getModuleName() + "_"); + mpg.setStrategy(strategy); + mpg.setTemplateEngine(new FreemarkerTemplateEngine()); + mpg.execute(); + } + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/UartBackendApplication.java b/uartBackend/src/main/java/com/topsail/uartBackend/UartBackendApplication.java new file mode 100644 index 0000000..4ed1200 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/UartBackendApplication.java @@ -0,0 +1,18 @@ +package com.topsail.uartBackend; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.PropertySource; + +/** + * <描述> + * + * @author lj + * @date 2022/07/19 14:15 + */ +@SpringBootApplication +public class UartBackendApplication { + public static void main(String[] args) { + SpringApplication.run(UartBackendApplication.class,args); + } +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/config/GlobalException.java b/uartBackend/src/main/java/com/topsail/uartBackend/config/GlobalException.java new file mode 100644 index 0000000..6f77f8b --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/config/GlobalException.java @@ -0,0 +1,51 @@ +package com.topsail.uartBackend.config; + +import com.topsail.uartBackend.core.CodeMsg; +import com.topsail.uartBackend.core.Result; +import org.springframework.dao.DuplicateKeyException; +import org.springframework.validation.BindException; +import org.springframework.validation.ObjectError; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.servlet.http.HttpServletRequest; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.text.ParseException; +import java.util.List; + +/** + * <描述> + * + * @author lj + * @date 2022/07/21 10:09 + */ +@ControllerAdvice +@ResponseBody +public class GlobalException { + + @ExceptionHandler(value = Exception.class)//拦截所有异常 + public Result exceptionHandler(HttpServletRequest request, Exception e){ + e.printStackTrace(); + if(e instanceof BindException) { + BindException ex = (BindException)e; + List errors = ex.getAllErrors();//绑定错误返回很多错误,是一个错误列表,只需要第一个错误 + ObjectError error = errors.get(0); + String msg = error.getDefaultMessage(); + return Result.error(CodeMsg.BIND_ERROR.fillArgs(msg));//给状态码填充参数 + }else if(e instanceof ParseException){ + return Result.error(CodeMsg.TIME_ERROR); + }else if(e instanceof DuplicateKeyException){ + return Result.error(CodeMsg.DUPLICATEKEY_ERROR); + }else if(e instanceof IllegalStateException){ + return Result.error(CodeMsg.TOKEN_INVALID); + }else { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + e.printStackTrace(pw); + return Result.error(new CodeMsg(500,sw.toString().substring(0,300)));//输出错误的堆栈信息 + } + + } +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/config/Interceptor.java b/uartBackend/src/main/java/com/topsail/uartBackend/config/Interceptor.java new file mode 100644 index 0000000..32b38ae --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/config/Interceptor.java @@ -0,0 +1,37 @@ +package com.topsail.uartBackend.config; + +import com.topsail.uartBackend.core.JwtUtil; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * <描述> + * + * @author lj + * @date 2022/07/20 9:47 + */ +public class Interceptor implements HandlerInterceptor { + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + if (!(request.getRequestURI().contains("/user/login"))){ + String token = request.getHeader("Authorization"); + JwtUtil.validateToken(token); + } + return true; + } + + @Override + public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { + HandlerInterceptor.super.postHandle(request, response, handler, modelAndView); + + } + + @Override + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { + HandlerInterceptor.super.afterCompletion(request, response, handler, ex); + + } +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/config/InterceptorConfig.java b/uartBackend/src/main/java/com/topsail/uartBackend/config/InterceptorConfig.java new file mode 100644 index 0000000..d98b4fb --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/config/InterceptorConfig.java @@ -0,0 +1,26 @@ +package com.topsail.uartBackend.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * <描述> + * + * @author lj + * @date 2022/07/20 10:09 + */ +@Configuration +public class InterceptorConfig implements WebMvcConfigurer { + @Bean + public Interceptor interceptor(){ + return new Interceptor(); + } + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(interceptor()) +// .addPathPatterns("/**") + .excludePathPatterns("/user/login","/user/logout"); + } +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/config/MybatisObjectHandler.java b/uartBackend/src/main/java/com/topsail/uartBackend/config/MybatisObjectHandler.java new file mode 100644 index 0000000..2b66900 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/config/MybatisObjectHandler.java @@ -0,0 +1,31 @@ +package com.topsail.uartBackend.config; + +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import org.apache.ibatis.reflection.MetaObject; + +import java.util.Date; + +/** + * <描述> + * + * @author lj + * @date 2022/07/20 9:40 + */ +public class MybatisObjectHandler implements MetaObjectHandler { + @Override + public void insertFill(MetaObject metaObject) { + if (metaObject.hasSetter("createTime")){ + setFieldValByName("createTime",new Date(),metaObject); + } + if (metaObject.hasSetter("updateTime")){ + setFieldValByName("updateTime",new Date(),metaObject); + } + } + + @Override + public void updateFill(MetaObject metaObject) { + if(metaObject.hasSetter("updateTime")){ + setFieldValByName("updateTime",new Date(),metaObject); + } + } +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/core/CodeMsg.java b/uartBackend/src/main/java/com/topsail/uartBackend/core/CodeMsg.java new file mode 100644 index 0000000..0a6f0a5 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/core/CodeMsg.java @@ -0,0 +1,90 @@ +package com.topsail.uartBackend.core; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * <描述> + * + * @author lj + * @date 2022/07/19 14:34 + */ +public class CodeMsg { + + private int code; + private String msg; + + //通用的错误码 + public static CodeMsg SUCCESS = new CodeMsg(0, "success"); + public static CodeMsg FAILED = new CodeMsg(502, "failed"); + public static CodeMsg TOKEN_EXPIRED = new CodeMsg(400, "token过期"); + public static CodeMsg TOKEN_INVALID = new CodeMsg(502, "token解析异常"); + public static CodeMsg USER_NOT_LOGGED_IN = new CodeMsg(402, "未登录,请登录!"); + public static CodeMsg SIGNATURE_ERROR = new CodeMsg(506, "签名失败"); + public static CodeMsg SERVER_ERROR = new CodeMsg(500, "服务端异常"); + public static CodeMsg FILE_ERROR = new CodeMsg(501, "文件不存在"); + public static CodeMsg FILE_EXIST = new CodeMsg(5012, "文件已存在"); + public static CodeMsg TIME_ERROR = new CodeMsg(502, "时间格式错误,应为 yyyy-MM-dd HH:mm:ss"); + public static CodeMsg DUPLICATEKEY_ERROR = new CodeMsg(502, "IMEI已注册"); + public static CodeMsg TIMEMISS_ERROR = new CodeMsg(503, "查询时间缺失,应为 yyyy-MM-dd HH:mm:ss"); + public static CodeMsg BIND_ERROR = new CodeMsg(504, "参数绑定异常"); + public static CodeMsg CONTROL_ERROR = new CodeMsg(505, "命令下发失败,请检查设备相关信息是否存在或正确以及参数输入是否正确"); + + private CodeMsg() { + } + + public CodeMsg(int code, String msg) { + this.code = code; + this.msg = msg; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + /** + * 返回带参数的错误码 + * @param args + * @return + */ + public CodeMsg fillArgs(Object... args) { + int code = this.code; + String message = String.format(this.msg, args); + return new CodeMsg(code, message); + } + + @Override + public String toString() { + return "CodeMsg [code=" + code + ", msg=" + msg + "]"; + } + + public static void main(String[] args) { + //String regex="^[+-@=](.*?)\\d$"; + //String regex="^[\\u4e00-\\u9fa5]{0,}(.*?)\\d$"; + String regex="(.*?)\\d+(\\.\\d+)?(.*?)\\d+(\\.\\d+)?"; + String regex2="[\\u4e00-\\u9fa5](.*?:)[\\u4e00-\\u9fa5]?";//匹配所有汉字 + String a="北一层:17*7.5\n东房:6.3*3"; + Pattern p = Pattern.compile(regex); + Matcher m = p.matcher(a); + List result=new ArrayList(); + while(m.find()) { + System.out.println(m.group()); + result.add(m.group()); + } + System.out.println(result.toString()); + } +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/core/JwtUtil.java b/uartBackend/src/main/java/com/topsail/uartBackend/core/JwtUtil.java new file mode 100644 index 0000000..fceb070 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/core/JwtUtil.java @@ -0,0 +1,55 @@ +package com.topsail.uartBackend.core; + +import cn.hutool.core.date.DateField; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.exceptions.ValidateException; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import cn.hutool.jwt.JWT; +import cn.hutool.jwt.JWTValidator; +import cn.hutool.jwt.signers.JWTSignerUtil; +import com.topsail.uartBackend.user.entity.User; + +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; + +/** + * <描述> + * + * @author lj + * @date 2022/07/19 14:45 + */ +public class JwtUtil { + private final static String TOKEN_KEY = "DJASNCSALKNASNNHAbvkslmm1161"; + + + public static String getToken(User user){ + DateTime newTime = DateTime.now().offsetNew(DateField.SECOND, 60 * 60 * 24); + Mapmap = new HashMap<>(); + map.put("user",user); + String token = JWT.create() + .addPayloads(map) + .setSigner(JWTSignerUtil.hs512(TOKEN_KEY.getBytes())) + .setExpiresAt(newTime) + .sign(); + return "Bearer "+token; + } + + public static User getUserFromToken(String token){ + return JSONUtil.toBean((JSONObject)JWT.of(token.split(" ")[1]).getPayloads().get("user"),User.class); + } + + public static void validateToken(String token){ + + try { + String newToken = token.split(" ")[1]; + JWTValidator.of(newToken) + .validateAlgorithm(JWTSignerUtil.hs512(TOKEN_KEY.getBytes())) + .validateDate(DateTime.now()); + }catch (ValidateException ex){ + throw new ValidateException("token异常!"); + } + } + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/core/Result.java b/uartBackend/src/main/java/com/topsail/uartBackend/core/Result.java new file mode 100644 index 0000000..b71940f --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/core/Result.java @@ -0,0 +1,91 @@ +package com.topsail.uartBackend.core; + +import com.github.pagehelper.PageInfo; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * <描述> + * + * @author lj + * @date 2022/07/19 14:38 + */ +public class Result { + private int code; + private String msg = "success"; + private T data; + + + /** + * 成功时候的调用 + * */ + public static Result success(T data){ + return new Result(CodeMsg.SUCCESS,data); + } + + /** + * 失败时候的调用 + * */ + public static Result error(CodeMsg codeMsg){ + return new Result(codeMsg); + } + + public static Map returnPageMap(List t){ + PageInfo pageInfo=new PageInfo(t); + int count=(int)pageInfo.getTotal(); + Map map=new HashMap<>(); + map.put("list", new ArrayList(pageInfo.getList())); + map.put("count",count); + return map; + } + + private Result(CodeMsg codeMsg) { + if(codeMsg != null) { + this.code = codeMsg.getCode(); + this.msg = codeMsg.getMsg(); + } + } + + private Result(CodeMsg codeMsg,T data){ + this.code = codeMsg.getCode(); + this.msg = codeMsg.getMsg(); + this.data = data; + } + + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + + @Override + public String toString() { + return "Result{" + + "code=" + code + + ", msg='" + msg + '\'' + + ", data=" + data + + '}'; + } +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/CommandCollectionController.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/CommandCollectionController.java new file mode 100644 index 0000000..eb9a600 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/CommandCollectionController.java @@ -0,0 +1,66 @@ + +package com.topsail.uartBackend.uart.controller; + + +import com.topsail.uartBackend.core.CodeMsg; +import com.topsail.uartBackend.uart.service.CommandCollectionService; +import com.topsail.uartBackend.uart.entity.CommandCollection; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; +import com.topsail.uartBackend.core.Result; + + + +/** +* +* Created by lj on '2022-08-01 14:14:15'. +*/ +@RestController +//@RequestMapping("/command-collection") +@RequestMapping("commandCollection") + +public class CommandCollectionController { + + @Autowired + private CommandCollectionService commandCollectionService; + + /** + * 新增 + */ + @PostMapping("/insertCommandCollection") + public Result insertCommandCollection( @RequestBody CommandCollection commandCollection){ + boolean rsp= commandCollectionService.save(commandCollection); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + /** + * 删除 + */ + @DeleteMapping("/deleteCommandCollection/{id}") + public Result deleteCommandCollection(@PathVariable Integer id){ + boolean rsp= commandCollectionService.removeById(id); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + /** + * 更新 + */ + @PutMapping("/updateCommandCollection") + public Result updateCommandCollection(@RequestBody CommandCollection commandCollection){ + boolean rsp= commandCollectionService.updateById(commandCollection); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + + + /** + * 分页查询 + */ + @GetMapping("/getCommandCollectionList") + + public Result pageList(CommandCollection commandCollection,@RequestParam(required = false,defaultValue = "1")Integer pageNo, @RequestParam(required = false,defaultValue = "10")Integer pageSize) { + + return Result.success(Result.returnPageMap(commandCollectionService.pageList(commandCollection,pageNo,pageSize))); + } + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/CommandDetailController.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/CommandDetailController.java new file mode 100644 index 0000000..f11a6a1 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/CommandDetailController.java @@ -0,0 +1,74 @@ + +package com.topsail.uartBackend.uart.controller; + + +import com.topsail.uartBackend.core.CodeMsg; +import com.topsail.uartBackend.uart.entity.DeviceCommand; +import com.topsail.uartBackend.uart.service.CommandDetailService; +import com.topsail.uartBackend.uart.entity.CommandDetail; +import com.topsail.uartBackend.uart.service.DeviceCommandService; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; +import com.topsail.uartBackend.core.Result; + +import javax.annotation.Resource; +import java.util.List; + + +/** +* +* Created by lj on '2022-08-01 14:14:15'. +*/ +@RestController +//@RequestMapping("/command-detail") +@RequestMapping("commandDetail") + +public class CommandDetailController { + + @Autowired + private CommandDetailService commandDetailService; + + @Resource + private DeviceCommandService deviceCommandService; + + /** + * 新增 + */ + @PostMapping("/insertCommandDetail") + public Result insertCommandDetail(@RequestBody DeviceCommand deviceCommand){ + deviceCommandService.insertList(deviceCommand); + return Result.success("成功"); + } + + /** + * 删除 + */ + @DeleteMapping("/deleteCommandDetail/{id}") + public Result deleteCommandDetail(@PathVariable Integer deviceDetailId){ + deviceCommandService.deleteByDevice(deviceDetailId); + + return Result.success("成功"); + } + + /** + * 更新 + */ + @PutMapping("/updateCommandDetail") + public Result updateCommandDetail(ListdeviceCommands){ + deviceCommandService.updateList(deviceCommands); + return Result.success("成功"); + } + + + + /** + * 分页查询 + */ + @GetMapping("/getCommandDetailList") + + public Result pageList(CommandDetail commandDetail,@RequestParam(required = false,defaultValue = "1")Integer pageNo, @RequestParam(required = false,defaultValue = "10")Integer pageSize) { + + return Result.success(Result.returnPageMap(commandDetailService.pageList(commandDetail,pageNo,pageSize))); + } + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/CommandTypeController.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/CommandTypeController.java new file mode 100644 index 0000000..8ca9223 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/CommandTypeController.java @@ -0,0 +1,72 @@ + +package com.topsail.uartBackend.uart.controller; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.topsail.uartBackend.core.CodeMsg; +import com.topsail.uartBackend.uart.service.CommandTypeService; +import com.topsail.uartBackend.uart.entity.CommandType; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; +import com.topsail.uartBackend.core.Result; + + + +/** +* +* Created by lj on '2022-08-01 14:14:15'. +*/ +@RestController +//@RequestMapping("/command-type") +@RequestMapping("commandType") + +public class CommandTypeController { + + @Autowired + private CommandTypeService commandTypeService; + + /** + * 新增 + */ + @PostMapping("/insertCommandType") + public Result insertCommandType( @RequestBody CommandType commandType){ + + CommandType commandType1 = commandTypeService.selectByTypeId(commandType.getTypeId()); + if (null!=commandType1){ + return Result.error(new CodeMsg(502,"类型ID重复!")); + } + boolean rsp= commandTypeService.save(commandType); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + /** + * 删除 + */ + @DeleteMapping("/deleteCommandType/{id}") + public Result deleteCommandType(@PathVariable Integer id){ + boolean rsp= commandTypeService.removeById(id); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + /** + * 更新 + */ + @PutMapping("/updateCommandType") + public Result updateCommandType(@RequestBody CommandType commandType){ + boolean rsp= commandTypeService.updateById(commandType); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + + + /** + * 分页查询 + */ + @GetMapping("/getCommandTypeList") + + public Result pageList(CommandType commandType,@RequestParam(required = false,defaultValue = "1")Integer pageNo, @RequestParam(required = false,defaultValue = "10")Integer pageSize) { + + return Result.success(Result.returnPageMap(commandTypeService.pageList(commandType,pageNo,pageSize))); + } + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/DeviceCommandController.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/DeviceCommandController.java new file mode 100644 index 0000000..ed78e44 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/DeviceCommandController.java @@ -0,0 +1,66 @@ + +package com.topsail.uartBackend.uart.controller; + + +import com.topsail.uartBackend.core.CodeMsg; +import com.topsail.uartBackend.uart.service.DeviceCommandService; +import com.topsail.uartBackend.uart.entity.DeviceCommand; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; +import com.topsail.uartBackend.core.Result; + + + +/** +* +* Created by lj on '2022-08-01 14:14:15'. +*/ +@RestController +//@RequestMapping("/device-command") +@RequestMapping("deviceCommand") + +public class DeviceCommandController { + + @Autowired + private DeviceCommandService deviceCommandService; + + /** + * 新增 + */ + @PostMapping("/insertDeviceCommand") + public Result insertDeviceCommand( @RequestBody DeviceCommand deviceCommand){ + boolean rsp= deviceCommandService.save(deviceCommand); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + /** + * 删除 + */ + @DeleteMapping("/deleteDeviceCommand/{id}") + public Result deleteDeviceCommand(@PathVariable Integer id){ + boolean rsp= deviceCommandService.removeById(id); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + /** + * 更新 + */ + @PutMapping("/updateDeviceCommand") + public Result updateDeviceCommand(@RequestBody DeviceCommand deviceCommand){ + boolean rsp= deviceCommandService.updateById(deviceCommand); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + + + /** + * 分页查询 + */ + @GetMapping("/getDeviceCommandList") + + public Result pageList(DeviceCommand deviceCommand,@RequestParam(required = false,defaultValue = "1")Integer pageNo, @RequestParam(required = false,defaultValue = "10")Integer pageSize) { + + return Result.success(Result.returnPageMap(deviceCommandService.pageList(deviceCommand,pageNo,pageSize))); + } + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/DeviceConfigDetailController.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/DeviceConfigDetailController.java new file mode 100644 index 0000000..2243915 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/controller/DeviceConfigDetailController.java @@ -0,0 +1,73 @@ + +package com.topsail.uartBackend.uart.controller; + + +import com.topsail.uartBackend.core.CodeMsg; +import com.topsail.uartBackend.uart.entity.DeviceCommand; +import com.topsail.uartBackend.uart.service.DeviceCommandService; +import com.topsail.uartBackend.uart.service.DeviceConfigDetailService; +import com.topsail.uartBackend.uart.entity.DeviceConfigDetail; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; +import com.topsail.uartBackend.core.Result; + +import javax.annotation.Resource; + + +/** +* +* Created by lj on '2022-08-01 14:14:15'. +*/ +@RestController +//@RequestMapping("/device-config-detail") +@RequestMapping("deviceConfigDetail") + +public class DeviceConfigDetailController { + + @Autowired + private DeviceConfigDetailService deviceConfigDetailService; + + @Resource + private DeviceCommandService deviceCommandService; + /** + * 新增 + */ + @PostMapping("/insertDeviceConfigDetail") + public Result insertDeviceConfigDetail( @RequestBody DeviceConfigDetail deviceConfigDetail){ + boolean rsp= deviceConfigDetailService.save(deviceConfigDetail); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + /** + * 删除 + */ + + @DeleteMapping("/deleteDeviceConfigDetail/{id}") + public Result deleteDeviceConfigDetail(@PathVariable Integer id){ + deviceCommandService.deleteByDevice(id); + boolean rsp= deviceConfigDetailService.removeById(id); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + /** + * 更新 + */ + @PutMapping("/updateDeviceConfigDetail") + public Result updateDeviceConfigDetail(@RequestBody DeviceConfigDetail deviceConfigDetail){ + boolean rsp= deviceConfigDetailService.updateById(deviceConfigDetail); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + + + /** + * 分页查询 + */ + @GetMapping("/getDeviceConfigDetailList") + + public Result pageList(DeviceConfigDetail deviceConfigDetail,@RequestParam(required = false,defaultValue = "1")Integer pageNo, @RequestParam(required = false,defaultValue = "10")Integer pageSize) { + + return Result.success(Result.returnPageMap(deviceConfigDetailService.pageList(deviceConfigDetail,pageNo,pageSize))); + } + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/CommandCollection.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/CommandCollection.java new file mode 100644 index 0000000..29c603e --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/CommandCollection.java @@ -0,0 +1,137 @@ +package com.topsail.uartBackend.uart.entity; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 指令集合表 + *

+ * + * @author lj + * @since 2022-08-01 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class CommandCollection implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id ; + + + /** + * 指令大类ID + */ + private Integer commandType ; + + + /** + * 大类名称 + */ + private String typeName ; + + + /** + * 指令名称 + */ + private String commandName ; + + + /** + * 具体指令(一般为四位) + */ + private String commandDetail ; + + + /** + * 指令参数格式 + */ + private String commandFormat ; + + + /** + * 指令示例 + */ + private String commandExample ; + + + /** + * 输入类型(btn(按钮),input(输入框),select(固定值选择)) + */ + private String inputType ; + + + /** + * 为固定值选择的时候,需要获取选择内容key,value形式 + */ + private String inputValue ; + + + /** + * 取值最小值 + */ + private String minValue ; + + + /** + * 取值最大值 + */ + private String maxValue ; + + + /** + * 取值单位 + */ + private String valueUnit ; + + + /** + * 取值范围描述(用于界面展示,文字不应过多) + */ + private String rangeDesc ; + + + /** + * 指令描述 + */ + private String commandDesc ; + + + /** + * 备注 + */ + private String commandMsg ; + + + /** + * 适用的设备描述 + */ + private String adaptDevice ; + + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(fill = FieldFill.INSERT) + private Date createTime ; + + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime ; + + + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/CommandDetail.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/CommandDetail.java new file mode 100644 index 0000000..45f7fc2 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/CommandDetail.java @@ -0,0 +1,175 @@ +package com.topsail.uartBackend.uart.entity; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * VIEW + *

+ * + * @author lj + * @since 2022-08-01 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class CommandDetail implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 指令ID + */ + private Integer commandId ; + + + /** + * 详细设备ID + */ + private Integer deviceDetailId ; + + + private Integer dcId ; + + + /** + * 指令大类ID + */ + private Integer commandType ; + + + /** + * 大类名称 + */ + private String typeName ; + + + /** + * 指令名称 + */ + private String commandName ; + + + /** + * 具体指令(一般为四位) + */ + private String commandDetail ; + + + /** + * 指令参数格式 + */ + private String commandFormat ; + + + /** + * 指令示例 + */ + private String commandExample ; + + + /** + * 输入类型(btn(按钮),input(输入框),select(固定值选择)) + */ + private String inputType ; + + + /** + * 为固定值选择的时候,需要获取选择内容key,value形式 + */ + private String inputValue ; + + + /** + * 取值最小值 + */ + private String minValue ; + + + /** + * 取值最大值 + */ + private String maxValue ; + + + /** + * 取值单位 + */ + private String valueUnit ; + + + /** + * 取值范围描述(用于界面展示,文字不应过多) + */ + private String rangeDesc ; + + + /** + * 指令描述 + */ + private String commandDesc ; + + + /** + * 备注 + */ + private String commandMsg ; + + + /** + * 适用的设备描述 + */ + private String adaptDevice ; + + + /** + * 该类型设备的详细名称 + */ + private String deviceName ; + + + /** + * 硬件版本号 + */ + private String hardVersion ; + + + /** + * 软件版本号 + */ + private String softVersion ; + + + /** + * 所属设备类型 + */ + private String deviceType ; + + + /** + * 是否为TOPOS 1(是),2(否) + */ + private String topOs ; + + + /** + * 通用蓝牙名称(蓝牙名称-前的内容) + */ + private String blueName ; + + + /** + * 蓝牙后数字位数 + */ + private Integer blueNumSize ; + + + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/CommandType.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/CommandType.java new file mode 100644 index 0000000..8180cd1 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/CommandType.java @@ -0,0 +1,49 @@ +package com.topsail.uartBackend.uart.entity; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 指令大类 + *

+ * + * @author lj + * @since 2022-08-01 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class CommandType implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id ; + + + /** + * 设备类型ID + */ + private Integer typeId ; + + + /** + * 设备类型名称 + */ + private String typeName ; + + + private String msg ; + + + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/DeviceCommand.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/DeviceCommand.java new file mode 100644 index 0000000..9ab15a4 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/DeviceCommand.java @@ -0,0 +1,49 @@ +package com.topsail.uartBackend.uart.entity; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import java.util.List; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 设备-指令 关联表 + *

+ * + * @author lj + * @since 2022-08-01 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class DeviceCommand implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id ; + + + /** + * 指令ID + */ + private Integer commandId ; + + + /** + * 详细设备ID + */ + private Integer deviceDetailId ; + + + private Listids; + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/DeviceConfigDetail.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/DeviceConfigDetail.java new file mode 100644 index 0000000..8ff4b66 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/entity/DeviceConfigDetail.java @@ -0,0 +1,89 @@ +package com.topsail.uartBackend.uart.entity; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 所有类型设备的详细配置表 + *

+ * + * @author lj + * @since 2022-08-01 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class DeviceConfigDetail implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id ; + + + /** + * 该类型设备的详细名称 + */ + private String deviceName ; + + + /** + * 硬件版本号 + */ + private String hardVersion ; + + + /** + * 软件版本号 + */ + private String softVersion ; + + + /** + * 所属设备类型 + */ + private String deviceType ; + + + /** + * 是否为TOPOS 1(是),2(否) + */ + private String topOs ; + + + /** + * 通用蓝牙名称(蓝牙名称-前的内容) + */ + private String blueName ; + + + /** + * 蓝牙后数字位数 + */ + private Integer blueNumSize ; + + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(fill = FieldFill.INSERT) + private Date createTime ; + + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime ; + + + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/CommandCollectionMapper.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/CommandCollectionMapper.java new file mode 100644 index 0000000..384b94c --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/CommandCollectionMapper.java @@ -0,0 +1,18 @@ +package com.topsail.uartBackend.uart.mapper; + +import com.topsail.uartBackend.uart.entity.CommandCollection; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 指令集合表 Mapper 接口 + *

+ * + * @author lj + * @since 2022-08-01 + */ +@Mapper +public interface CommandCollectionMapper extends BaseMapper { + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/CommandDetailMapper.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/CommandDetailMapper.java new file mode 100644 index 0000000..4c5624e --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/CommandDetailMapper.java @@ -0,0 +1,18 @@ +package com.topsail.uartBackend.uart.mapper; + +import com.topsail.uartBackend.uart.entity.CommandDetail; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * VIEW Mapper 接口 + *

+ * + * @author lj + * @since 2022-08-01 + */ +@Mapper +public interface CommandDetailMapper extends BaseMapper { + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/CommandTypeMapper.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/CommandTypeMapper.java new file mode 100644 index 0000000..e6147c1 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/CommandTypeMapper.java @@ -0,0 +1,20 @@ +package com.topsail.uartBackend.uart.mapper; + +import com.topsail.uartBackend.uart.entity.CommandType; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 指令大类 Mapper 接口 + *

+ * + * @author lj + * @since 2022-08-01 + */ +@Mapper +public interface CommandTypeMapper extends BaseMapper { + + CommandType selectByTypeId(@Param("typeId")Integer typeId); +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/DeviceCommandMapper.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/DeviceCommandMapper.java new file mode 100644 index 0000000..c05d41d --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/DeviceCommandMapper.java @@ -0,0 +1,20 @@ +package com.topsail.uartBackend.uart.mapper; + +import com.topsail.uartBackend.uart.entity.DeviceCommand; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 设备-指令 关联表 Mapper 接口 + *

+ * + * @author lj + * @since 2022-08-01 + */ +@Mapper +public interface DeviceCommandMapper extends BaseMapper { + + //删除某个设备类型时调用 + Boolean deleteByDevice(Integer deviceDetailId); +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/DeviceConfigDetailMapper.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/DeviceConfigDetailMapper.java new file mode 100644 index 0000000..ddd9416 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/mapper/DeviceConfigDetailMapper.java @@ -0,0 +1,18 @@ +package com.topsail.uartBackend.uart.mapper; + +import com.topsail.uartBackend.uart.entity.DeviceConfigDetail; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 所有类型设备的详细配置表 Mapper 接口 + *

+ * + * @author lj + * @since 2022-08-01 + */ +@Mapper +public interface DeviceConfigDetailMapper extends BaseMapper { + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/CommandCollectionService.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/CommandCollectionService.java new file mode 100644 index 0000000..b77f500 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/CommandCollectionService.java @@ -0,0 +1,21 @@ +package com.topsail.uartBackend.uart.service; + +import com.topsail.uartBackend.uart.entity.CommandCollection; +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + +/** + *

+ * 指令集合表 服务类 + *

+ * + * @author lj + * @since 2022-08-01 + */ +public interface CommandCollectionService extends IService { + +/** +*分页查询 +*/ +public List pageList(CommandCollection commandCollection,Integer pageNo, Integer pageSize); +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/CommandDetailService.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/CommandDetailService.java new file mode 100644 index 0000000..8b0467f --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/CommandDetailService.java @@ -0,0 +1,21 @@ +package com.topsail.uartBackend.uart.service; + +import com.topsail.uartBackend.uart.entity.CommandDetail; +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + +/** + *

+ * VIEW 服务类 + *

+ * + * @author lj + * @since 2022-08-01 + */ +public interface CommandDetailService extends IService { + +/** +*分页查询 +*/ +public List pageList(CommandDetail commandDetail,Integer pageNo, Integer pageSize); +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/CommandTypeService.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/CommandTypeService.java new file mode 100644 index 0000000..e267a40 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/CommandTypeService.java @@ -0,0 +1,23 @@ +package com.topsail.uartBackend.uart.service; + +import com.topsail.uartBackend.uart.entity.CommandType; +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + +/** + *

+ * 指令大类 服务类 + *

+ * + * @author lj + * @since 2022-08-01 + */ +public interface CommandTypeService extends IService { + +/** +*分页查询 +*/ +public List pageList(CommandType commandType,Integer pageNo, Integer pageSize); + + CommandType selectByTypeId(Integer typeId); +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/DeviceCommandService.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/DeviceCommandService.java new file mode 100644 index 0000000..e0b1664 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/DeviceCommandService.java @@ -0,0 +1,31 @@ +package com.topsail.uartBackend.uart.service; + +import com.topsail.uartBackend.uart.entity.DeviceCommand; +import com.baomidou.mybatisplus.extension.service.IService; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + *

+ * 设备-指令 关联表 服务类 + *

+ * + * @author lj + * @since 2022-08-01 + */ +public interface DeviceCommandService extends IService { + +/** +*分页查询 +*/ +public List pageList(DeviceCommand deviceCommand,Integer pageNo, Integer pageSize); + + Boolean deleteByDevice(Integer deviceDetailId); + + @Transactional + Boolean insertList(DeviceCommand deviceCommand); + + @Transactional + Boolean updateList(List deviceCommands); +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/DeviceConfigDetailService.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/DeviceConfigDetailService.java new file mode 100644 index 0000000..42621ed --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/DeviceConfigDetailService.java @@ -0,0 +1,21 @@ +package com.topsail.uartBackend.uart.service; + +import com.topsail.uartBackend.uart.entity.DeviceConfigDetail; +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + +/** + *

+ * 所有类型设备的详细配置表 服务类 + *

+ * + * @author lj + * @since 2022-08-01 + */ +public interface DeviceConfigDetailService extends IService { + +/** +*分页查询 +*/ +public List pageList(DeviceConfigDetail deviceConfigDetail,Integer pageNo, Integer pageSize); +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/CommandCollectionServiceImpl.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/CommandCollectionServiceImpl.java new file mode 100644 index 0000000..5ae43c3 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/CommandCollectionServiceImpl.java @@ -0,0 +1,42 @@ +package com.topsail.uartBackend.uart.service.Impl; + +import com.topsail.uartBackend.uart.entity.CommandCollection; +import com.topsail.uartBackend.uart.mapper.CommandCollectionMapper; +import com.topsail.uartBackend.uart.service.CommandCollectionService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; +import com.github.pagehelper.PageHelper; +import java.util.List; +import lombok.extern.slf4j.Slf4j; + +/** +*

+ * 指令集合表 服务实现类 + *

+* +* @author lj +* @since 2022-08-01 +*/ +@Service +@Slf4j +public class CommandCollectionServiceImpl extends ServiceImpl implements CommandCollectionService { + + + @Autowired + private CommandCollectionMapper commandCollectionMapper; + + /** + *分页查询 + */ + @Override + public List pageList(CommandCollection commandCollection,Integer pageNo, Integer pageSize) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.setEntity(commandCollection); + PageHelper.startPage(pageNo,pageSize); + List list=list(wrapper); + return list; + } +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/CommandDetailServiceImpl.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/CommandDetailServiceImpl.java new file mode 100644 index 0000000..5ebbffc --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/CommandDetailServiceImpl.java @@ -0,0 +1,42 @@ +package com.topsail.uartBackend.uart.service.Impl; + +import com.topsail.uartBackend.uart.entity.CommandDetail; +import com.topsail.uartBackend.uart.mapper.CommandDetailMapper; +import com.topsail.uartBackend.uart.service.CommandDetailService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; +import com.github.pagehelper.PageHelper; +import java.util.List; +import lombok.extern.slf4j.Slf4j; + +/** +*

+ * VIEW 服务实现类 + *

+* +* @author lj +* @since 2022-08-01 +*/ +@Service +@Slf4j +public class CommandDetailServiceImpl extends ServiceImpl implements CommandDetailService { + + + @Autowired + private CommandDetailMapper commandDetailMapper; + + /** + *分页查询 + */ + @Override + public List pageList(CommandDetail commandDetail,Integer pageNo, Integer pageSize) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.setEntity(commandDetail); + PageHelper.startPage(pageNo,pageSize); + List list=list(wrapper); + return list; + } +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/CommandTypeServiceImpl.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/CommandTypeServiceImpl.java new file mode 100644 index 0000000..8a473cc --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/CommandTypeServiceImpl.java @@ -0,0 +1,47 @@ +package com.topsail.uartBackend.uart.service.Impl; + +import com.topsail.uartBackend.uart.entity.CommandType; +import com.topsail.uartBackend.uart.mapper.CommandTypeMapper; +import com.topsail.uartBackend.uart.service.CommandTypeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; +import com.github.pagehelper.PageHelper; +import java.util.List; +import lombok.extern.slf4j.Slf4j; + +/** +*

+ * 指令大类 服务实现类 + *

+* +* @author lj +* @since 2022-08-01 +*/ +@Service +@Slf4j +public class CommandTypeServiceImpl extends ServiceImpl implements CommandTypeService { + + + @Autowired + private CommandTypeMapper commandTypeMapper; + + /** + *分页查询 + */ + @Override + public List pageList(CommandType commandType,Integer pageNo, Integer pageSize) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.setEntity(commandType); + PageHelper.startPage(pageNo,pageSize); + List list=list(wrapper); + return list; + } + + @Override + public CommandType selectByTypeId(Integer typeId){ + return this.commandTypeMapper.selectByTypeId(typeId); + } +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/DeviceCommandServiceImpl.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/DeviceCommandServiceImpl.java new file mode 100644 index 0000000..f3d2f44 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/DeviceCommandServiceImpl.java @@ -0,0 +1,83 @@ +package com.topsail.uartBackend.uart.service.Impl; + +import com.topsail.uartBackend.uart.entity.DeviceCommand; +import com.topsail.uartBackend.uart.mapper.DeviceCommandMapper; +import com.topsail.uartBackend.uart.service.DeviceCommandService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; +import com.github.pagehelper.PageHelper; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestBody; + +/** +*

+ * 设备-指令 关联表 服务实现类 + *

+* +* @author lj +* @since 2022-08-01 +*/ +@Transactional +@Service +@Slf4j +public class DeviceCommandServiceImpl extends ServiceImpl implements DeviceCommandService { + + + @Autowired + private DeviceCommandMapper deviceCommandMapper; + + /** + *分页查询 + */ + @Override + public List pageList(DeviceCommand deviceCommand,Integer pageNo, Integer pageSize) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.setEntity(deviceCommand); + PageHelper.startPage(pageNo,pageSize); + List list=list(wrapper); + return list; + } + + @Override + public Boolean deleteByDevice(Integer deviceDetailId){ + return this.deviceCommandMapper.deleteByDevice(deviceDetailId); + } + + + @Override + @Transactional + public Boolean insertList( DeviceCommand deviceCommand){ + DeviceCommand deviceCommand1 = new DeviceCommand(); + if (null!= deviceCommand.getDeviceDetailId()){ + deviceCommandMapper.deleteByDevice(deviceCommand.getDeviceDetailId()); + if (deviceCommand.getIds().size()!=0){ + deviceCommand.getIds().forEach(id->{ + deviceCommand1.setCommandId(id); + deviceCommand1.setDeviceDetailId(deviceCommand.getDeviceDetailId()); + deviceCommandMapper.insert(deviceCommand1); + }); + } + } + return true; + } + @Override + @Transactional + public Boolean updateList(List deviceCommands){ + + deviceCommands.forEach(deviceCommand -> { + deviceCommandMapper.deleteByDevice(deviceCommand.getDeviceDetailId()); + deviceCommandMapper.insert(deviceCommand); + }); + + return true; + } + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/DeviceConfigDetailServiceImpl.java b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/DeviceConfigDetailServiceImpl.java new file mode 100644 index 0000000..94efe57 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/uart/service/Impl/DeviceConfigDetailServiceImpl.java @@ -0,0 +1,42 @@ +package com.topsail.uartBackend.uart.service.Impl; + +import com.topsail.uartBackend.uart.entity.DeviceConfigDetail; +import com.topsail.uartBackend.uart.mapper.DeviceConfigDetailMapper; +import com.topsail.uartBackend.uart.service.DeviceConfigDetailService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; +import com.github.pagehelper.PageHelper; +import java.util.List; +import lombok.extern.slf4j.Slf4j; + +/** +*

+ * 所有类型设备的详细配置表 服务实现类 + *

+* +* @author lj +* @since 2022-08-01 +*/ +@Service +@Slf4j +public class DeviceConfigDetailServiceImpl extends ServiceImpl implements DeviceConfigDetailService { + + + @Autowired + private DeviceConfigDetailMapper deviceConfigDetailMapper; + + /** + *分页查询 + */ + @Override + public List pageList(DeviceConfigDetail deviceConfigDetail,Integer pageNo, Integer pageSize) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.setEntity(deviceConfigDetail); + PageHelper.startPage(pageNo,pageSize); + List list=list(wrapper); + return list; + } +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/user/controller/UserController.java b/uartBackend/src/main/java/com/topsail/uartBackend/user/controller/UserController.java new file mode 100644 index 0000000..f6c6f75 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/user/controller/UserController.java @@ -0,0 +1,106 @@ + +package com.topsail.uartBackend.user.controller; + + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.topsail.uartBackend.core.CodeMsg; +import com.topsail.uartBackend.core.JwtUtil; +import com.topsail.uartBackend.user.service.UserService; +import com.topsail.uartBackend.user.entity.User; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; +import com.topsail.uartBackend.core.Result; + +import java.util.HashMap; +import java.util.Map; + + +/** +* +* Created by pz on '2022-07-19 14:59:56'. +*/ +@RestController +//@RequestMapping("/user") +@RequestMapping("user") + +public class UserController { + + @Autowired + private UserService userService; + + /** + * 新增 + */ + @PostMapping("/insertUser") + public Result insertUser( @RequestBody User user){ + User newUser = new User(); + if (null != user.getId() ){ + newUser = userService.getOne(new QueryWrapper<>(user)); + + } + if (newUser == null){ + return Result.error(new CodeMsg(502,"用户重复!")); + } + boolean rsp= userService.save(user); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + /** + * 删除 + */ + @DeleteMapping("/deleteUser/{id}") + public Result deleteUser(@PathVariable Integer id){ + boolean rsp= userService.removeById(id); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + /** + * 更新 + */ + @PutMapping("/updateUser") + public Result updateUser(@RequestBody User user){ + boolean rsp= userService.updateById(user); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + + + /** + * 分页查询 + */ + @GetMapping("/getUserList") + + public Result pageList(User user,@RequestParam(required = false,defaultValue = "1")Integer pageNo, @RequestParam(required = false,defaultValue = "10")Integer pageSize) { + + return Result.success(Result.returnPageMap(userService.pageList(user,pageNo,pageSize))); + } + + /** + * 登录 + * */ + @PostMapping("/login") + public Result login(@RequestBody User user){ + User newUser = new User(); + if (null != user ){ + newUser = userService.getOne(new QueryWrapper<>(user)); + + }else { + return Result.error(new CodeMsg(502,"登录失败,请检查账号或密码!")); + } + + if (null == newUser){ + return Result.error(new CodeMsg(502,"登录失败,请检查账号或密码!")); + } + + String token = JwtUtil.getToken(user); + Map map = new HashMap<>(); + map.put("token",token); + map.put("user",newUser); + if (2 == newUser.getStatus()){ + return Result.error(new CodeMsg(502,"该账户暂停使用!")); + } + return Result.success(map); + } + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/user/entity/User.java b/uartBackend/src/main/java/com/topsail/uartBackend/user/entity/User.java new file mode 100644 index 0000000..d6d9aeb --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/user/entity/User.java @@ -0,0 +1,83 @@ +package com.topsail.uartBackend.user.entity; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 用户表 + *

+ * + * @author lj + * @since 2022-07-21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class User implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id ; + + + /** + * 用户名 + */ + private String userName ; + + + /** + * 别名 + */ + private String anotherName ; + + + /** + * 密码 + */ + private String password ; + + + /** + * 所属公司 + */ + private String company ; + + + /** + * 角色ID + */ + private Integer roleId ; + + + /** + * 账号状态(1:正常,2:暂停使用) + */ + private Integer status ; + + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(fill = FieldFill.INSERT) + private Date createTime ; + + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime ; + + + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/user/mapper/UserMapper.java b/uartBackend/src/main/java/com/topsail/uartBackend/user/mapper/UserMapper.java new file mode 100644 index 0000000..9e64dd0 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/user/mapper/UserMapper.java @@ -0,0 +1,18 @@ +package com.topsail.uartBackend.user.mapper; + +import com.topsail.uartBackend.user.entity.User; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 用户表 Mapper 接口 + *

+ * + * @author lj + * @since 2022-07-19 + */ +@Mapper +public interface UserMapper extends BaseMapper { + +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/user/service/Impl/UserServiceImpl.java b/uartBackend/src/main/java/com/topsail/uartBackend/user/service/Impl/UserServiceImpl.java new file mode 100644 index 0000000..25cf277 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/user/service/Impl/UserServiceImpl.java @@ -0,0 +1,42 @@ +package com.topsail.uartBackend.user.service.Impl; + +import com.topsail.uartBackend.user.entity.User; +import com.topsail.uartBackend.user.mapper.UserMapper; +import com.topsail.uartBackend.user.service.UserService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; +import com.github.pagehelper.PageHelper; +import java.util.List; +import lombok.extern.slf4j.Slf4j; + +/** +*

+ * 用户表 服务实现类 + *

+* +* @author lj +* @since 2022-07-19 +*/ +@Service +@Slf4j +public class UserServiceImpl extends ServiceImpl implements UserService { + + + @Autowired + private UserMapper userMapper; + + /** + *分页查询 + */ + @Override + public List pageList(User user,Integer pageNo, Integer pageSize) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.setEntity(user); + PageHelper.startPage(pageNo,pageSize); + List list=list(wrapper); + return list; + } +} diff --git a/uartBackend/src/main/java/com/topsail/uartBackend/user/service/UserService.java b/uartBackend/src/main/java/com/topsail/uartBackend/user/service/UserService.java new file mode 100644 index 0000000..f891362 --- /dev/null +++ b/uartBackend/src/main/java/com/topsail/uartBackend/user/service/UserService.java @@ -0,0 +1,21 @@ +package com.topsail.uartBackend.user.service; + +import com.topsail.uartBackend.user.entity.User; +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + +/** + *

+ * 用户表 服务类 + *

+ * + * @author lj + * @since 2022-07-19 + */ +public interface UserService extends IService { + +/** +*分页查询 +*/ +public List pageList(User user,Integer pageNo, Integer pageSize); +} diff --git a/uartBackend/src/main/resources/application-prod.properties b/uartBackend/src/main/resources/application-prod.properties new file mode 100644 index 0000000..4cebbb8 --- /dev/null +++ b/uartBackend/src/main/resources/application-prod.properties @@ -0,0 +1,5 @@ + +spring.datasource.url=jdbc:mysql://rm-2ze77qng1ddlfur9g4o.mysql.rds.aliyuncs.com:3306/bluetooth_uart?useUnicode=true&characterEncoding=UTF-8&useSSL=false +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.username=topsail +spring.datasource.password=Topsail2020 \ No newline at end of file diff --git a/uartBackend/src/main/resources/application.properties b/uartBackend/src/main/resources/application.properties new file mode 100644 index 0000000..82026ad --- /dev/null +++ b/uartBackend/src/main/resources/application.properties @@ -0,0 +1,19 @@ +server.port=7425 +spring.profiles.active=prod +spring.application.name=bluetooth-uart + +#mybatis-plus +mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl +mybatis-plus.global-config.db-config.update-strategy=not_empty +mybatis-plus.global-config.db-config.select-strategy=not_empty +mybatis-plus.mapper-locations=classpath:mapper/*.xml +mybatis-plus.configuration.call-setters-on-nulls=true + +#pagehelper + +pagehelper.helperDialect=mysql +pagehelper.reasonable=true +pagehelper.support-methods-arguments=true +pagehelper.params=count=countSql + +spring.jackson.time-zone=GMT+8 diff --git a/uartBackend/src/main/resources/mapper/CommandCollectionMapper.xml b/uartBackend/src/main/resources/mapper/CommandCollectionMapper.xml new file mode 100644 index 0000000..c59dc2b --- /dev/null +++ b/uartBackend/src/main/resources/mapper/CommandCollectionMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/uartBackend/src/main/resources/mapper/CommandDetailMapper.xml b/uartBackend/src/main/resources/mapper/CommandDetailMapper.xml new file mode 100644 index 0000000..c9dd73a --- /dev/null +++ b/uartBackend/src/main/resources/mapper/CommandDetailMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/uartBackend/src/main/resources/mapper/CommandTypeMapper.xml b/uartBackend/src/main/resources/mapper/CommandTypeMapper.xml new file mode 100644 index 0000000..77c1772 --- /dev/null +++ b/uartBackend/src/main/resources/mapper/CommandTypeMapper.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/uartBackend/src/main/resources/mapper/DeviceCommandMapper.xml b/uartBackend/src/main/resources/mapper/DeviceCommandMapper.xml new file mode 100644 index 0000000..149ea5e --- /dev/null +++ b/uartBackend/src/main/resources/mapper/DeviceCommandMapper.xml @@ -0,0 +1,9 @@ + + + + + + delete from device_command where device_detail_id = #{deviceDetailId} + + + diff --git a/uartBackend/src/main/resources/mapper/DeviceConfigDetailMapper.xml b/uartBackend/src/main/resources/mapper/DeviceConfigDetailMapper.xml new file mode 100644 index 0000000..4807edc --- /dev/null +++ b/uartBackend/src/main/resources/mapper/DeviceConfigDetailMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/uartBackend/src/main/resources/mapper/UserMapper.xml b/uartBackend/src/main/resources/mapper/UserMapper.xml new file mode 100644 index 0000000..fe87e7b --- /dev/null +++ b/uartBackend/src/main/resources/mapper/UserMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/uartBackend/src/main/resources/templates/controller.ftl b/uartBackend/src/main/resources/templates/controller.ftl new file mode 100644 index 0000000..22a4e0f --- /dev/null +++ b/uartBackend/src/main/resources/templates/controller.ftl @@ -0,0 +1,66 @@ + +package ${package.Controller}; + + +import com.topsail.uartBackend.core.CodeMsg; +import ${package.Service}.${table.serviceName}; +import ${package.Entity}.${entity}; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; +import com.topsail.uartBackend.core.Result; + + + +/** +* +* Created by pz on '${.now?string('yyyy-MM-dd HH:mm:ss')}'. +*/ +@RestController +//@RequestMapping("<#if package.ModuleName??>/${package.ModuleName}/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}") +@RequestMapping("${entity?uncap_first}") + +public class ${entity}Controller { + + @Autowired + private ${entity}Service ${entity?uncap_first}Service; + + /** + * 新增 + */ + @PostMapping("/insert${entity}") + public Result insert${entity}( @RequestBody ${entity} ${entity?uncap_first}){ + boolean rsp= ${entity?uncap_first}Service.save(${entity?uncap_first}); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + /** + * 删除 + */ + @DeleteMapping("/delete${entity}/{id}") + public Result delete${entity}(@PathVariable Integer id){ + boolean rsp= ${entity?uncap_first}Service.removeById(id); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + /** + * 更新 + */ + @PutMapping("/update${entity}") + public Result update${entity}(@RequestBody ${entity} ${entity?uncap_first}){ + boolean rsp= ${entity?uncap_first}Service.updateById(${entity?uncap_first}); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + + + /** + * 分页查询 + */ + @GetMapping("/get${entity}List") + + public Result pageList(${entity} ${entity?uncap_first},@RequestParam(required = false,defaultValue = "1")Integer pageNo, @RequestParam(required = false,defaultValue = "10")Integer pageSize) { + + return Result.success(Result.returnPageMap(${entity?uncap_first}Service.pageList(${entity?uncap_first},pageNo,pageSize))); + } + +} diff --git a/uartBackend/src/main/resources/templates/entity.ftl b/uartBackend/src/main/resources/templates/entity.ftl new file mode 100644 index 0000000..9d15051 --- /dev/null +++ b/uartBackend/src/main/resources/templates/entity.ftl @@ -0,0 +1,170 @@ +package ${package.Entity}; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.FieldFill; +<#list table.importPackages as pkg> +import ${pkg}; + +<#if swagger2> +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +<#if entityLombokModel> +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + + +/** + *

+ * ${table.comment!} + *

+ * + * @author ${author} + * @since ${date} + */ +<#if entityLombokModel> +@Data + <#if superEntityClass??> +@EqualsAndHashCode(callSuper = true) + <#else> +@EqualsAndHashCode(callSuper = false) + +@Accessors(chain = true) + +<#if table.convert> +@TableName("${table.name}") + +<#if swagger2> +@ApiModel(value="${entity}对象", description="${table.comment!}") + +<#if superEntityClass??> +public class ${entity} extends ${superEntityClass}<#if activeRecord><${entity}> { +<#elseif activeRecord> +public class ${entity} extends Model<${entity}> { +<#else> +public class ${entity} implements Serializable { + + +<#if entitySerialVersionUID> + private static final long serialVersionUID = 1L; + +<#-- ---------- BEGIN 字段循环遍历 ----------> +<#list table.fields as field> + <#if field.keyFlag> + <#assign keyPropertyName="${field.propertyName}"/> + + + <#if field.comment!?length gt 0> + <#if swagger2> + @ApiModelProperty(value = "${field.comment}") + <#else> + /** + * ${field.comment} + */ + + + <#if field.keyFlag> + <#-- 主键 --> + <#if field.keyIdentityFlag> + @TableId(value = "${field.name}", type = IdType.AUTO) + <#elseif idType??> + @TableId(value = "${field.name}", type = IdType.${idType}) + <#elseif field.convert> + @TableId("${field.name}") + + <#-- 普通字段 --> + <#elseif field.fill??> + <#-- ----- 存在字段填充设置 -----> + <#if field.convert> + @TableField(value = "${field.name}", fill = FieldFill.${field.fill}) + <#else> + @TableField(fill = FieldFill.${field.fill}) + + <#elseif field.convert> + @TableField("${field.name}") + +<#-- 乐观锁注解 --> + <#if (versionFieldName!"") == field.name> + @Version + +<#-- 逻辑删除注解 --> + <#if (logicDeleteFieldName!"") == field.name> + @TableLogic + +<#-- 时间类型处理--> + <#if (field.propertyType) == "LocalDateTime"> + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + <#if (field.propertyName) == "createTime"> + @TableField(fill = FieldFill.INSERT) + + <#if (field.propertyName) == "updateTime"> + @TableField(fill = FieldFill.INSERT_UPDATE) + + private Date ${field.propertyName} ; + <#else> + private ${field.propertyType} ${field.propertyName} ; + + + +<#------------ END 字段循环遍历 ----------> + +<#if !entityLombokModel> + <#list table.fields as field> + <#if field.propertyType == "boolean"> + <#assign getprefix="is"/> + <#else> + <#assign getprefix="get"/> + + public ${field.propertyType} ${getprefix}${field.capitalName}() { + return ${field.propertyName}; + } + + <#if entityBuilderModel> + public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) { + <#else> + public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) { + + this.${field.propertyName} = ${field.propertyName}; + <#if entityBuilderModel> + return this; + + } + + + +<#if entityColumnConstant> + <#list table.fields as field> + public static final String ${field.name?upper_case} = "${field.name}"; + + + +<#if activeRecord> + @Override + protected Serializable pkVal() { + <#if keyPropertyName??> + return this.${keyPropertyName}; + <#else> + return null; + + } + + +<#if !entityLombokModel> + @Override + public String toString() { + return "${entity}{" + + <#list table.fields as field> + <#if field_index==0> + "${field.propertyName}=" + ${field.propertyName} + + <#else> + ", ${field.propertyName}=" + ${field.propertyName} + + + + "}"; + } + +} diff --git a/uartBackend/src/main/resources/templates/mapper.ftl b/uartBackend/src/main/resources/templates/mapper.ftl new file mode 100644 index 0000000..eaed5e2 --- /dev/null +++ b/uartBackend/src/main/resources/templates/mapper.ftl @@ -0,0 +1,22 @@ +package ${package.Mapper}; + +import ${package.Entity}.${entity}; +import ${superMapperClassPackage}; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * ${table.comment!} Mapper 接口 + *

+ * + * @author ${author} + * @since ${date} + */ +<#if kotlin> +interface ${table.mapperName} : ${superMapperClass}<${entity}> +<#else> +@Mapper +public interface ${table.mapperName} extends ${superMapperClass}<${entity}> { + +} + diff --git a/uartBackend/src/main/resources/templates/service.ftl b/uartBackend/src/main/resources/templates/service.ftl new file mode 100644 index 0000000..94bbfa7 --- /dev/null +++ b/uartBackend/src/main/resources/templates/service.ftl @@ -0,0 +1,25 @@ +package ${package.Service}; + +import ${package.Entity}.${entity}; +import ${superServiceClassPackage}; +import java.util.List; + +/** + *

+ * ${table.comment!} 服务类 + *

+ * + * @author ${author} + * @since ${date} + */ +<#if kotlin> +interface ${table.serviceName} : ${superServiceClass}<${entity}> +<#else> +public interface ${table.serviceName} extends ${superServiceClass}<${entity}> { + +/** +*分页查询 +*/ +public List<${entity}> pageList(${entity} ${entity?uncap_first},Integer pageNo, Integer pageSize); +} + diff --git a/uartBackend/src/main/resources/templates/serviceImpl.ftl b/uartBackend/src/main/resources/templates/serviceImpl.ftl new file mode 100644 index 0000000..50fde8c --- /dev/null +++ b/uartBackend/src/main/resources/templates/serviceImpl.ftl @@ -0,0 +1,48 @@ +package ${package.ServiceImpl}; + +import ${package.Entity}.${entity}; +import ${package.Mapper}.${table.mapperName}; +import ${package.Service}.${table.serviceName}; +import ${superServiceImplClassPackage}; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; +import com.github.pagehelper.PageHelper; +import java.util.List; +import lombok.extern.slf4j.Slf4j; + +/** +*

+ * ${table.comment!} 服务实现类 + *

+* +* @author ${author} +* @since ${date} +*/ +@Service +<#if kotlin> +open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} { + +} +<#else> +@Slf4j +public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} { + + + @Autowired + private ${entity}Mapper ${entity?uncap_first}Mapper; + + /** + *分页查询 + */ + @Override + public List<${entity}> pageList(${entity} ${entity?uncap_first},Integer pageNo, Integer pageSize) { + QueryWrapper<${entity}> wrapper = new QueryWrapper<>(); + wrapper.setEntity(${entity?uncap_first}); + PageHelper.startPage(pageNo,pageSize); + List<${entity}> list=list(wrapper); + return list; + } +} + \ No newline at end of file diff --git a/uartBackend/target/classes/application-prod.properties b/uartBackend/target/classes/application-prod.properties new file mode 100644 index 0000000..4cebbb8 --- /dev/null +++ b/uartBackend/target/classes/application-prod.properties @@ -0,0 +1,5 @@ + +spring.datasource.url=jdbc:mysql://rm-2ze77qng1ddlfur9g4o.mysql.rds.aliyuncs.com:3306/bluetooth_uart?useUnicode=true&characterEncoding=UTF-8&useSSL=false +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.username=topsail +spring.datasource.password=Topsail2020 \ No newline at end of file diff --git a/uartBackend/target/classes/application.properties b/uartBackend/target/classes/application.properties new file mode 100644 index 0000000..82026ad --- /dev/null +++ b/uartBackend/target/classes/application.properties @@ -0,0 +1,19 @@ +server.port=7425 +spring.profiles.active=prod +spring.application.name=bluetooth-uart + +#mybatis-plus +mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl +mybatis-plus.global-config.db-config.update-strategy=not_empty +mybatis-plus.global-config.db-config.select-strategy=not_empty +mybatis-plus.mapper-locations=classpath:mapper/*.xml +mybatis-plus.configuration.call-setters-on-nulls=true + +#pagehelper + +pagehelper.helperDialect=mysql +pagehelper.reasonable=true +pagehelper.support-methods-arguments=true +pagehelper.params=count=countSql + +spring.jackson.time-zone=GMT+8 diff --git a/uartBackend/target/classes/com/topsail/uartBackend/CodeGenerator$1.class b/uartBackend/target/classes/com/topsail/uartBackend/CodeGenerator$1.class new file mode 100644 index 0000000..7569fd8 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/CodeGenerator$1.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/CodeGenerator$2.class b/uartBackend/target/classes/com/topsail/uartBackend/CodeGenerator$2.class new file mode 100644 index 0000000..f3465e7 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/CodeGenerator$2.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/CodeGenerator$3.class b/uartBackend/target/classes/com/topsail/uartBackend/CodeGenerator$3.class new file mode 100644 index 0000000..787ac98 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/CodeGenerator$3.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/CodeGenerator.class b/uartBackend/target/classes/com/topsail/uartBackend/CodeGenerator.class new file mode 100644 index 0000000..f00d169 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/CodeGenerator.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/UartBackendApplication.class b/uartBackend/target/classes/com/topsail/uartBackend/UartBackendApplication.class new file mode 100644 index 0000000..ada32bd Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/UartBackendApplication.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/config/GlobalException.class b/uartBackend/target/classes/com/topsail/uartBackend/config/GlobalException.class new file mode 100644 index 0000000..7c558e2 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/config/GlobalException.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/config/Interceptor.class b/uartBackend/target/classes/com/topsail/uartBackend/config/Interceptor.class new file mode 100644 index 0000000..2c7a5e1 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/config/Interceptor.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/config/InterceptorConfig.class b/uartBackend/target/classes/com/topsail/uartBackend/config/InterceptorConfig.class new file mode 100644 index 0000000..a8ca6d5 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/config/InterceptorConfig.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/config/MybatisObjectHandler.class b/uartBackend/target/classes/com/topsail/uartBackend/config/MybatisObjectHandler.class new file mode 100644 index 0000000..c19cab9 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/config/MybatisObjectHandler.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/core/CodeMsg.class b/uartBackend/target/classes/com/topsail/uartBackend/core/CodeMsg.class new file mode 100644 index 0000000..ba57502 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/core/CodeMsg.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/core/JwtUtil.class b/uartBackend/target/classes/com/topsail/uartBackend/core/JwtUtil.class new file mode 100644 index 0000000..408d95e Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/core/JwtUtil.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/core/Result.class b/uartBackend/target/classes/com/topsail/uartBackend/core/Result.class new file mode 100644 index 0000000..52d903e Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/core/Result.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/CommandCollectionController.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/CommandCollectionController.class new file mode 100644 index 0000000..963dd5d Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/CommandCollectionController.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/CommandDetailController.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/CommandDetailController.class new file mode 100644 index 0000000..a3fd11e Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/CommandDetailController.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/CommandTypeController.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/CommandTypeController.class new file mode 100644 index 0000000..f5bb384 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/CommandTypeController.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/DeviceCommandController.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/DeviceCommandController.class new file mode 100644 index 0000000..091b8e5 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/DeviceCommandController.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/DeviceConfigDetailController.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/DeviceConfigDetailController.class new file mode 100644 index 0000000..e1d47e1 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/controller/DeviceConfigDetailController.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/CommandCollection.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/CommandCollection.class new file mode 100644 index 0000000..28f27a1 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/CommandCollection.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/CommandDetail.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/CommandDetail.class new file mode 100644 index 0000000..f3c3a16 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/CommandDetail.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/CommandType.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/CommandType.class new file mode 100644 index 0000000..70c8e0b Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/CommandType.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/DeviceCommand.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/DeviceCommand.class new file mode 100644 index 0000000..389638c Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/DeviceCommand.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/DeviceConfigDetail.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/DeviceConfigDetail.class new file mode 100644 index 0000000..a26f7d6 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/entity/DeviceConfigDetail.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/CommandCollectionMapper.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/CommandCollectionMapper.class new file mode 100644 index 0000000..5f528a5 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/CommandCollectionMapper.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/CommandDetailMapper.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/CommandDetailMapper.class new file mode 100644 index 0000000..f9a7f30 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/CommandDetailMapper.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/CommandTypeMapper.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/CommandTypeMapper.class new file mode 100644 index 0000000..68e4dc3 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/CommandTypeMapper.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/DeviceCommandMapper.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/DeviceCommandMapper.class new file mode 100644 index 0000000..eb4477e Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/DeviceCommandMapper.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/DeviceConfigDetailMapper.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/DeviceConfigDetailMapper.class new file mode 100644 index 0000000..0301772 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/mapper/DeviceConfigDetailMapper.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/service/CommandCollectionService.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/CommandCollectionService.class new file mode 100644 index 0000000..2dca4ac Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/CommandCollectionService.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/service/CommandDetailService.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/CommandDetailService.class new file mode 100644 index 0000000..4047163 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/CommandDetailService.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/service/CommandTypeService.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/CommandTypeService.class new file mode 100644 index 0000000..ad3b7e4 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/CommandTypeService.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/service/DeviceCommandService.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/DeviceCommandService.class new file mode 100644 index 0000000..8488f38 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/DeviceCommandService.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/service/DeviceConfigDetailService.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/DeviceConfigDetailService.class new file mode 100644 index 0000000..75d51bb Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/DeviceConfigDetailService.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/CommandCollectionServiceImpl.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/CommandCollectionServiceImpl.class new file mode 100644 index 0000000..ae02a13 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/CommandCollectionServiceImpl.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/CommandDetailServiceImpl.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/CommandDetailServiceImpl.class new file mode 100644 index 0000000..c4347fd Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/CommandDetailServiceImpl.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/CommandTypeServiceImpl.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/CommandTypeServiceImpl.class new file mode 100644 index 0000000..f08dd14 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/CommandTypeServiceImpl.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/DeviceCommandServiceImpl.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/DeviceCommandServiceImpl.class new file mode 100644 index 0000000..446a246 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/DeviceCommandServiceImpl.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/DeviceConfigDetailServiceImpl.class b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/DeviceConfigDetailServiceImpl.class new file mode 100644 index 0000000..1c1c3ea Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/uart/service/Impl/DeviceConfigDetailServiceImpl.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/user/controller/UserController.class b/uartBackend/target/classes/com/topsail/uartBackend/user/controller/UserController.class new file mode 100644 index 0000000..cd4f734 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/user/controller/UserController.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/user/entity/User.class b/uartBackend/target/classes/com/topsail/uartBackend/user/entity/User.class new file mode 100644 index 0000000..b26e8b8 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/user/entity/User.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/user/mapper/UserMapper.class b/uartBackend/target/classes/com/topsail/uartBackend/user/mapper/UserMapper.class new file mode 100644 index 0000000..0f2f1c3 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/user/mapper/UserMapper.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/user/service/Impl/UserServiceImpl.class b/uartBackend/target/classes/com/topsail/uartBackend/user/service/Impl/UserServiceImpl.class new file mode 100644 index 0000000..589cc40 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/user/service/Impl/UserServiceImpl.class differ diff --git a/uartBackend/target/classes/com/topsail/uartBackend/user/service/UserService.class b/uartBackend/target/classes/com/topsail/uartBackend/user/service/UserService.class new file mode 100644 index 0000000..07d9c66 Binary files /dev/null and b/uartBackend/target/classes/com/topsail/uartBackend/user/service/UserService.class differ diff --git a/uartBackend/target/classes/mapper/CommandCollectionMapper.xml b/uartBackend/target/classes/mapper/CommandCollectionMapper.xml new file mode 100644 index 0000000..c59dc2b --- /dev/null +++ b/uartBackend/target/classes/mapper/CommandCollectionMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/uartBackend/target/classes/mapper/CommandDetailMapper.xml b/uartBackend/target/classes/mapper/CommandDetailMapper.xml new file mode 100644 index 0000000..c9dd73a --- /dev/null +++ b/uartBackend/target/classes/mapper/CommandDetailMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/uartBackend/target/classes/mapper/CommandTypeMapper.xml b/uartBackend/target/classes/mapper/CommandTypeMapper.xml new file mode 100644 index 0000000..77c1772 --- /dev/null +++ b/uartBackend/target/classes/mapper/CommandTypeMapper.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/uartBackend/target/classes/mapper/DeviceCommandMapper.xml b/uartBackend/target/classes/mapper/DeviceCommandMapper.xml new file mode 100644 index 0000000..149ea5e --- /dev/null +++ b/uartBackend/target/classes/mapper/DeviceCommandMapper.xml @@ -0,0 +1,9 @@ + + + + + + delete from device_command where device_detail_id = #{deviceDetailId} + + + diff --git a/uartBackend/target/classes/mapper/DeviceConfigDetailMapper.xml b/uartBackend/target/classes/mapper/DeviceConfigDetailMapper.xml new file mode 100644 index 0000000..4807edc --- /dev/null +++ b/uartBackend/target/classes/mapper/DeviceConfigDetailMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/uartBackend/target/classes/mapper/UserMapper.xml b/uartBackend/target/classes/mapper/UserMapper.xml new file mode 100644 index 0000000..fe87e7b --- /dev/null +++ b/uartBackend/target/classes/mapper/UserMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/uartBackend/target/classes/templates/controller.ftl b/uartBackend/target/classes/templates/controller.ftl new file mode 100644 index 0000000..22a4e0f --- /dev/null +++ b/uartBackend/target/classes/templates/controller.ftl @@ -0,0 +1,66 @@ + +package ${package.Controller}; + + +import com.topsail.uartBackend.core.CodeMsg; +import ${package.Service}.${table.serviceName}; +import ${package.Entity}.${entity}; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; +import com.topsail.uartBackend.core.Result; + + + +/** +* +* Created by pz on '${.now?string('yyyy-MM-dd HH:mm:ss')}'. +*/ +@RestController +//@RequestMapping("<#if package.ModuleName??>/${package.ModuleName}/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}") +@RequestMapping("${entity?uncap_first}") + +public class ${entity}Controller { + + @Autowired + private ${entity}Service ${entity?uncap_first}Service; + + /** + * 新增 + */ + @PostMapping("/insert${entity}") + public Result insert${entity}( @RequestBody ${entity} ${entity?uncap_first}){ + boolean rsp= ${entity?uncap_first}Service.save(${entity?uncap_first}); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + /** + * 删除 + */ + @DeleteMapping("/delete${entity}/{id}") + public Result delete${entity}(@PathVariable Integer id){ + boolean rsp= ${entity?uncap_first}Service.removeById(id); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + /** + * 更新 + */ + @PutMapping("/update${entity}") + public Result update${entity}(@RequestBody ${entity} ${entity?uncap_first}){ + boolean rsp= ${entity?uncap_first}Service.updateById(${entity?uncap_first}); + return rsp?Result.success("成功"):Result.error(new CodeMsg(502,"失败")); + } + + + + /** + * 分页查询 + */ + @GetMapping("/get${entity}List") + + public Result pageList(${entity} ${entity?uncap_first},@RequestParam(required = false,defaultValue = "1")Integer pageNo, @RequestParam(required = false,defaultValue = "10")Integer pageSize) { + + return Result.success(Result.returnPageMap(${entity?uncap_first}Service.pageList(${entity?uncap_first},pageNo,pageSize))); + } + +} diff --git a/uartBackend/target/classes/templates/entity.ftl b/uartBackend/target/classes/templates/entity.ftl new file mode 100644 index 0000000..9d15051 --- /dev/null +++ b/uartBackend/target/classes/templates/entity.ftl @@ -0,0 +1,170 @@ +package ${package.Entity}; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.FieldFill; +<#list table.importPackages as pkg> +import ${pkg}; + +<#if swagger2> +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +<#if entityLombokModel> +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + + +/** + *

+ * ${table.comment!} + *

+ * + * @author ${author} + * @since ${date} + */ +<#if entityLombokModel> +@Data + <#if superEntityClass??> +@EqualsAndHashCode(callSuper = true) + <#else> +@EqualsAndHashCode(callSuper = false) + +@Accessors(chain = true) + +<#if table.convert> +@TableName("${table.name}") + +<#if swagger2> +@ApiModel(value="${entity}对象", description="${table.comment!}") + +<#if superEntityClass??> +public class ${entity} extends ${superEntityClass}<#if activeRecord><${entity}> { +<#elseif activeRecord> +public class ${entity} extends Model<${entity}> { +<#else> +public class ${entity} implements Serializable { + + +<#if entitySerialVersionUID> + private static final long serialVersionUID = 1L; + +<#-- ---------- BEGIN 字段循环遍历 ----------> +<#list table.fields as field> + <#if field.keyFlag> + <#assign keyPropertyName="${field.propertyName}"/> + + + <#if field.comment!?length gt 0> + <#if swagger2> + @ApiModelProperty(value = "${field.comment}") + <#else> + /** + * ${field.comment} + */ + + + <#if field.keyFlag> + <#-- 主键 --> + <#if field.keyIdentityFlag> + @TableId(value = "${field.name}", type = IdType.AUTO) + <#elseif idType??> + @TableId(value = "${field.name}", type = IdType.${idType}) + <#elseif field.convert> + @TableId("${field.name}") + + <#-- 普通字段 --> + <#elseif field.fill??> + <#-- ----- 存在字段填充设置 -----> + <#if field.convert> + @TableField(value = "${field.name}", fill = FieldFill.${field.fill}) + <#else> + @TableField(fill = FieldFill.${field.fill}) + + <#elseif field.convert> + @TableField("${field.name}") + +<#-- 乐观锁注解 --> + <#if (versionFieldName!"") == field.name> + @Version + +<#-- 逻辑删除注解 --> + <#if (logicDeleteFieldName!"") == field.name> + @TableLogic + +<#-- 时间类型处理--> + <#if (field.propertyType) == "LocalDateTime"> + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + <#if (field.propertyName) == "createTime"> + @TableField(fill = FieldFill.INSERT) + + <#if (field.propertyName) == "updateTime"> + @TableField(fill = FieldFill.INSERT_UPDATE) + + private Date ${field.propertyName} ; + <#else> + private ${field.propertyType} ${field.propertyName} ; + + + +<#------------ END 字段循环遍历 ----------> + +<#if !entityLombokModel> + <#list table.fields as field> + <#if field.propertyType == "boolean"> + <#assign getprefix="is"/> + <#else> + <#assign getprefix="get"/> + + public ${field.propertyType} ${getprefix}${field.capitalName}() { + return ${field.propertyName}; + } + + <#if entityBuilderModel> + public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) { + <#else> + public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) { + + this.${field.propertyName} = ${field.propertyName}; + <#if entityBuilderModel> + return this; + + } + + + +<#if entityColumnConstant> + <#list table.fields as field> + public static final String ${field.name?upper_case} = "${field.name}"; + + + +<#if activeRecord> + @Override + protected Serializable pkVal() { + <#if keyPropertyName??> + return this.${keyPropertyName}; + <#else> + return null; + + } + + +<#if !entityLombokModel> + @Override + public String toString() { + return "${entity}{" + + <#list table.fields as field> + <#if field_index==0> + "${field.propertyName}=" + ${field.propertyName} + + <#else> + ", ${field.propertyName}=" + ${field.propertyName} + + + + "}"; + } + +} diff --git a/uartBackend/target/classes/templates/mapper.ftl b/uartBackend/target/classes/templates/mapper.ftl new file mode 100644 index 0000000..eaed5e2 --- /dev/null +++ b/uartBackend/target/classes/templates/mapper.ftl @@ -0,0 +1,22 @@ +package ${package.Mapper}; + +import ${package.Entity}.${entity}; +import ${superMapperClassPackage}; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * ${table.comment!} Mapper 接口 + *

+ * + * @author ${author} + * @since ${date} + */ +<#if kotlin> +interface ${table.mapperName} : ${superMapperClass}<${entity}> +<#else> +@Mapper +public interface ${table.mapperName} extends ${superMapperClass}<${entity}> { + +} + diff --git a/uartBackend/target/classes/templates/service.ftl b/uartBackend/target/classes/templates/service.ftl new file mode 100644 index 0000000..94bbfa7 --- /dev/null +++ b/uartBackend/target/classes/templates/service.ftl @@ -0,0 +1,25 @@ +package ${package.Service}; + +import ${package.Entity}.${entity}; +import ${superServiceClassPackage}; +import java.util.List; + +/** + *

+ * ${table.comment!} 服务类 + *

+ * + * @author ${author} + * @since ${date} + */ +<#if kotlin> +interface ${table.serviceName} : ${superServiceClass}<${entity}> +<#else> +public interface ${table.serviceName} extends ${superServiceClass}<${entity}> { + +/** +*分页查询 +*/ +public List<${entity}> pageList(${entity} ${entity?uncap_first},Integer pageNo, Integer pageSize); +} + diff --git a/uartBackend/target/classes/templates/serviceImpl.ftl b/uartBackend/target/classes/templates/serviceImpl.ftl new file mode 100644 index 0000000..50fde8c --- /dev/null +++ b/uartBackend/target/classes/templates/serviceImpl.ftl @@ -0,0 +1,48 @@ +package ${package.ServiceImpl}; + +import ${package.Entity}.${entity}; +import ${package.Mapper}.${table.mapperName}; +import ${package.Service}.${table.serviceName}; +import ${superServiceImplClassPackage}; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; +import com.github.pagehelper.PageHelper; +import java.util.List; +import lombok.extern.slf4j.Slf4j; + +/** +*

+ * ${table.comment!} 服务实现类 + *

+* +* @author ${author} +* @since ${date} +*/ +@Service +<#if kotlin> +open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} { + +} +<#else> +@Slf4j +public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} { + + + @Autowired + private ${entity}Mapper ${entity?uncap_first}Mapper; + + /** + *分页查询 + */ + @Override + public List<${entity}> pageList(${entity} ${entity?uncap_first},Integer pageNo, Integer pageSize) { + QueryWrapper<${entity}> wrapper = new QueryWrapper<>(); + wrapper.setEntity(${entity?uncap_first}); + PageHelper.startPage(pageNo,pageSize); + List<${entity}> list=list(wrapper); + return list; + } +} + \ No newline at end of file diff --git a/uartBackend/target/maven-archiver/pom.properties b/uartBackend/target/maven-archiver/pom.properties new file mode 100644 index 0000000..408682c --- /dev/null +++ b/uartBackend/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=uartBackend +groupId=com.topsail +version=1.0.0-SNAPSHOT diff --git a/uartBackend/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/uartBackend/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..a5c538e --- /dev/null +++ b/uartBackend/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,42 @@ +com\topsail\uartBackend\uart\service\Impl\CommandCollectionServiceImpl.class +com\topsail\uartBackend\config\GlobalException.class +com\topsail\uartBackend\uart\service\CommandTypeService.class +com\topsail\uartBackend\uart\entity\CommandCollection.class +com\topsail\uartBackend\uart\controller\DeviceConfigDetailController.class +com\topsail\uartBackend\user\controller\UserController.class +com\topsail\uartBackend\uart\service\Impl\DeviceConfigDetailServiceImpl.class +com\topsail\uartBackend\user\service\Impl\UserServiceImpl.class +com\topsail\uartBackend\uart\controller\DeviceCommandController.class +com\topsail\uartBackend\uart\mapper\CommandTypeMapper.class +com\topsail\uartBackend\uart\entity\CommandType.class +com\topsail\uartBackend\uart\service\CommandCollectionService.class +com\topsail\uartBackend\uart\controller\CommandCollectionController.class +com\topsail\uartBackend\core\JwtUtil.class +com\topsail\uartBackend\CodeGenerator$3.class +com\topsail\uartBackend\UartBackendApplication.class +com\topsail\uartBackend\uart\service\CommandDetailService.class +com\topsail\uartBackend\config\Interceptor.class +com\topsail\uartBackend\uart\entity\DeviceConfigDetail.class +com\topsail\uartBackend\user\service\UserService.class +com\topsail\uartBackend\CodeGenerator.class +com\topsail\uartBackend\config\MybatisObjectHandler.class +com\topsail\uartBackend\core\Result.class +com\topsail\uartBackend\uart\mapper\DeviceConfigDetailMapper.class +com\topsail\uartBackend\CodeGenerator$2.class +com\topsail\uartBackend\uart\entity\CommandDetail.class +com\topsail\uartBackend\config\InterceptorConfig.class +com\topsail\uartBackend\user\entity\User.class +com\topsail\uartBackend\uart\controller\CommandTypeController.class +com\topsail\uartBackend\uart\service\DeviceCommandService.class +com\topsail\uartBackend\uart\service\Impl\DeviceCommandServiceImpl.class +com\topsail\uartBackend\uart\entity\DeviceCommand.class +com\topsail\uartBackend\uart\controller\CommandDetailController.class +com\topsail\uartBackend\uart\mapper\CommandDetailMapper.class +com\topsail\uartBackend\uart\mapper\CommandCollectionMapper.class +com\topsail\uartBackend\uart\service\Impl\CommandDetailServiceImpl.class +com\topsail\uartBackend\uart\service\Impl\CommandTypeServiceImpl.class +com\topsail\uartBackend\uart\service\DeviceConfigDetailService.class +com\topsail\uartBackend\core\CodeMsg.class +com\topsail\uartBackend\uart\mapper\DeviceCommandMapper.class +com\topsail\uartBackend\user\mapper\UserMapper.class +com\topsail\uartBackend\CodeGenerator$1.class diff --git a/uartBackend/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/uartBackend/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..da31712 --- /dev/null +++ b/uartBackend/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,39 @@ +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\user\service\Impl\UserServiceImpl.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\core\Result.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\user\entity\User.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\controller\CommandTypeController.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\entity\DeviceCommand.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\controller\DeviceCommandController.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\service\CommandCollectionService.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\service\DeviceConfigDetailService.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\core\CodeMsg.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\mapper\CommandDetailMapper.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\config\InterceptorConfig.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\mapper\DeviceCommandMapper.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\mapper\CommandCollectionMapper.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\service\Impl\DeviceCommandServiceImpl.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\service\Impl\DeviceConfigDetailServiceImpl.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\config\Interceptor.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\service\DeviceCommandService.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\controller\CommandCollectionController.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\mapper\CommandTypeMapper.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\user\mapper\UserMapper.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\config\GlobalException.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\core\JwtUtil.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\controller\CommandDetailController.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\service\Impl\CommandDetailServiceImpl.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\entity\CommandCollection.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\service\Impl\CommandTypeServiceImpl.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\entity\DeviceConfigDetail.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\user\service\UserService.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\config\MybatisObjectHandler.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\controller\DeviceConfigDetailController.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\UartBackendApplication.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\mapper\DeviceConfigDetailMapper.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\CodeGenerator.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\service\CommandDetailService.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\service\Impl\CommandCollectionServiceImpl.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\service\CommandTypeService.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\entity\CommandType.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\uart\entity\CommandDetail.java +G:\bluetoothUart\bluetoothUart\uartBackend\src\main\java\com\topsail\uartBackend\user\controller\UserController.java diff --git a/uartBackend/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/uartBackend/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/uartBackend/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/uartBackend/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/uartBackend/target/uartBackend-1.0.0-SNAPSHOT.jar.original b/uartBackend/target/uartBackend-1.0.0-SNAPSHOT.jar.original new file mode 100644 index 0000000..df587b1 Binary files /dev/null and b/uartBackend/target/uartBackend-1.0.0-SNAPSHOT.jar.original differ diff --git a/uartBackend/uartBackend.iml b/uartBackend/uartBackend.iml new file mode 100644 index 0000000..78b2cc5 --- /dev/null +++ b/uartBackend/uartBackend.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/uartPage/read.txt b/uartPage/read.txt new file mode 100644 index 0000000..e69de29