|
|
|
@ -2,6 +2,8 @@ package top.liangwy.read_statistics.controller;
|
|
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.ibatis.session.SqlSession;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.ui.Model;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
@ -24,11 +26,10 @@ import java.util.*;
|
|
|
|
|
* @ 微博
|
|
|
|
|
*/
|
|
|
|
|
@Controller
|
|
|
|
|
@Slf4j
|
|
|
|
|
@RequestMapping("/wb")
|
|
|
|
|
public class WbController extends BaseController {
|
|
|
|
|
|
|
|
|
|
// private static final Logger logger = LoggerFactory.getLogger(WbController.class);
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(WbController.class);
|
|
|
|
|
|
|
|
|
|
@GetMapping("/today")
|
|
|
|
|
public String today(Model model) {
|
|
|
|
@ -48,9 +49,9 @@ public class WbController extends BaseController {
|
|
|
|
|
if (null == wbUserScanString) {
|
|
|
|
|
status = 1;
|
|
|
|
|
} else {
|
|
|
|
|
log.info("微博点赞评论人员是:" + wbUserScanString);
|
|
|
|
|
logger.info("微博点赞评论人员是:" + wbUserScanString);
|
|
|
|
|
String newWbUserScanString = wbFree + wbUserScanString.replace(" ", "");
|
|
|
|
|
log.info(newWbUserScanString);
|
|
|
|
|
logger.info(newWbUserScanString);
|
|
|
|
|
String[] a = newWbUserScanString.split(",");
|
|
|
|
|
model.addAttribute("date", year + "年" + month + "月" + day + "日");
|
|
|
|
|
|
|
|
|
@ -100,10 +101,10 @@ public class WbController extends BaseController {
|
|
|
|
|
WbMapper wbMapper = sqlSession.getMapper(WbMapper.class);
|
|
|
|
|
|
|
|
|
|
//因为微博复制出来的有两个空行,去掉后再存入数据库
|
|
|
|
|
log.info("前端页面传入的wbUserScanList: " + wbUserScanList);
|
|
|
|
|
logger.info("前端页面传入的wbUserScanList: " + wbUserScanList);
|
|
|
|
|
String str = wbUserScanList.replace("\r\n\r\n", ",");
|
|
|
|
|
String newWbUserScanList = wbFree + str;
|
|
|
|
|
log.info("准备要输入数据库中的newWbUserScanList: " + newWbUserScanList);
|
|
|
|
|
logger.info("准备要输入数据库中的newWbUserScanList: " + newWbUserScanList);
|
|
|
|
|
int i = wbMapper.setWbUserScanList(newWbUserScanList);
|
|
|
|
|
if (i == 1) {
|
|
|
|
|
//插入成功
|
|
|
|
|