package com.sqx.modules.shop.controller;

import com.sqx.common.utils.Result;
import com.sqx.modules.shop.entity.ShopType;
import com.sqx.modules.shop.service.ShopTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags={"管理端-商户类型管理"})
@RestController
@RequestMapping("/admin/shoptype")
public class AdminShopTypeController {

    @Autowired
    private ShopTypeService shopTypeService;

    @ApiOperation("增")
    @PostMapping(value = "insertShopType")
    public Result insertShopType(@RequestBody ShopType shopType){

        return shopTypeService.insertShopType(shopType);
    }

    @ApiOperation("列表")
    @GetMapping(value = "selectShopTypeList")
    public Result selectShopTypeList(Integer page, Integer limit){

        return shopTypeService.selectShopTypeList(page, limit);
    }

    @ApiOperation("改")
    @PostMapping(value = "upateShopType")
    public Result updateShopType(@RequestBody ShopType shopType){

        return shopTypeService.updateShopType(shopType);
    }

    @ApiOperation("删")
    @PostMapping(value = "deleteShopType")
    public Result deleteShopType(Long shopTypeId){

        return shopTypeService.deleteShopType(shopTypeId);
    }
}
