package com.ai.da.controller;


import com.ai.da.common.response.Response;
import com.ai.da.mapper.primary.entity.Product;
import com.ai.da.mapper.primary.entity.Tags;
import com.ai.da.service.ProductService;
import com.ai.da.service.TagsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

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

@CrossOrigin //开放前端的跨域访问
@Api(tags = "标签管理")
@RestController
@RequestMapping("/api/tags")
public class TagsController {

    @Resource
    private TagsService tagsService;

    @ApiOperation("获取标签")
    @GetMapping("/getTags")
    public Response<List<Tags>> getTags(@RequestParam(value = "userInput", required = false) String userInput) {
        return Response.success(tagsService.getTags(userInput));
    }
}
