parent
444c29b068
commit
cb7eafd3ac
@ -0,0 +1,21 @@
|
||||
package com.taxi.aipboss.controller;
|
||||
|
||||
import com.internal.dto.DriverUser;
|
||||
import com.internal.dto.ResponseResult;
|
||||
import com.taxi.aipboss.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("/driver-user")
|
||||
public ResponseResult addDriverUser(@RequestBody DriverUser driverUser){
|
||||
return driverUserService.addDriverUser(driverUser);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.taxi.aipboss.remote;
|
||||
|
||||
import com.internal.dto.DriverUser;
|
||||
import com.internal.dto.ResponseResult;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
@FeignClient("service-driver-user")
|
||||
public interface ServiceDriverUserClient {
|
||||
|
||||
@RequestMapping(method = RequestMethod.POST,value = "/users")
|
||||
ResponseResult addDriverUser(@RequestBody DriverUser driverUser);
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.taxi.aipboss.service;
|
||||
|
||||
import com.internal.dto.DriverUser;
|
||||
import com.internal.dto.ResponseResult;
|
||||
import com.taxi.aipboss.remote.ServiceDriverUserClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class DriverUserService {
|
||||
@Autowired
|
||||
private ServiceDriverUserClient serviceDriverUserClient;
|
||||
|
||||
public ResponseResult addDriverUser(DriverUser driverUser){
|
||||
return serviceDriverUserClient.addDriverUser(driverUser);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue