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

main
topsun 2 years ago
parent 96aeeb53eb
commit 8feaf148ea

@ -2,36 +2,68 @@ package com.internal.dto;
import lombok.Data;
import java.time.LocalDate;
import java.util.Date;
@Data
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 driverName;
private String driverPhone;
private Integer driverGender;
private Date driverBrithday;
private LocalDate driverBrithday;
private String driverNation;
private String driverContactAddress;
private String licenseId;
private Date getDriverLicenseDate;
private Date driverLicenseOn;
private Date driverLicenseOff;
private LocalDate getDriverLicenseDate;
private LocalDate driverLicenseOn;
private LocalDate 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 LocalDate networkCarIssueDate;
private LocalDate getNetworkCarProofDate;
private LocalDate networkCarProofOn;
private LocalDate networkCarProofOff;
private LocalDate registerDate;
private Integer commercialType;
private String contractCompany;
private Date contractOn;
private Date contractOff;
private LocalDate contractOn;
private LocalDate contractOff;
private Integer state;
private Date gmtCreate;
private Date gmtModified;

@ -1,14 +1,24 @@
package com.taxi.servicedriveruser.controller;
import com.internal.dto.DriverUser;
import com.internal.dto.ResponseResult;
import com.taxi.servicedriveruser.service.DriverUserService;
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;
@RestController
public class DriverUserController {
@Autowired
private DriverUserService driverUserService;
@PostMapping("/users")
public ResponseResult addDriverUser(@RequestBody DriverUser driverUser){
return driverUserService.addDriverUser(driverUser);
}
}

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

@ -4,7 +4,7 @@ server:
spring:
datasource:
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
password: topsun123
# cloud:

@ -4,7 +4,7 @@ server:
spring:
datasource:
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
password: topsun123
# cloud:

Loading…
Cancel
Save