KKSU
2024-07-08 1bfe95ae803adee6f824e83d887aaf24d1d07788
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package cc.mrbird.febs.tree;
 
import cc.mrbird.febs.common.entity.FebsResponse;
import cn.hutool.core.util.RandomUtil;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * @author wzy
 * @date 2022-08-24
 **/
@Api(value = "TreeController", tags = "矩阵树测试")
@Slf4j
@RequestMapping(value = "/test")
@RestController
public class TreeController {
 
    @GetMapping(value = "/addNode/{id}")
    public FebsResponse addNode(@PathVariable("id") Long id) {
        MatrixTree matrixTree = MatrixTree.getInstance();
        MemberNode memberNode = new MemberNode();
        memberNode.setMemberId(id);
        memberNode.setAddress(RandomUtil.randomString(16));
        memberNode.setInviteId(RandomUtil.randomNumbers(6));
 
        matrixTree.addNode(memberNode);
        return new FebsResponse().success();
    }
}