商户视频号 管理
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
package cn.ysk.cashier.controller.shop;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.dto.shop.TbShopVideoQueryCriteria;
|
||||
import cn.ysk.cashier.pojo.shop.TbShopVideo;
|
||||
import cn.ysk.cashier.service.shop.TbShopVideoService;
|
||||
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.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
|
||||
/**
|
||||
* @author ww
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "商户视频号管理")
|
||||
@RequestMapping("/api/tbShopVideo")
|
||||
public class TbShopVideoController {
|
||||
|
||||
private final TbShopVideoService tbShopVideoService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询商户视频号")
|
||||
@ApiOperation("查询商户视频号")
|
||||
public ResponseEntity<Object> queryTbShopVideo(TbShopVideoQueryCriteria criteria){
|
||||
return new ResponseEntity<>(tbShopVideoService.queryAllPage(criteria), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@Log("查询商户视频号")
|
||||
@ApiOperation("查询商户视频号")
|
||||
public Object queryInfo(@PathVariable("id") Integer id){
|
||||
return tbShopVideoService.findById(id);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增商户视频号")
|
||||
@ApiOperation("新增商户视频号")
|
||||
public ResponseEntity<Object> createTbShopVideo(@Validated @RequestBody TbShopVideo resources){
|
||||
return new ResponseEntity<>(tbShopVideoService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改商户视频号")
|
||||
@ApiOperation("修改商户视频号")
|
||||
public ResponseEntity<Object> updateTbShopVideo(@Validated @RequestBody TbShopVideo resources){
|
||||
tbShopVideoService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除商户视频号")
|
||||
@ApiOperation("删除商户视频号")
|
||||
public ResponseEntity<Object> deleteTbShopVideo(@RequestBody Integer[] ids) {
|
||||
tbShopVideoService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user