|
@@ -0,0 +1,157 @@
|
|
|
+package com.ruoyi.web.controller.api;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Arrays;
|
|
|
+
|
|
|
+import com.ruoyi.app.domain.TbMyPublish;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+import com.ruoyi.common.annotation.Log;
|
|
|
+import com.ruoyi.common.core.controller.BaseController;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.enums.BusinessType;
|
|
|
+import com.ruoyi.app.service.ITbMyPublishService;
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 我的近况(我的发)Controller
|
|
|
+ *
|
|
|
+ * @author Administrator
|
|
|
+ * @date 2020-10-02
|
|
|
+ */
|
|
|
+@Api(value = "我的近况(我的发)", tags = "我的近况(我的发)")
|
|
|
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
|
|
+@RestController
|
|
|
+@RequestMapping("/app/publish" )
|
|
|
+public class TbMyPublishController extends BaseController {
|
|
|
+
|
|
|
+ private final ITbMyPublishService iTbMyPublishService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询我的近况(我的发)列表
|
|
|
+ */
|
|
|
+ @ApiOperation("查询我的近况(我的发)列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('app:publish:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(TbMyPublish tbMyPublish)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ LambdaQueryWrapper<TbMyPublish> lqw = new LambdaQueryWrapper<TbMyPublish>();
|
|
|
+ if (tbMyPublish.getAppUserId() != null){
|
|
|
+ lqw.eq(TbMyPublish::getAppUserId ,tbMyPublish.getAppUserId());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tbMyPublish.getContents())){
|
|
|
+ lqw.eq(TbMyPublish::getContents ,tbMyPublish.getContents());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tbMyPublish.getPicurl1())){
|
|
|
+ lqw.eq(TbMyPublish::getPicurl1 ,tbMyPublish.getPicurl1());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tbMyPublish.getPicurl2())){
|
|
|
+ lqw.eq(TbMyPublish::getPicurl2 ,tbMyPublish.getPicurl2());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tbMyPublish.getPicurl3())){
|
|
|
+ lqw.eq(TbMyPublish::getPicurl3 ,tbMyPublish.getPicurl3());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tbMyPublish.getPicurl4())){
|
|
|
+ lqw.eq(TbMyPublish::getPicurl4 ,tbMyPublish.getPicurl4());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tbMyPublish.getPicurl5())){
|
|
|
+ lqw.eq(TbMyPublish::getPicurl5 ,tbMyPublish.getPicurl5());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tbMyPublish.getPicurl6())){
|
|
|
+ lqw.eq(TbMyPublish::getPicurl6 ,tbMyPublish.getPicurl6());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tbMyPublish.getPicurl7())){
|
|
|
+ lqw.eq(TbMyPublish::getPicurl7 ,tbMyPublish.getPicurl7());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tbMyPublish.getPicurl8())){
|
|
|
+ lqw.eq(TbMyPublish::getPicurl8 ,tbMyPublish.getPicurl8());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tbMyPublish.getPicurl9())){
|
|
|
+ lqw.eq(TbMyPublish::getPicurl9 ,tbMyPublish.getPicurl9());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tbMyPublish.getMessage())){
|
|
|
+ lqw.eq(TbMyPublish::getMessage ,tbMyPublish.getMessage());
|
|
|
+ }
|
|
|
+ if (tbMyPublish.getMessageUserId() != null){
|
|
|
+ lqw.eq(TbMyPublish::getMessageUserId ,tbMyPublish.getMessageUserId());
|
|
|
+ }
|
|
|
+ if (tbMyPublish.getThumbs() != null){
|
|
|
+ lqw.eq(TbMyPublish::getThumbs ,tbMyPublish.getThumbs());
|
|
|
+ }
|
|
|
+ List<TbMyPublish> list = iTbMyPublishService.list(lqw);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出我的近况(我的发)列表
|
|
|
+ */
|
|
|
+ @ApiOperation("导出我的近况(我的发)列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('app:publish:export')" )
|
|
|
+ @Log(title = "我的近况(我的发)" , businessType = BusinessType.EXPORT)
|
|
|
+ @GetMapping("/export" )
|
|
|
+ public AjaxResult export(TbMyPublish tbMyPublish) {
|
|
|
+ LambdaQueryWrapper<TbMyPublish> lqw = new LambdaQueryWrapper<TbMyPublish>(tbMyPublish);
|
|
|
+ List<TbMyPublish> list = iTbMyPublishService.list(lqw);
|
|
|
+ ExcelUtil<TbMyPublish> util = new ExcelUtil<TbMyPublish>(TbMyPublish. class);
|
|
|
+ return util.exportExcel(list, "publish" );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取我的近况(我的发)详细信息
|
|
|
+ */
|
|
|
+ @ApiOperation("获取我的近况(我的发)详细信息")
|
|
|
+ @PreAuthorize("@ss.hasPermi('app:publish:query')" )
|
|
|
+ @GetMapping(value = "/{id}" )
|
|
|
+ public AjaxResult getInfo(@PathVariable("id" ) Long id) {
|
|
|
+ return AjaxResult.success(iTbMyPublishService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增我的近况(我的发)
|
|
|
+ */
|
|
|
+ @ApiOperation("新增我的近况(我的发)")
|
|
|
+ @PreAuthorize("@ss.hasPermi('app:publish:add')" )
|
|
|
+ @Log(title = "我的近况(我的发)" , businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody TbMyPublish tbMyPublish) {
|
|
|
+ return toAjax(iTbMyPublishService.save(tbMyPublish) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改我的近况(我的发)
|
|
|
+ */
|
|
|
+ @ApiOperation("修改我的近况(我的发)")
|
|
|
+ @PreAuthorize("@ss.hasPermi('app:publish:edit')" )
|
|
|
+ @Log(title = "我的近况(我的发)" , businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody TbMyPublish tbMyPublish) {
|
|
|
+ return toAjax(iTbMyPublishService.updateById(tbMyPublish) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除我的近况(我的发)
|
|
|
+ */
|
|
|
+ @ApiOperation("删除我的近况(我的发)")
|
|
|
+ @PreAuthorize("@ss.hasPermi('app:publish:remove')" )
|
|
|
+ @Log(title = "我的近况(我的发)" , businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}" )
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
+ return toAjax(iTbMyPublishService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
+ }
|
|
|
+}
|