4 files modified
5 files added
New file |
| | |
| | | package com.xcong.farmer.cms.core.handler; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.xcong.farmer.cms.core.node.AttrNode; |
| | | import com.xcong.farmer.cms.core.tag.data.AdData; |
| | | import com.xcong.farmer.cms.core.tag.model.Ad; |
| | | import com.xcong.farmer.cms.core.tag.model.Column; |
| | | import com.xcong.farmer.cms.modules.system.entity.CmsAdInfoEntity; |
| | | import com.xcong.farmer.cms.modules.system.mapper.CmsAdInfoMapper; |
| | | import com.xcong.farmer.cms.utils.SpringContextHolder; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2022-08-30 |
| | | **/ |
| | | public class AdDataParserHandler implements DataParserHandler{ |
| | | |
| | | private final CmsAdInfoMapper adInfoMapper = SpringContextHolder.getBean(CmsAdInfoMapper.class); |
| | | |
| | | @Override |
| | | public void dataParser(AttrNode attrNode) { |
| | | Long companyId = (Long) attrNode.getSystemDataValue("companyId"); |
| | | |
| | | Ad param = (Ad) attrNode.getParam(); |
| | | if (StrUtil.isNotBlank(param.getGroupId())) { |
| | | List<CmsAdInfoEntity> ads = adInfoMapper.selectByGroupIdAndCompanyId(Long.parseLong(param.getGroupId()), companyId); |
| | | } else { |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.xcong.farmer.cms.core.handler; |
| | | |
| | | import com.xcong.farmer.cms.core.node.AttrNode; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2022-08-30 |
| | | **/ |
| | | public class FriendlyDataParserHandler implements DataParserHandler{ |
| | | |
| | | @Override |
| | | public void dataParser(AttrNode attrNode) { |
| | | |
| | | } |
| | | } |
| | |
| | | ARTICLE("@article", "com.xcong.farmer.cms.core.tag.model.Article", "com.xcong.farmer.cms.core.handler.ArticleDataParserHandler",2), |
| | | CHILD("@child", "com.xcong.farmer.cms.core.tag.model.Child", "com.xcong.farmer.cms.core.handler.ChildDataParserHandler",2), |
| | | PAGE("@page", "com.xcong.farmer.cms.core.tag.model.Pagination", "com.xcong.farmer.cms.core.handler.PageDataParserHandler",2), |
| | | // AD("@ad", "com.xcong.farmer.cms.core.tag.model.Ad", "",2), |
| | | // COLUMNS("@columns", "com.xcong.farmer.cms.core.tag.model.Columns", "",2), |
| | | AD("@ad", "com.xcong.farmer.cms.core.tag.model.Ad", "com.xcong.farmer.cms.core.handler.AdDataParserHandler",2), |
| | | FRI("@fri", "com.xcong.farmer.cms.core.tag.model.Friendly", "com.xcong.farmer.cms.core.handler.FriendlyDataParserHandler",2), |
| | | COLUMN("@column", "com.xcong.farmer.cms.core.tag.model.Column", "com.xcong.farmer.cms.core.handler.ColumnDataParserHandler",2); |
| | | |
| | | private String name; |
New file |
| | |
| | | package com.xcong.farmer.cms.core.tag.data; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2022-08-30 |
| | | **/ |
| | | public class AdData { |
| | | |
| | | private String name; |
| | | |
| | | private String data; |
| | | |
| | | private int index; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(String data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | public int getIndex() { |
| | | return index; |
| | | } |
| | | |
| | | public void setIndex(int index) { |
| | | this.index = index; |
| | | } |
| | | } |
New file |
| | |
| | | package com.xcong.farmer.cms.core.tag.data; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2022-08-30 |
| | | **/ |
| | | public class FriendlyData { |
| | | |
| | | private String name; |
| | | |
| | | private String url; |
| | | |
| | | private String index; |
| | | |
| | | private String logo; |
| | | |
| | | private String image; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getIndex() { |
| | | return index; |
| | | } |
| | | |
| | | public void setIndex(String index) { |
| | | this.index = index; |
| | | } |
| | | |
| | | public String getLogo() { |
| | | return logo; |
| | | } |
| | | |
| | | public void setLogo(String logo) { |
| | | this.logo = logo; |
| | | } |
| | | |
| | | public String getImage() { |
| | | return image; |
| | | } |
| | | |
| | | public void setImage(String image) { |
| | | this.image = image; |
| | | } |
| | | } |
| | |
| | | |
| | | private String field; |
| | | |
| | | /** |
| | | * image/url/code |
| | | */ |
| | | private String type; |
| | | |
| | | public String getGroupId() { |
| | | return groupId; |
| | | } |
| | |
| | | public void setField(String field) { |
| | | this.field = field; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | } |
New file |
| | |
| | | package com.xcong.farmer.cms.core.tag.model; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2022-08-30 |
| | | **/ |
| | | public class Friendly { |
| | | |
| | | private String groupId; |
| | | |
| | | private String field; |
| | | |
| | | public String getGroupId() { |
| | | return groupId; |
| | | } |
| | | |
| | | public void setGroupId(String groupId) { |
| | | this.groupId = groupId; |
| | | } |
| | | |
| | | public String getField() { |
| | | return field; |
| | | } |
| | | |
| | | public void setField(String field) { |
| | | this.field = field; |
| | | } |
| | | } |
| | |
| | | import com.xcong.farmer.cms.modules.system.entity.CmsAdInfoEntity; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface CmsAdInfoMapper extends BaseMapper<CmsAdInfoEntity> { |
| | | |
| | | Page<CmsAdInfoEntity> selectInPage(Page<CmsAdInfoEntity> page, @Param("record") CmsAdInfoEntity cmsAdInfoEntity); |
| | | |
| | | List<CmsAdInfoEntity> selectByGroupIdAndCompanyId(@Param("groupId") Long groupId, @Param("companyId") Long companyId); |
| | | |
| | | } |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectByGroupIdAndCompanyId" resultType="com.xcong.farmer.cms.modules.system.entity.CmsAdInfoEntity"> |
| | | select * from cms_ad_info where group_id=#{groupId} and company_id=#{companyId} |
| | | </select> |
| | | </mapper> |