Package com.bytedesk.starter.controller
Class HelloMvcController
java.lang.Object
com.bytedesk.starter.controller.HelloMvcController
for testing api
http://127.0.0.1:9003/swagger-ui/index.html
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) io.micrometer.core.instrument.Counter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfirstLetterPinyin
(String text) 将中文转为首字母格式 http://127.0.0.1:9003/hello/pinyin/firstletter?org.springframework.http.ResponseEntity<?>
getCallback
(String requestBody) org.springframework.http.ResponseEntity<?>
getHost()
get server host ip http://127.0.0.1:9003/hello/hostgetSession
(jakarta.servlet.http.HttpServletRequest request) 获取sessiongreeting()
multiplePinyin
(String character) 获取单个汉字的多音字列表 http://127.0.0.1:9003/hello/pinyin/multiple?normalPinyin
(String text) 将中文转为普通格式拼音(不带声调) http://127.0.0.1:9003/hello/pinyin/normal?setSession
(jakarta.servlet.http.HttpServletRequest request, String uid) 设置sessiontoneStylePinyin
(String text) 将中文转为带声调的拼音 http://127.0.0.1:9003/hello/pinyin/tone?org.springframework.http.ResponseEntity<?>
-
Field Details
-
visitCounter
io.micrometer.core.instrument.Counter visitCounter
-
-
Constructor Details
-
HelloMvcController
public HelloMvcController(io.micrometer.core.instrument.MeterRegistry registry)
-
-
Method Details
-
greeting
-
visitCount
@GetMapping("/visits") public org.springframework.http.ResponseEntity<?> visitCount() -
setSession
@GetMapping("/set/session") public Object setSession(jakarta.servlet.http.HttpServletRequest request, @RequestParam("uid") String uid) 设置session- Parameters:
request
-- Returns:
-
getSession
@GetMapping("/get/session") public Object getSession(jakarta.servlet.http.HttpServletRequest request) 获取session- Parameters:
request
-- Returns:
-
getHost
@GetMapping("/host") public org.springframework.http.ResponseEntity<?> getHost()get server host ip http://127.0.0.1:9003/hello/host- Returns:
-
userAccess
@GetMapping("/user") @PreAuthorize("hasRole(\'USER\') or hasRole(\'ADMIN\') or hasRole(\'SUPER\')") public String userAccess() -
moderatorAccess
-
superAccess
-
getCallback
@PostMapping("/callback") public org.springframework.http.ResponseEntity<?> getCallback(@RequestBody String requestBody) -
getExampleMessage
-
normalPinyin
将中文转为普通格式拼音(不带声调) http://127.0.0.1:9003/hello/pinyin/normal?text=你好世界- Parameters:
text
- 需要转换的中文文本- Returns:
- 转换结果
-
toneStylePinyin
将中文转为带声调的拼音 http://127.0.0.1:9003/hello/pinyin/tone?text=你好世界- Parameters:
text
- 需要转换的中文文本- Returns:
- 转换结果
-
multiplePinyin
@GetMapping("/pinyin/multiple") public Map<String,Object> multiplePinyin(@RequestParam String character) 获取单个汉字的多音字列表 http://127.0.0.1:9003/hello/pinyin/multiple?character=重- Parameters:
character
- 单个汉字- Returns:
- 多音字列表
-
firstLetterPinyin
@GetMapping("/pinyin/firstletter") public Map<String,String> firstLetterPinyin(@RequestParam String text) 将中文转为首字母格式 http://127.0.0.1:9003/hello/pinyin/firstletter?text=你好世界- Parameters:
text
- 需要转换的中文文本- Returns:
- 转换结果
-