SampleController.java 786 字节
Newer Older
武汉红喜's avatar
武汉红喜 已提交
1 2
package org.hongxi.whatsmars.boot.sample.web.controller;

武汉红喜's avatar
web  
武汉红喜 已提交
3 4
import org.hongxi.whatsmars.common.result.Result;
import org.hongxi.whatsmars.common.result.ResultHelper;
武汉红喜's avatar
武汉红喜 已提交
5 6 7 8 9 10 11 12 13 14 15 16 17
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;

/**
 * Created by shenhongxi on 2020/8/16.
 */
@RestController
@RequestMapping("/sample")
public class SampleController {

    @GetMapping("/hello")
武汉红喜's avatar
web  
武汉红喜 已提交
18 19
    public Result<String> hello(@RequestParam String userId,
                                @RequestParam Integer age) {
武汉红喜's avatar
武汉红喜 已提交
20
        String hello = userId + "," + age;
武汉红喜's avatar
web  
武汉红喜 已提交
21
        return ResultHelper.newSuccessResult(hello);
武汉红喜's avatar
武汉红喜 已提交
22 23
    }
}