Xiajijian
2025-11-24 3c934bdfc9338a9a727b482b7fac89657f6594a6
ard-work/src/main/java/com/ard/work/service/impl/ArdServerInfoServiceImpl.java
@@ -10,6 +10,7 @@
import com.ard.work.domain.receiver.TyHttpCommonReceiver;
import com.ard.work.mapper.ArdServerInfoMapper;
import com.ard.work.service.IArdServerInfoService;
import com.dtflys.forest.exceptions.ForestRuntimeException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;
@@ -124,7 +125,7 @@
    @Override
    public AccessTokenReceiver getAccessToken(String id) {
        long timeStamp = getTimeStamp();
        AccessTokenReceiver accessToken = null;
        ArdServerInfo serverInfo = selectArdServerInfoById(id);
        // 准备请求的json
        TokenDTO gtd = TokenDTO.builder()
@@ -132,22 +133,22 @@
                .encryptStr(getEncryptStr(serverInfo, timeStamp))
                .timeStamp(timeStamp)
                .build();
        try {
      //  try {
            TyHttpCommonReceiver<AccessTokenReceiver> getTokenRes = tyClient.getToken(id, gtd);
            accessToken = getTokenRes.getContent();
        } catch (Exception e) {
            log.error("获取token失败:{}", e.getMessage());
        }
            return getTokenRes.getContent();
//        } catch (Exception e) {
//            log.error("获取 Token 失败 serverId={}, 异常: {}", id, e.getMessage());
//            return null; // 请求失败返回 null
//        }
        //{"state":0,"content":{"companyId":4127,"accessToken":"sOONT0MMVdoKcMBibb40xxgrUrq0Hw9RFiajic3KOzoNtk"}}
        return accessToken;
    }
    /**
     * 修改服务器状态
     */
    @Override
    public int updateServerStatus(String id,String status) {
        return ardServerInfoMapper.updateServerStatus(id,status);
    public int updateServerStatus(String id, String status) {
        return ardServerInfoMapper.updateServerStatus(id, status);
    }
    @Override