parent
53b069d0d9
commit
b35acd6040
@ -0,0 +1,23 @@
|
||||
package com.mashibing.apiboss.controller;
|
||||
|
||||
import com.mashibing.apiboss.service.UserService;
|
||||
import com.mashibing.internalcommon.dto.DriverUser;
|
||||
import com.mashibing.internalcommon.dto.ResponseResult;
|
||||
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 UserService service;
|
||||
|
||||
@PostMapping("/driver-user")
|
||||
public ResponseResult saveDriverUser(@RequestBody DriverUser driverUser){
|
||||
return service.saveDriverUser(driverUser);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.mashibing.apiboss.remote;
|
||||
|
||||
import com.mashibing.internalcommon.dto.DriverUser;
|
||||
import com.mashibing.internalcommon.dto.ResponseResult;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@Service
|
||||
@FeignClient("service-driver-user")
|
||||
public interface ServiceDriverUserClient {
|
||||
|
||||
@PostMapping("/user")
|
||||
public ResponseResult saveUser(@RequestBody DriverUser driverUser);
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.mashibing.apiboss.service;
|
||||
|
||||
import com.mashibing.apiboss.remote.ServiceDriverUserClient;
|
||||
import com.mashibing.internalcommon.dto.DriverUser;
|
||||
import com.mashibing.internalcommon.dto.ResponseResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class UserService {
|
||||
|
||||
@Autowired
|
||||
private ServiceDriverUserClient client;
|
||||
|
||||
public ResponseResult saveDriverUser(DriverUser driverUser){
|
||||
|
||||
return client.saveUser(driverUser);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue