Fixing .gitignore
This commit is contained in:
@@ -1,132 +1,132 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.modules.book.entity.AuthorEntity;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
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.PublisherEntity;
|
||||
import com.peanut.modules.book.service.PublisherService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 出版商表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-04 15:36:59
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/publisher")
|
||||
public class PublisherController {
|
||||
@Autowired
|
||||
private PublisherService publisherService;
|
||||
@Autowired
|
||||
private BookService bookService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:publisher:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = publisherService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/publisherList")
|
||||
// @RequiresPermissions("book:publisher:list")
|
||||
public R publisherList(){
|
||||
List<PublisherEntity> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<PublisherEntity>());
|
||||
ArrayList<Object> list = new ArrayList<>();
|
||||
for (PublisherEntity publisherEntitie : publisherEntities) {
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
map.put("id",publisherEntitie.getId());
|
||||
map.put("value",publisherEntitie.getPublisherName());
|
||||
list.add(map);
|
||||
}
|
||||
|
||||
return R.ok().put("list", list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:publisher:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
PublisherEntity publisher = publisherService.getById(id);
|
||||
|
||||
return R.ok().put("publisher", publisher);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/appGetInfo/{id}/{limit}/{page}")
|
||||
// @RequiresPermissions("book:author:info")
|
||||
public R appGetInfo(@PathVariable("id") Integer id,
|
||||
@PathVariable("limit") String limit,
|
||||
@PathVariable("page") String page){
|
||||
PublisherEntity publisherEntity = publisherService.getById(id);
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("publisherName",publisherEntity.getPublisherName());
|
||||
map.put("limit",limit);
|
||||
map.put("page",page);
|
||||
PageUtils pageUtils = bookService.queryPage(map);
|
||||
return R.ok().put("publisherInfo", publisherEntity).put("publisherBooks",pageUtils);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:publisher:save")
|
||||
public R save(@RequestBody PublisherEntity publisher){
|
||||
publisher.setDelFlag(0);
|
||||
publisherService.save(publisher);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:publisher:update")
|
||||
public R update(@RequestBody PublisherEntity publisher){
|
||||
publisherService.updateById(publisher);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:publisher:delete")
|
||||
public R delete(@RequestBody Integer[] ids){
|
||||
publisherService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.modules.book.entity.AuthorEntity;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
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.PublisherEntity;
|
||||
import com.peanut.modules.book.service.PublisherService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 出版商表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-04 15:36:59
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/publisher")
|
||||
public class PublisherController {
|
||||
@Autowired
|
||||
private PublisherService publisherService;
|
||||
@Autowired
|
||||
private BookService bookService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:publisher:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = publisherService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/publisherList")
|
||||
// @RequiresPermissions("book:publisher:list")
|
||||
public R publisherList(){
|
||||
List<PublisherEntity> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<PublisherEntity>());
|
||||
ArrayList<Object> list = new ArrayList<>();
|
||||
for (PublisherEntity publisherEntitie : publisherEntities) {
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
map.put("id",publisherEntitie.getId());
|
||||
map.put("value",publisherEntitie.getPublisherName());
|
||||
list.add(map);
|
||||
}
|
||||
|
||||
return R.ok().put("list", list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:publisher:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
PublisherEntity publisher = publisherService.getById(id);
|
||||
|
||||
return R.ok().put("publisher", publisher);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/appGetInfo/{id}/{limit}/{page}")
|
||||
// @RequiresPermissions("book:author:info")
|
||||
public R appGetInfo(@PathVariable("id") Integer id,
|
||||
@PathVariable("limit") String limit,
|
||||
@PathVariable("page") String page){
|
||||
PublisherEntity publisherEntity = publisherService.getById(id);
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("publisherName",publisherEntity.getPublisherName());
|
||||
map.put("limit",limit);
|
||||
map.put("page",page);
|
||||
PageUtils pageUtils = bookService.queryPage(map);
|
||||
return R.ok().put("publisherInfo", publisherEntity).put("publisherBooks",pageUtils);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:publisher:save")
|
||||
public R save(@RequestBody PublisherEntity publisher){
|
||||
publisher.setDelFlag(0);
|
||||
publisherService.save(publisher);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:publisher:update")
|
||||
public R update(@RequestBody PublisherEntity publisher){
|
||||
publisherService.updateById(publisher);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:publisher:delete")
|
||||
public R delete(@RequestBody Integer[] ids){
|
||||
publisherService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user