店铺管理-店铺配置:打印机设置相关接口
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
package com.chaozhanggui.system.cashierservice.controller;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.ShopPrinterDTO;
|
||||
import com.chaozhanggui.system.cashierservice.service.ShopPrinterService;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 店铺打印机配置
|
||||
* @author tankaikai
|
||||
* @since 2024-09-24 16:56
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@CrossOrigin(origins = "*")
|
||||
@RequestMapping("shop-config/printer")
|
||||
public class ShopPrinterController {
|
||||
|
||||
@Resource
|
||||
private ShopPrinterService shopPrinterService;
|
||||
|
||||
@GetMapping("page")
|
||||
public Result page(@RequestParam Map<String, Object> params) {
|
||||
PageInfo<ShopPrinterDTO> page = shopPrinterService.page(params);
|
||||
return Result.success(CodeEnum.SUCCESS,page);
|
||||
}
|
||||
|
||||
@GetMapping("list")
|
||||
public Result list(@RequestParam Map<String, Object> params) {
|
||||
List<ShopPrinterDTO> list = shopPrinterService.list(params);
|
||||
return Result.success(CodeEnum.SUCCESS,list);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
public Result get(@PathVariable("id") Integer id) {
|
||||
ShopPrinterDTO dto = shopPrinterService.get(id);
|
||||
return Result.success(CodeEnum.SUCCESS,dto);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public Result save(@RequestBody ShopPrinterDTO dto) {
|
||||
shopPrinterService.save(dto);
|
||||
return Result.success(CodeEnum.SUCCESS);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public Result update(@RequestBody ShopPrinterDTO dto) {
|
||||
shopPrinterService.update(dto);
|
||||
return Result.success(CodeEnum.SUCCESS);
|
||||
}
|
||||
|
||||
@DeleteMapping("{id}")
|
||||
public Result delete(@PathVariable("id") Integer id){
|
||||
shopPrinterService.delete(id);
|
||||
return Result.success(CodeEnum.SUCCESS);
|
||||
}
|
||||
|
||||
@PostMapping("update-status")
|
||||
public Result updateStatus(@RequestBody ShopPrinterDTO dto){
|
||||
shopPrinterService.updateStatus(dto.getId(),dto.getStatus());
|
||||
return Result.success(CodeEnum.SUCCESS);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user