|
|
@ -3,8 +3,10 @@ package com.mashibing.apiboss.controller;
|
|
|
|
import com.mashibing.apiboss.service.UserService;
|
|
|
|
import com.mashibing.apiboss.service.UserService;
|
|
|
|
import com.mashibing.internalcommon.dto.DriverUser;
|
|
|
|
import com.mashibing.internalcommon.dto.DriverUser;
|
|
|
|
import com.mashibing.internalcommon.dto.ResponseResult;
|
|
|
|
import com.mashibing.internalcommon.dto.ResponseResult;
|
|
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
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.PostMapping;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
@ -15,9 +17,28 @@ public class DriverUserController {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private UserService service;
|
|
|
|
private UserService service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 新增 司机 用户信息
|
|
|
|
|
|
|
|
* @param driverUser
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
@PostMapping("/driver-user")
|
|
|
|
@PostMapping("/driver-user")
|
|
|
|
public ResponseResult saveDriverUser(@RequestBody DriverUser driverUser){
|
|
|
|
public ResponseResult saveDriverUser(@RequestBody DriverUser driverUser){
|
|
|
|
|
|
|
|
// 接口扩展
|
|
|
|
|
|
|
|
if(driverUser.getId() != null && driverUser.getId() > 0){
|
|
|
|
|
|
|
|
return service.updateDriverUser(driverUser);
|
|
|
|
|
|
|
|
}
|
|
|
|
return service.saveDriverUser(driverUser);
|
|
|
|
return service.saveDriverUser(driverUser);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 修改 司机 用户信息
|
|
|
|
|
|
|
|
* @param driverUser
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@PutMapping("/driver-user")
|
|
|
|
|
|
|
|
public ResponseResult updateDriverUser(@RequestBody DriverUser driverUser){
|
|
|
|
|
|
|
|
return service.updateDriverUser(driverUser);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|