/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.distribution.api.controller;

import com.yami.shop.distribution.comment.model.DistributionBasicSet;
import com.yami.shop.distribution.comment.service.DistributionBasicSetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author lgh on 2019/04/01.
 */
@RestController
@RequestMapping("/p/distribution/distributionBasicSet")
@AllArgsConstructor
@Api(tags = "分销基本设置")
public class DistributionBasicController {


    private DistributionBasicSetService distributionBasicSetService;

	/**
	 * 获取信息(根据店铺)fi'l
	 */
	@GetMapping("/canDistribution")
	@ApiOperation(value = "分销开关是否开启", notes = "获取分销开关是否开启，0关闭 1开启")
	public ResponseEntity<Integer> info(){
		DistributionBasicSet distributionSet = distributionBasicSetService.getByShopId();
		return ResponseEntity.ok(distributionSet.getDistributionSwitch());
	}

}
