|
|
@@ -1,5 +1,6 @@
|
|
|
package com.ylx.web.controller.massage;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
@@ -56,13 +57,14 @@ public class TLbtController {
|
|
|
* 添加或者更新轮播图
|
|
|
*
|
|
|
* @param lbt
|
|
|
- * @return
|
|
|
+ * @return R
|
|
|
*/
|
|
|
@Log(title = "轮播图管理", businessType = BusinessType.INSERT)
|
|
|
@RequestMapping(value = "/addOrUpdate", method = RequestMethod.POST)
|
|
|
@ApiOperation("添加或者更新轮播图")
|
|
|
public R addOrUpdate(@RequestBody TLbt lbt) {
|
|
|
try {
|
|
|
+ log.info("请求参数:{}", JSON.toJSONString(lbt));
|
|
|
return R.ok(lbtService.addOrUpdate(lbt));
|
|
|
} catch (ServiceException s) {
|
|
|
log.error(s.toString());
|
|
|
@@ -75,21 +77,33 @@ public class TLbtController {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 分页查询数据
|
|
|
+ * 分页查询轮播图数据
|
|
|
+ * @param page
|
|
|
+ * @param lbt
|
|
|
+ * @return R<Page<TLbt>>
|
|
|
*/
|
|
|
@ApiOperation("分页查询数据")
|
|
|
@RequestMapping(value = "/select", method = RequestMethod.GET)
|
|
|
public R<Page<TLbt>> selectSpfl(Page<TLbt> page, TLbt lbt) {
|
|
|
-
|
|
|
- LambdaQueryWrapper<TLbt> tLbtLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
-
|
|
|
- tLbtLambdaQueryWrapper.like(StringUtils.isNotBlank(lbt.getCDescribe()), TLbt::getCDescribe, lbt.getCDescribe())
|
|
|
- .orderByAsc(TLbt::getCSort);
|
|
|
- // 获取查询返回结果
|
|
|
- Page<TLbt> pageSelect = lbtService.page(page, tLbtLambdaQueryWrapper);
|
|
|
- return R.ok(pageSelect);
|
|
|
+ try {
|
|
|
+ LambdaQueryWrapper<TLbt> tLbtLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ tLbtLambdaQueryWrapper.like(StringUtils.isNotBlank(lbt.getCDescribe()), TLbt::getCDescribe, lbt.getCDescribe())
|
|
|
+ .orderByAsc(TLbt::getCSort);
|
|
|
+ // 获取查询返回结果
|
|
|
+ Page<TLbt> pageSelect = lbtService.page(page, tLbtLambdaQueryWrapper);
|
|
|
+ return R.ok(pageSelect);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 删除轮播图
|
|
|
+ *
|
|
|
+ * @param tLbt
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
@Log(title = "轮播图管理", businessType = BusinessType.DELETE)
|
|
|
@RequestMapping(value = "/del", method = RequestMethod.POST)
|
|
|
@ApiOperation("删除轮播图")
|
|
|
@@ -105,6 +119,12 @@ public class TLbtController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据id查询轮播图
|
|
|
+ *
|
|
|
+ * @param tLbt
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
@ApiOperation("根据id查询轮播图")
|
|
|
@RequestMapping(value = "/wx/getByid", method = RequestMethod.POST)
|
|
|
public R getById(@RequestBody TLbt tLbt) {
|