package com.cxyxiaomo.epp.test.controller;

// 提供 restful 服务

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
    @GetMapping("/")
    public String helloWorld() {
        return "Hello World!";
    }

    @GetMapping("/error")
    public String error() throws Exception {
        throw new Exception("这是一个异常");
    }

    @GetMapping("/hi/{id}")
    public String hi(@PathVariable("id") String id) {
        return id;
    }
}
