admin 管理员组文章数量: 887021
2024年1月5日发(作者:web界面开发工程师)
ckage ;import ield;import ogic;import ame;import n;import ;import ;@Data@TableName(value ="user")public class User extends BaseEntity {@Versionprivate Integer version;private String username;private String nickname;private String password;private String email;private String phone;private Integer age;private Integer gender;private Integer status;@TableField(value = "last_login_time")private Date lastLoginTime;@TableLogic(value = "0", delval = "1")private Integer del;} 1 package ; 2
3 import pper; 4 import ; 5
6 /** 7 * @desc: 8 * @author:caifan 9 * @date:2020/3/1510 */11 public interface UserMapper extends BaseMapper
import tBody;import tMapping;import tMethod;import ntroller;import ;@RestController@RequestMapping("/rest/user")public class UserRest {@Autowiredprivate UserService userService;@RequestMapping(value = "/save1", method = , produces = ATION_JSON_UTF8_VALUE)public void save1(@RequestBody User user) { if (null == ateTime()) { ateTime(new Date()); } er1(user);}@RequestMapping(value = "/save2", method = , produces = ATION_JSON_UTF8_VALUE)public void save2(@RequestBody User user) { if (null == ateTime()) { ateTime(new Date()); } er2(user);}} 1 package e; 2
3 import ; 4 import ; 5 import pper; 6 import e; 7 import ctional; 8
9 import ce;10
11 @Service12 @Transactional13 @DS("ds1")14 public class UserService {15 @Resource16 private UserMapper userMapper;17
18 public void saveUser1(User user) {19 (user);20 }21
22 public User findById(Long id) {23 return ById(id);24 }25
26 @DS("ds2")27 public void saveUser2(User user) {28 (user);29 }30
31 } 1 package ;
版权声明:本文标题:mybatis-plus、hikariCP动态数据源 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/free/1704444746h460076.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论