|
|
|
@ -19,35 +19,35 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
* @date 2021/6/29 21:42
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping(Constants.BASE_PATH)
|
|
|
|
|
@RequestMapping(Constants.BASE_PATH + "/item")
|
|
|
|
|
public class ItemController {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ItemService itemService;
|
|
|
|
|
|
|
|
|
|
@PostMapping("/item/query/page")
|
|
|
|
|
@PostMapping("/query/page")
|
|
|
|
|
public Result<IPage<ItemRespDTO>> queryItemPage(@RequestBody ItemQueryReqDTO reqDTO) {
|
|
|
|
|
return Results.success(itemService.queryItemPage(reqDTO));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/item/query/{tenantId}/{itemId}")
|
|
|
|
|
@GetMapping("/query/{tenantId}/{itemId}")
|
|
|
|
|
public Result queryItemById(@PathVariable("tenantId") String tenantId, @PathVariable("itemId") String itemId) {
|
|
|
|
|
return Results.success(itemService.queryItemById(tenantId, itemId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/item/save")
|
|
|
|
|
@PostMapping("/save")
|
|
|
|
|
public Result saveItem(@RequestBody ItemSaveReqDTO reqDTO) {
|
|
|
|
|
itemService.saveItem(reqDTO);
|
|
|
|
|
return Results.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/item/update")
|
|
|
|
|
@PostMapping("/update")
|
|
|
|
|
public Result updateItem(@RequestBody ItemUpdateReqDTO reqDTO) {
|
|
|
|
|
itemService.updateItem(reqDTO);
|
|
|
|
|
return Results.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@DeleteMapping("/item/delete/{tenantId}/{itemId}")
|
|
|
|
|
@DeleteMapping("/delete/{tenantId}/{itemId}")
|
|
|
|
|
public Result deleteItem(@PathVariable("tenantId") String tenantId, @PathVariable("itemId") String itemId) {
|
|
|
|
|
itemService.deleteItem(tenantId, itemId);
|
|
|
|
|
return Results.success();
|
|
|
|
|