package net.northking.cctp.platform.feign;

import com.hzbank.testteam.autotest.dependencies.baseDefineDependency.dto.TagDto;
import com.hzbank.testteam.autotest.dependencies.baseDefineDependency.form.TagForm;
import com.hzbank.testteam.autotest.dependencies.baseDefineDependency.vo.ResponseVO;
import net.northking.cctp.common.feign.FeignCctpConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(contextId = "apiTagService", value = "common-center", path = "/common-center/api/tag", configuration = {FeignCctpConfig.class})
public interface ApiTagService {

    @PostMapping("/save")
    ResponseVO saveTags(@RequestBody TagForm form);

    /**
     * 跟据objectId获取到其对应的标签{@literal (tag)}列表
     *
     * @param objectId 标签归属数据的ID
     * @return 标签列表
     */
    @GetMapping("/listByObjectId/{objectId}")
    List<TagDto> listTagByObjectId(@PathVariable("objectId") String objectId);

    @PostMapping("/removeByObjectId")
    Integer removeByObjectId(@RequestParam("objectId") String objectId);

    @PostMapping("/removeByObjectIds")
    Integer removeByObjectIds(@RequestBody List<String> objectIds);

    @GetMapping("/getMatchTagObject")
    ResponseVO<List<Long>> getMatchTagObject(
            @RequestParam(value = "tagContent") String tagContent,
            @RequestParam(value = "projectId") Long projectId,
            @RequestParam(value = "type") Integer type);

    @GetMapping("/getMatchTagObjectByProjectIds")
    ResponseVO<List<Long>> getMatchTagObjectByProjectIds(
            @RequestParam(value = "tagContent") String tagContent,
            @RequestParam(value = "projectIds") List<Long> projectIds,
            @RequestParam(value = "type") Integer type);

    @GetMapping("/getTagsByTypeAndProjectId")
    List<String> getTagsByTypeAndProjectId(
            @RequestParam(value = "type") Integer type,
            @RequestParam(value = "projectId") Long projectId);

    @PostMapping("/removeByProjectId")
    void removeByProjectId(@RequestParam("projectId") Long projectId);

    @PostMapping("/removeById")
    ResponseVO<Integer> removeById(@RequestParam("tagId") Long tagId);
}