clock打卡前端
This commit is contained in:
@@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.BookClockEntryEntity;
|
||||
import com.peanut.modules.book.entity.BookEntity;
|
||||
import com.peanut.modules.book.service.BookClockEntryChatService;
|
||||
import com.peanut.modules.book.service.BookClockEntryService;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
import com.peanut.modules.book.service.UserBookClockService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -23,6 +25,8 @@ public class UserClockController {
|
||||
private BookClockEntryService bookClockEntryService;
|
||||
@Autowired
|
||||
private BookClockEntryChatService bookClockEntryChatService;
|
||||
@Autowired
|
||||
private BookService bookService;
|
||||
|
||||
/**
|
||||
* 获取书打卡列表
|
||||
@@ -41,6 +45,17 @@ public class UserClockController {
|
||||
return R.ok().put("page",bookClockEntryEntityPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取读书打卡详情
|
||||
* @param entryId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getBookClockDetail")
|
||||
public R getBookClockDetail(@RequestParam Integer entryId){
|
||||
BookClockEntryEntity byId = bookClockEntryService.getById(entryId);
|
||||
return R.ok().put("entry",byId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增读书打卡
|
||||
* @param bookClockEntry
|
||||
@@ -73,4 +88,31 @@ public class UserClockController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户已购打卡书列表
|
||||
* @param userId
|
||||
* @param limit
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getUserClockBooks")
|
||||
public R getUserClockBooks(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){
|
||||
Page<BookEntity> userClockBooks = bookService.getUserClockBooks(userId, limit, page);
|
||||
return R.ok().put("page",userClockBooks);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户推荐打卡图书列表
|
||||
* @param userId
|
||||
* @param limit
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getUserClockBestBooks")
|
||||
public R getUserClockBestBooks(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){
|
||||
Page<BookEntity> userClockBestBooks = bookService.getUserClockBestBooks(userId, limit, page);
|
||||
return R.ok().put("page",userClockBestBooks);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ public class BookClockEntryEntity implements Serializable {
|
||||
|
||||
private Integer bookId;
|
||||
|
||||
private String title;
|
||||
|
||||
private String image;
|
||||
|
||||
private String video;
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.modules.book.entity.BookEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -37,5 +39,12 @@ public interface BookService extends IService<BookEntity> {
|
||||
|
||||
|
||||
PageUtils queryPagebooks(Map<String, Object> params);
|
||||
|
||||
|
||||
Page<BookEntity> getUserClockBooks(Integer userId, Integer limit, Integer page);
|
||||
|
||||
|
||||
|
||||
Page<BookEntity> getUserClockBestBooks(Integer userId, Integer limit, Integer page);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,10 @@ import com.aliyun.oss.OSS;
|
||||
import com.aliyun.oss.OSSClientBuilder;
|
||||
import com.aliyun.oss.OSSException;
|
||||
import com.aliyun.oss.model.OSSObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.peanut.common.utils.ConstantPropertiesUtils;
|
||||
@@ -14,6 +16,7 @@ import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.Query;
|
||||
import com.peanut.modules.book.dao.BookDao;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.book.entity.SysDictDataEntity;
|
||||
import com.peanut.modules.book.service.BookChapterService;
|
||||
import com.peanut.modules.book.service.BookForumArticlesService;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
@@ -705,7 +708,28 @@ public class BookServiceImpl extends ServiceImpl<BookDao, BookEntity> implements
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<BookEntity> getUserClockBooks(Integer userId, Integer limit, Integer page) {
|
||||
String exist_sql = "select 1 from user_ebook_buy where book_id = book.id and user_id = "+userId;
|
||||
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BookEntity::getClockIn,1);
|
||||
wrapper.eq(BookEntity::getDelFlag,0);
|
||||
wrapper.exists(exist_sql);
|
||||
Page<BookEntity> bookEntityPage = this.getBaseMapper().selectPage(new Page<BookEntity>(page, limit), wrapper);
|
||||
return bookEntityPage;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Page<BookEntity> getUserClockBestBooks(Integer userId, Integer limit, Integer page) {
|
||||
String exist_sql = "select 1 from user_ebook_buy where book_id = book.id and user_id = "+userId;
|
||||
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BookEntity::getClockIn,1);
|
||||
wrapper.eq(BookEntity::getDelFlag,0);
|
||||
wrapper.notExists(exist_sql);
|
||||
Page<BookEntity> bookEntityPage = this.getBaseMapper().selectPage(new Page<BookEntity>(page, limit), wrapper);
|
||||
return bookEntityPage;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,18 +9,18 @@ wxpay.notifyUrl:https://testapi.nuttyreading.com/pay/payNotify
|
||||
# ?? url
|
||||
wxpay.refundNotifyUrl:http://pjm6m9.natappfree.cc/pay/refundNotify
|
||||
# key pem
|
||||
#wxpay.keyPemPath:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
|
||||
wxpay.keyPemPath:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
|
||||
#wxpay.keyPemPath:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
|
||||
wxpay.keyPemPath:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
|
||||
#wxpay.keyPemPath:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
|
||||
# ???
|
||||
wxpay.serialNo:679AECB2F7AC4183033F713828892BA640E4EEE3
|
||||
# API v3 key
|
||||
wxpay.apiV3Key:4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF
|
||||
# ????
|
||||
#wxpay.wechatPayCertificateUrl:/usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
|
||||
wxpay.wechatPayCertificateUrl:/usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
|
||||
# wxpay.wechatPayCertificateUrl:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
|
||||
wxpay.wechatPayCertificateUrl:D:/hs/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
|
||||
# wxpay.wechatPayCertificateUrl:D:/hs/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
|
||||
# ?? url
|
||||
#wxpay.privateKeyUrl:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
|
||||
wxpay.privateKeyUrl:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
|
||||
#wxpay.privateKeyUrl:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
|
||||
wxpay.privateKeyUrl:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
|
||||
#wxpay.privateKeyUrl:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
|
||||
Reference in New Issue
Block a user