霸王餐接口
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.account.dto.freeding.FreeDineConfigEditDTO;
|
||||
import com.czg.account.entity.FreeDineConfig;
|
||||
import com.czg.account.service.FreeDineConfigService;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 霸王餐相关
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/freeDing")
|
||||
public class FreeDingController {
|
||||
@Resource
|
||||
private FreeDineConfigService freeDineConfigService;
|
||||
|
||||
/**
|
||||
* 获取当前店铺霸王餐配置信息列表
|
||||
* @return 霸王餐配置信息 (不存在会新建)
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "freeDing:detail", name = "获取霸王餐配置信息")
|
||||
@GetMapping
|
||||
public CzgResult<FreeDineConfig> getConfig() {
|
||||
return CzgResult.success(freeDineConfigService.getConfig(StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改霸王餐配置信息
|
||||
* @param freeDineConfigEditDTO 修改信息
|
||||
* @return 霸王餐配置信息
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "freeDing:edit", name = "修改霸王餐配置信息")
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit(@RequestBody FreeDineConfigEditDTO freeDineConfigEditDTO) {
|
||||
return CzgResult.success(freeDineConfigService.edit(StpKit.USER.getShopId(), freeDineConfigEditDTO));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user