package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.entity.TagCategory;
import com.zhentao.mapper.TagCategoryMapper;
import com.zhentao.service.TagCategoryService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 标签分类Service实现类
 */
@Service
public class TagCategoryServiceImpl extends ServiceImpl<TagCategoryMapper, TagCategory> implements TagCategoryService {
    
    @Override
    public List<TagCategory> getAllActiveCategories() {
        QueryWrapper<TagCategory> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("status", 1);
        queryWrapper.orderByAsc("sort_order");
        queryWrapper.orderByAsc("category_id");
        return this.list(queryWrapper);
    }
}

