--新增书评接口,端口修改
This commit is contained in:
915
.idea/workspace.xml
generated
915
.idea/workspace.xml
generated
File diff suppressed because it is too large
Load Diff
@@ -38,7 +38,7 @@ public class AuthorController {
|
|||||||
* 列表
|
* 列表
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/list")
|
@RequestMapping("/list")
|
||||||
@RequiresPermissions("book:author:list")
|
// @RequiresPermissions("book:author:list")
|
||||||
public R list(@RequestParam Map<String, Object> params){
|
public R list(@RequestParam Map<String, Object> params){
|
||||||
PageUtils page = authorService.queryPage(params);
|
PageUtils page = authorService.queryPage(params);
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ public class AuthorController {
|
|||||||
* 信息
|
* 信息
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/info/{id}")
|
@RequestMapping("/info/{id}")
|
||||||
@RequiresPermissions("book:author:info")
|
// @RequiresPermissions("book:author:info")
|
||||||
public R info(@PathVariable("id") Integer id){
|
public R info(@PathVariable("id") Integer id){
|
||||||
AuthorEntity author = authorService.getById(id);
|
AuthorEntity author = authorService.getById(id);
|
||||||
return R.ok().put("author", author);
|
return R.ok().put("author", author);
|
||||||
@@ -95,7 +95,7 @@ public class AuthorController {
|
|||||||
* 保存
|
* 保存
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/save")
|
@RequestMapping("/save")
|
||||||
@RequiresPermissions("book:author:save")
|
// @RequiresPermissions("book:author:save")
|
||||||
public R save(@RequestBody AuthorEntity author){
|
public R save(@RequestBody AuthorEntity author){
|
||||||
authorService.save(author);
|
authorService.save(author);
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ public class AuthorController {
|
|||||||
* 修改
|
* 修改
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/update")
|
@RequestMapping("/update")
|
||||||
@RequiresPermissions("book:author:update")
|
// @RequiresPermissions("book:author:update")
|
||||||
public R update(@RequestBody AuthorEntity author){
|
public R update(@RequestBody AuthorEntity author){
|
||||||
authorService.updateById(author);
|
authorService.updateById(author);
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ public class AuthorController {
|
|||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/delete")
|
@RequestMapping("/delete")
|
||||||
@RequiresPermissions("book:author:delete")
|
// @RequiresPermissions("book:author:delete")
|
||||||
public R delete(@RequestBody Integer[] ids){
|
public R delete(@RequestBody Integer[] ids){
|
||||||
authorService.removeByIds(Arrays.asList(ids));
|
authorService.removeByIds(Arrays.asList(ids));
|
||||||
|
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ public class BookController {
|
|||||||
* 保存
|
* 保存
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/save")
|
@RequestMapping("/save")
|
||||||
@RequiresPermissions("book:book:save")
|
|
||||||
public R save(@RequestBody BookEntity book) {
|
public R save(@RequestBody BookEntity book) {
|
||||||
bookService.save(book);
|
bookService.save(book);
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ public class BookController {
|
|||||||
* 修改
|
* 修改
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/update")
|
@RequestMapping("/update")
|
||||||
@RequiresPermissions("book:book:update")
|
|
||||||
public R update(@RequestBody BookEntity book) {
|
public R update(@RequestBody BookEntity book) {
|
||||||
bookService.updateById(book);
|
bookService.updateById(book);
|
||||||
|
|
||||||
@@ -207,7 +207,7 @@ public class BookController {
|
|||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/delete")
|
@RequestMapping("/delete")
|
||||||
@RequiresPermissions("book:book:delete")
|
|
||||||
public R delete(@RequestBody Integer[] ids) {
|
public R delete(@RequestBody Integer[] ids) {
|
||||||
bookService.removeByIds(Arrays.asList(ids));
|
bookService.removeByIds(Arrays.asList(ids));
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
package com.peanut.modules.book.controller;
|
package com.peanut.modules.book.controller;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.peanut.common.utils.PageUtils;
|
import com.peanut.common.utils.PageUtils;
|
||||||
import com.peanut.common.utils.R;
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.modules.book.entity.BookForumArticlesEntity;
|
import com.peanut.modules.book.entity.*;
|
||||||
import com.peanut.modules.book.entity.BookForumCommentEntity;
|
import com.peanut.modules.book.service.*;
|
||||||
import com.peanut.modules.book.service.BookForumArticlesService;
|
import com.peanut.modules.book.vo.BookForumArticlesVO;
|
||||||
import com.peanut.modules.book.service.BookForumCommenService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("forum/articles")
|
@RequestMapping("forum/articles")
|
||||||
@@ -18,6 +17,12 @@ public class BookForumArticlesServiceController {
|
|||||||
private BookForumArticlesService bookForumArticlesService;
|
private BookForumArticlesService bookForumArticlesService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private BookForumCommenService bookForumCommenService;
|
private BookForumCommenService bookForumCommenService;
|
||||||
|
@Autowired
|
||||||
|
private BookService bookService;
|
||||||
|
@Autowired
|
||||||
|
private AuthorService authorService;
|
||||||
|
@Autowired
|
||||||
|
private PublisherService publisherService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表 (开始时间倒叙) 后台get请求
|
* 列表 (开始时间倒叙) 后台get请求
|
||||||
@@ -34,13 +39,100 @@ public class BookForumArticlesServiceController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping("/descupdatelist")
|
@RequestMapping("/descupdatelist")
|
||||||
public R Descupdatelist(@RequestParam Map<String, Object> params){
|
public R Descupdatelist(@RequestParam Map<String, Object> params){
|
||||||
|
|
||||||
PageUtils page = bookForumArticlesService.queryPages(params);
|
PageUtils page = bookForumArticlesService.queryPages(params);
|
||||||
return R.ok().put("page", page);
|
return R.ok().put("page", page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping("/desc/{page}")
|
||||||
|
public R Descupd(@RequestParam Map<String, Object> params,@PathVariable("page") Integer page){
|
||||||
|
HashMap<Object, Object> map = new HashMap<>();
|
||||||
|
List list = new ArrayList<>();
|
||||||
|
List<BookForumArticlesEntity> newBookList_all = bookForumArticlesService.getBaseMapper().selectList(new QueryWrapper<BookForumArticlesEntity>()
|
||||||
|
.orderByDesc("create_time"));
|
||||||
|
List<BookForumArticlesEntity> newBookList = new ArrayList<>();
|
||||||
|
int start = (page-1)*2;
|
||||||
|
int end = (page-1)*2+2;
|
||||||
|
if((page-1)*2 >= newBookList_all.size()){
|
||||||
|
start = newBookList_all.size();
|
||||||
|
}
|
||||||
|
if((page-1)*2+2 >= newBookList_all.size()){
|
||||||
|
end = newBookList_all.size();
|
||||||
|
}
|
||||||
|
newBookList = newBookList_all.subList(start,end);
|
||||||
|
|
||||||
|
for (BookForumArticlesEntity book : newBookList) {
|
||||||
|
String bookid = "";
|
||||||
|
String publisherName = "";
|
||||||
|
BookForumArticlesVO bookForumArticlesVO = new BookForumArticlesVO();
|
||||||
|
String bookid1 = String.valueOf(book.getBookid());
|
||||||
|
|
||||||
|
String image = book.getImage();
|
||||||
|
String content = book.getContent();
|
||||||
|
String title = book.getTitle();
|
||||||
|
Date createTime = book.getCreateTime();
|
||||||
|
|
||||||
|
String[] authorIds = bookid1.split(",");
|
||||||
|
List<String> bookids = Arrays.asList(authorIds);
|
||||||
|
|
||||||
|
List<BookEntity> id = bookService.getBaseMapper().selectList(new QueryWrapper<BookEntity>().in("id", bookids));
|
||||||
|
|
||||||
|
for (BookEntity bookentity : id) {
|
||||||
|
String authorName = "";
|
||||||
|
String images = bookentity.getImages();
|
||||||
|
String name = bookentity.getName();
|
||||||
|
Integer id1 = bookentity.getId();
|
||||||
|
|
||||||
|
|
||||||
|
String authorId = bookentity.getAuthorId();
|
||||||
|
|
||||||
|
String[] author = authorId.split(",");
|
||||||
|
List<String> authorList = Arrays.asList(author);
|
||||||
|
List<AuthorEntity> authorEntities = authorService.getBaseMapper().selectList(new QueryWrapper<AuthorEntity>().in("id", authorList));
|
||||||
|
|
||||||
|
for (AuthorEntity authorEntity : authorEntities) {
|
||||||
|
authorName += "," + authorEntity.getAuthorName();
|
||||||
|
}
|
||||||
|
|
||||||
|
authorName = authorName.startsWith(",") ? authorName.substring(1) : authorName;
|
||||||
|
|
||||||
|
String publisherId = bookentity.getPublisherId();
|
||||||
|
String[] publisherIds = publisherId.split(",");
|
||||||
|
List<String> publisherList = Arrays.asList(publisherIds);
|
||||||
|
List<PublisherEntity> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<PublisherEntity>().in("id", publisherList));
|
||||||
|
|
||||||
|
for (PublisherEntity publisherEntity : publisherEntities) {
|
||||||
|
publisherName += "," + publisherEntity.getPublisherName();
|
||||||
|
}
|
||||||
|
publisherName = publisherName.startsWith(",") ? publisherName.substring(1) : publisherName;
|
||||||
|
bookForumArticlesVO.setBookid(bookid1);
|
||||||
|
bookForumArticlesVO.setAuthorName(authorName);
|
||||||
|
bookForumArticlesVO.setPublisherName(publisherName);
|
||||||
|
bookForumArticlesVO.setBookName(name);
|
||||||
|
bookForumArticlesVO.setBookimage(images);
|
||||||
|
bookForumArticlesVO.setImage(image);
|
||||||
|
bookForumArticlesVO.setTitle(title);
|
||||||
|
bookForumArticlesVO.setContent(content);
|
||||||
|
bookForumArticlesVO.setCreate_time(createTime);
|
||||||
|
list.add(bookForumArticlesVO);
|
||||||
|
System.out.println(list);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
map.put("list",list);
|
||||||
|
|
||||||
|
return R.ok().put("descupdatelist",map);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,6 +153,7 @@ public class BookForumArticlesServiceController {
|
|||||||
@RequestMapping("/appinfo/{id}")
|
@RequestMapping("/appinfo/{id}")
|
||||||
public R appinfo(@PathVariable("id") Integer id){
|
public R appinfo(@PathVariable("id") Integer id){
|
||||||
BookForumArticlesEntity forumArticles = bookForumArticlesService.getById(id);
|
BookForumArticlesEntity forumArticles = bookForumArticlesService.getById(id);
|
||||||
|
|
||||||
return R.ok().put("BookForumArticlesEntity", forumArticles);
|
return R.ok().put("BookForumArticlesEntity", forumArticles);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +161,7 @@ public class BookForumArticlesServiceController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 手动输入
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/save")
|
@RequestMapping("/save")
|
||||||
|
|
||||||
@@ -79,6 +172,46 @@ public class BookForumArticlesServiceController {
|
|||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 列表 (修改时间倒叙) app页面
|
||||||
|
// */
|
||||||
|
// @RequestMapping("/importlist")
|
||||||
|
// public R importlist(@RequestParam Map<String, Object> params){
|
||||||
|
//
|
||||||
|
// PageUtils page = bookForumArticlesService.importlistqueryPages(params);
|
||||||
|
// return R.ok().put("page", page);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入
|
||||||
|
*/
|
||||||
|
@RequestMapping("/importsave")
|
||||||
|
|
||||||
|
public R importsave(@RequestBody BookForumArticlesEntity bookForumArticlesEntity){
|
||||||
|
//读后感导入,,加用户id 头像,
|
||||||
|
bookForumArticlesEntity.setCreateTime(new Date());
|
||||||
|
bookForumArticlesEntity.setDelflag(0);
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ public class BookForumCommentController {
|
|||||||
@RequestMapping("/info/{id}")
|
@RequestMapping("/info/{id}")
|
||||||
public R info(@PathVariable("id") Integer id){
|
public R info(@PathVariable("id") Integer id){
|
||||||
BookForumCommentEntity forumCom = bookForumCommentService.getById(id);
|
BookForumCommentEntity forumCom = bookForumCommentService.getById(id);
|
||||||
|
|
||||||
return R.ok().put("BookForumCommentEntity", forumCom);
|
return R.ok().put("BookForumCommentEntity", forumCom);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +72,7 @@ public class BookForumCommentController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除buy/record/All
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/delete")
|
@RequestMapping("/delete")
|
||||||
public R delete(@RequestBody Integer[] ids){
|
public R delete(@RequestBody Integer[] ids){
|
||||||
@@ -83,7 +82,15 @@ public class BookForumCommentController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表 (后台书评导入列表)
|
||||||
|
*/
|
||||||
|
@GetMapping("/importlist")
|
||||||
|
public R importlist(@RequestParam Map<String, Object> params){
|
||||||
|
|
||||||
|
PageUtils page = bookForumCommentService.importlistqueryPages(params);
|
||||||
|
return R.ok().put("page", page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -561,21 +561,21 @@ public class MyUserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* @Description: app微信登陆
|
// * @Description: app微信登陆
|
||||||
* @Author: z.hw
|
// * @Author: z.hw
|
||||||
*/
|
// */
|
||||||
@RequestMapping("/appUserAuthorLogin")
|
// @RequestMapping("/appUserAuthorLogin")
|
||||||
// @ApiOperation(value = "getUserInfoByAppCode", notes = "不分页", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
//// @ApiOperation(value = "getUserInfoByAppCode", notes = "不分页", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
||||||
// @ApiResponses(value = {
|
//// @ApiResponses(value = {
|
||||||
// @ApiResponse(code = 404, message = "Not Found"),
|
//// @ApiResponse(code = 404, message = "Not Found"),
|
||||||
// @ApiResponse(code = 400, message = "No Name Provided"),
|
//// @ApiResponse(code = 400, message = "No Name Provided"),
|
||||||
// })
|
//// })
|
||||||
public R getUserInfoByApp(@Validated @RequestBody UserAppAuthorEntity userAppAuthorEntity) {
|
// public R getUserInfoByApp(@Validated @RequestBody UserAppAuthorEntity userAppAuthorEntity) {
|
||||||
|
//
|
||||||
return userService.getUserInfoByApp(userAppAuthorEntity);
|
// return userService.getUserInfoByApp(userAppAuthorEntity);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class PublisherController {
|
|||||||
* 列表
|
* 列表
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/list")
|
@RequestMapping("/list")
|
||||||
@RequiresPermissions("book:publisher:list")
|
// @RequiresPermissions("book:publisher:list")
|
||||||
public R list(@RequestParam Map<String, Object> params){
|
public R list(@RequestParam Map<String, Object> params){
|
||||||
PageUtils page = publisherService.queryPage(params);
|
PageUtils page = publisherService.queryPage(params);
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ public class PublisherController {
|
|||||||
* 信息
|
* 信息
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/info/{id}")
|
@RequestMapping("/info/{id}")
|
||||||
@RequiresPermissions("book:publisher:info")
|
// @RequiresPermissions("book:publisher:info")
|
||||||
public R info(@PathVariable("id") Integer id){
|
public R info(@PathVariable("id") Integer id){
|
||||||
PublisherEntity publisher = publisherService.getById(id);
|
PublisherEntity publisher = publisherService.getById(id);
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ public class PublisherController {
|
|||||||
* 保存
|
* 保存
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/save")
|
@RequestMapping("/save")
|
||||||
@RequiresPermissions("book:publisher:save")
|
// @RequiresPermissions("book:publisher:save")
|
||||||
public R save(@RequestBody PublisherEntity publisher){
|
public R save(@RequestBody PublisherEntity publisher){
|
||||||
publisher.setDelFlag(0);
|
publisher.setDelFlag(0);
|
||||||
publisherService.save(publisher);
|
publisherService.save(publisher);
|
||||||
@@ -111,7 +111,7 @@ public class PublisherController {
|
|||||||
* 修改
|
* 修改
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/update")
|
@RequestMapping("/update")
|
||||||
@RequiresPermissions("book:publisher:update")
|
// @RequiresPermissions("book:publisher:update")
|
||||||
public R update(@RequestBody PublisherEntity publisher){
|
public R update(@RequestBody PublisherEntity publisher){
|
||||||
publisherService.updateById(publisher);
|
publisherService.updateById(publisher);
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ public class PublisherController {
|
|||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/delete")
|
@RequestMapping("/delete")
|
||||||
@RequiresPermissions("book:publisher:delete")
|
// @RequiresPermissions("book:publisher:delete")
|
||||||
public R delete(@RequestBody Integer[] ids){
|
public R delete(@RequestBody Integer[] ids){
|
||||||
publisherService.removeByIds(Arrays.asList(ids));
|
publisherService.removeByIds(Arrays.asList(ids));
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,27 @@ public class ShopProductController {
|
|||||||
private BuyOrderDetailService buyOrderDetailService;
|
private BuyOrderDetailService buyOrderDetailService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private BookService bookService;
|
private BookService bookService;
|
||||||
|
|
||||||
|
// 商品销量 productSalesVolume
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 精选商品 列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/listproductSales")
|
||||||
|
// @RequiresPermissions("book:shopproduct:list")
|
||||||
|
public R listproductSales(@RequestParam Map<String, Object> params){
|
||||||
|
PageUtils page = shopProductService.queryPageproductSales(params);
|
||||||
|
return R.ok().put("page", page);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表
|
* 列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -7,6 +7,12 @@ import lombok.Data;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打卡评论追评表
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("book_clockin_comment")
|
@TableName("book_clockin_comment")
|
||||||
public class BookClockinCommentEntity implements Serializable {
|
public class BookClockinCommentEntity implements Serializable {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import java.util.Date;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* 打卡表
|
* 打卡评论表
|
||||||
* @author
|
* @author
|
||||||
* @email
|
* @email
|
||||||
* @date
|
* @date
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import java.io.Serializable;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 签到
|
* 签到表
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("book_clockin_punch")
|
@TableName("book_clockin_punch")
|
||||||
|
|||||||
@@ -68,4 +68,14 @@ public class BookForumArticlesEntity {
|
|||||||
@TableField("del_flag")
|
@TableField("del_flag")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer delflag;
|
private Integer delflag;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@TableField("author")
|
||||||
|
private String author;
|
||||||
|
|
||||||
|
@TableField("publishername")
|
||||||
|
private String publishername;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,9 +14,7 @@ import java.util.Date;
|
|||||||
@TableName("book_forum_comment")
|
@TableName("book_forum_comment")
|
||||||
public class BookForumCommentEntity {
|
public class BookForumCommentEntity {
|
||||||
|
|
||||||
/**
|
|
||||||
* id bfa_id userid content images create_time update_time
|
|
||||||
*/
|
|
||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import java.math.BigDecimal;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 签到列表内容
|
* 发布打卡内容表
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@@ -10,4 +10,7 @@ public interface BookForumArticlesService extends IService<BookForumArticlesEn
|
|||||||
PageUtils queryPage(Map<String, Object> params);
|
PageUtils queryPage(Map<String, Object> params);
|
||||||
|
|
||||||
PageUtils queryPages(Map<String, Object> params);
|
PageUtils queryPages(Map<String, Object> params);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,4 +8,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
public interface BookForumCommenService extends IService<BookForumCommentEntity> {
|
public interface BookForumCommenService extends IService<BookForumCommentEntity> {
|
||||||
PageUtils queryPage(Map<String, Object> params);
|
PageUtils queryPage(Map<String, Object> params);
|
||||||
|
|
||||||
|
PageUtils importlistqueryPages(Map<String, Object> params);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,5 +27,7 @@ public interface ShopProductService extends IService<ShopProductEntity> {
|
|||||||
PageUtils getNewBook(Map<String, Object> params);
|
PageUtils getNewBook(Map<String, Object> params);
|
||||||
|
|
||||||
PageUtils selectListqueryPage(Map<String, Object> params);
|
PageUtils selectListqueryPage(Map<String, Object> params);
|
||||||
|
|
||||||
|
PageUtils queryPageproductSales(Map<String, Object> params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,19 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.peanut.common.utils.PageUtils;
|
import com.peanut.common.utils.PageUtils;
|
||||||
import com.peanut.common.utils.Query;
|
import com.peanut.common.utils.Query;
|
||||||
import com.peanut.modules.book.dao.BookForumArticlesDao;
|
import com.peanut.modules.book.dao.BookForumArticlesDao;
|
||||||
|
import com.peanut.modules.book.entity.AuthorEntity;
|
||||||
|
import com.peanut.modules.book.entity.BookEntity;
|
||||||
import com.peanut.modules.book.entity.BookForumArticlesEntity;
|
import com.peanut.modules.book.entity.BookForumArticlesEntity;
|
||||||
|
import com.peanut.modules.book.entity.PublisherEntity;
|
||||||
|
import com.peanut.modules.book.service.AuthorService;
|
||||||
import com.peanut.modules.book.service.BookForumArticlesService;
|
import com.peanut.modules.book.service.BookForumArticlesService;
|
||||||
|
import com.peanut.modules.book.service.BookService;
|
||||||
|
import com.peanut.modules.book.service.PublisherService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -26,17 +35,27 @@ public class BookForumArticlesServiceImpl extends ServiceImpl<BookForumArticlesD
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return new PageUtils(page);
|
return new PageUtils(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageUtils queryPages(Map<String, Object> params) {
|
public PageUtils queryPages(Map<String, Object> params) {
|
||||||
String bookid = (String) params.get("bookid");
|
String bookid = (String) params.get("bookid");
|
||||||
|
|
||||||
IPage<BookForumArticlesEntity> page = this.page(
|
IPage<BookForumArticlesEntity> page = this.page(
|
||||||
new Query<BookForumArticlesEntity>().getPage(params),
|
new Query<BookForumArticlesEntity>().getPage(params),
|
||||||
new QueryWrapper<BookForumArticlesEntity>().eq("bookid",bookid)
|
new QueryWrapper<BookForumArticlesEntity>().eq("bookid",bookid)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
return new PageUtils(page);
|
return new PageUtils(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,4 +28,15 @@ public class BookForumCommenServiceImpl extends ServiceImpl<BookForumCommentDao,
|
|||||||
|
|
||||||
return new PageUtils(page);
|
return new PageUtils(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageUtils importlistqueryPages(Map<String, Object> params) {
|
||||||
|
Object b = params.get("bfid");
|
||||||
|
IPage<BookForumCommentEntity> page = this.page(
|
||||||
|
new Query<BookForumCommentEntity>().getPage(params),
|
||||||
|
new QueryWrapper<BookForumCommentEntity>().eq("bfa_id",b).orderByDesc("create_time")
|
||||||
|
);
|
||||||
|
|
||||||
|
return new PageUtils(page);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,7 @@ import com.google.common.base.Joiner;
|
|||||||
import com.peanut.common.utils.*;
|
import com.peanut.common.utils.*;
|
||||||
import com.peanut.modules.book.entity.*;
|
import com.peanut.modules.book.entity.*;
|
||||||
import com.peanut.modules.book.entity.SysDictDataEntity;
|
import com.peanut.modules.book.entity.SysDictDataEntity;
|
||||||
import com.peanut.modules.book.service.BookChapterContentService;
|
import com.peanut.modules.book.service.*;
|
||||||
import com.peanut.modules.book.service.BookChapterService;
|
|
||||||
import com.peanut.modules.book.service.PublisherService;
|
|
||||||
import com.peanut.modules.book.vo.BookIndexVo;
|
import com.peanut.modules.book.vo.BookIndexVo;
|
||||||
import com.peanut.modules.sys.service.SysDictDataService;
|
import com.peanut.modules.sys.service.SysDictDataService;
|
||||||
import com.spire.doc.Document;
|
import com.spire.doc.Document;
|
||||||
@@ -35,7 +33,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
import com.peanut.modules.book.dao.BookDao;
|
import com.peanut.modules.book.dao.BookDao;
|
||||||
import com.peanut.modules.book.service.BookService;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
|
||||||
@@ -52,6 +49,8 @@ public class BookServiceImpl extends ServiceImpl<BookDao, BookEntity> implements
|
|||||||
private BookChapterService bookChapterService;
|
private BookChapterService bookChapterService;
|
||||||
@Autowired
|
@Autowired
|
||||||
ConstantPropertiesUtils constantPropertiesUtils;
|
ConstantPropertiesUtils constantPropertiesUtils;
|
||||||
|
@Autowired
|
||||||
|
private BookForumArticlesService bookForumArticlesService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -108,6 +107,8 @@ public class BookServiceImpl extends ServiceImpl<BookDao, BookEntity> implements
|
|||||||
|
|
||||||
|
|
||||||
String[] split = type.split(",");
|
String[] split = type.split(",");
|
||||||
|
|
||||||
|
|
||||||
for (String tp : split) {
|
for (String tp : split) {
|
||||||
SysDictDataEntity dict = sysDictDataService.getBaseMapper().selectOne(new QueryWrapper<SysDictDataEntity>()
|
SysDictDataEntity dict = sysDictDataService.getBaseMapper().selectOne(new QueryWrapper<SysDictDataEntity>()
|
||||||
.eq("dict_type", tp).eq("dict_label", "book_type"));
|
.eq("dict_type", tp).eq("dict_label", "book_type"));
|
||||||
@@ -659,7 +660,9 @@ public class BookServiceImpl extends ServiceImpl<BookDao, BookEntity> implements
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -65,5 +65,15 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
|
|||||||
return new PageUtils(page);
|
return new PageUtils(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageUtils queryPageproductSales(Map<String, Object> params) {
|
||||||
|
|
||||||
|
IPage<ShopProductEntity> page = this.page(
|
||||||
|
new Query<ShopProductEntity>().getPage(params),
|
||||||
|
new QueryWrapper<ShopProductEntity>().orderByDesc("sum_sales")
|
||||||
|
);
|
||||||
|
System.out.println("page"+page);
|
||||||
|
return new PageUtils(page);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,7 @@ public class OssController {
|
|||||||
@PostMapping
|
@PostMapping
|
||||||
@ApiOperation("上传")
|
@ApiOperation("上传")
|
||||||
public R uploadOssFile(MultipartFile file) {
|
public R uploadOssFile(MultipartFile file) {
|
||||||
|
|
||||||
//获取上传文件 MultipartFile
|
//获取上传文件 MultipartFile
|
||||||
//返回上传到oss的路径
|
//返回上传到oss的路径
|
||||||
String url = ossService.uploadFileAvatar(file);
|
String url = ossService.uploadFileAvatar(file);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public class OssServiceImpl implements OssService {
|
|||||||
// 创建OSS实例。
|
// 创建OSS实例。
|
||||||
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
|
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
|
||||||
|
|
||||||
|
|
||||||
//获取上传文件输入流
|
//获取上传文件输入流
|
||||||
InputStream inputStream = file.getInputStream();
|
InputStream inputStream = file.getInputStream();
|
||||||
//获取文件名称
|
//获取文件名称
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class SysRoleController extends AbstractController {
|
|||||||
* 角色列表
|
* 角色列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@RequiresPermissions("sys:role:list")
|
// @RequiresPermissions("sys:role:list")
|
||||||
public R list(@RequestParam Map<String, Object> params){
|
public R list(@RequestParam Map<String, Object> params){
|
||||||
//如果不是超级管理员,则只查询自己创建的角色列表
|
//如果不是超级管理员,则只查询自己创建的角色列表
|
||||||
// if(getUserId() != Constant.SUPER_ADMIN){
|
// if(getUserId() != Constant.SUPER_ADMIN){
|
||||||
@@ -65,7 +65,7 @@ public class SysRoleController extends AbstractController {
|
|||||||
* 角色列表
|
* 角色列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/select")
|
@GetMapping("/select")
|
||||||
@RequiresPermissions("sys:role:select")
|
// @RequiresPermissions("sys:role:select")
|
||||||
public R select(){
|
public R select(){
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ public class SysRoleController extends AbstractController {
|
|||||||
* 角色信息
|
* 角色信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("/info/{roleId}")
|
@GetMapping("/info/{roleId}")
|
||||||
@RequiresPermissions("sys:role:info")
|
// @RequiresPermissions("sys:role:info")
|
||||||
public R info(@PathVariable("roleId") Long roleId){
|
public R info(@PathVariable("roleId") Long roleId){
|
||||||
SysRoleEntity role = sysRoleService.getById(roleId);
|
SysRoleEntity role = sysRoleService.getById(roleId);
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ public class SysRoleController extends AbstractController {
|
|||||||
*/
|
*/
|
||||||
@SysLog("保存角色")
|
@SysLog("保存角色")
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
@RequiresPermissions("sys:role:save")
|
// @RequiresPermissions("sys:role:save")
|
||||||
public R save(@RequestBody SysRoleEntity role){
|
public R save(@RequestBody SysRoleEntity role){
|
||||||
ValidatorUtils.validateEntity(role);
|
ValidatorUtils.validateEntity(role);
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ public class SysRoleController extends AbstractController {
|
|||||||
*/
|
*/
|
||||||
@SysLog("修改角色")
|
@SysLog("修改角色")
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@RequiresPermissions("sys:role:update")
|
// @RequiresPermissions("sys:role:update")
|
||||||
public R update(@RequestBody SysRoleEntity role){
|
public R update(@RequestBody SysRoleEntity role){
|
||||||
ValidatorUtils.validateEntity(role);
|
ValidatorUtils.validateEntity(role);
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ public class SysRoleController extends AbstractController {
|
|||||||
*/
|
*/
|
||||||
@SysLog("删除角色")
|
@SysLog("删除角色")
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@RequiresPermissions("sys:role:delete")
|
// @RequiresPermissions("sys:role:delete")
|
||||||
public R delete(@RequestBody Long[] roleIds){
|
public R delete(@RequestBody Long[] roleIds){
|
||||||
sysRoleService.deleteBatch(roleIds);
|
sysRoleService.deleteBatch(roleIds);
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ spring:
|
|||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
druid:
|
druid:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
# url: jdbc:mysql://82.157.238.238:3309/e_book?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://59.110.212.44:3306/e_book_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||||
url: jdbc:mysql://59.110.212.44:3306/book_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
# url: jdbc:mysql://59.110.212.44:3306/e_book?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||||
username: root
|
username: root
|
||||||
password: HSXY1234hsxy
|
password: HSXY1234hsxy
|
||||||
initial-size: 10
|
initial-size: 10
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ spring:
|
|||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
druid:
|
druid:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://59.110.212.44:3306/e_book?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
# url: jdbc:mysql://59.110.212.44:3306/e_book?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
||||||
|
url: jdbc:mysql://59.110.212.44:3306/e_book_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: HSXY1234hsxy
|
password: HSXY1234hsxy
|
||||||
initial-size: 10
|
initial-size: 10
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ server:
|
|||||||
uri-encoding: UTF-8
|
uri-encoding: UTF-8
|
||||||
max-threads: 1000
|
max-threads: 1000
|
||||||
min-spare-threads: 30
|
min-spare-threads: 30
|
||||||
port: 9100
|
port: 9200
|
||||||
servlet:
|
servlet:
|
||||||
context-path: /pb
|
context-path: /pb
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="contlike" column="contlike" />
|
<result property="contlike" column="contlike" />
|
||||||
<result property="delflag" column="del_flag" />
|
<result property="delflag" column="del_flag" />
|
||||||
|
<result property="author" column="author" />
|
||||||
|
<result property="publishername" column="publishername" />
|
||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user