新字典
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.dto.TbPlatformDictDto;
|
||||
import cn.ysk.cashier.dto.TbPlatformDictQueryCriteria;
|
||||
import cn.ysk.cashier.pojo.TbPlatformDict;
|
||||
import cn.ysk.cashier.service.TbPlatformDictService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author ww
|
||||
* @date 2024-03-29
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "新字典管理")
|
||||
@RequestMapping("/api/tbPlatformDict")
|
||||
public class TbPlatformDictController {
|
||||
|
||||
private final TbPlatformDictService tbPlatformDictService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询新字典")
|
||||
@ApiOperation("查询新字典")
|
||||
public ResponseEntity<Object> queryTbPlatformDict(TbPlatformDictQueryCriteria criteria){
|
||||
return new ResponseEntity<>(tbPlatformDictService.queryAllPage(criteria),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@Log("通过Id查询新字典")
|
||||
@ApiOperation("通过Id查询新字典")
|
||||
public TbPlatformDictDto queryTbOrderInfo(@PathVariable("id") Integer id){
|
||||
return tbPlatformDictService.findById(id);
|
||||
}
|
||||
@PostMapping
|
||||
@Log("新增新字典")
|
||||
@ApiOperation("新增新字典")
|
||||
public ResponseEntity<Object> createTbPlatformDict(@Validated @RequestBody TbPlatformDict resources){
|
||||
return new ResponseEntity<>(tbPlatformDictService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改新字典")
|
||||
@ApiOperation("修改新字典")
|
||||
public ResponseEntity<Object> updateTbPlatformDict(@Validated @RequestBody TbPlatformDict resources){
|
||||
tbPlatformDictService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除新字典")
|
||||
@ApiOperation("删除新字典")
|
||||
public ResponseEntity<Object> deleteTbPlatformDict(@RequestBody Integer[] ids) {
|
||||
tbPlatformDictService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user