首页>代码>ssm框架+easyui开发简单demo实例>/web/src/com/ajxm/web/controller/DeptController.java
package com.ajxm.web.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ajxm.web.entity.Dept;
import com.ajxm.web.service.IDeptService;

@Controller
@RequestMapping(value="/dept")
public class DeptController {
	@Resource(name="deptService")
	private IDeptService deptService;
	//这段可以不要
	public void setDeptService(IDeptService deptService) {
		this.deptService = deptService;
	}
	
	@RequestMapping(value="/get")
	@ResponseBody
	public List<Dept> queryDept(){
		return deptService.getList();
	}
	
	@RequestMapping(value="/insert")
	@ResponseBody
	public String insert(Dept dept){
		int rows = deptService.insertDept(dept);
		return rows>=1?"{\"code\":\"success\"}":"{\"coed\":\"fail\"}";
	}
	
	@RequestMapping(value="/update")
	@ResponseBody
	public String update(Dept dept){
		int rows = deptService.updateDept(dept);
		return rows>=1?"{\"code\":\"success\"}":"{\"coed\":\"fail\"}";
	}
}
最近下载更多
yeyuuu  LV6 2023年5月20日
h_z_feng  LV1 2022年12月24日
potato1234  LV6 2022年3月22日
amour1  LV11 2021年12月5日
543666826  LV33 2021年11月19日
w384553037  LV1 2021年11月4日
wubinbin  LV11 2021年10月10日
heqian  LV16 2021年9月28日
ljl123456321  LV1 2021年9月11日
木木不爱安妮酱  LV10 2021年7月3日
最近浏览更多
h G24741  LV2 3月12日
Henew168  LV2 2023年11月19日
mmmhhh 2023年11月13日
暂无贡献等级
张朕朕  LV3 2023年9月1日
yeyuuu  LV6 2023年5月20日
milou123  LV2 2023年3月7日
yiposhop  LV4 2023年2月16日
LITIANYU084414  LV11 2023年1月1日
h_z_feng  LV1 2022年12月24日
kaonixiwa  LV3 2022年11月15日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友