package com.cim.idm.controller;

import com.cim.idm.model.dto.WareHouseEditDto;
import com.cim.idm.service.IWareHouseService;
import com.cim.idm.utils.AjaxResult;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
@RequestMapping("/api/wareHouse")
@EnableAutoConfiguration
public class WareHouseController {

	@Resource
	private IWareHouseService wareHouseService;

	/**
	 * 编辑
	 */
	@PostMapping(value = "/edit")
	public AjaxResult edit(@RequestBody WareHouseEditDto wareHouseEditDto) {
		if (wareHouseService.edit(wareHouseEditDto) > 0) {
			return AjaxResult.me().setSuccess(true).setMessage("编辑成功");
		} else {
			return AjaxResult.me().setErrorCode(-1).setMessage("编辑失败");
		}
	}
}
