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

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

import com.yami.shop.common.config.Constant;
import com.yami.shop.distribution.comment.model.DistributionLevel;
import com.yami.shop.distribution.comment.model.DistributionLevelSet;
import com.yami.shop.distribution.comment.service.DistributionLevelSetService;
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;

import java.util.List;

/**
 * @author lgh on 2019/04/04.
 */
@RestController
@RequestMapping("/distribution/distributionLevel")
@AllArgsConstructor
public class DistributionLevelController {
//
    private DistributionLevelSetService distributionLevelSetService;
//
//    /**
//     * 分页获取
//     */
//    @GetMapping("/page")
//	public ResponseEntity<IPage<DistributionLevel>> page(DistributionLevel distributionLevel,PageParam<DistributionLevel> page){
//		IPage<DistributionLevel> list = distributionLevelService.page(page,new LambdaQueryWrapper<DistributionLevel>());
//		return ResponseEntity.ok(list);
//	}
//
    /**
     * 获取信息
     */
    @GetMapping("/info")
    public ResponseEntity<List<DistributionLevel>> info() {
        DistributionLevelSet distributionLevelSet = distributionLevelSetService.getByShopId();
        return ResponseEntity.ok(distributionLevelSet.getDistributionLevels());
    }
//
//    /**
//     * 获取信息
//     */
//    @GetMapping("/info/{id}")
//    public ResponseEntity<DistributionLevel> info(@PathVariable("id") Long id) {
//        DistributionLevel distributionLevel = distributionLevelService.getById(id);
//        return ResponseEntity.ok(distributionLevel);
//    }
//
//    /**
//     * 保存
//     */
//    @PostMapping
//    public ResponseEntity<Void> save(@RequestBody @Valid DistributionLevel distributionLevel) {
//        distributionLevelService.save(distributionLevel);
//        return ResponseEntity.ok().build();
//    }
//
//    /**
//     * 修改
//     */
//    @PutMapping
//    public ResponseEntity<Void> update(@RequestBody @Valid DistributionLevel distributionLevel) {
//        distributionLevelService.updateById(distributionLevel);
//        return ResponseEntity.ok().build();
//    }
//
//    /**
//     * 删除
//     */
//    @DeleteMapping("/{id}")
//    public ResponseEntity<Void> delete(@PathVariable Long id) {
//        distributionLevelService.removeById(id);
//        return ResponseEntity.ok().build();
//    }
}
