package self.me.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;

import self.me.common.utils.PageBean;
import self.me.web.service.UserService;

@Controller
public class IndexController {

	@Autowired
	private UserService userService;
	
	
	/**
	 * 首页
	 * @return
	 */
	@RequestMapping("/")
	public String index(){
		return "index";
	}
	
	/**
	 * 用户列表  public.js 里ajax 触发
	 * @param pageNum
	 * @param model
	 * @return
	 */
	@RequestMapping("/list")
	public String list(Integer pageNum,Model model){
		PageBean page=userService.getList(pageNum);
		model.addAttribute("page", page);
		return "list";
	}
	
	
	/**
	 * 保存用户 没做数据校验,尽量按合法的来做吧。本工程主要展示上传图片。。
	 * @param pageNum
	 * @param model
	 * @return
	 */
	@RequestMapping("/save")
	public String save(MultipartFile img,String name){
		userService.save(img,name);
		return "redirect:/";
	}
	
}
最近下载更多
shiopaaa  LV13 2021年1月29日
清咿酱  LV11 2020年5月6日
skipple3  LV39 2019年10月15日
qq_1344127185  LV27 2018年9月7日
yangctz  LV24 2018年5月28日
106177804liyang  LV7 2018年3月12日
boqiu2016  LV17 2017年11月25日
chinafjfzlj  LV31 2017年9月8日
190679152@qq.com  LV15 2017年2月5日
雷诺阿  LV10 2016年9月13日
最近浏览更多
qiangmin1223  LV12 4月24日
wuying8208  LV15 2023年9月4日
tomcat_test  LV2 2022年7月6日
xuweisong2010  LV27 2022年5月20日
Zeorwyc  LV8 2022年4月27日
yangsha868  LV9 2021年8月13日
on_Angels  LV1 2021年7月27日
鑫励诚  LV1 2021年5月10日
Mote-Lwh  LV1 2021年3月10日
xuexizhuanyong23  LV16 2021年2月9日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友