package com.kmall.admin.controller.vip; import java.util.List; import java.util.Map; import com.kmall.common.utils.PageUtils; import com.kmall.common.utils.Query; import com.kmall.common.utils.R; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import com.kmall.admin.entity.vip.Mall2PointsRulesEntity; import com.kmall.admin.service.vip.Mall2PointsRulesService; /** * 积分规则表Controller * * @author emato * @email admin@qhdswl.com * @date 2020-06-15 10:44:07 */ @Controller @RequestMapping("mall2pointsrules") public class Mall2PointsRulesController { @Autowired private Mall2PointsRulesService mall2PointsRulesService; /** * 查看列表 */ @RequestMapping("/list") // @RequiresPermissions("mall2pointsrules:list") @ResponseBody public R list(@RequestParam Map params) { //查询列表数据 Query query = new Query(params); List mall2PointsRulesList = mall2PointsRulesService.queryList(query); int total = mall2PointsRulesService.queryTotal(query); PageUtils pageUtil = new PageUtils(mall2PointsRulesList, total, query.getLimit(), query.getPage()); return R.ok().put("page", pageUtil); } /** * 查看信息 */ @RequestMapping("/info/{mprId}") // @RequiresPermissions("mall2pointsrules:info") @ResponseBody public R info(@PathVariable("mprId") Integer mprId) { Mall2PointsRulesEntity mall2PointsRules = mall2PointsRulesService.queryObject(mprId); return R.ok().put("mall2PointsRules", mall2PointsRules); } /** * 保存 */ @RequestMapping("/save") // @RequiresPermissions("mall2pointsrules:save") @ResponseBody public R save(@RequestBody Mall2PointsRulesEntity mall2PointsRules) { mall2PointsRulesService.save(mall2PointsRules); return R.ok(); } /** * 修改 */ @RequestMapping("/update") // @RequiresPermissions("mall2pointsrules:update") @ResponseBody public R update(@RequestBody Mall2PointsRulesEntity mall2PointsRules) { mall2PointsRulesService.update(mall2PointsRules); return R.ok(); } /** * 删除 */ @RequestMapping("/delete") // @RequiresPermissions("mall2pointsrules:delete") @ResponseBody public R delete(@RequestBody Integer[]mprIds) { mall2PointsRulesService.deleteBatch(mprIds); return R.ok(); } /** * 查看所有列表 */ @RequestMapping("/queryAll") @ResponseBody public R queryAll(@RequestParam Map params) { List list = mall2PointsRulesService.queryList(params); return R.ok().put("list", list); } }