From 107f28a7a67294776327963b112cc2850eb3b394 Mon Sep 17 00:00:00 2001 From: liyongxiang Date: Tue, 4 Mar 2025 17:38:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4demo=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/pom.xml | 140 ++++++++++++++++++ .../com/example/demo/DemoApplication.java | 15 ++ .../example/demo/constant/EleConstant.java | 120 +++++++++++++++ .../example/demo/constant/StaConstant.java | 13 ++ .../demos/web/controller/BasicController.java | 78 ++++++++++ .../controller/PathVariableController.java | 44 ++++++ .../demo/mapper/ElectricityBillMapper.java | 14 ++ .../com/example/demo/model/DataAndView.java | 31 ++++ .../example/demo/model/ElectricityBill.java | 32 ++++ .../com/example/demo/model/ElectricityVo.java | 10 ++ .../java/com/example/demo/model/Response.java | 14 ++ .../com/example/demo/model/TypeAndQuery.java | 31 ++++ .../java/com/example/demo/model/User.java | 43 ++++++ .../example/demo/service/BasicService.java | 13 ++ .../demo/service/impl/BasicServiceImpl.java | 99 +++++++++++++ .../src/main/resources/application.properties | 24 +++ .../mapper/ElectricityBillMapper.xml | 8 + demo/src/main/resources/static/index.html | 6 + .../example/demo/DemoApplicationTests.java | 13 ++ 19 files changed, 748 insertions(+) create mode 100644 demo/pom.xml create mode 100644 demo/src/main/java/com/example/demo/DemoApplication.java create mode 100644 demo/src/main/java/com/example/demo/constant/EleConstant.java create mode 100644 demo/src/main/java/com/example/demo/constant/StaConstant.java create mode 100644 demo/src/main/java/com/example/demo/demos/web/controller/BasicController.java create mode 100644 demo/src/main/java/com/example/demo/demos/web/controller/PathVariableController.java create mode 100644 demo/src/main/java/com/example/demo/mapper/ElectricityBillMapper.java create mode 100644 demo/src/main/java/com/example/demo/model/DataAndView.java create mode 100644 demo/src/main/java/com/example/demo/model/ElectricityBill.java create mode 100644 demo/src/main/java/com/example/demo/model/ElectricityVo.java create mode 100644 demo/src/main/java/com/example/demo/model/Response.java create mode 100644 demo/src/main/java/com/example/demo/model/TypeAndQuery.java create mode 100644 demo/src/main/java/com/example/demo/model/User.java create mode 100644 demo/src/main/java/com/example/demo/service/BasicService.java create mode 100644 demo/src/main/java/com/example/demo/service/impl/BasicServiceImpl.java create mode 100644 demo/src/main/resources/application.properties create mode 100644 demo/src/main/resources/mapper/ElectricityBillMapper.xml create mode 100644 demo/src/main/resources/static/index.html create mode 100644 demo/src/test/java/com/example/demo/DemoApplicationTests.java diff --git a/demo/pom.xml b/demo/pom.xml new file mode 100644 index 0000000..db4a593 --- /dev/null +++ b/demo/pom.xml @@ -0,0 +1,140 @@ + + + 4.0.0 + com.example + demo + 0.0.1-SNAPSHOT + demo + demo + + 1.8 + UTF-8 + UTF-8 + 2.6.13 + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + com.alibaba + fastjson + 1.2.78 + + + + + org.projectlombok + lombok + 1.18.14 + provided + + + + org.slf4j + slf4j-log4j12 + 1.7.25 + + + + + + org.springframework.boot + spring-boot-starter-jdbc + + + + mysql + mysql-connector-java + 8.0.23 + + + + com.baomidou + mybatis-plus-boot-starter + 3.5.7 + + + + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + + + + repackage + + repackage + + + + + + + + + src/main/java + + **/*.properties + **/*.xml + + false + + + src/main/resources + + **/*.properties + **/*.xml + + false + + + + + diff --git a/demo/src/main/java/com/example/demo/DemoApplication.java b/demo/src/main/java/com/example/demo/DemoApplication.java new file mode 100644 index 0000000..a85ba8b --- /dev/null +++ b/demo/src/main/java/com/example/demo/DemoApplication.java @@ -0,0 +1,15 @@ +package com.example.demo; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@MapperScan(value = "com.example.demo.mapper") +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + +} diff --git a/demo/src/main/java/com/example/demo/constant/EleConstant.java b/demo/src/main/java/com/example/demo/constant/EleConstant.java new file mode 100644 index 0000000..bd0eeef --- /dev/null +++ b/demo/src/main/java/com/example/demo/constant/EleConstant.java @@ -0,0 +1,120 @@ +package com.example.demo.constant; + +import java.util.Arrays; +import java.util.List; + + +public class EleConstant { + + /* + 电费 + */ + public static final String ELECTRICITY = "电费"; + /* + 曲线图集合 + */ + public static final List lineList = Arrays.asList("折线","趋势分析","趋势图","曲线"); + /* + 柱状图集合 + */ + public static final List barList = Arrays.asList("柱状","柱型","柱形"); + /* + 扇形图集合 + */ + public static final List pieList = Arrays.asList("饼图","扇形","扇型"); + + /* + 表格集合 + */ + public static final List bgList = Arrays.asList("excel","图表","表格","xlsx","xls"); + /* + 电量 + */ + public static final String QUANTITY_OF_ELECTRICITY = "电量"; + + /* + 电量数据标识 + */ + public static final int QUANTITY_OF_ELECTRICITY_SYMBOL = 1; + + /* + 电费数据标识 + */ + public static final int ELECTRICITY_SYMBOL = 2; + + /* + 数据展示类型-折线图 + */ + public static final String LINE_TYPE_ZX = "ZX"; + + /* + 数据展示类型-柱状图 + */ + public static final String LINE_TYPE_ZZ = "ZZ"; + /* + 数据展示类型-扇形图 + */ + public static final String LINE_TYPE_SX = "SX"; + /* + 数据展示类型-表格 + */ + public static final String LINE_TYPE_BG = "BG"; + /* + 折线图 + */ + public static final String LINE_CHART_ZX = "折线"; + /* + 折线图 + */ + public static final String LINE_CHART_QXFX = "趋势分析"; + /* + 折线图 + */ + public static final String LINE_CHART_QXT = "趋势图"; + /* + 折线图 + */ + public static final String LINE_CHART_QX = "曲线"; + /* + 柱状图 + */ + public static final String BAR_CHART_ZZ = "柱状"; + /* + 柱状图 + */ + public static final String BAR_CHART_ZX1 = "柱型"; + /* + 柱状图 + */ + public static final String BAR_CHART_ZX2 = "柱形"; + + /* + 扇形图 + */ + public static final String PIE_CHART_SX1 = "扇形"; + /* + 扇形图 + */ + public static final String PIE_CHART_SX2 = "扇型"; + + /* + 表格 + */ + public static final String EXCEL= "excel"; + /* +表格 + */ + public static final String EXCEL_TB = "图表"; + /* +表格 +*/ + public static final String EXCEL_BG = "表格"; + /* +表格 +*/ + public static final String EXCEL_XLS = "xls"; + /* +表格 +*/ + public static final String EXCEL_XLSX = "xlsx"; +} diff --git a/demo/src/main/java/com/example/demo/constant/StaConstant.java b/demo/src/main/java/com/example/demo/constant/StaConstant.java new file mode 100644 index 0000000..8aa5fc5 --- /dev/null +++ b/demo/src/main/java/com/example/demo/constant/StaConstant.java @@ -0,0 +1,13 @@ +package com.example.demo.constant; + + +public class StaConstant { + /* + 不支持的查询类型 + */ + public static final String UNSUPPORTED_QUERY_TYPE ="03"; + /* + 成功 + */ + public static final String SUCCESS ="00"; +} diff --git a/demo/src/main/java/com/example/demo/demos/web/controller/BasicController.java b/demo/src/main/java/com/example/demo/demos/web/controller/BasicController.java new file mode 100644 index 0000000..e8f6a7d --- /dev/null +++ b/demo/src/main/java/com/example/demo/demos/web/controller/BasicController.java @@ -0,0 +1,78 @@ +/* + * Copyright 2013-2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.demo.demos.web.controller; + +import com.alibaba.fastjson.JSON; +import com.example.demo.model.Response; +import com.example.demo.model.User; +import com.example.demo.service.BasicService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +/** + * @author theonefx + */ +@RestController +@Slf4j +public class BasicController { + @Autowired + BasicService basicService; + + // http://127.0.0.1:8080/hello?name=lisi + @PostMapping("/getElectricityInfo") + @ResponseBody + public Response getElectricityInfo(@RequestBody Map param) { + log.info("获取电费相关信息入参:{}", JSON.toJSONString(param)); + Response response = basicService.getElectricityInfo(param); + log.info("获取电费相关信息响应:{}", JSON.toJSONString(response)); + return response; + } + + // http://127.0.0.1:8080/user + @RequestMapping("/user") + @ResponseBody + public User user() { + User user = new User(); + user.setName("theonefx"); + user.setAge(666); + return user; + } + + // http://127.0.0.1:8080/save_user?name=newName&age=11 + @RequestMapping("/save_user") + @ResponseBody + public String saveUser(User u) { + return "user will save: name=" + u.getName() + ", age=" + u.getAge(); + } + + // http://127.0.0.1:8080/html + @RequestMapping("/html") + public String html(){ + return "index.html"; + } + + @ModelAttribute + public void parseUser(@RequestParam(name = "name", defaultValue = "unknown user") String name + , @RequestParam(name = "age", defaultValue = "12") Integer age, User user) { + user.setName("zhangsan"); + user.setAge(18); + } +} diff --git a/demo/src/main/java/com/example/demo/demos/web/controller/PathVariableController.java b/demo/src/main/java/com/example/demo/demos/web/controller/PathVariableController.java new file mode 100644 index 0000000..0240813 --- /dev/null +++ b/demo/src/main/java/com/example/demo/demos/web/controller/PathVariableController.java @@ -0,0 +1,44 @@ +/* + * Copyright 2013-2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.demo.demos.web.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * @author theonefx + */ +@Controller +public class PathVariableController { + + // http://127.0.0.1:8080/user/123/roles/222 + @RequestMapping(value = "/user/{userId}/roles/{roleId}", method = RequestMethod.GET) + @ResponseBody + public String getLogin(@PathVariable("userId") String userId, @PathVariable("roleId") String roleId) { + return "User Id : " + userId + " Role Id : " + roleId; + } + + // http://127.0.0.1:8080/javabeat/somewords + @RequestMapping(value = "/javabeat/{regexp1:[a-z-]+}", method = RequestMethod.GET) + @ResponseBody + public String getRegExp(@PathVariable("regexp1") String regexp1) { + return "URI Part : " + regexp1; + } +} diff --git a/demo/src/main/java/com/example/demo/mapper/ElectricityBillMapper.java b/demo/src/main/java/com/example/demo/mapper/ElectricityBillMapper.java new file mode 100644 index 0000000..68fcdc7 --- /dev/null +++ b/demo/src/main/java/com/example/demo/mapper/ElectricityBillMapper.java @@ -0,0 +1,14 @@ +package com.example.demo.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.example.demo.model.ElectricityBill; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Mapper +public interface ElectricityBillMapper extends BaseMapper { + + List queryElectricityByDate(); +} diff --git a/demo/src/main/java/com/example/demo/model/DataAndView.java b/demo/src/main/java/com/example/demo/model/DataAndView.java new file mode 100644 index 0000000..c7803e3 --- /dev/null +++ b/demo/src/main/java/com/example/demo/model/DataAndView.java @@ -0,0 +1,31 @@ +/* + * Copyright 2013-2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.demo.model; + +import lombok.Data; + +/** + * @author theonefx + */ +@Data +public class DataAndView { + + private String type; + + private Object data; + +} diff --git a/demo/src/main/java/com/example/demo/model/ElectricityBill.java b/demo/src/main/java/com/example/demo/model/ElectricityBill.java new file mode 100644 index 0000000..221b3ad --- /dev/null +++ b/demo/src/main/java/com/example/demo/model/ElectricityBill.java @@ -0,0 +1,32 @@ +package com.example.demo.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; + +@Data +@Component +public class ElectricityBill { + + @TableId + private String id; + private String province; + private String city; + private String district; + private String street; + private String electricityUserNumber; + private String electricityAddress; + private String electricityUserName; + private String electricityCategory; + private String electricityPriceType; + private BigDecimal implementElectricityPrices; + private String statementDate; + private String billingCycle; + private BigDecimal powerConsumption; + private BigDecimal electricityBill; + private String paymentStatus; + private BigDecimal totalElectricityConsumption; + private BigDecimal totalElectricityCost; +} diff --git a/demo/src/main/java/com/example/demo/model/ElectricityVo.java b/demo/src/main/java/com/example/demo/model/ElectricityVo.java new file mode 100644 index 0000000..92cb304 --- /dev/null +++ b/demo/src/main/java/com/example/demo/model/ElectricityVo.java @@ -0,0 +1,10 @@ +package com.example.demo.model; + +import lombok.Data; + +@Data +public class ElectricityVo { + private String startDate; + private String endDate; + private String eleNumber; +} diff --git a/demo/src/main/java/com/example/demo/model/Response.java b/demo/src/main/java/com/example/demo/model/Response.java new file mode 100644 index 0000000..a0d44a8 --- /dev/null +++ b/demo/src/main/java/com/example/demo/model/Response.java @@ -0,0 +1,14 @@ +package com.example.demo.model; + +import lombok.Data; + +@Data +public class Response { + + //响应状态码 + private String sta; + //响应消息 + private String message; + //响应body + private Object data; +} diff --git a/demo/src/main/java/com/example/demo/model/TypeAndQuery.java b/demo/src/main/java/com/example/demo/model/TypeAndQuery.java new file mode 100644 index 0000000..3215a29 --- /dev/null +++ b/demo/src/main/java/com/example/demo/model/TypeAndQuery.java @@ -0,0 +1,31 @@ +/* + * Copyright 2013-2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.demo.model; + +import lombok.Data; + +/** + * @author theonefx + */ +@Data +public class TypeAndQuery { + + private String type; + + private int querySymbol; + +} diff --git a/demo/src/main/java/com/example/demo/model/User.java b/demo/src/main/java/com/example/demo/model/User.java new file mode 100644 index 0000000..7690cf0 --- /dev/null +++ b/demo/src/main/java/com/example/demo/model/User.java @@ -0,0 +1,43 @@ +/* + * Copyright 2013-2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.demo.model; + +/** + * @author theonefx + */ +public class User { + + private String name; + + private Integer age; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } +} diff --git a/demo/src/main/java/com/example/demo/service/BasicService.java b/demo/src/main/java/com/example/demo/service/BasicService.java new file mode 100644 index 0000000..bd8ad10 --- /dev/null +++ b/demo/src/main/java/com/example/demo/service/BasicService.java @@ -0,0 +1,13 @@ +package com.example.demo.service; + +import com.example.demo.model.Response; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.Map; + + +public interface BasicService { + + Response getElectricityInfo(Map param); +} diff --git a/demo/src/main/java/com/example/demo/service/impl/BasicServiceImpl.java b/demo/src/main/java/com/example/demo/service/impl/BasicServiceImpl.java new file mode 100644 index 0000000..afea17d --- /dev/null +++ b/demo/src/main/java/com/example/demo/service/impl/BasicServiceImpl.java @@ -0,0 +1,99 @@ +package com.example.demo.service.impl; + +import com.example.demo.constant.EleConstant; +import com.example.demo.constant.StaConstant; +import com.example.demo.mapper.ElectricityBillMapper; +import com.example.demo.model.DataAndView; +import com.example.demo.model.ElectricityBill; +import com.example.demo.model.Response; +import com.example.demo.model.TypeAndQuery; +import com.example.demo.service.BasicService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +@Slf4j +@Service +public class BasicServiceImpl implements BasicService { + + @Autowired + ElectricityBillMapper electricityBillMapper; + + @Override + public Response getElectricityInfo(Map param) { + String keyWord = (String) param.get("kw"); + Response response = new Response(); + List bills = new ArrayList<>(); + TypeAndQuery typeAndQuery = new TypeAndQuery(); + String type =new String(); + Integer querySymbol = new Integer(0); + analysisKeyWord(keyWord,typeAndQuery); + if (0 == typeAndQuery.getQuerySymbol()){ + log.info("不支持的查询类型"); + response.setSta(StaConstant.UNSUPPORTED_QUERY_TYPE); + response.setData("暂时还不支持查询此类问题,您可以说查询电费或查询电量"); + return response; + } + DataAndView dataAndView =new DataAndView(); + dataAndView.setType(typeAndQuery.getType()); + if (1 == typeAndQuery.getQuerySymbol()){ + log.info("数据库查询电量!"); + response.setSta(StaConstant.UNSUPPORTED_QUERY_TYPE); + response.setData("电量查询暂未开放!"); + return response; + }else if (2 == typeAndQuery.getQuerySymbol()){ + log.info("数据库查询电费!"); + bills = electricityBillMapper.queryElectricityByDate(); + dataAndView.setData(bills); + response.setSta(StaConstant.SUCCESS); + response.setData(dataAndView); + }else { + log.info("暂时还没有此类查询!"); + response.setSta(StaConstant.UNSUPPORTED_QUERY_TYPE); + response.setData("暂时还不支持查询此类问题,您可以说查询电费或查询电量"); + return response; + } + return response; + } + + + private void analysisKeyWord(String keyWord,TypeAndQuery typeAndQuery){ + int querySymbol = 0; + String type = EleConstant.LINE_TYPE_BG; + typeAndQuery.setType(type); + typeAndQuery.setQuerySymbol(querySymbol); + if (keyWord.contains(EleConstant.ELECTRICITY)){ + querySymbol = EleConstant.ELECTRICITY_SYMBOL; + typeAndQuery.setQuerySymbol(querySymbol); + }else if (keyWord.contains(EleConstant.QUANTITY_OF_ELECTRICITY)){ + querySymbol = EleConstant.QUANTITY_OF_ELECTRICITY_SYMBOL; + typeAndQuery.setQuerySymbol(querySymbol); + } + for (String val:EleConstant.barList){ + if (keyWord.contains(val)){ + type = EleConstant.LINE_TYPE_ZZ; + typeAndQuery.setType(type); + return; + } + } + for (String val:EleConstant.lineList){ + if (keyWord.contains(val)){ + type = EleConstant.LINE_TYPE_ZX; + typeAndQuery.setType(type); + return; + } + } + for (String val:EleConstant.pieList){ + if (keyWord.contains(val)){ + type = EleConstant.LINE_TYPE_SX; + typeAndQuery.setType(type); + return; + } + } + } +} diff --git a/demo/src/main/resources/application.properties b/demo/src/main/resources/application.properties new file mode 100644 index 0000000..d284cb9 --- /dev/null +++ b/demo/src/main/resources/application.properties @@ -0,0 +1,24 @@ +# 应用服务 WEB 访问端口 +server.port=9090 + +# DataSource configuration using HikariCP (default connection pool in Spring Boot) +spring.datasource.url=jdbc:mysql://120.78.126.4:5455/rag_flow?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true +spring.datasource.username=root +spring.datasource.password=infini_rag_flow +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +# HikariCP specific properties (optional) +spring.datasource.hikari.maximum-pool-size=10 +spring.datasource.hikari.minimum-idle=5 +spring.datasource.hikari.idle-timeout=300000 +spring.datasource.hikari.max-lifetime=1800000 +spring.datasource.hikari.connection-timeout=30000 + +mybatis-plus: +#mapper配置文件 +mapper-locations: classpath:mapper/*.xml +type-aliases-package: com.example.demo.model #需要配置成你当前包下的实体类路径 +configuration: +#开启驼峰命名 +map-underscore-to-camel-case: true +log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + diff --git a/demo/src/main/resources/mapper/ElectricityBillMapper.xml b/demo/src/main/resources/mapper/ElectricityBillMapper.xml new file mode 100644 index 0000000..080e64b --- /dev/null +++ b/demo/src/main/resources/mapper/ElectricityBillMapper.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/demo/src/main/resources/static/index.html b/demo/src/main/resources/static/index.html new file mode 100644 index 0000000..e2d94a2 --- /dev/null +++ b/demo/src/main/resources/static/index.html @@ -0,0 +1,6 @@ + + +

hello word!!!

+

this is a html page

+ + \ No newline at end of file diff --git a/demo/src/test/java/com/example/demo/DemoApplicationTests.java b/demo/src/test/java/com/example/demo/DemoApplicationTests.java new file mode 100644 index 0000000..eaa9969 --- /dev/null +++ b/demo/src/test/java/com/example/demo/DemoApplicationTests.java @@ -0,0 +1,13 @@ +package com.example.demo; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class DemoApplicationTests { + + @Test + void contextLoads() { + } + +}