修复controller
This commit is contained in:
@ -0,0 +1,34 @@
|
||||
package com.xkrs.microservice.controller;
|
||||
|
||||
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import static com.xkrs.microservice.common.encapsulation.OutputEncapsulation.outputEncapsulationObject;
|
||||
|
||||
/**
|
||||
* HelloController
|
||||
* @author tajochen
|
||||
*/
|
||||
@RestController
|
||||
public class HelloController {
|
||||
|
||||
/**
|
||||
* 获取区域信息
|
||||
*/
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
|
||||
/**
|
||||
* 返回类型为Mono<String>
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/hello")
|
||||
public Mono<String> hello() {
|
||||
// 【改】使用Mono.just生成响应式数据
|
||||
return Mono.just(outputEncapsulationObject(PromptMessageEnum.SUCCESS,"Welcome to reactive world ~",locale));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user