package com.sckw.goods.controller;

import com.sckw.goods.entity.req.KwGoodsDictReq;
import com.sckw.goods.service.GoodsDictService;
import com.sckw.core.web.response.HttpResult;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @desc:
 * @author: lt
 * @date: 2024/4/3 17:33
 */
@Validated
@RestController
@RequestMapping("/goods")
public class GoodsDictController {


    @Autowired
    GoodsDictService goodsDictService;

    /**
     * @desc: 字典新增
     * @author: lt
     * @date: 2024/4/3 17:35
     */
    @PostMapping(value = "/dictInsert")
    public HttpResult dictInsert(@RequestBody @Valid KwGoodsDictReq kwOrderDictReq)
    {
        return HttpResult.ok(goodsDictService.dictInsert(kwOrderDictReq));
    }

    @GetMapping("/getDictData")
    public HttpResult getDictData(@RequestParam("group") String group)
    {
        return HttpResult.ok(goodsDictService.getDictData(group));
    }

}
