PersonServiceImpl.java 784 字节
Newer Older
1 2
package com.kwan.springbootkwan.service.impl;

3
import com.baomidou.dynamic.datasource.annotation.DS;
4 5 6 7 8 9 10 11 12 13 14 15 16
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kwan.springbootkwan.entity.Person;
import com.kwan.springbootkwan.mapper.PersonMapper;
import com.kwan.springbootkwan.service.IPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person> implements IPersonService {

    @Autowired
    private PersonMapper personMapper;

17
    @DS(value = "ali-ds")
18 19 20
    @Override
    public Person savePerson(Person person) {
        personMapper.insert(person);
21
//        final int i = 1 / 0;
22 23 24
        return person;
    }
}