商户视频号 管理

This commit is contained in:
2024-04-09 15:06:44 +08:00
parent 26a4fd6214
commit a70deaa375
10 changed files with 326 additions and 0 deletions

View File

@@ -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);
}
}