Code Monkey home page Code Monkey logo

Comments (4)

smltq avatar smltq commented on May 18, 2024

可以贴上报错信息吗,方便我排查

from spring-boot-demo.

Strivema avatar Strivema commented on May 18, 2024

`package com.easy.mybatis.multidatasource.config;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@aspect
@component
public class DataSourceAop {
@pointcut("@annotation(com.easy.mybatis.multidatasource.annotation.Master) " +
"|| execution(* com.easy.mybatis.multidatasource.service...insert(..)) " +
"|| execution(* com.easy.mybatis.multidatasource.service...add(..)) " +
"|| execution(* com.easy.mybatis.multidatasource.service...update(..)) " +
"|| execution(* com.easy.mybatis.multidatasource.service...edit(..)) " +
"|| execution(* com.easy.mybatis.multidatasource.service...delete(..)) " +
"|| execution(* com.easy.mybatis.multidatasource.service...remove(..))")
public void writePointcut() {

}

@Pointcut("!@annotation(com.easy.mybatis.multidatasource.annotation.Master) " +
        "&& (execution(* com.easy.mybatis.multidatasource.service..*.select*(..)) " +
        "|| execution(* com.easy.mybatis.multidatasource.service..*.get*(..)))")
public void readPointcut() {

}`

您看,readPointCut,里面的注解在代码22行,抱歉截屏不了

from spring-boot-demo.

smltq avatar smltq commented on May 18, 2024

这个没有错的,你注意看下括号,类似这样(!master&&(select||get)。表示没有master注解并且是select或get开头的方法,去读库取数据。

from spring-boot-demo.

Strivema avatar Strivema commented on May 18, 2024

抱歉,没看见前面的非,不好意思

from spring-boot-demo.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.