feat: address rpc
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package com.schisandra.share.infra.rpc;;
|
||||
|
||||
import com.schisandra.auth.api.SchisandraAuthFeignService;
|
||||
import com.schisandra.auth.entity.Result;
|
||||
import com.schisandra.auth.entity.SchisandraAuthAddressDTO;
|
||||
import com.schisandra.share.infra.entity.AuthUserAddressEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
/**
|
||||
* @Classname UserRpc
|
||||
* @BelongsProject: schisandra-cloud-storage
|
||||
* @BelongsPackage: com.schisandra.share.infra.rpc
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-07-15 09:48
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Component
|
||||
public class AddressRpc {
|
||||
@Resource
|
||||
private SchisandraAuthFeignService schisandraAuthFeignService;
|
||||
|
||||
public AuthUserAddressEntity getUserAddress(@RequestParam("userId") String userId){
|
||||
Result<SchisandraAuthAddressDTO> result = schisandraAuthFeignService.getUserAddress(userId);
|
||||
AuthUserAddressEntity authUserAddressEntity = new AuthUserAddressEntity();
|
||||
if (!result.getSuccess()) {
|
||||
return authUserAddressEntity;
|
||||
}
|
||||
SchisandraAuthAddressDTO data = result.getData();
|
||||
authUserAddressEntity.setId(data.getId());
|
||||
authUserAddressEntity.setUserId(data.getUserId());
|
||||
authUserAddressEntity.setLocation(data.getLocation());
|
||||
authUserAddressEntity.setBrowser(data.getBrowser());
|
||||
return authUserAddressEntity;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user