/*
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.kea.userconfigcenter.demos.web;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @author <a href="mailto:chenxilzx1@gmail.com">theonefx</a>
*/
@Controller
public class BasicController {
// http://127.0.0.1:8080/hello?name=lisi
@RequestMapping("/hello")
@ResponseBody
public String hello(@RequestParam(name = "name", defaultValue = "unknown user") String name) {
return "Hello " + name;
}
// http://127.0.0.1:8080/user
@RequestMapping("/user")
@ResponseBody
public User user() {
User user = new User();
user.setName("theonefx");
user.setAge(666);
return user;
}
// http://127.0.0.1:8080/save_user?name=newName&age=11
@RequestMapping("/save_user")
@ResponseBody
public String saveUser(User u) {
return "user will save: name=" + u.getName() + ", age=" + u.getAge();
}
// http://127.0.0.1:8080/html
@RequestMapping("/html")
public String html() {
return "index.html";
}
@ModelAttribute
public void parseUser(@RequestParam(name = "name", defaultValue = "unknown user") String name
, @RequestParam(name = "age", defaultValue = "12") Integer age, User user) {
user.setName("zhangsan");
user.setAge(18);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
springboot用户中心源代码 (119个子文件)
0ac31d3e8cbfdd4c1815238bfe79c9c63dea1c 596B
2b49860b402d53164a87bfe88a26a1fa665f2c 69B
4fc0854399771bf3dc59383d26c0a74bb8f4c2 945B
7a6a110c597f0f0173b29cb6a42b07bae42156 176B
9e00a2a96fa9d7c5dbc9859664a78d980158c2 249B
ac58c9147a7631b0d70bb2d7b13ad2514165b0 199B
bd42fffa66390cc350fd80ccea3763a1577081 816B
c64def15f28dfa48611c25d90623170190bde0 832B
BasicController.class 2KB
PathVariableController.class 1KB
User.class 807B
UserConfigCenterApplication.class 755B
UserConfigCenterApplicationTests.class 583B
config 130B
d94a21beada6e678ec06a482930a393da315bf 88B
description 73B
exclude 240B
.gitignore 395B
HEAD 23B
index.html 79B
index.html 79B
user-config-center.iml 8KB
index 1KB
user-config-center-0.0.1-SNAPSHOT.jar 6KB
BasicController.java 2KB
PathVariableController.java 2KB
User.java 1KB
UserConfigCenterApplication.java 349B
UserConfigCenterApplicationTests.java 235B
inputFiles.lst 438B
createdFiles.lst 226B
inputFiles.lst 117B
createdFiles.lst 64B
HELP.md 853B
pom.properties 124B
application.properties 50B
application.properties 50B
pre-rebase.sample 5KB
fsmonitor-watchman.sample 5KB
update.sample 4KB
push-to-checkout.sample 3KB
sendemail-validate.sample 2KB
pre-commit.sample 2KB
prepare-commit-msg.sample 1KB
pre-push.sample 1KB
commit-msg.sample 896B
pre-receive.sample 544B
applypatch-msg.sample 478B
pre-applypatch.sample 424B
pre-merge-commit.sample 416B
post-update.sample 189B
workspace.xml 4KB
pom.xml 3KB
jarRepositories.xml 864B
Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_13_4.xml 736B
Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_6_13.xml 720B
Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml 700B
Maven__org_springframework_boot_spring_boot_starter_logging_2_6_13.xml 699B
Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_13_4.xml 695B
Maven__org_springframework_boot_spring_boot_starter_tomcat_2_6_13.xml 692B
Maven__org_springframework_boot_spring_boot_autoconfigure_2_6_13.xml 685B
Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_13_4.xml 681B
Maven__org_springframework_boot_spring_boot_starter_json_2_6_13.xml 678B
Maven__org_springframework_boot_spring_boot_starter_test_2_6_13.xml 678B
Maven__org_springframework_boot_spring_boot_starter_web_2_6_13.xml 671B
compiler.xml 663B
Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_68.xml 660B
Maven__com_fasterxml_jackson_core_jackson_annotations_2_13_4.xml 651B
Maven__com_fasterxml_jackson_core_jackson_databind_2_13_4_2.xml 644B
Maven__org_springframework_boot_spring_boot_starter_2_6_13.xml 643B
Maven__org_junit_platform_junit_platform_commons_1_8_2.xml 633B
Maven__jakarta_activation_jakarta_activation_api_1_2_2.xml 633B
Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml 633B
Maven__org_junit_platform_junit_platform_engine_1_8_2.xml 626B
Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_68.xml 625B
Maven__org_springframework_boot_spring_boot_test_2_6_13.xml 622B
Maven__org_junit_jupiter_junit_jupiter_params_5_8_2.xml 615B
Maven__org_junit_jupiter_junit_jupiter_engine_5_8_2.xml 615B
Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_68.xml 611B
Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_3.xml 611B
Maven__org_springframework_spring_expression_5_3_23.xml 609B
Maven__org_apache_logging_log4j_log4j_to_slf4j_2_17_2.xml 608B
Maven__com_fasterxml_jackson_core_jackson_core_2_13_4.xml 602B
Maven__org_mockito_mockito_junit_jupiter_4_0_0.xml 598B
Maven__org_junit_jupiter_junit_jupiter_api_5_8_2.xml 594B
Maven__org_springframework_spring_context_5_3_23.xml 588B
Maven__org_springframework_boot_spring_boot_2_6_13.xml 587B
Maven__net_bytebuddy_byte_buddy_agent_1_11_22.xml 585B
Maven__org_springframework_spring_webmvc_5_3_23.xml 581B
Maven__ch_qos_logback_logback_classic_1_2_11.xml 575B
Maven__org_springframework_spring_beans_5_3_23.xml 574B
Maven__org_apache_logging_log4j_log4j_api_2_17_2.xml 573B
Maven__org_apiguardian_apiguardian_api_1_1_2.xml 572B
Maven__org_springframework_spring_test_5_3_23.xml 567B
Maven__org_springframework_spring_core_5_3_23.xml 567B
Maven__org_junit_jupiter_junit_jupiter_5_8_2.xml 566B
Maven__org_springframework_spring_aop_5_3_23.xml 560B
Maven__org_springframework_spring_jcl_5_3_23.xml 560B
Maven__org_springframework_spring_web_5_3_23.xml 560B
Maven__net_minidev_accessors_smart_2_4_8.xml 556B
共 119 条
- 1
- 2
资源评论
孤独叶
- 粉丝: 145
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功