买家端专题
This commit is contained in:
parent
55270548c7
commit
cb7814cbd6
@ -2,17 +2,17 @@ package cn.lili.controller.other;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.page.entity.dos.PageData;
|
||||
import cn.lili.modules.page.entity.dto.PageDataDTO;
|
||||
import cn.lili.modules.page.entity.enums.PageEnum;
|
||||
import cn.lili.modules.page.entity.vos.PageDataVO;
|
||||
import cn.lili.modules.page.service.PageDataService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 买家端,页面接口
|
||||
@ -43,8 +43,46 @@ public class PageBuyerController {
|
||||
@ApiOperation(value = "获取页面数据")
|
||||
@GetMapping
|
||||
public ResultMessage<PageDataVO> get(PageDataDTO pageDataDTO) {
|
||||
|
||||
PageDataVO pageDataVO=pageService.getPageData(pageDataDTO);
|
||||
return ResultUtil.data(pageDataVO);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取页面数据")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/get/{id}")
|
||||
public ResultMessage<PageData> getPage(@PathVariable("id") String id) {
|
||||
return ResultUtil.data(pageService.getSpecial(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取专题页面数据(根据消息内容得知)")
|
||||
@GetMapping("/getSpecial")
|
||||
public ResultMessage<PageData> getSpecial(@RequestParam String body) {
|
||||
String name = "";
|
||||
if (body.indexOf("』") >= 0 && body.indexOf("『") >= 0) {
|
||||
name = body.substring(body.indexOf("『") + 1, body.lastIndexOf("』"));
|
||||
} else if (body.indexOf("〉") >= 0 && body.indexOf("〈") >= 0) {
|
||||
name = body.substring(body.indexOf("〈") + 1, body.lastIndexOf("〉"));
|
||||
} else if (body.indexOf("」") >= 0 && body.indexOf("「") >= 0) {
|
||||
name = body.substring(body.indexOf("「") + 1, body.lastIndexOf("」"));
|
||||
} else if (body.indexOf("》") >= 0 && body.indexOf("《") >= 0) {
|
||||
name = body.substring(body.indexOf("《") + 1, body.lastIndexOf("》"));
|
||||
} else if (body.indexOf(")") >= 0 && body.indexOf("(") >= 0) {
|
||||
name = body.substring(body.indexOf("(") + 1, body.lastIndexOf(")"));
|
||||
} else if (body.indexOf("】") >= 0 && body.indexOf("【") >= 0) {
|
||||
name = body.substring(body.indexOf("【") + 1, body.lastIndexOf("】"));
|
||||
} else if (body.indexOf("}") >= 0 && body.indexOf("{") >= 0) {
|
||||
name = body.substring(body.indexOf("{") + 1, body.lastIndexOf("}"));
|
||||
} else if (body.indexOf("!") >= 0) {
|
||||
name = body.substring(body.indexOf("!") + 1, body.lastIndexOf("!"));
|
||||
} else if (body.indexOf("|") >= 0) {
|
||||
name = body.substring(body.indexOf("|") + 1, body.lastIndexOf("|"));
|
||||
}
|
||||
|
||||
PageData pageData = pageService.getOne(
|
||||
new LambdaQueryWrapper<PageData>()
|
||||
.eq(PageData::getPageType, PageEnum.SPECIAL.name())
|
||||
.eq(PageData::getName, name));
|
||||
return ResultUtil.data(pageData);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -74,4 +74,12 @@ public interface PageDataService extends IService<PageData> {
|
||||
* @return
|
||||
*/
|
||||
IPage<PageDataListVO> getPageDataList(PageVO pageVO, PageDataDTO pageDataDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 获取专题信息
|
||||
* @param id id
|
||||
* @return
|
||||
*/
|
||||
PageData getSpecial(String id);
|
||||
}
|
@ -200,4 +200,9 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
|
||||
return this.baseMapper.getPageDataList(PageUtil.initPage(pageVO), queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageData getSpecial(String id) {
|
||||
return this.getById(id);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user