|
|
@ -1,7 +1,10 @@
|
|
|
|
package cn.teammodel;
|
|
|
|
package cn.teammodel;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.teammodel.common.R;
|
|
|
|
import cn.teammodel.common.R;
|
|
|
|
|
|
|
|
import cn.teammodel.model.entity.EvaluationTree;
|
|
|
|
|
|
|
|
import cn.teammodel.model.entity.EvaluationTreeNode;
|
|
|
|
import cn.teammodel.model.entity.User;
|
|
|
|
import cn.teammodel.model.entity.User;
|
|
|
|
|
|
|
|
import cn.teammodel.service.impl.EvaluationTreeServiceImpl;
|
|
|
|
import com.dingtalk.api.DefaultDingTalkClient;
|
|
|
|
import com.dingtalk.api.DefaultDingTalkClient;
|
|
|
|
import com.dingtalk.api.DingTalkClient;
|
|
|
|
import com.dingtalk.api.DingTalkClient;
|
|
|
|
import com.dingtalk.api.request.OapiRobotSendRequest;
|
|
|
|
import com.dingtalk.api.request.OapiRobotSendRequest;
|
|
|
@ -10,7 +13,10 @@ import com.taobao.api.ApiException;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @author winter
|
|
|
|
* @author winter
|
|
|
@ -82,14 +88,38 @@ public class TestWithoutSpring {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testResult() {
|
|
|
|
public void testResult() {
|
|
|
|
User user = new User();
|
|
|
|
EvaluationTreeServiceImpl service = new EvaluationTreeServiceImpl();
|
|
|
|
user.setId("ds");
|
|
|
|
EvaluationTree evaluationTree = new EvaluationTree();
|
|
|
|
user.setName("ds");
|
|
|
|
evaluationTree.setCode("evaluation");
|
|
|
|
user.setPicture("s");
|
|
|
|
evaluationTree.setCampusId("default");
|
|
|
|
user.setStandard("s");
|
|
|
|
List<EvaluationTreeNode> nodes = new ArrayList<>();
|
|
|
|
user.setScope("ad");
|
|
|
|
|
|
|
|
user.setWebsite("dsa");
|
|
|
|
// 1
|
|
|
|
user.setArea("");
|
|
|
|
String rootId = UUID.randomUUID().toString();
|
|
|
|
System.out.println(R.success(user));
|
|
|
|
EvaluationTreeNode node = new EvaluationTreeNode();
|
|
|
|
|
|
|
|
node.setId(rootId);
|
|
|
|
|
|
|
|
node.setPid(null);
|
|
|
|
|
|
|
|
node.setName("root");
|
|
|
|
|
|
|
|
node.setScore(0);
|
|
|
|
|
|
|
|
// 2
|
|
|
|
|
|
|
|
EvaluationTreeNode node1 = new EvaluationTreeNode();
|
|
|
|
|
|
|
|
String subId = UUID.randomUUID().toString();
|
|
|
|
|
|
|
|
node1.setId(subId);
|
|
|
|
|
|
|
|
node1.setPid(rootId);
|
|
|
|
|
|
|
|
node1.setName("child-1");
|
|
|
|
|
|
|
|
node1.setScore(0);
|
|
|
|
|
|
|
|
// 3
|
|
|
|
|
|
|
|
EvaluationTreeNode node2 = new EvaluationTreeNode();
|
|
|
|
|
|
|
|
node2.setId(UUID.randomUUID().toString());
|
|
|
|
|
|
|
|
node2.setPid(subId);
|
|
|
|
|
|
|
|
node2.setName("child-2");
|
|
|
|
|
|
|
|
node2.setScore(0);
|
|
|
|
|
|
|
|
nodes.add(node);
|
|
|
|
|
|
|
|
nodes.add(node1);
|
|
|
|
|
|
|
|
nodes.add(node2);
|
|
|
|
|
|
|
|
evaluationTree.setNodes(nodes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<EvaluationTreeNode> tree = service.buildTree(nodes);
|
|
|
|
|
|
|
|
System.out.println(tree);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|