package org.springblade.system.expand.feign;

import io.swagger.annotations.ApiParam;
import org.springblade.system.expand.entity.Conf;
import org.springblade.system.expand.vo.ConfVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import javax.validation.Valid;
import java.util.List;

/**
 * 系统配置表 Feign
 *
 * @author lianghanqiang
 * @since 2021-04-25
 */
@FeignClient(value = "blade-system-expand",path = "/feign/conf")
public interface IConfClient  {

	/**
	 * 详情
	 */
	@GetMapping("/detail")
    ConfVO detail(@SpringQueryMap Conf conf);

	/**
	 * 根据token获取配置
	 */
	@GetMapping("/getValueByToken")
	String getValueByToken(@RequestParam String token);

	/**
	 * 查询 系统配置表
	 */
	@GetMapping("/list")
    List<ConfVO> list(@SpringQueryMap Conf conf);



	/**
	 * 新增 系统配置表
	 */
	@PostMapping("/save")
	boolean save(@Valid @RequestBody Conf conf);

	/**
	 * 修改 系统配置表
	 */
	@PostMapping("/update")
    boolean update(@Valid @RequestBody Conf conf);

	/**
	 * 新增或修改 系统配置表
	 */
	@PostMapping("/submit")
    boolean submit(@Valid @RequestBody Conf conf);


	/**
	 * 删除 系统配置表
	 */
	@PostMapping("/remove")
    boolean remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids);

	/**
	 * 添加图片前缀
	 * @param oldPicPath
	 * @return
	 */
	@GetMapping("/addPrefix")
	String addPrefix(@RequestParam String oldPicPath);

	/**
	 * 删除图片前缀
	 * @param oldPicPath
	 * @return
	 */
	@GetMapping("/removePrefix")
	String removePrefix(@RequestParam String oldPicPath);


}
