|
@@ -0,0 +1,90 @@
|
|
|
|
+package com.yonge.cooleshow.admin.controller;
|
|
|
|
+
|
|
|
|
+import com.microsvc.toolkit.common.response.paging.PageInfo;
|
|
|
|
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
|
|
|
|
+import com.microsvc.toolkit.common.response.template.R;
|
|
|
|
+
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import com.microsvc.toolkit.config.jwt.utils.JwtUserInfo;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
+import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
+
|
|
|
|
+import com.yonge.cooleshow.biz.dal.service.TenantGroupAlbumService;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.wrapper.TenantGroupAlbumWrapper;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.TenantGroupAlbum;
|
|
|
|
+
|
|
|
|
+@Slf4j
|
|
|
|
+@Validated
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/tenantGroupAlbum")
|
|
|
|
+@Api(tags = "机构小组专辑配置表")
|
|
|
|
+public class TenantGroupAlbumController {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private TenantGroupAlbumService tenantGroupAlbumService;
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "详情", notes = "机构小组专辑配置表-根据详情ID查询单条, 传入id")
|
|
|
|
+ @PreAuthorize("@auditsvc.hasPermissions('tenantGroupAlbum/detail', {'BACKEND'})")
|
|
|
|
+ //@GetMapping("/detail/{id}")
|
|
|
|
+ public R<TenantGroupAlbum> detail(@PathVariable("id") Long id) {
|
|
|
|
+
|
|
|
|
+ TenantGroupAlbum wrapper = tenantGroupAlbumService.detail(id);
|
|
|
|
+
|
|
|
|
+ return R.from(wrapper);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "查询分页", notes = "机构小组专辑配置表- 传入 TenantGroupAlbumWrapper.TenantGroupAlbumQuery")
|
|
|
|
+ @PreAuthorize("@auditsvc.hasPermissions('tenantGroupAlbum/page', {'BACKEND'})")
|
|
|
|
+ @PostMapping("/page")
|
|
|
|
+ public R<PageInfo<TenantGroupAlbum>> page(@RequestBody TenantGroupAlbumWrapper.TenantGroupAlbumQuery query) {
|
|
|
|
+
|
|
|
|
+ IPage<TenantGroupAlbum> pages = tenantGroupAlbumService.selectPage(QueryInfo.getPage(query), query);
|
|
|
|
+
|
|
|
|
+ return R.from(QueryInfo.pageInfo(pages));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "新增", notes = "机构小组专辑配置表- 传入 TenantGroupAlbumWrapper.TenantGroupAlbum")
|
|
|
|
+ @PreAuthorize("@auditsvc.hasPermissions('tenantGroupAlbum/save', {'BACKEND'})")
|
|
|
|
+ //@PostMapping("/save")
|
|
|
|
+ public R<JSONObject> add(@Validated @RequestBody TenantGroupAlbum tenantGroupAlbum) {
|
|
|
|
+
|
|
|
|
+ // 新增数据
|
|
|
|
+ tenantGroupAlbumService.save(tenantGroupAlbum);
|
|
|
|
+
|
|
|
|
+ return R.defaultR();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "修改", notes = "机构小组专辑配置表- 传入 TenantGroupAlbumWrapper.TenantGroupAlbum")
|
|
|
|
+ @PreAuthorize("@auditsvc.hasPermissions('tenantGroupAlbum/update', {'BACKEND'})")
|
|
|
|
+ //@PostMapping("/update")
|
|
|
|
+ public R<JSONObject> update(@Validated @RequestBody TenantGroupAlbum tenantGroupAlbum) {
|
|
|
|
+
|
|
|
|
+ // 更新数据
|
|
|
|
+ tenantGroupAlbumService.updateById(tenantGroupAlbum);
|
|
|
|
+
|
|
|
|
+ return R.defaultR();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "删除", notes = "机构小组专辑配置表- 传入id")
|
|
|
|
+ @PreAuthorize("@auditsvc.hasPermissions('tenantGroupAlbum/remove', {'BACKEND'})")
|
|
|
|
+ //@PostMapping("/remove")
|
|
|
|
+ public R<Boolean> remove(@RequestParam Long id) {
|
|
|
|
+
|
|
|
|
+ return R.from(tenantGroupAlbumService.removeById(id));
|
|
|
|
+ }
|
|
|
|
+}
|