gongzuming
2024-09-19 a768dc3daa04d35fedfbe75c0a59b9b2545b85c4
src/main/java/com/mzl/flower/service/customer/FollowService.java
@@ -2,13 +2,11 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mzl.flower.config.exception.ValidationException;
import com.mzl.flower.config.security.SecurityUtils;
import com.mzl.flower.dto.request.customer.CreateFollowDTO;
import com.mzl.flower.dto.response.customer.FollowDTO;
import com.mzl.flower.entity.customer.Follow;
import com.mzl.flower.mapper.customer.FollowMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -59,4 +57,18 @@
        }
        return false;
    }
    public int fansCount(Long supplierId) {
        int count = followMapper.selectCount(new LambdaQueryWrapper<Follow>()
                .eq(Follow::getSupplierId, supplierId));
        return count;
    }
    public Integer getStatisFansCount(Long supplierId) {
        Integer count = followMapper.getStatisFansCount(supplierId);
        return count;
    }
}