package org.springblade.community.feign;

import io.swagger.annotations.ApiParam;
import org.springblade.community.entity.Unit;
import org.springblade.community.vo.UnitVO;
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-03-29
 */
@FeignClient(value = "cyzh-community",path = "/feign/unit")
public interface IUnitClient  {

	/**
	 * 详情
	 */
	@GetMapping("/detail")
    UnitVO detail(@SpringQueryMap Unit unit);

	@GetMapping("/getById")
	Unit getById(@RequestParam Long id);

	/**
	 * 查询 单元表
	 */
	@GetMapping("/list")
    List<UnitVO> list(@SpringQueryMap Unit unit);



	/**
	 * 新增 单元表
	 */
	@PostMapping("/save")
	boolean save(@Valid @RequestBody Unit unit);

	/**
	 * 修改 单元表
	 */
	@PostMapping("/update")
    boolean update(@Valid @RequestBody Unit unit);

	/**
	 * 新增或修改 单元表
	 */
	@PostMapping("/submit")
    boolean submit(@Valid @RequestBody Unit unit);


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


}
