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); } }