clock打卡
This commit is contained in:
@@ -0,0 +1,76 @@
|
|||||||
|
package com.peanut.modules.book.controller;
|
||||||
|
|
||||||
|
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.service.BookClockEntryChatService;
|
||||||
|
import com.peanut.modules.book.service.BookClockEntryService;
|
||||||
|
import com.peanut.modules.book.service.UserBookClockService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("book/clock")
|
||||||
|
public class UserClockController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserBookClockService userBookClockService;
|
||||||
|
@Autowired
|
||||||
|
private BookClockEntryService bookClockEntryService;
|
||||||
|
@Autowired
|
||||||
|
private BookClockEntryChatService bookClockEntryChatService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取书打卡列表
|
||||||
|
* @param bookId
|
||||||
|
* @param limit
|
||||||
|
* @param page
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getBookClocks")
|
||||||
|
public R getBookClocks(@RequestParam Integer bookId,@RequestParam Integer limit,@RequestParam Integer page){
|
||||||
|
LambdaQueryWrapper<BookClockEntryEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(BookClockEntryEntity::getBookId,bookId);
|
||||||
|
wrapper.eq(BookClockEntryEntity::getDelFlag,0);
|
||||||
|
wrapper.orderByAsc(BookClockEntryEntity::getDay);
|
||||||
|
Page<BookClockEntryEntity> bookClockEntryEntityPage = bookClockEntryService.getBaseMapper().selectPage(new Page<BookClockEntryEntity>(page, limit), wrapper);
|
||||||
|
return R.ok().put("page",bookClockEntryEntityPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增读书打卡
|
||||||
|
* @param bookClockEntry
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/addBookClock")
|
||||||
|
public R addBookClock(@RequestBody BookClockEntryEntity bookClockEntry){
|
||||||
|
bookClockEntryService.save(bookClockEntry);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除读书打卡
|
||||||
|
* @param entryId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delBookClock")
|
||||||
|
public R delBookClock(@RequestParam Integer entryId){
|
||||||
|
bookClockEntryService.removeById(entryId);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改读书打卡
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/updateBookClock")
|
||||||
|
public R updateBookClock(@RequestBody BookClockEntryEntity bookClockEntry){
|
||||||
|
bookClockEntryService.updateById(bookClockEntry);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@ import java.io.Serializable;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("user_clock_entry")
|
@TableName("book_clock_entry")
|
||||||
public class BookClockEntryEntity implements Serializable {
|
public class BookClockEntryEntity implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -19,6 +19,10 @@ public class BookClockEntryEntity implements Serializable {
|
|||||||
|
|
||||||
private Integer bookId;
|
private Integer bookId;
|
||||||
|
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
private String video;
|
||||||
|
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|||||||
@@ -9,15 +9,18 @@ wxpay.notifyUrl:https://testapi.nuttyreading.com/pay/payNotify
|
|||||||
# ?? url
|
# ?? url
|
||||||
wxpay.refundNotifyUrl:http://pjm6m9.natappfree.cc/pay/refundNotify
|
wxpay.refundNotifyUrl:http://pjm6m9.natappfree.cc/pay/refundNotify
|
||||||
# key pem
|
# 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: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.serialNo:679AECB2F7AC4183033F713828892BA640E4EEE3
|
wxpay.serialNo:679AECB2F7AC4183033F713828892BA640E4EEE3
|
||||||
# API v3 key
|
# API v3 key
|
||||||
wxpay.apiV3Key:4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF
|
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: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
|
||||||
# ?? url
|
# ?? 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: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
|
||||||
Reference in New Issue
Block a user