package com.hs.api.service.Impl;

import com.hs.api.mapper.SysRoleMapper;
import com.hs.api.model.SysRole;
import com.hs.api.service.SysRoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SysRoleServiceImpl implements SysRoleService {
    @Resource
    private SysRoleMapper sysRoleMapper;

    @Override
    public int add(SysRole sysRole) {
        return sysRoleMapper.insert(sysRole);
    }

    @Override
    public List<SysRole> findAll() {
        return sysRoleMapper.selectAll();
    }

    @Override
    public SysRole find(Long id) {
        return sysRoleMapper.selectByPrimaryKey(id);
    }

    @Override
    public int delete(Long id) {
        return sysRoleMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int logicDelete(Long id) {
        return 0;
    }

    @Override
    public int update(SysRole sysRole) {
        return sysRoleMapper.updateByPrimaryKey(sysRole);
    }
}
