| | |
| | | |
| | | import cn.huge.base.common.bo.R; |
| | | import cn.huge.base.common.utils.HttpClientUtils; |
| | | import cn.huge.module.grid.domain.vo.GridUserVo; |
| | | import cn.huge.module.grid.domain.vo.*; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.UUID; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class GridUserService { |
| | | private String gridUrl = "http://219.137.166.84:8061"; |
| | | |
| | | public R<GridUserVo> getUserInfo(String token) { |
| | | public R<GridUserVo> getUserInfo(GridTokenVo gridTokenVo) { |
| | | String s = null; |
| | | HeadVo headVo = initHeadVo(); |
| | | GridUserRequestVo requestVo = new GridUserRequestVo(); |
| | | requestVo.setHeadVo(headVo); |
| | | requestVo.setBodyVo(gridTokenVo); |
| | | try { |
| | | log.info("xsd:{}",JSON.toJSONString(token)); |
| | | log.info("xsdobject:{}",JSON.toJSONString(requestVo)); |
| | | log.info("xsdurl:{}",gridUrl + "/sys/getUserByToken"); |
| | | s = HttpClientUtils.httpPostRaw(gridUrl + "/sys/getUserByToken", JSON.toJSONString(token), new HashMap<>(), "utf-8"); |
| | | s = HttpClientUtils.httpPostRaw(gridUrl + "/sys/getUserByToken", JSON.toJSONString(requestVo), new HashMap<>(), "utf-8"); |
| | | log.info("xsd:{}",s); |
| | | } catch (Exception e) { |
| | | log.info("xsderror:{}",e.getLocalizedMessage()); |
| | |
| | | GridUserVo gridUserVo = JSONObject.parseObject(s).getObject("data", GridUserVo.class); |
| | | return R.ok(gridUserVo); |
| | | } |
| | | |
| | | public HeadVo initHeadVo() { |
| | | HeadVo headVo = new HeadVo(); |
| | | headVo.setUsername("mtxt001"); |
| | | headVo.setPassword("aek8CdcaM"); |
| | | headVo.setRequestId(UUID.randomUUID().toString()); |
| | | headVo.setSource("string"); |
| | | return headVo; |
| | | } |
| | | } |