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