whycxzp
2021-06-03 0ed39bd9a35a51a118f54b6c3fea792294431a2f
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
34
35
36
37
38
39
40
41
42
43
44
45
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.dto.multiTree.MultiTree;
import com.whyc.exception.first.CustomExceptionResultHandler;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
 
/**
 * 作为功能测试接口,实际项目不可调用!
 */
@RestController
@RequestMapping("test")
@Api(tags = "test")
@Slf4j
public class TestController {
 
    @GetMapping("test")
    public Response<MultiTree> test(){
        MultiTree multiTree = new MultiTree();
 
        String dates = "2020-01-02,2020-01-03,2020-02-03,2021-06-06,2021-05-06";
        String[] dateArr = dates.split(",");
 
        MultiTree tree = new MultiTree().saveAsTree(dateArr);
        return new Response<MultiTree>().set(1,tree);
    }
    @GetMapping("test2")
    @ApiOperation(value = "test2")
    public Response test2(@RequestParam Integer num){
        System.out.println("执行了test2的方法1");
        log.info("哈哈");
        byte b = num.byteValue();
        System.out.println("执行了test2的方法");
        return new Response().set(1,num);
 
    }
 
}