首页>代码>SSH+mysql开发电商网站(可直接导入运行)>/E_shop/src/cn/it/shop/action/CategoryAction.java
package cn.it.shop.action;

import java.io.ByteArrayInputStream;
import java.util.HashMap;
import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import cn.it.shop.model.Category;


@Controller("categoryAction")
@Scope("prototype")
public class CategoryAction extends BaseAction<Category> {
	
	public String queryJoinAccount() {
		System.out.println("type:" + model.getType());
		System.out.println("page:" + page);
		System.out.println("rows:" + rows);
		
		//用来存储分页的数据
		pageMap = new HashMap<String, Object>();
		
		//根据关键字和分页的参数查询相应的数据
		List<Category> categoryList = categoryService.queryJoinAccount(model.getType(), page, rows);
		pageMap.put("rows", categoryList); //存储为JSON格式
		//根据关键字查询总记录数
		Long total = categoryService.getCount(model.getType());
//		System.out.println(total);
		pageMap.put("total", total); //存储为JSON格式

		return "jsonMap";
	}
	
	public String deleteByIds() {
		System.out.println(ids);
		categoryService.deleteByIds(ids);
		//如果删除成功就会往下执行,我们将"true"以流的形式传给前台
		inputStream = new ByteArrayInputStream("true".getBytes());
		return "stream";
	}
	
	public void save() {
		System.out.println(model);
		categoryService.save(model);
	}
	
	public void update() {
		System.out.println(model);
		categoryService.update(model);
	}
	
	public String query() {
		jsonList = categoryService.query();
		return "jsonList";
	}
}
最近下载更多
an7654  LV1 2023年10月9日
陆程江  LV2 2023年5月29日
jierffff  LV2 2023年4月20日
天下无敌啦啦啦啦啦  LV2 2023年2月3日
反复发烧  LV1 2023年1月28日
wuying8208  LV15 2023年1月1日
二十一画  LV10 2022年6月25日
wanglinddad  LV54 2022年4月18日
1358677997  LV2 2021年12月27日
最近浏览更多
jiemomo  LV12 2023年11月6日
微信网友_6707371254878208 2023年10月25日
暂无贡献等级
an7654  LV1 2023年10月9日
我是高手  LV1 2023年9月17日
SDLFJL  LV6 2023年7月23日
include  LV8 2023年6月20日
yemmmm666  LV1 2023年6月12日
陆程江  LV2 2023年5月23日
3516569014  LV5 2023年5月8日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友