package com.yeshi.location.app.service.impl;
|
|
import com.yeshi.location.app.dao.admin.AdminUserDao;
|
import com.yeshi.location.app.entity.AdminUser;
|
import com.yeshi.location.app.service.inter.AdminUserService;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
|
/**
|
* @author hxh
|
* @title: AdminUserServiceImpl
|
* @description:
|
* @date 2021/11/13 12:57
|
*/
|
@Service
|
public class AdminUserServiceImpl implements AdminUserService {
|
|
@Resource
|
private AdminUserDao adminUserDao;
|
|
@Override
|
public AdminUser selectByAccount(String account) {
|
return adminUserDao.selectByAccount(account);
|
}
|
|
@Override
|
public void add(AdminUser adminUser) throws Exception {
|
if (selectByAccount(adminUser.getAccount()) != null) {
|
throw new Exception("账号已存在");
|
}
|
adminUserDao.save(adminUser);
|
}
|
}
|