台桌批量生成桌码接口

This commit is contained in:
张松
2025-02-18 16:11:32 +08:00
parent f00b51001a
commit d323ac3ef9
9 changed files with 115 additions and 4 deletions

View File

@@ -13,9 +13,12 @@ import com.czg.utils.PageUtil;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
/**
* 台桌管理
* @author Administrator
@@ -26,6 +29,20 @@ public class ShopTableController {
@Resource
private ShopTableService shopTableService;
/**
* 批量生成台桌码
* 权限标识: shopTable:code
* @return 台桌列表
*/
@SaAdminCheckPermission("shopTable:code")
@PostMapping("/code")
public CzgResult<Page<ShopTable>> createCode(@RequestParam Integer num, HttpServletResponse response) throws IOException {
if (num > 100) {
return CzgResult.failure("单次最多可获取100个");
}
shopTableService.createQrCode(StpKit.USER.getShopId(), num, response);
return CzgResult.success();
}
/**
* 获取台桌列表