SellerController.java 1.6 KB
package com.w1hd.zzhnc.controller.pc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.w1hd.zzhnc.model.Seller;
import com.w1hd.zzhnc.service.SellerService;
import com.w1hd.zzhnc.vo.Vo_msg;
import com.wordnik.swagger.annotations.Api;

@Deprecated
@Controller
@RequestMapping("/seller")
public class SellerController {

	@Autowired
	SellerService sellerService;

	@RequestMapping(value="/sellerList",method=RequestMethod.GET)
	public ModelAndView sellerList() {
		return new ModelAndView("/pc/seller/sellerList");
	}

	@ResponseBody
	@RequestMapping(value="/update",method=RequestMethod.POST)
	public Object update(@RequestBody Seller s) {
		boolean b = sellerService.update(s);
		return new Vo_msg(0, true);
	}

	@ResponseBody
	@RequestMapping(value="/search",method=RequestMethod.GET)
	public Object search(@RequestParam(value = "key", required = false) String key,
			@RequestParam(value = "sellerId", required = false, defaultValue = "0") Integer sellerId,
			@RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
			@RequestParam(value = "size", required = false, defaultValue = "10") Integer size) {
		return new Vo_msg(0, sellerService.search(key,sellerId,page,size));
	}

}