代码拉取完成,页面将自动刷新
package com.fengdu.controller;
import java.util.List;
import java.util.Map;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.fengdu.entity.OrderGoodsEntity;
import com.fengdu.service.OrderGoodsService;
import com.fengdu.utils.PageUtils;
import com.fengdu.utils.Query;
import com.fengdu.utils.R;
/**
*
*
* @author tiankong
* @email 2366207000@qq.com
* @date 2017-08-13 10:41:09
*/
@RestController
@RequestMapping("ordergoods")
public class OrderGoodsController {
@Autowired
private OrderGoodsService orderGoodsService;
/**
* 列表
*/
@RequestMapping("/list")
@RequiresPermissions("ordergoods:list")
public R list(@RequestParam Map<String, Object> params){
//查询列表数据
Query query = new Query(params);
List<OrderGoodsEntity> orderGoodsList = orderGoodsService.queryList(query);
int total = orderGoodsService.queryTotal(query);
PageUtils pageUtil = new PageUtils(orderGoodsList, total, query.getLimit(), query.getPage());
return R.ok().put("page", pageUtil);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
@RequiresPermissions("ordergoods:info")
public R info(@PathVariable("id") Integer id){
OrderGoodsEntity orderGoods = orderGoodsService.queryObject(id);
return R.ok().put("orderGoods", orderGoods);
}
/**
* 保存
*/
@RequestMapping("/save")
@RequiresPermissions("ordergoods:save")
public R save(@RequestBody OrderGoodsEntity orderGoods){
orderGoodsService.save(orderGoods);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@RequiresPermissions("ordergoods:update")
public R update(@RequestBody OrderGoodsEntity orderGoods){
orderGoodsService.update(orderGoods);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
@RequiresPermissions("ordergoods:delete")
public R delete(@RequestBody Integer[] ids){
orderGoodsService.deleteBatch(ids);
return R.ok();
}
/**
* 查看所有列表
*/
@RequestMapping("/queryAll")
public R queryAll(@RequestParam Map<String, Object> params) {
List<OrderGoodsEntity> list = orderGoodsService.queryList(params);
return R.ok().put("list", list);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。