package cn.ysk.cashier.controller.points;

import cn.ysk.cashier.mybatis.entity.TbPointsBasicSetting;
import cn.ysk.cashier.mybatis.service.TbPointsBasicSettingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * 积分基本设置
 *
 * @author Tankaikai tankaikai@aliyun.com
 * @since 2.0 2024-10-25
 */
@RestController
@RequestMapping("/api/points/basic-setting")
@Api(tags = "积分基本设置")
public class TbPointsBasicSettingController {

    @Resource
    private TbPointsBasicSettingService tbPointsBasicSettingService;

    @GetMapping("{shopId}")
    @ApiOperation("信息")
    public ResponseEntity get(@PathVariable("shopId") Long shopId) {
        TbPointsBasicSetting data = tbPointsBasicSettingService.getByShopId(shopId);
        return ResponseEntity.ok().body(data);
    }

    @PostMapping
    @ApiOperation("保存")
    public ResponseEntity save(@RequestBody TbPointsBasicSetting entity) {
        tbPointsBasicSettingService.save(entity);
        return ResponseEntity.ok().build();
    }


}