|
|
|
@@ -6,13 +6,13 @@ import com.alibaba.fastjson2.JSONObject; |
|
|
|
import com.ruoyi.common.core.utils.DateUtils; |
|
|
|
import com.ruoyi.common.security.utils.SecurityUtils; |
|
|
|
import com.ruoyi.platform.annotations.CheckDuplicate; |
|
|
|
import com.ruoyi.system.api.constant.Constant; |
|
|
|
import com.ruoyi.platform.domain.*; |
|
|
|
import com.ruoyi.platform.domain.dependencydomain.TrainTaskDepency; |
|
|
|
import com.ruoyi.platform.mapper.*; |
|
|
|
import com.ruoyi.platform.service.*; |
|
|
|
import com.ruoyi.platform.utils.*; |
|
|
|
import com.ruoyi.platform.vo.*; |
|
|
|
import com.ruoyi.system.api.constant.Constant; |
|
|
|
import com.ruoyi.system.api.model.LoginUser; |
|
|
|
import io.minio.messages.Item; |
|
|
|
import org.apache.commons.io.FileUtils; |
|
|
|
@@ -1125,6 +1125,12 @@ public class ModelsServiceImpl implements ModelsService { |
|
|
|
throw new Exception("版本数据为空"); |
|
|
|
} |
|
|
|
|
|
|
|
String token = gitService.checkoutToken(); |
|
|
|
String url = gitendpoint + "/api/" + owner + "/" + identifier + "/detail.json"; |
|
|
|
String req = httpUtils.sendGetWithToken(url, null, token); |
|
|
|
Map<String, Object> reqMap = JacksonUtil.parseJSONStr2Map(req); |
|
|
|
modelsVo.setPraisesCount((Integer) reqMap.get("praises_count")); |
|
|
|
modelsVo.setPraised((Boolean) reqMap.get("praised")); |
|
|
|
return modelsVo; |
|
|
|
} |
|
|
|
|
|
|
|
@@ -1227,6 +1233,22 @@ public class ModelsServiceImpl implements ModelsService { |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public String praise(Integer id) throws Exception { |
|
|
|
String token = gitService.checkoutToken(); |
|
|
|
String url = gitendpoint + "/api/projects/" + id + "/praise_tread/like.json"; |
|
|
|
httpUtils.sendPostWithToken(url, null, token, null); |
|
|
|
return "点赞成功"; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public String unpraise(Integer id) throws Exception { |
|
|
|
String token = gitService.checkoutToken(); |
|
|
|
String url = gitendpoint + "/api/projects/" + id + "/praise_tread/unlike.json"; |
|
|
|
httpUtils.sendDeleteWithToken(url, null, token, null); |
|
|
|
return "取消点赞成功"; |
|
|
|
} |
|
|
|
|
|
|
|
public List<ModelsVo> convert(List<Map<String, Object>> lst, String modelTopic, String modelTagName, String modelTypeName) { |
|
|
|
if (lst != null && lst.size() > 0) { |
|
|
|
List<ModelsVo> result = new ArrayList<>(); |
|
|
|
|