import com.lcm.exception.constant.Status; import com.lcm.exception.exception.BaseException; import org.springframework.stereotype.Service; import org.springframework.util.ObjectUtils; @Service public class UserService { public boolean addUser(Object o){ if (ObjectUtils.isEmpty(o)){ throw new BaseException(Status.NULLPOINT_ERROR); } return true; } }
項目demo地址:https://github.com/woyaochengweidaniu/springgit