package com.miaxis.pc.controller.goods;

import com.miaxis.common.annotation.Log;
import com.miaxis.common.core.controller.BaseController;
import com.miaxis.common.core.domain.Response;
import com.miaxis.common.enums.BusinessTypeEnum;
import com.miaxis.goods.service.IGoodsInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 【商品管理】Controller
 *
 * @author miaxis
 * @date 2021-03-11
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/goods/info")
@Api(tags={"【pc-商品管理】"})
public class GoodsInfoController extends BaseController{

    private final IGoodsInfoService goodsInfoService;


    /**
     * 删除商品
     */
    @PreAuthorize("@ss.hasPermi('goods:info:remove')")
    @Log(title = "商品", businessType = BusinessTypeEnum.UPDATE)
	@PutMapping("/{ids}")
    @ApiOperation("删除商品")
    public  Response<Integer> remove(
            @ApiParam(name = "ids", value = "商品ids参数", required = true)
            @PathVariable Long[] ids
    ){
        return goodsInfoService.removeGoodsByIds(ids);
    }


}
