修改事务管理
This commit is contained in:
@@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
@@ -345,23 +346,12 @@ public class BookController {
|
||||
* 常规章节拆分
|
||||
*/
|
||||
@RequestMapping("/getChapter")
|
||||
@Transactional
|
||||
public R getChapter(@RequestParam("id") Integer id) {
|
||||
|
||||
ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor();
|
||||
singleThreadExecutor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// bookService.getWordChapter(id);
|
||||
// bookService.getChapter(id);
|
||||
// bookService.getWord(id);
|
||||
bookService.getWordSection(id);
|
||||
}
|
||||
});
|
||||
|
||||
bookService.getWordSection(id);
|
||||
BookEntity bookEntity = bookService.getBaseMapper().selectById(id);
|
||||
bookEntity.setChapterStatus("2");
|
||||
bookService.updateById(bookEntity);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@@ -452,7 +452,6 @@ public class BookServiceImpl extends ServiceImpl<BookDao, BookEntity> implements
|
||||
* @return0
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean getWordSection(Integer bookId) {
|
||||
try{
|
||||
int topText = 22;
|
||||
|
||||
Reference in New Issue
Block a user