|
|
|
@ -3,6 +3,8 @@ package com.huoran.iasf.controller; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.huoran.iasf.common.utils.Constant; |
|
|
|
|
import com.huoran.iasf.entity.SysTemplateStyle; |
|
|
|
|
import com.huoran.iasf.entity.SysTemplateStyleConfiguration; |
|
|
|
|
import com.huoran.iasf.service.SysTemplateStyleConfigurationService; |
|
|
|
|
import com.huoran.iasf.service.SysTemplateStyleService; |
|
|
|
|
import io.swagger.annotations.*; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
@ -41,12 +43,13 @@ public class SysTemplateController { |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
public SysTemplateStyleService styleService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
public SysTemplateStyleConfigurationService templateStyleConfigurationService; |
|
|
|
|
|
|
|
|
|
@PostMapping("/listOfColumnTemplates") |
|
|
|
|
@ApiOperation(value = "获取文章模板列表、详情样式", response = SysTemplate.class) |
|
|
|
|
public R listOfColumnTemplates() { |
|
|
|
|
List<SysTemplate> list = templateService.list(new QueryWrapper<SysTemplate>().eq("type",1)); |
|
|
|
|
List<SysTemplate> list = templateService.list(new QueryWrapper<SysTemplate>().eq("type", 1)); |
|
|
|
|
return R.success(list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -54,7 +57,7 @@ public class SysTemplateController { |
|
|
|
|
@PostMapping("/longPageListStyle") |
|
|
|
|
@ApiOperation(value = "长页列表样式", response = SysTemplate.class) |
|
|
|
|
public R longPageListStyle() { |
|
|
|
|
List<SysTemplateStyle> list = styleService.list(new QueryWrapper<SysTemplateStyle>().eq("template_id",9)); |
|
|
|
|
List<SysTemplateStyle> list = styleService.list(new QueryWrapper<SysTemplateStyle>().eq("is_long_page", 1)); |
|
|
|
|
return R.success(list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -62,28 +65,28 @@ public class SysTemplateController { |
|
|
|
|
@ApiOperation(value = "根据模板id获取样式", response = SysTemplateStyle.class) |
|
|
|
|
public R theTemplateIdGetsTheStyle(@ApiParam(name = "templateId", value = "模板id", required = true) @RequestParam Integer templateId) { |
|
|
|
|
|
|
|
|
|
QueryWrapper<SysTemplateStyle> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("template_id",templateId); |
|
|
|
|
/*QueryWrapper<SysTemplateStyle> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("type", Constant.LIST_TEMPLATE_TYPES); |
|
|
|
|
queryWrapper.eq("is_long_page", 0); |
|
|
|
|
List<SysTemplateStyle> listingTemplateTypes = styleService.list(queryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<SysTemplateStyle> queryWrapper1 = new QueryWrapper<>(); |
|
|
|
|
queryWrapper1.eq("template_id",templateId); |
|
|
|
|
queryWrapper1.eq("type", Constant.DETAILS_TEMPLATE_TYPE); |
|
|
|
|
List<SysTemplateStyle> detailsTypeOfTheTemplate = styleService.list(queryWrapper1); |
|
|
|
|
List<SysTemplateStyle> detailsTypeOfTheTemplate = styleService.list(queryWrapper1);*/ |
|
|
|
|
|
|
|
|
|
List<SysTemplateStyle> listingTemplateTypes = templateStyleConfigurationService.getsTheStyleUnderTheTemplate(templateId, 0); |
|
|
|
|
List<SysTemplateStyle> detailsTypeOfTheTemplate = templateStyleConfigurationService.getsTheStyleUnderTheTemplate(templateId, 1); |
|
|
|
|
|
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("listingTemplateTypes",listingTemplateTypes);//列表样式
|
|
|
|
|
map.put("detailsTypeOfTheTemplate",detailsTypeOfTheTemplate);//详情样式
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("listingTemplateTypes", listingTemplateTypes);//列表样式
|
|
|
|
|
map.put("detailsTypeOfTheTemplate", detailsTypeOfTheTemplate);//详情样式
|
|
|
|
|
return R.success(map); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/fullDetailsTemplateStyle") |
|
|
|
|
@ApiOperation(value = "全部详情模板样式", response = SysTemplateStyle.class) |
|
|
|
|
public R fullDetailsTemplateStyle() { |
|
|
|
@ -93,5 +96,13 @@ public class SysTemplateController { |
|
|
|
|
List<SysTemplateStyle> listingTemplateTypes = styleService.list(queryWrapper); |
|
|
|
|
return R.success(listingTemplateTypes); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/individualTemplateDetailsStyle") |
|
|
|
|
@ApiOperation(value = "独立模板详情样式", response = SysTemplate.class) |
|
|
|
|
public R individualTemplateDetailsStyle() { |
|
|
|
|
List<SysTemplateStyle> list = styleService.list(new QueryWrapper<SysTemplateStyle>().eq("type", 1).eq("is_long_page", 0)); |
|
|
|
|
return R.success(list); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|