first commit
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
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.peanut.modules.book.entity.UserEbookBuyEntity;
|
||||
import com.peanut.modules.book.service.UserEbookBuyService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 用户购买书籍表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-18 16:28:20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/userebookbuy")
|
||||
public class UserEbookBuyController {
|
||||
@Autowired
|
||||
private UserEbookBuyService userEbookBuyService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:userebookbuy:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = userEbookBuyService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{buyId}")
|
||||
// @RequiresPermissions("book:userebookbuy:info")
|
||||
public R info(@PathVariable("buyId") Integer buyId){
|
||||
UserEbookBuyEntity userEbookBuy = userEbookBuyService.getById(buyId);
|
||||
|
||||
return R.ok().put("userEbookBuy", userEbookBuy);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:userebookbuy:save")
|
||||
public R save(@RequestBody UserEbookBuyEntity userEbookBuy){
|
||||
userEbookBuyService.save(userEbookBuy);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:userebookbuy:update")
|
||||
public R update(@RequestBody UserEbookBuyEntity userEbookBuy){
|
||||
userEbookBuyService.updateById(userEbookBuy);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:userebookbuy:delete")
|
||||
public R delete(@RequestBody Integer[] buyIds){
|
||||
userEbookBuyService.removeByIds(Arrays.asList(buyIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user