package com.example.projectforwenhua.web;
import com.example.projectforwenhua.model.Customer;
import com.example.projectforwenhua.model.User;
import com.example.projectforwenhua.service.CustomerServiceImpl;
import com.example.projectforwenhua.service.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpSession;
import java.util.List;
@Controller
public class CustomerWeb {
@Autowired
CustomerServiceImpl customerService;
@GetMapping("/toCustomerList")//接口的请求地址//让我们可以以字符串的形式获取用户的列表数据
public String getUserList(Model model){
List<Customer> customerList = customerService.getList();
model.addAttribute("customerList" ,customerList);
return "customerList";
}
@GetMapping("/toUpdate/{id}")
public String toUpdate(@PathVariable("id") int id,Model model){
Customer customer = customerService.getCustomerById(id);
model.addAttribute("customer",customer);
return "updateCustomer";
}
@RequestMapping(value = "/handleUpdateCustomer",method = RequestMethod.POST)
public String handleUpdateCustomer(Customer customer){
customerService.updateCustomer(customer);
return "redirect:/toCustomerList";
}
@RequestMapping(value = "/handleAddCustomer",method = RequestMethod.POST)
public String handleAddCustomer(Customer customer){
customerService.addCustomer(customer);
return "redirect:/toCustomerList";
}
@GetMapping("/deleteCustomer/{id}")
public String deleteCustomerById(@PathVariable("id") int id){
customerService.deleteCustomerById(id);
return "redirect:/toCustomerList";
}
@GetMapping("/toAddCustomer")
public String toAddCustomer(){
return "addCustomer";
}
@GetMapping("/queryCustomer")
public String toAddCustomer(@RequestParam String customerName,Model model){
if(customerName==null || customerName.equals("")){
List<Customer> list = customerService.getList();
model.addAttribute("customerList",list);
return "customerList";
}else{
List<Customer> listByCustomerName = customerService.getListByCustomerName(customerName);
model.addAttribute("customerList",listByCustomerName);
return "customerList";
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
员工管理系统SpringBoot+MYSQL+HTML前后端分离
共129个文件
xml:82个
html:14个
class:13个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 6 下载量 149 浏览量
2022-06-22
09:02:09
上传
评论 2
收藏 85KB ZIP 举报
温馨提示
员工管理系统SpringBoot+MYSQL+HTML前后端分离
资源推荐
资源详情
资源评论
收起资源包目录
员工管理系统SpringBoot+MYSQL+HTML前后端分离 (129个子文件)
UserWeb.class 3KB
CustomerWeb.class 3KB
CustomerServiceImpl.class 2KB
UserServiceImpl.class 2KB
Customer.class 2KB
CustomerMapper.class 2KB
ProjectforwenhuaApplicationTests.class 1KB
User.class 1KB
UserMapper.class 1KB
ProjectforwenhuaApplication.class 793B
CustomerService.class 756B
UserService.class 735B
TestWeb.class 411B
mvnw.cmd 7KB
.gitignore 395B
updateCustomer.html 2KB
updateCustomer.html 2KB
addCustomer.html 2KB
addCustomer.html 2KB
login.html 2KB
login.html 2KB
updatePassword.html 2KB
updatePassword.html 2KB
customerList.html 2KB
customerList.html 2KB
index.html 299B
index.html 299B
loginFail.html 208B
loginFail.html 208B
projectforwenhua.iml 10KB
CustomerWeb.java 3KB
UserWeb.java 2KB
Customer.java 1KB
CustomerServiceImpl.java 1KB
CustomerMapper.java 1KB
UserServiceImpl.java 1KB
User.java 959B
UserMapper.java 827B
ProjectforwenhuaApplicationTests.java 673B
CustomerService.java 530B
UserService.java 369B
ProjectforwenhuaApplication.java 353B
TestWeb.java 332B
HELP.md 1KB
mvnw 10KB
application.properties 597B
application.properties 541B
workspace.xml 8KB
pom.xml 2KB
compiler.xml 839B
Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_13_3.xml 736B
Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_2_2_2.xml 730B
Maven__org_thymeleaf_extras_thymeleaf_extras_java8time_3_0_4_RELEASE.xml 725B
Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_7_0.xml 713B
Maven__org_springframework_boot_spring_boot_starter_thymeleaf_2_7_0.xml 706B
Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml 700B
Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_13_3.xml 695B
Maven__org_springframework_boot_spring_boot_starter_logging_2_7_0.xml 692B
Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_2_2_2.xml 688B
Maven__org_springframework_boot_spring_boot_starter_tomcat_2_7_0.xml 685B
Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_13_3.xml 681B
Maven__org_springframework_boot_spring_boot_autoconfigure_2_7_0.xml 678B
Maven__org_springframework_boot_spring_boot_starter_jdbc_2_7_0.xml 671B
Maven__org_springframework_boot_spring_boot_starter_test_2_7_0.xml 671B
Maven__org_springframework_boot_spring_boot_starter_json_2_7_0.xml 671B
Maven__org_springframework_boot_spring_boot_starter_web_2_7_0.xml 664B
Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_63.xml 660B
Maven__com_fasterxml_jackson_core_jackson_annotations_2_13_3.xml 651B
Maven__org_thymeleaf_thymeleaf_spring5_3_0_15_RELEASE.xml 641B
Maven__org_springframework_boot_spring_boot_starter_2_7_0.xml 636B
Maven__jakarta_activation_jakarta_activation_api_1_2_2.xml 633B
Maven__org_junit_platform_junit_platform_commons_1_8_2.xml 633B
Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml 633B
Maven__com_fasterxml_jackson_core_jackson_databind_2_13_3.xml 630B
Maven__org_junit_platform_junit_platform_engine_1_8_2.xml 626B
Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_63.xml 625B
Maven__org_junit_jupiter_junit_jupiter_params_5_8_2.xml 615B
Maven__org_springframework_boot_spring_boot_test_2_7_0.xml 615B
Maven__org_junit_jupiter_junit_jupiter_engine_5_8_2.xml 615B
Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_63.xml 611B
Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_3.xml 611B
Maven__org_springframework_spring_expression_5_3_20.xml 609B
Maven__org_apache_logging_log4j_log4j_to_slf4j_2_17_2.xml 608B
Maven__com_fasterxml_jackson_core_jackson_core_2_13_3.xml 602B
Maven__org_mockito_mockito_junit_jupiter_4_5_1.xml 598B
Maven__org_junit_jupiter_junit_jupiter_api_5_8_2.xml 594B
Maven__org_attoparser_attoparser_2_0_5_RELEASE.xml 589B
Maven__org_springframework_spring_context_5_3_20.xml 588B
Maven__net_bytebuddy_byte_buddy_agent_1_12_10.xml 585B
Maven__org_thymeleaf_thymeleaf_3_0_15_RELEASE.xml 585B
Maven__org_springframework_spring_webmvc_5_3_20.xml 581B
Maven__org_springframework_boot_spring_boot_2_7_0.xml 580B
Maven__org_unbescape_unbescape_1_1_6_RELEASE.xml 578B
Maven__ch_qos_logback_logback_classic_1_2_11.xml 575B
Maven__mysql_mysql_connector_java_8_0_29.xml 574B
Maven__org_springframework_spring_beans_5_3_20.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_20.xml 567B
Maven__org_springframework_spring_jdbc_5_3_20.xml 567B
共 129 条
- 1
- 2
viper困告了
- 粉丝: 20
- 资源: 21
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页