feat: 1.增加商品单位列表接口

This commit is contained in:
张松
2024-11-26 09:42:50 +08:00
parent c6aff238c1
commit 7797edd813
6 changed files with 293 additions and 162 deletions

View File

@@ -0,0 +1,25 @@
package com.chaozhanggui.system.cashierservice.controller;
import com.chaozhanggui.system.cashierservice.service.TbShopUnitService;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/unit")
public class ShopUnitController {
private final TbShopUnitService shopUnitService;
public ShopUnitController(TbShopUnitService shopUnitService) {
this.shopUnitService = shopUnitService;
}
@GetMapping
public Result getShopUnit(@RequestParam Integer shopId, @RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "20") Integer size, @RequestParam(required = false) String name) {
return Result.success(CodeEnum.SUCCESS, shopUnitService.getShopUnit(shopId, page, size, name));
}
}