From 29f9b6a6a13aa4500485734842593d3b7f84743f Mon Sep 17 00:00:00 2001 From: yh <1844516659@qq.com> Date: Tue, 19 Jul 2022 17:11:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A3=9E=E6=BB=B4=E5=87=BA=E8=A1=8C=E7=BD=91?= =?UTF-8?q?=E7=BA=A6=E8=BD=A62022-service-driver-user=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=92=8C=E5=90=AF=E5=8A=A8=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E8=AF=BB=E5=BA=93=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../internalcommon/dto/DriverUser.java | 37 ++++++++++++++ pom.xml | 1 + service-driver-user/.gitignore | 48 +++++++++++++++++++ service-driver-user/pom.xml | 36 ++++++++++++++ .../ServiceDriverUserApplication.java | 15 ++++++ .../controller/TestControler.java | 31 ++++++++++++ .../mapper/DriverUserMapper.java | 9 ++++ .../service/DriverUserService.java | 20 ++++++++ .../src/main/resources/application.yml | 14 ++++++ 项目端口预设.md | 8 ++++ 10 files changed, 219 insertions(+) create mode 100644 internal-common/src/main/java/com/mashibing/internalcommon/dto/DriverUser.java create mode 100644 service-driver-user/.gitignore create mode 100644 service-driver-user/pom.xml create mode 100644 service-driver-user/src/main/java/com/mashibing/servicedriveruser/ServiceDriverUserApplication.java create mode 100644 service-driver-user/src/main/java/com/mashibing/servicedriveruser/controller/TestControler.java create mode 100644 service-driver-user/src/main/java/com/mashibing/servicedriveruser/mapper/DriverUserMapper.java create mode 100644 service-driver-user/src/main/java/com/mashibing/servicedriveruser/service/DriverUserService.java create mode 100644 service-driver-user/src/main/resources/application.yml create mode 100644 项目端口预设.md diff --git a/internal-common/src/main/java/com/mashibing/internalcommon/dto/DriverUser.java b/internal-common/src/main/java/com/mashibing/internalcommon/dto/DriverUser.java new file mode 100644 index 0000000..1eae653 --- /dev/null +++ b/internal-common/src/main/java/com/mashibing/internalcommon/dto/DriverUser.java @@ -0,0 +1,37 @@ +package com.mashibing.internalcommon.dto; + +import lombok.Data; + +import java.util.Date; + +@Data +public class DriverUser { + + private Integer id; + private String address; + private String driverName; + private String driverPhone; + private Integer driverGender; + private Date driverBirthday; + private String driverNation; + private String driverContactAddress; + private String licenseId; + private Date getDriverLicenseDate; + private Date driverLicenseOn; + private Date driverLicenseOff; + private Integer taxiDriver; + private String certificateNo; + private String networkCarIssueOrganization; + private Date networkCarIssueDate; + private Date getNetworkCarProofDate; + private Date networkCarProofOn; + private Date networkCarProofOff; + private Date registerDate; + private Integer commercialType; + private String contractCompany; + private Date contractOn; + private Date contractOff; + private Integer state; + private Date gmtCreate; + private Date gmtModified; +} diff --git a/pom.xml b/pom.xml index 5f8ff95..dc0cf8d 100644 --- a/pom.xml +++ b/pom.xml @@ -29,6 +29,7 @@ service-passenger-user service-price service-map + service-driver-user diff --git a/service-driver-user/.gitignore b/service-driver-user/.gitignore new file mode 100644 index 0000000..bdd28b0 --- /dev/null +++ b/service-driver-user/.gitignore @@ -0,0 +1,48 @@ +# .gitignore + +### IntelliJ IDEA Project ### +.idea +*.iws +*.iml +*.ipr +/.idea +target +src/test/ +!**/src/test/**/target/ +#!**/src/main/**/target/ + +### Maven template +HELP.md +README.md +.mvn +mvnw +mvnw.cmd +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +timing.properties +#.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ diff --git a/service-driver-user/pom.xml b/service-driver-user/pom.xml new file mode 100644 index 0000000..ed9cb29 --- /dev/null +++ b/service-driver-user/pom.xml @@ -0,0 +1,36 @@ + + + + online-taxi-public + com.mashibing + 1.0-SNAPSHOT + + 4.0.0 + + service-driver-user + + + + org.springframework.boot + spring-boot-starter-web + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + com.baomidou + mybatis-plus-boot-starter + 3.4.1 + + + mysql + mysql-connector-java + + + + \ No newline at end of file diff --git a/service-driver-user/src/main/java/com/mashibing/servicedriveruser/ServiceDriverUserApplication.java b/service-driver-user/src/main/java/com/mashibing/servicedriveruser/ServiceDriverUserApplication.java new file mode 100644 index 0000000..73bcee9 --- /dev/null +++ b/service-driver-user/src/main/java/com/mashibing/servicedriveruser/ServiceDriverUserApplication.java @@ -0,0 +1,15 @@ +package com.mashibing.servicedriveruser; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@MapperScan("com.mashibing.servicedriveruser.mapper") +public class ServiceDriverUserApplication { + + public static void main(String[] args) { + SpringApplication.run(ServiceDriverUserApplication.class, args); + } + +} diff --git a/service-driver-user/src/main/java/com/mashibing/servicedriveruser/controller/TestControler.java b/service-driver-user/src/main/java/com/mashibing/servicedriveruser/controller/TestControler.java new file mode 100644 index 0000000..1035f02 --- /dev/null +++ b/service-driver-user/src/main/java/com/mashibing/servicedriveruser/controller/TestControler.java @@ -0,0 +1,31 @@ +package com.mashibing.servicedriveruser.controller; + +import com.mashibing.internalcommon.dto.DriverUser; +import com.mashibing.internalcommon.dto.ResponseResult; +import com.mashibing.servicedriveruser.service.DriverUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class TestControler { + + @Value("${spring.application.name}") + private String serviceName; + + @Autowired + private DriverUserService service; + + @GetMapping("/") + public String test() { + return serviceName; + } + + @GetMapping("/test_db") + public ResponseResult test_db() { + return service.testGetDriverUser(); + } + + +} diff --git a/service-driver-user/src/main/java/com/mashibing/servicedriveruser/mapper/DriverUserMapper.java b/service-driver-user/src/main/java/com/mashibing/servicedriveruser/mapper/DriverUserMapper.java new file mode 100644 index 0000000..8a7b467 --- /dev/null +++ b/service-driver-user/src/main/java/com/mashibing/servicedriveruser/mapper/DriverUserMapper.java @@ -0,0 +1,9 @@ +package com.mashibing.servicedriveruser.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mashibing.internalcommon.dto.DriverUser; +import org.springframework.stereotype.Repository; + +@Repository +public interface DriverUserMapper extends BaseMapper { +} diff --git a/service-driver-user/src/main/java/com/mashibing/servicedriveruser/service/DriverUserService.java b/service-driver-user/src/main/java/com/mashibing/servicedriveruser/service/DriverUserService.java new file mode 100644 index 0000000..22cfaa0 --- /dev/null +++ b/service-driver-user/src/main/java/com/mashibing/servicedriveruser/service/DriverUserService.java @@ -0,0 +1,20 @@ +package com.mashibing.servicedriveruser.service; + +import com.mashibing.internalcommon.dto.DriverUser; +import com.mashibing.internalcommon.dto.ResponseResult; +import com.mashibing.servicedriveruser.mapper.DriverUserMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class DriverUserService { + + @Autowired + private DriverUserMapper driverUserMapper; + + public ResponseResult testGetDriverUser(){ + DriverUser driverUser = driverUserMapper.selectById(1); + return ResponseResult.success(driverUser); + } + +} diff --git a/service-driver-user/src/main/resources/application.yml b/service-driver-user/src/main/resources/application.yml new file mode 100644 index 0000000..c1e5ca6 --- /dev/null +++ b/service-driver-user/src/main/resources/application.yml @@ -0,0 +1,14 @@ +server: + port: 8086 +spring: + application: + name: service-driver-user +# cloud: +# nacos: +# discovery: +# server-addr: 127.0.0.1:8848 + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/service-driver-user?characterEncoding=utf-8&serverTimezone=GMT%2B8 + username: root + password: 123456 diff --git a/项目端口预设.md b/项目端口预设.md new file mode 100644 index 0000000..953a854 --- /dev/null +++ b/项目端口预设.md @@ -0,0 +1,8 @@ +| 服务名 | 端口号 | +| ------ | ------ | +| api-passenger|8081| +| service-verificationcode|8082| +| service-passenger-user|8083| +| service-price|8084| +|service-map|8085| +|service-driver-user|8086| \ No newline at end of file