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