问答详情
源自:3-10 用户模型管理--用户注册功能实现01

overridden method does not throw 'com.miaosha.error.BusinessException'


'register(UserModel)' in 'com.miaosha.service.impl.UserServiceImpl' clashes with 'register(UserModel)' in 'com.miaosha.service.UserService'; overridden method does not throw 'com.miaosha.error.BusinessException'


提问者:sgdy23 2019-01-18 16:32

个回答

  • qq_缔曦_04032696
    2019-01-19 12:00:10
    已采纳

    实现类和对应的接口类的方法不一样,应该是接口类在定义时没有throw BusinessException.

  • qq1515
    2019-03-05 15:35:31

    在UserService接口中这样定义re'gister方法,

     void register(UserModel userModel) throws BusinessException;