fix:设置初始状态

上级 0503d7e7
......@@ -124,11 +124,6 @@
<artifactId>mybatis-plus-extension</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
......
package com.kwan.springbootkwan.controller;
import com.kwan.springbootkwan.entity.User;
import com.kwan.springbootkwan.service.IUserService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/seata")
public class SeataControlller {
@Autowired
private IUserService userService;
@ApiOperation(value = "保存用户", notes = "保存用户")
@RequestMapping(value = "/save", method = RequestMethod.GET)
public User save() {
//保存用户
User user = new User();
user.setName("秦梓淞");
user.setSex("男");
return userService.saveUser(user);
}
}
......@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.kwan.springbootkwan.entity.CsdnUserInfo;
import com.kwan.springbootkwan.enums.CollectStatus;
import com.kwan.springbootkwan.enums.CommentStatus;
import com.kwan.springbootkwan.enums.LikeStatus;
import com.kwan.springbootkwan.service.CsdnService;
import com.kwan.springbootkwan.service.CsdnUserInfoService;
......@@ -43,7 +44,7 @@ public class CsdnSchedule {
for (CsdnUserInfo csdnUserInfo : list) {
csdnUserInfo.setLikeStatus(LikeStatus.UN_PROCESSED.getCode());
csdnUserInfo.setCollectStatus(CollectStatus.UN_PROCESSED.getCode());
// csdnUserInfo.setCommentStatus(CommentStatus.UN_PROCESSED.getCode());
csdnUserInfo.setCommentStatus(CommentStatus.RESTRICTED_COMMENTS.getCode());
csdnUserInfoService.updateById(csdnUserInfo);
}
}
......
......@@ -27,7 +27,6 @@ spring:
# mysql
datasource:
dynamic:
seata: true
primary: kwan-ds
datasource:
kwan-ds:
......
......@@ -23,20 +23,6 @@ spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
#seata:
# tx-service-group: default_tx_group
#seata:
# application-id: spring-boot-name
# tx-service-group: my-tx-group
# service:
# vgroup-mapping:
# my-tx-group: seata-server
# grouplist:
# seata-server: 127.0.0.1:8091
# enabled: true
#mybatis-plus配置
mybatis-plus:
......
service {
#事务组名称
vgroup_mapping.my-tx-group ="seata-server"
default.grouplist ="127.0.0.1:8091'
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册