package io.gisbi.template.service;

import io.gisbi.api.template.TemplateMarketApi;
import io.gisbi.api.template.response.MarketBaseResponse;
import io.gisbi.api.template.response.MarketPreviewBaseResponse;
import io.gisbi.api.template.vo.MarketMetaDataVO;
import io.gisbi.template.manage.TemplateCenterManage;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author bi-coder
 * @date : 2023/11/17 13:20
 */
@RestController
@RequestMapping("/templateMarket")
public class TemplateMarketService implements TemplateMarketApi {

    @Resource
    private TemplateCenterManage templateCenterManage;
    @Override
    public MarketBaseResponse searchTemplate() {
        return templateCenterManage.searchTemplate("0");
    }
    @Override
    public MarketBaseResponse searchTemplateRecommend() {
        return templateCenterManage.searchTemplateRecommend();
    }

    @Override
    public MarketPreviewBaseResponse searchTemplatePreview(String offline) {
        return templateCenterManage.searchTemplatePreview(offline);
    }

    @Override
    public List<String> categories() {
        return templateCenterManage.getCategories();
    }

    @Override
    public List<MarketMetaDataVO> categoriesObject() {
        return templateCenterManage.getCategoriesObject();
    }
}
