package com.lz.modules.luck.controller;


import com.alibaba.fastjson.JSONObject;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.luck.entity.LuckRecord;
import com.lz.modules.luck.service.LuckRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/luckRecord")
public class LuckRecordController {


    @Autowired
    private LuckRecordService luckRecordService;


    @RequestMapping("/list")
     public R list(@RequestBody String body) {
        return R.ok();
     }


     @RequestMapping("/getById")
     public R getById(@RequestBody LuckRecord luckRecord) {
        luckRecord = luckRecordService.selectLuckRecordById(luckRecord.getId());
        return R.ok().put("luckRecord",luckRecord);
     }


     @RequestMapping("/update")
     public R update(@RequestBody LuckRecord luckRecord) {
         luckRecordService.updateLuckRecordById(luckRecord);
        return R.ok();
     }


     @RequestMapping("/save")
        public R save(@RequestBody LuckRecord luckRecord) {
         luckRecordService.insertLuckRecord(luckRecord);
        return R.ok();
     }


    @RequestMapping("/delete")
    public R list(@RequestBody Long id) {
        luckRecordService.deleteLuckRecordById(id);
        return R.ok();
     }
}
