blog列表页接口实现,blog分类接口实现,统计接口实现
8 files added
6 files modified
New file |
| | |
| | | package vip.xiaonuo.core.consts; |
| | | |
| | | public interface MyConstant { |
| | | Integer Yes = 1; |
| | | Integer No = 1; |
| | | } |
| | |
| | | */ |
| | | String[] NONE_SECURITY_URL_PATTERNS = { |
| | | |
| | | //对外开发的接口 |
| | | "/outside/**", |
| | | |
| | | //前端的 |
| | | "/favicon.ico", |
| | | |
New file |
| | |
| | | /* |
| | | Copyright [2020] [https://www.xiaonuo.vip] |
| | | |
| | | Licensed under the Apache License, Version 2.0 (the "License"); |
| | | you may not use this file except in compliance with the License. |
| | | You may obtain a copy of the License at |
| | | |
| | | http://www.apache.org/licenses/LICENSE-2.0 |
| | | |
| | | Unless required by applicable law or agreed to in writing, software |
| | | distributed under the License is distributed on an "AS IS" BASIS, |
| | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | See the License for the specific language governing permissions and |
| | | limitations under the License. |
| | | |
| | | Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: |
| | | |
| | | 1.请不要删除和修改根目录下的LICENSE文件。 |
| | | 2.请不要删除和修改Snowy源码头部的版权声明。 |
| | | 3.请保留源码和相关描述文件的项目出处,作者声明等。 |
| | | 4.分发源码时候,请注明软件出处 https://gitee.com/xiaonuobase/snowy |
| | | 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/xiaonuobase/snowy |
| | | 6.若您的项目无法满足以上几点,可申请商业授权,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip |
| | | */ |
| | | package vip.xiaonuo.modular.blogStatistics; |
| | | |
| | | import cn.hutool.core.date.DateUnit; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import vip.xiaonuo.core.annotion.BusinessLog; |
| | | import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum; |
| | | import vip.xiaonuo.core.pojo.response.ResponseData; |
| | | import vip.xiaonuo.core.pojo.response.SuccessResponseData; |
| | | import vip.xiaonuo.modular.blogStatistics.vo.BlogStatisticsVo; |
| | | import vip.xiaonuo.modular.blogarticle.entity.BlogArticle; |
| | | import vip.xiaonuo.modular.blogarticle.service.BlogArticleService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * blog文章控制器 (提供给外部blog系统查询) |
| | | * |
| | | * @author inleft |
| | | * @date 2022-02-09 18:20:22 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/outside") |
| | | public class BlogStatisticsController { |
| | | |
| | | @Resource |
| | | private BlogArticleService blogArticleService; |
| | | |
| | | /** |
| | | * @author inleft |
| | | * @date 2022-02-09 18:20:22 |
| | | */ |
| | | @GetMapping("/blog/statistics") |
| | | @BusinessLog(title = "外部blog系统_统计_查询", opType = LogAnnotionOpTypeEnum.QUERY) |
| | | public ResponseData statistics() { |
| | | |
| | | //相差一个月,31天 |
| | | long betweenDay = DateUtil.between(DateUtil.parseDate("2020-05-27"), new Date(), DateUnit.DAY); |
| | | String updateDate; |
| | | BlogArticle lastUpdateBlog = blogArticleService.lambdaQuery().orderByDesc(BlogArticle::getUpdateDate) |
| | | .last(" limit 1 ").one(); |
| | | if (lastUpdateBlog != null && lastUpdateBlog.getUpdateDate() != null) { |
| | | updateDate = DateUtil.formatDate(lastUpdateBlog.getUpdateDate()); |
| | | } else { |
| | | updateDate = "--"; |
| | | } |
| | | String startFrom = "从这开始: 2020-05-27 "; |
| | | String aliveDayCount = "已稳定运行:" + betweenDay + "天"; |
| | | String lastUpdateDate = "上次更新:" + updateDate; |
| | | String visitCount = "累计访问:1010次"; |
| | | String visitorCount = "累计访客:1001名"; |
| | | |
| | | List<BlogStatisticsVo.simpleVo> res = new ArrayList<>(); |
| | | res.add(new BlogStatisticsVo.simpleVo().setName(startFrom)); |
| | | res.add(new BlogStatisticsVo.simpleVo().setName(aliveDayCount)); |
| | | res.add(new BlogStatisticsVo.simpleVo().setName(lastUpdateDate)); |
| | | res.add(new BlogStatisticsVo.simpleVo().setName(visitCount)); |
| | | res.add(new BlogStatisticsVo.simpleVo().setName(visitorCount)); |
| | | |
| | | BlogStatisticsVo statisticsVo = new BlogStatisticsVo(); |
| | | statisticsVo.setList(res); |
| | | statisticsVo.setTitle("统计信息"); |
| | | return new SuccessResponseData(statisticsVo); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | Copyright [2020] [https://www.xiaonuo.vip] |
| | | |
| | | Licensed under the Apache License, Version 2.0 (the "License"); |
| | | you may not use this file except in compliance with the License. |
| | | You may obtain a copy of the License at |
| | | |
| | | http://www.apache.org/licenses/LICENSE-2.0 |
| | | |
| | | Unless required by applicable law or agreed to in writing, software |
| | | distributed under the License is distributed on an "AS IS" BASIS, |
| | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | See the License for the specific language governing permissions and |
| | | limitations under the License. |
| | | |
| | | Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: |
| | | |
| | | 1.请不要删除和修改根目录下的LICENSE文件。 |
| | | 2.请不要删除和修改Snowy源码头部的版权声明。 |
| | | 3.请保留源码和相关描述文件的项目出处,作者声明等。 |
| | | 4.分发源码时候,请注明软件出处 https://gitee.com/xiaonuobase/snowy |
| | | 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/xiaonuobase/snowy |
| | | 6.若您的项目无法满足以上几点,可申请商业授权,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip |
| | | */ |
| | | package vip.xiaonuo.modular.blogStatistics.vo; |
| | | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * blog 统计信息 |
| | | * |
| | | * @author inleft |
| | | * @date 2022-01-22 16:53:06 |
| | | */ |
| | | @Data |
| | | public class BlogStatisticsVo { |
| | | |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | private String title; |
| | | |
| | | private List<simpleVo> list; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public static class simpleVo { |
| | | private String name; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | Copyright [2020] [https://www.xiaonuo.vip] |
| | | |
| | | Licensed under the Apache License, Version 2.0 (the "License"); |
| | | you may not use this file except in compliance with the License. |
| | | You may obtain a copy of the License at |
| | | |
| | | http://www.apache.org/licenses/LICENSE-2.0 |
| | | |
| | | Unless required by applicable law or agreed to in writing, software |
| | | distributed under the License is distributed on an "AS IS" BASIS, |
| | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | See the License for the specific language governing permissions and |
| | | limitations under the License. |
| | | |
| | | Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: |
| | | |
| | | 1.请不要删除和修改根目录下的LICENSE文件。 |
| | | 2.请不要删除和修改Snowy源码头部的版权声明。 |
| | | 3.请保留源码和相关描述文件的项目出处,作者声明等。 |
| | | 4.分发源码时候,请注明软件出处 https://gitee.com/xiaonuobase/snowy |
| | | 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/xiaonuobase/snowy |
| | | 6.若您的项目无法满足以上几点,可申请商业授权,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip |
| | | */ |
| | | package vip.xiaonuo.modular.blogarticle.controller; |
| | | |
| | | import cn.hutool.core.util.PageUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import vip.xiaonuo.core.annotion.BusinessLog; |
| | | import vip.xiaonuo.core.context.constant.ConstantContextHolder; |
| | | import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum; |
| | | import vip.xiaonuo.core.pojo.response.ResponseData; |
| | | import vip.xiaonuo.core.pojo.response.SuccessResponseData; |
| | | import vip.xiaonuo.modular.blogarticle.param.BlogArticleQueryDto; |
| | | import vip.xiaonuo.modular.blogarticle.param.BlogArticleVo; |
| | | import vip.xiaonuo.modular.blogarticle.service.BlogArticleService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * blog文章控制器 (提供给外部blog系统查询) |
| | | * |
| | | * @author inleft |
| | | * @date 2022-02-09 18:20:22 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/outside") |
| | | public class BlogArticleOutsideController { |
| | | |
| | | @Resource |
| | | private BlogArticleService blogArticleService; |
| | | |
| | | /** |
| | | * 查询blog文章 |
| | | * |
| | | * @author inleft |
| | | * @date 2022-02-09 18:20:22 |
| | | */ |
| | | @GetMapping("/blogArticle/queryBlogArticleList") |
| | | @BusinessLog(title = "外部blog系统_blog文章_查询", opType = LogAnnotionOpTypeEnum.QUERY) |
| | | public ResponseData queryBlogArticleList(BlogArticleQueryDto queryDto) { |
| | | |
| | | |
| | | Map<String, Object> param = new HashMap<>(16); |
| | | param.put("pageNo", PageUtil.getStart(queryDto.getPageNo() - 1, queryDto.getPageSize())); |
| | | param.put("pageSize", queryDto.getPageSize()); |
| | | String fileUploadPathForLinux = ConstantContextHolder.getDefaultFileUploadPathForLinux(); |
| | | |
| | | List<BlogArticleVo> resList = blogArticleService.searchMediaList(param).stream().map(e -> { |
| | | if (StrUtil.isNotEmpty(e.getArticleFileURL())) { |
| | | e.setArticleFileURL(fileUploadPathForLinux + e.getArticleFileURL()); |
| | | } |
| | | return e; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | long count = blogArticleService.searchMediaListCount(param); |
| | | |
| | | Page<BlogArticleVo> queryPage = new Page<>(queryDto.getPageNo(), queryDto.getPageSize()); |
| | | queryPage.setRecords(resList); |
| | | queryPage.setTotal(count); |
| | | |
| | | return new SuccessResponseData(queryPage); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package vip.xiaonuo.modular.blogarticle.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import vip.xiaonuo.modular.blogarticle.entity.BlogArticle; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * blog文章主体 |
| | |
| | | * @date 2022-01-22 16:53:06 |
| | | */ |
| | | public interface BlogArticleMapper extends BaseMapper<BlogArticle> { |
| | | |
| | | List searchMediaList(@Param("param") Map<String, Object> param); |
| | | |
| | | long searchMediaListCount(@Param("param") Map<String, Object> param); |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="vip.xiaonuo.modular.blogarticle.mapper.BlogArticleMapper"> |
| | | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column"> |
| | | id,title,article_file_id,article_file_type, |
| | | article_type_id,introduce,cover_file_id,last_editor_date,publish_date, |
| | | is_top,top_value,auth_status,auth_password,editor_status, |
| | | separate_year,separate_month,separate_day,is_enable,update_date,create_date |
| | | </sql> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | a.id, |
| | | a.title, |
| | | a.article_file_type, |
| | | a.article_type_id, |
| | | a.introduce, |
| | | a.cover_file_id, |
| | | a.auth_status, |
| | | a.last_editor_date, |
| | | a.publish_date, |
| | | a.is_top, |
| | | a.editor_status, |
| | | a.create_date |
| | | </sql> |
| | | |
| | | <sql id="queryListCondition"> |
| | | <trim prefix="WHERE" prefixOverrides="AND | OR"> |
| | | a.is_enable=1 |
| | | and a.auth_status=1 |
| | | and a.editor_status=1 |
| | | </trim> |
| | | </sql> |
| | | |
| | | <select id="searchMediaList" resultType="vip.xiaonuo.modular.blogarticle.param.BlogArticleVo"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | ,CONCAT("/",f1.file_bucket,"/",f1.file_object_name) as articleFileURL |
| | | ,IFNULL("",CONCAT("/",f2.file_bucket,"/",f2.file_object_name)) as coverFileURL |
| | | ,t.type_name as articleTypeName |
| | | from |
| | | blog_article a |
| | | inner join blog_article_type t |
| | | on t.id =a.article_type_id |
| | | |
| | | left join sys_file_info f1 |
| | | on f1.id=a.article_file_id |
| | | |
| | | |
| | | left join sys_file_info f2 |
| | | on f2.id=a.cover_file_id |
| | | |
| | | <include refid="queryListCondition"/> |
| | | |
| | | order by a.top_value asc , a.create_date desc |
| | | |
| | | limit #{param.pageNo},#{param.pageSize} |
| | | </select> |
| | | |
| | | <select id="searchMediaListCount" resultType="java.lang.Long"> |
| | | select |
| | | count(0) |
| | | from |
| | | blog_article a |
| | | <include refid="queryListCondition"/> |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package vip.xiaonuo.modular.blogarticle.param; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | |
| | | @Data |
| | | public class BlogArticleQueryDto { |
| | | |
| | | @Min(1) |
| | | @ApiModelProperty(value = "pageSize", required = false, example = "10") |
| | | private Integer pageSize = 5; |
| | | |
| | | @Min(1) |
| | | @ApiModelProperty(value = "pageNo", required = true, example = "1") |
| | | private Integer pageNo = 1; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | Copyright [2020] [https://www.xiaonuo.vip] |
| | | |
| | | Licensed under the Apache License, Version 2.0 (the "License"); |
| | | you may not use this file except in compliance with the License. |
| | | You may obtain a copy of the License at |
| | | |
| | | http://www.apache.org/licenses/LICENSE-2.0 |
| | | |
| | | Unless required by applicable law or agreed to in writing, software |
| | | distributed under the License is distributed on an "AS IS" BASIS, |
| | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | See the License for the specific language governing permissions and |
| | | limitations under the License. |
| | | |
| | | Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: |
| | | |
| | | 1.请不要删除和修改根目录下的LICENSE文件。 |
| | | 2.请不要删除和修改Snowy源码头部的版权声明。 |
| | | 3.请保留源码和相关描述文件的项目出处,作者声明等。 |
| | | 4.分发源码时候,请注明软件出处 https://gitee.com/xiaonuobase/snowy |
| | | 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/xiaonuobase/snowy |
| | | 6.若您的项目无法满足以上几点,可申请商业授权,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip |
| | | */ |
| | | package vip.xiaonuo.modular.blogarticle.param; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * blog文章主体 |
| | | * |
| | | * @author inleft |
| | | * @date 2022-01-22 16:53:06 |
| | | */ |
| | | @Data |
| | | public class BlogArticleVo { |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | |
| | | /** |
| | | * 文章标题 |
| | | */ |
| | | private String title; |
| | | |
| | | /** |
| | | * 文章文件地址 |
| | | */ |
| | | private String articleFileURL; |
| | | |
| | | private String coverFileURL; |
| | | |
| | | /** |
| | | * 文件类型 1:markdown 2:html |
| | | */ |
| | | private Integer articleFileType; |
| | | |
| | | /** |
| | | * 文章分类id 0:没有分类 |
| | | */ |
| | | private Long articleTypeId; |
| | | |
| | | |
| | | /** |
| | | * 分类名称 |
| | | */ |
| | | private String articleTypeName; |
| | | |
| | | /** |
| | | * 文章引言 |
| | | */ |
| | | private String introduce; |
| | | |
| | | /** |
| | | * 封面文件地址(id) |
| | | */ |
| | | private Long coverFileId; |
| | | |
| | | /** |
| | | * 上次编辑时间 |
| | | */ |
| | | private Date lastEditorDate; |
| | | |
| | | /** |
| | | * 发布时间 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") |
| | | private Date publishDate; |
| | | |
| | | /** |
| | | * 是否置顶 0:否 1:是 |
| | | */ |
| | | private Integer isTop; |
| | | |
| | | |
| | | /** |
| | | * 公开状态 1:公开 2:私密 3:密码授权 |
| | | */ |
| | | private Integer authStatus; |
| | | |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createDate; |
| | | |
| | | } |
| | |
| | | import vip.xiaonuo.core.pojo.page.PageResult; |
| | | import vip.xiaonuo.modular.blogarticle.entity.BlogArticle; |
| | | import vip.xiaonuo.modular.blogarticle.param.BlogArticleParam; |
| | | import vip.xiaonuo.modular.blogarticle.param.BlogArticleVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * blog文章主体service接口 |
| | |
| | | */ |
| | | void export(BlogArticleParam blogArticleParam); |
| | | |
| | | List<BlogArticleVo> searchMediaList(Map<String,Object> param); |
| | | |
| | | long searchMediaListCount(Map<String, Object> param); |
| | | } |
| | |
| | | import vip.xiaonuo.modular.blogarticle.service.BlogArticleService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * blog文章service接口实现类 |
| | |
| | | PoiUtil.exportExcelWithStream("SnowyBlogArticle.xls", BlogArticle.class, list); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List searchMediaList(Map<String, Object> param) { |
| | | return this.baseMapper.searchMediaList(param); |
| | | } |
| | | |
| | | @Override |
| | | public long searchMediaListCount(Map<String, Object> param) { |
| | | return this.baseMapper.searchMediaListCount(param); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | Copyright [2020] [https://www.xiaonuo.vip] |
| | | |
| | | Licensed under the Apache License, Version 2.0 (the "License"); |
| | | you may not use this file except in compliance with the License. |
| | | You may obtain a copy of the License at |
| | | |
| | | http://www.apache.org/licenses/LICENSE-2.0 |
| | | |
| | | Unless required by applicable law or agreed to in writing, software |
| | | distributed under the License is distributed on an "AS IS" BASIS, |
| | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | See the License for the specific language governing permissions and |
| | | limitations under the License. |
| | | |
| | | Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: |
| | | |
| | | 1.请不要删除和修改根目录下的LICENSE文件。 |
| | | 2.请不要删除和修改Snowy源码头部的版权声明。 |
| | | 3.请保留源码和相关描述文件的项目出处,作者声明等。 |
| | | 4.分发源码时候,请注明软件出处 https://gitee.com/xiaonuobase/snowy |
| | | 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/xiaonuobase/snowy |
| | | 6.若您的项目无法满足以上几点,可申请商业授权,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip |
| | | */ |
| | | package vip.xiaonuo.modular.blogarticletype.controller; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import vip.xiaonuo.core.annotion.BusinessLog; |
| | | import vip.xiaonuo.core.consts.MyConstant; |
| | | import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum; |
| | | import vip.xiaonuo.core.pojo.response.ResponseData; |
| | | import vip.xiaonuo.core.pojo.response.SuccessResponseData; |
| | | import vip.xiaonuo.modular.blogarticletype.entity.BlogArticleType; |
| | | import vip.xiaonuo.modular.blogarticletype.param.BlogArticleTypeVo; |
| | | import vip.xiaonuo.modular.blogarticletype.service.BlogArticleTypeService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * blog文章分类控制器 |
| | | * |
| | | * @author inleft |
| | | * @date 2022-02-15 15:17:15 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/outside") |
| | | public class BlogArticleTypeOutSideController { |
| | | |
| | | @Resource |
| | | private BlogArticleTypeService blogArticleTypeService; |
| | | |
| | | |
| | | /** |
| | | * 查询blog文章 |
| | | * |
| | | * @author inleft |
| | | * @date 2022-02-09 18:20:22 |
| | | */ |
| | | @GetMapping("/blogArticleType/queryBlogArticleType") |
| | | @BusinessLog(title = "外部blog系统_blog文章分类_查询", opType = LogAnnotionOpTypeEnum.QUERY) |
| | | public ResponseData queryBlogArticleType() { |
| | | |
| | | List<BlogArticleTypeVo> list = blogArticleTypeService.lambdaQuery() |
| | | .eq(BlogArticleType::getIsEnable, MyConstant.Yes) |
| | | .orderByAsc(BlogArticleType::getTopValue) |
| | | .orderByDesc(BlogArticleType::getCreateDate) |
| | | .list().stream().map(e -> { |
| | | BlogArticleTypeVo vo = new BlogArticleTypeVo(); |
| | | BeanUtil.copyProperties(e, vo); |
| | | return vo; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | return new SuccessResponseData(list); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | Copyright [2020] [https://www.xiaonuo.vip] |
| | | |
| | | Licensed under the Apache License, Version 2.0 (the "License"); |
| | | you may not use this file except in compliance with the License. |
| | | You may obtain a copy of the License at |
| | | |
| | | http://www.apache.org/licenses/LICENSE-2.0 |
| | | |
| | | Unless required by applicable law or agreed to in writing, software |
| | | distributed under the License is distributed on an "AS IS" BASIS, |
| | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | See the License for the specific language governing permissions and |
| | | limitations under the License. |
| | | |
| | | Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: |
| | | |
| | | 1.请不要删除和修改根目录下的LICENSE文件。 |
| | | 2.请不要删除和修改Snowy源码头部的版权声明。 |
| | | 3.请保留源码和相关描述文件的项目出处,作者声明等。 |
| | | 4.分发源码时候,请注明软件出处 https://gitee.com/xiaonuobase/snowy |
| | | 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/xiaonuobase/snowy |
| | | 6.若您的项目无法满足以上几点,可申请商业授权,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip |
| | | */ |
| | | package vip.xiaonuo.modular.blogarticletype.param; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * blog文章分类 |
| | | * |
| | | * @author inleft |
| | | * @date 2022-02-15 15:17:15 |
| | | */ |
| | | @Data |
| | | public class BlogArticleTypeVo { |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | |
| | | /** |
| | | * 分类名称 |
| | | */ |
| | | private String typeName; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createDate; |
| | | |
| | | } |
| | |
| | | cache-enabled: true |
| | | lazy-loading-enabled: true |
| | | multiple-result-sets-enabled: true |
| | | log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | # log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl |
| | | global-config: |
| | | banner: false |
| | | db-config: |