package com.ho.business.service.impl;

import com.ho.business.entity.UserHabit;
import com.ho.business.mapper.UserHabitMapper;
import com.ho.business.service.UserHabitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserHabitServiceImpl implements UserHabitService {

    @Autowired
    UserHabitMapper userHabitMapper;

    @Override
    public UserHabit selectByUserId(String userId) {
        UserHabit userHabit = userHabitMapper.selectByUserId(userId);
        return userHabit;
    }

    @Override
    public int insertUserHabit(UserHabit userHabit) {
        int count = userHabitMapper.insertUserHabit(userHabit);
        return count;
    }

    @Override
    public int updateById(UserHabit userHabit) {
        int count = userHabitMapper.updateById(userHabit);
        return count;
    }
}
