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