/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2016 abel533@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.keydong.ker.web;
import java.util.List;
import org.keydong.ker.entity.Country;
import org.keydong.ker.service.CountryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.github.pagehelper.PageInfo;
/**
* @author key dong
* @since 2016-12-19 11:10
*/
@Controller
@RequestMapping("/countries")
public class CountryController {
@Autowired
private CountryService countryService;
@RequestMapping
public ModelAndView getAll(Country country) {
ModelAndView result = new ModelAndView("index");
List<Country> countryList = countryService.getAll(country);
result.addObject("pageInfo", new PageInfo<Country>(countryList));
result.addObject("queryParam", country);
result.addObject("page", country.getPage());
result.addObject("rows", country.getRows());
return result;
}
@RequestMapping(value = "/add")
public ModelAndView add() {
ModelAndView result = new ModelAndView("view");
result.addObject("country", new Country());
return result;
}
@RequestMapping(value = "/view/{id}")
public ModelAndView view(@PathVariable Integer id) {
ModelAndView result = new ModelAndView("view");
Country country = countryService.getById(id);
result.addObject("country", country);
return result;
}
@RequestMapping(value = "/delete/{id}")
public ModelAndView delete(@PathVariable Integer id, RedirectAttributes ra) {
ModelAndView result = new ModelAndView("redirect:/countries");
countryService.deleteById(id);
ra.addFlashAttribute("msg", "删除成功!");
return result;
}
@RequestMapping(value = "/save", method = RequestMethod.POST)
public ModelAndView save(Country country) {
ModelAndView result = new ModelAndView("view");
String msg = country.getId() == null ? "新增成功!" : "更新成功!";
countryService.save(country);
result.addObject("country", country);
result.addObject("msg", msg);
return result;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
maven 整合 springboot mybatis druid
共99个文件
java:18个
class:18个
prefs:17个
5星 · 超过95%的资源 需积分: 15 132 下载量 42 浏览量
2017-05-03
09:33:08
上传
评论 3
收藏 175KB ZIP 举报
温馨提示
maven 整合 springboot mybatis druid 模块化
资源推荐
资源详情
资源评论
收起资源包目录
keydong-ker-parent.zip (99个子文件)
keydong-ker-parent
.project 398B
keydong-ker-common
.project 984B
src
test
resources
java
main
resources
java
org
keydong
ker
util
MyMapper.java 1KB
target
classes
META-INF
MANIFEST.MF 372B
maven
com.key.ker
keydong-ker-common
pom.properties 264B
pom.xml 439B
org
keydong
ker
util
MyMapper.class 345B
test-classes
.settings
org.eclipse.wst.common.project.facet.core.xml 145B
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 736B
org.eclipse.core.resources.prefs 191B
pom.xml 439B
.classpath 1KB
keydong-ker-entity
.project 984B
src
test
resources
java
main
resources
java
org
keydong
ker
entity
BaseEntity.java 2KB
UserInfo.java 2KB
City.java 2KB
Country.java 2KB
target
classes
META-INF
MANIFEST.MF 372B
maven
com.key.ker
keydong-ker-entity
pom.properties 264B
pom.xml 439B
org
keydong
ker
entity
UserInfo.class 2KB
City.class 735B
Country.class 783B
BaseEntity.class 1KB
test-classes
.settings
org.eclipse.wst.common.project.facet.core.xml 122B
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 736B
org.eclipse.core.resources.prefs 191B
pom.xml 439B
.classpath 1KB
keydong-ker-service
.project 985B
src
test
resources
java
main
resources
java
org
keydong
ker
service
UserInfoService.java 2KB
CityService.java 2KB
CountryService.java 2KB
target
classes
META-INF
MANIFEST.MF 374B
maven
com.key.ker
keydong-ker-service
pom.properties 267B
pom.xml 622B
org
keydong
ker
service
CountryService.class 2KB
CityService.class 2KB
UserInfoService.class 2KB
test-classes
.settings
org.eclipse.wst.common.project.facet.core.xml 145B
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 736B
org.eclipse.core.resources.prefs 191B
pom.xml 622B
.classpath 1KB
src
site
.settings
org.eclipse.m2e.core.prefs 90B
org.eclipse.core.resources.prefs 57B
keydong-ker-web
.project 981B
.springBeans 417B
src
test
resources
java
main
resources
application.properties 727B
mapper
test.sql 7KB
static
js
jquery-1.11.1.min.js 143KB
css
style.css 2KB
java
org
keydong
ker
shiro
web
CountryController.java 4KB
UserInfoController.java 3KB
CityController.java 3KB
config
DruidProperties.java 2KB
WebMvcConfig.java 2KB
DruidAutoConfiguration.java 2KB
Application.java 570B
target
classes
application.properties 727B
mapper
META-INF
MANIFEST.MF 366B
maven
com.key.ker
keydong-ker-web
pom.properties 255B
pom.xml 616B
test.sql 7KB
org
keydong
ker
shiro
Application.class 908B
web
CountryController.class 3KB
UserInfoController.class 3KB
CityController.class 3KB
config
DruidAutoConfiguration.class 2KB
WebMvcConfig.class 1KB
DruidProperties.class 2KB
static
js
jquery-1.11.1.min.js 143KB
css
style.css 2KB
test-classes
.settings
org.eclipse.wst.common.project.facet.core.xml 122B
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 736B
org.eclipse.core.resources.prefs 191B
pom.xml 616B
.classpath 1KB
pom.xml 4KB
keydong-ker-dao
.project 981B
src
test
resources
java
main
resources
java
org
keydong
ker
mapper
CountryMapper.java 1KB
CityMapper.java 1KB
UserInfoMapper.java 1KB
target
classes
META-INF
MANIFEST.MF 366B
maven
com.key.ker
keydong-ker-dao
pom.properties 255B
pom.xml 755B
org
keydong
ker
mapper
CountryMapper.class 273B
UserInfoMapper.class 276B
CityMapper.class 264B
test-classes
.settings
org.eclipse.wst.common.project.facet.core.xml 145B
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 736B
org.eclipse.core.resources.prefs 191B
pom.xml 755B
.classpath 1KB
共 99 条
- 1
资源评论
- zrbfree2017-08-17分模块开发,多谢!
- ptypty20112019-12-31资源不错 谢谢作者
- 小丑皇V2017-05-25资源不错,支持作者!
- FreedomLeo12018-01-20嗯,不错,要是能再深入些
码狂人
- 粉丝: 2
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Vue+Echarts实现风力发电机中传感器的数据展示监控可视化系统+源代码+文档说明(高分课程设计)
- 基于单片机的风力发电机转速控制源码
- 基于C++实现的风力发电气动平衡监测系统+源代码+测量数据(高分课程设计)
- 毕业设计- 基于STM32F103C8T6 单片机,物联网技术的太阳能发电装置+源代码+文档说明+架构图+界面截图
- 基于 LSTM(长短期记忆)(即改进的循环神经网络)预测风力发电厂中风力涡轮机产生的功率+源代码+文档说明
- 基于stm32f103+空心杯电机+oled按键+运动算法
- 《CKA/CKAD应试指南/从docker到kubernetes 完全攻略》学习笔记 第1章docker基础(1.1-1.4)
- 基于python实现的水下压缩空气储能互补系统建模仿真与经济效益分析+源代码+论文
- 华中科技大学-自然语言处理实验,Bi-LSTM+CRF的中文分词框架,并且利用基于深度学习的方法进行中文命名实体识别++源码报告
- 基于动态罚函数的铁路车流分配与径路优化模型python源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功