插入司机信息-service-driver-user完成

main
topsun 2 years ago
parent 96aeeb53eb
commit 8feaf148ea

@ -2,36 +2,68 @@ package com.internal.dto;
import lombok.Data; import lombok.Data;
import java.time.LocalDate;
import java.util.Date; import java.util.Date;
@Data @Data
public class DriverUser { public class DriverUser {
/**
private Integer id; {
"address":"地址",
"driverName":"司机姓名",
"driverPhone":"phone",
"driverGender":1,
"driverBrithday":"2020-01-02",
"driverNation":"01",
"driverContactAddress":"通信地址",
"licenseId":"机动车驾驶证号",
"getDriverLicenseDate":"2019-01-02",
"driverLicenseOn":"2019-01-02",
"driverLicenseOff":"2025-01-01",
"taxiDriver":1,
"certificateNo":"网络预约出租汽车驾驶员资格证号",
"networkCarIssueOrganization":"网络预约出租车驾驶员发证机构",
"networkCarIssueDate":"2020-01-02",
"getNetworkCarProofDate":"2020-01-02",
"networkCarProofOn":"2020-01-02",
"networkCarProofOff":"2025-01-02",
"registerDate":"2020-01-02",
"commercialType":1,
"contractCompany":"合约公司",
"contractOn":"2020-01-02",
"contractOff":"2020-01-02",
"state":1
}
**/
private Long id;
private String address; private String address;
private String driverName; private String driverName;
private String driverPhone; private String driverPhone;
private Integer driverGender; private Integer driverGender;
private Date driverBrithday; private LocalDate driverBrithday;
private String driverNation; private String driverNation;
private String driverContactAddress; private String driverContactAddress;
private String licenseId; private String licenseId;
private Date getDriverLicenseDate; private LocalDate getDriverLicenseDate;
private Date driverLicenseOn; private LocalDate driverLicenseOn;
private Date driverLicenseOff; private LocalDate driverLicenseOff;
private Integer taxiDriver; private Integer taxiDriver;
private String certificateNo; private String certificateNo;
private String networkCarIssueOrganization; private String networkCarIssueOrganization;
private Date networkCarIssueDate; private LocalDate networkCarIssueDate;
private Date getNetworkCarProofDate; private LocalDate getNetworkCarProofDate;
private Date networkCarProofOn; private LocalDate networkCarProofOn;
private Date networkCarProofOff; private LocalDate networkCarProofOff;
private Date registerDate; private LocalDate registerDate;
private Integer commercialType; private Integer commercialType;
private String contractCompany; private String contractCompany;
private Date contractOn; private LocalDate contractOn;
private Date contractOff; private LocalDate contractOff;
private Integer state; private Integer state;
private Date gmtCreate; private Date gmtCreate;
private Date gmtModified; private Date gmtModified;

@ -1,14 +1,24 @@
package com.taxi.servicedriveruser.controller; package com.taxi.servicedriveruser.controller;
import com.internal.dto.DriverUser;
import com.internal.dto.ResponseResult;
import com.taxi.servicedriveruser.service.DriverUserService; import com.taxi.servicedriveruser.service.DriverUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
public class DriverUserController { public class DriverUserController {
@Autowired @Autowired
private DriverUserService driverUserService; private DriverUserService driverUserService;
@PostMapping("/users")
public ResponseResult addDriverUser(@RequestBody DriverUser driverUser){
return driverUserService.addDriverUser(driverUser);
}
} }

@ -1,5 +1,7 @@
package com.taxi.servicedriveruser.service; package com.taxi.servicedriveruser.service;
import com.internal.dto.DriverUser;
import com.internal.dto.ResponseResult;
import com.taxi.servicedriveruser.mapper.DriverUserMapper; import com.taxi.servicedriveruser.mapper.DriverUserMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -10,5 +12,10 @@ public class DriverUserService {
@Autowired @Autowired
private DriverUserMapper driverUserMapper; private DriverUserMapper driverUserMapper;
public ResponseResult addDriverUser(DriverUser driverUser){
driverUserMapper.insert(driverUser);
return ResponseResult.success();
}
} }

@ -4,7 +4,7 @@ server:
spring: spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/service-price?characterEncoding=utf-8&serverTimezone=GMT%2B8 url: jdbc:mysql://localhost:3306/service-driver-user?characterEncoding=utf-8&serverTimezone=GMT%2B8
username: root username: root
password: topsun123 password: topsun123
# cloud: # cloud:

@ -4,7 +4,7 @@ server:
spring: spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/service-price?characterEncoding=utf-8&serverTimezone=GMT%2B8 url: jdbc:mysql://localhost:3306/service-driver-user?characterEncoding=utf-8&serverTimezone=GMT%2B8
username: root username: root
password: topsun123 password: topsun123
# cloud: # cloud:

Loading…
Cancel
Save