├── README.md ├── pom.xml ├── zhiliao-admin ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── lin │ │ └── zhiliaoAdmin │ │ ├── ZhiliaoAdminApplication.java │ │ ├── config │ │ ├── MybatisPlusConfig.java │ │ └── SecurityConfig.java │ │ ├── controller │ │ └── AdminController.java │ │ ├── dao │ │ ├── mapper │ │ │ ├── ArticleBodyMapper.java │ │ │ ├── ArticleMapper.java │ │ │ ├── ArticleTagMapper.java │ │ │ ├── ArticleVOMapper.java │ │ │ ├── CategoryMapper.java │ │ │ ├── CommentMapper.java │ │ │ ├── CommentVOMapper.java │ │ │ ├── PermissionMapper.java │ │ │ ├── SysUserMapper.java │ │ │ ├── TagMapper.java │ │ │ └── UserMapper.java │ │ └── pojo │ │ │ ├── Admin.java │ │ │ ├── Article.java │ │ │ ├── ArticleBody.java │ │ │ ├── ArticleTag.java │ │ │ ├── Category.java │ │ │ ├── Comment.java │ │ │ ├── Permission.java │ │ │ ├── SysUser.java │ │ │ └── Tag.java │ │ ├── service │ │ ├── ArticleService.java │ │ ├── AuthService.java │ │ ├── CategoryService.java │ │ ├── CommentService.java │ │ ├── MySimpleGrantedAuthority.java │ │ ├── PermissionService.java │ │ ├── SecurityUserService.java │ │ ├── SysUserService.java │ │ ├── TagService.java │ │ └── UserService.java │ │ ├── utils │ │ └── JWTUtil.java │ │ └── vo │ │ ├── ArticleVO.java │ │ ├── CommentVO.java │ │ ├── ErrorCode.java │ │ ├── PageResult.java │ │ ├── Result.java │ │ └── params │ │ └── PageParam.java │ └── resources │ ├── application.properties │ ├── com │ └── lin │ │ └── zhiliaoAdmin │ │ └── mapper │ │ └── PermissionMapper.xml │ └── static │ ├── css │ ├── bootstrap-datetimepicker.min.css │ ├── bootstrap │ │ ├── assets │ │ │ └── ie10-viewport-bug-workaround.css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ ├── dashboard.css │ ├── font │ │ ├── summernote.eot │ │ ├── summernote.ttf │ │ └── summernote.woff │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── login.css │ ├── login_style.css │ ├── pages-login-manage.css │ ├── signin.css │ ├── spin.css │ ├── style.css │ ├── summernote.css │ └── webbase.css │ ├── img │ ├── bg.jpg │ ├── head_img.png │ ├── icons.png │ └── left_hidden.png │ ├── js │ ├── angular-select2.js │ ├── axios-0.18.0.js │ ├── bootstrap-datetimepicker.min.js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── bootstrap │ │ └── assets │ │ │ ├── ie-emulation-modes-warning.js │ │ │ ├── ie10-viewport-bug-workaround.js │ │ │ ├── ie8-responsive-file-warning.js │ │ │ └── vendor │ │ │ └── holder.min.js │ ├── handlebars.js │ ├── jquery.min.js │ ├── main.js │ ├── moment-with-locales.js │ ├── plugins │ │ ├── birthday │ │ │ └── birthday.js │ │ ├── citypicker │ │ │ ├── distpicker.data.js │ │ │ └── distpicker.js │ │ ├── jquery-placeholder │ │ │ └── jquery.placeholder.min.js │ │ ├── jquery.easing │ │ │ └── jquery.easing.min.js │ │ ├── jquery.jqzoom │ │ │ ├── jquery.jqzoom.js │ │ │ └── zoom.js │ │ ├── jquery │ │ │ └── jquery.min.js │ │ ├── sui │ │ │ └── sui.min.js │ │ └── upload │ │ │ └── uploadPreview.js │ ├── spin.js │ ├── summernote.min.js │ ├── user_main.js │ ├── version.js │ ├── vue.js │ └── xlsx.full.min.js │ ├── login.html │ ├── pages │ ├── admin.html │ ├── article.html │ ├── category.html │ ├── comment.html │ ├── main.html │ ├── permission.html │ ├── tag.html │ └── user.html │ └── plugins │ ├── adminLTE │ ├── css │ │ ├── AdminLTE.css │ │ ├── AdminLTE.min.css │ │ ├── alt │ │ │ ├── AdminLTE-bootstrap-social.css │ │ │ ├── AdminLTE-bootstrap-social.min.css │ │ │ ├── AdminLTE-fullcalendar.css │ │ │ ├── AdminLTE-fullcalendar.min.css │ │ │ ├── AdminLTE-select2.css │ │ │ ├── AdminLTE-select2.min.css │ │ │ ├── AdminLTE-without-plugins.css │ │ │ └── AdminLTE-without-plugins.min.css │ │ └── skins │ │ │ ├── _all-skins.css │ │ │ ├── _all-skins.min.css │ │ │ ├── skin-black-light.css │ │ │ ├── skin-black-light.min.css │ │ │ ├── skin-black.css │ │ │ ├── skin-black.min.css │ │ │ ├── skin-blue-light.css │ │ │ ├── skin-blue-light.min.css │ │ │ ├── skin-blue.css │ │ │ ├── skin-blue.min.css │ │ │ ├── skin-green-light.css │ │ │ ├── skin-green-light.min.css │ │ │ ├── skin-green.css │ │ │ ├── skin-green.min.css │ │ │ ├── skin-purple-light.css │ │ │ ├── skin-purple-light.min.css │ │ │ ├── skin-purple.css │ │ │ ├── skin-purple.min.css │ │ │ ├── skin-red-light.css │ │ │ ├── skin-red-light.min.css │ │ │ ├── skin-red.css │ │ │ ├── skin-red.min.css │ │ │ ├── skin-yellow-light.css │ │ │ ├── skin-yellow-light.min.css │ │ │ ├── skin-yellow.css │ │ │ └── skin-yellow.min.css │ ├── img │ │ ├── avatar.png │ │ ├── avatar04.png │ │ ├── avatar2.png │ │ ├── avatar3.png │ │ ├── avatar5.png │ │ ├── boxed-bg.jpg │ │ ├── boxed-bg.png │ │ ├── credit │ │ │ ├── american-express.png │ │ │ ├── cirrus.png │ │ │ ├── mastercard.png │ │ │ ├── mestro.png │ │ │ ├── paypal.png │ │ │ ├── paypal2.png │ │ │ └── visa.png │ │ ├── default-50x50.gif │ │ ├── icons.png │ │ ├── photo1.png │ │ ├── photo2.png │ │ ├── photo3.jpg │ │ ├── photo4.jpg │ │ ├── user1-128x128.jpg │ │ ├── user2-160x160.jpg │ │ ├── user3-128x128.jpg │ │ ├── user4-128x128.jpg │ │ ├── user5-128x128.jpg │ │ ├── user6-128x128.jpg │ │ ├── user7-128x128.jpg │ │ └── user8-128x128.jpg │ └── js │ │ ├── app.js │ │ ├── app.min.js │ │ ├── demo.js │ │ └── pages │ │ ├── dashboard.js │ │ └── dashboard2.js │ ├── angularjs │ ├── angular-animate.min.js │ ├── angular-route.min.js │ ├── angular.min.js │ ├── pagination.css │ └── pagination.js │ ├── elementui │ ├── fonts │ │ └── element-icons.woff │ ├── index.css │ └── index.js │ ├── font-awesome │ ├── css │ │ ├── font-awesome.css │ │ └── font-awesome.min.css │ └── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── jQuery │ └── jquery-2.2.3.min.js │ ├── quill │ ├── examples │ │ ├── bubble.html │ │ ├── full.html │ │ └── snow.html │ ├── quill.bubble.css │ ├── quill.core.css │ ├── quill.core.js │ ├── quill.js │ ├── quill.min.js │ ├── quill.min.js.map │ ├── quill.snow.css │ └── vue-quill-editor.js │ └── select2 │ ├── .bower.json │ ├── LICENSE │ ├── README.md │ ├── angular-select2.js │ ├── bower.json │ ├── component.json │ ├── composer.json │ ├── package.json │ ├── release.sh │ ├── select2-bootstrap.css │ ├── select2-spinner.gif │ ├── select2.css │ ├── select2.jquery.json │ ├── select2.js │ ├── select2.min.js │ ├── select2.png │ ├── select2_locale_ar.js │ ├── select2_locale_bg.js │ ├── select2_locale_ca.js │ ├── select2_locale_cs.js │ ├── select2_locale_da.js │ ├── select2_locale_de.js │ ├── select2_locale_el.js │ ├── select2_locale_en.js.template │ ├── select2_locale_es.js │ ├── select2_locale_et.js │ ├── select2_locale_eu.js │ ├── select2_locale_fa.js │ ├── select2_locale_fi.js │ ├── select2_locale_fr.js │ ├── select2_locale_gl.js │ ├── select2_locale_he.js │ ├── select2_locale_hr.js │ ├── select2_locale_hu.js │ ├── select2_locale_id.js │ ├── select2_locale_is.js │ ├── select2_locale_it.js │ ├── select2_locale_ja.js │ ├── select2_locale_ka.js │ ├── select2_locale_ko.js │ ├── select2_locale_lt.js │ ├── select2_locale_lv.js │ ├── select2_locale_mk.js │ ├── select2_locale_ms.js │ ├── select2_locale_nl.js │ ├── select2_locale_no.js │ ├── select2_locale_pl.js │ ├── select2_locale_pt-BR.js │ ├── select2_locale_pt-PT.js │ ├── select2_locale_ro.js │ ├── select2_locale_rs.js │ ├── select2_locale_ru.js │ ├── select2_locale_sk.js │ ├── select2_locale_sv.js │ ├── select2_locale_th.js │ ├── select2_locale_tr.js │ ├── select2_locale_uk.js │ ├── select2_locale_vi.js │ ├── select2_locale_zh-CN.js │ ├── select2_locale_zh-TW.js │ └── select2x2.png └── zhiliao-api ├── pom.xml ├── src └── main │ ├── java │ └── com │ │ └── lin │ │ ├── common │ │ ├── aop │ │ │ ├── LimitType.java │ │ │ ├── LogAnnotation.java │ │ │ ├── LogAspect.java │ │ │ ├── RateLimiter.java │ │ │ └── RateLimiterAspect.java │ │ ├── cache │ │ │ ├── Cache.java │ │ │ └── CacheAspect.java │ │ ├── verificationCode │ │ │ └── Captcha.java │ │ └── webSocket │ │ │ └── WebSocketConfig.java │ │ ├── component │ │ └── WebSocketServer.java │ │ ├── config │ │ ├── MybatisPlusConfig.java │ │ ├── RedisConfig.java │ │ ├── Swagger3Config.java │ │ ├── ThreadPoolConfig.java │ │ └── WebMVCConfig.java │ │ ├── controller │ │ ├── AdController.java │ │ ├── AdTypeController.java │ │ ├── ArticleController.java │ │ ├── CategoryController.java │ │ ├── CommentsController.java │ │ ├── LikeAriticleController.java │ │ ├── LoginController.java │ │ ├── LogoutController.java │ │ ├── RegisterController.java │ │ ├── TagsController.java │ │ ├── TestController.java │ │ ├── UploadController.java │ │ ├── UsersController.java │ │ └── WeixinApiController.java │ │ ├── dao │ │ ├── dos │ │ │ └── Archives.java │ │ ├── mapper │ │ │ ├── AdMapper.java │ │ │ ├── AdTypeMapper.java │ │ │ ├── ArticleBodyMapper.java │ │ │ ├── ArticleMapper.java │ │ │ ├── ArticleTagMapper.java │ │ │ ├── CategoryMapper.java │ │ │ ├── CommentMapper.java │ │ │ ├── OpenaiAnswersMapper.java │ │ │ ├── SysUserMapper.java │ │ │ └── TagMapper.java │ │ └── pojo │ │ │ ├── Ad.java │ │ │ ├── AdType.java │ │ │ ├── Article.java │ │ │ ├── ArticleBody.java │ │ │ ├── ArticleTag.java │ │ │ ├── BaseEntity.java │ │ │ ├── Category.java │ │ │ ├── Comment.java │ │ │ ├── OpenaiAnswers.java │ │ │ ├── SysUser.java │ │ │ └── Tag.java │ │ ├── handler │ │ ├── AllExceptionHandler.java │ │ ├── LoginInterceptor.java │ │ └── ServiceException.java │ │ ├── service │ │ ├── AdService.java │ │ ├── AdTypeService.java │ │ ├── ArticleService.java │ │ ├── CaptchaService.java │ │ ├── CategoryService.java │ │ ├── CommentsService.java │ │ ├── LikeService.java │ │ ├── LoginService.java │ │ ├── OpenAIService.java │ │ ├── SysUserService.java │ │ ├── TagService.java │ │ ├── ThreadService.java │ │ ├── impl │ │ │ ├── AdServiceImpl.java │ │ │ ├── AdTypeServiceImpl.java │ │ │ ├── ArticleServiceImpl.java │ │ │ ├── CaptchaServiceImpl.java │ │ │ ├── CategoryServiceImpl.java │ │ │ ├── CommentsServiceImpl.java │ │ │ ├── LikeServiceImpl.java │ │ │ ├── LoginServiceImpl.java │ │ │ ├── OpenAIServiceImpl.java │ │ │ ├── SysUserServiceImpl.java │ │ │ └── TagServiceImpl.java │ │ └── mq │ │ │ └── ArticleListener.java │ │ ├── task │ │ └── ScheduleTask.java │ │ ├── utils │ │ ├── CaptchaUtils.java │ │ ├── ConstantPropertiesUtil.java │ │ ├── DateUtils.java │ │ ├── HttpClientUtils.java │ │ ├── HttpContextUtils.java │ │ ├── IpUtils.java │ │ ├── JWTUtils.java │ │ ├── QiniuUtils.java │ │ ├── SensitiveFilter.java │ │ ├── SnowFlakeUtil.java │ │ ├── UserThreadLocal.java │ │ └── text │ │ │ ├── CharsetKit.java │ │ │ ├── Constants.java │ │ │ ├── ConvertUtils.java │ │ │ ├── StrFormatter.java │ │ │ └── StringUtils.java │ │ ├── vo │ │ ├── ArticleBodyVo.java │ │ ├── ArticleMessage.java │ │ ├── ArticleVo.java │ │ ├── CategoryVo.java │ │ ├── CodeVo.java │ │ ├── CommentVo.java │ │ ├── ErrorCode.java │ │ ├── LoginUserVo.java │ │ ├── Result.java │ │ ├── TagVo.java │ │ ├── UserVo.java │ │ ├── ai │ │ │ ├── AIAnswer.java │ │ │ └── Choices.java │ │ └── params │ │ │ ├── AdTypePageParam.java │ │ │ ├── ArticleBodyParam.java │ │ │ ├── ArticleParam.java │ │ │ ├── CommentParam.java │ │ │ ├── LikeParam.java │ │ │ ├── LoginParam.java │ │ │ ├── PageParams.java │ │ │ ├── PageSearchParams.java │ │ │ └── UserPatam.java │ │ └── zhiliaoApplication.java │ └── resources │ ├── application-prod.properties │ ├── com │ └── lin │ │ └── dao │ │ └── mapper │ │ ├── AdMapper.xml │ │ ├── AdTypeMapper.xml │ │ ├── ArticleMapper.xml │ │ └── TagMapper.xml │ └── sensitiveWords.txt └── zhiliao-api.iml /README.md: -------------------------------------------------------------------------------- 1 | 2 | ![输入图片说明](https://images.gitee.com/uploads/images/2020/0922/091803_234785a7_2156220.gif "1.8ff235a.gif") 3 | # 知了社区 4 | 5 |

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

16 | 17 | ## 项目结构介绍 18 | * zhiiao-parent 19 | * * zhiliao-api 提供web端API接口服务; 20 | * * zhiliao-admin 提供管理端API接口服务; 21 | * zhiiao-app 前端使用vue+elementUI 22 | 23 | ## 技术应用 24 | 25 | ### 前端 26 | Vue、element-UI 、markdown-Editor 27 | ### 后端 28 | SpringBoot、MybatisPlus、MySQL、Redis、RocketMQ、Lombok、maven、七牛云sdk 29 | 30 | ### 项目发布采用技术 31 | docker,nginx,jdk8 32 | 33 | 使用docker-compose编排容器,dockerfile构建镜像 34 | 35 | ## 线上地址 36 | http://106.12.106.46 (服务器过期了) 37 | 38 | ## 服务器要求 39 | 1核1G(以上),但有时候会挂掉,建议更高配置的! 40 | 41 | ## 打包流程 42 | ![image](https://user-images.githubusercontent.com/84490780/195503969-e257ad2c-e5a1-4d14-9db7-c6726118a520.png) 43 | 然后运行 44 | jar包会保存在target目录下 45 | ## 注意事件 46 | RocketMQ必须连上了才能使用!!! 47 | 48 | 49 | -------------------------------------------------------------------------------- /zhiliao-admin/README.md: -------------------------------------------------------------------------------- 1 | # 后台管理系统 2 | 3 | # 延伸阅读 4 | 5 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/ZhiliaoAdminApplication.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @MapperScan({"com.lin.zhiliaoAdmin.dao"}) 9 | public class ZhiliaoAdminApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(ZhiliaoAdminApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.config; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; 4 | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; 5 | import org.mybatis.spring.annotation.MapperScan; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | @Configuration 10 | @MapperScan("com.admin.blog.dao.mapper") 11 | public class MybatisPlusConfig { 12 | 13 | // 分页插件 14 | @Bean 15 | public MybatisPlusInterceptor mybatisPlusInterceptor(){ 16 | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); 17 | interceptor.addInnerInterceptor(new PaginationInnerInterceptor()); 18 | return interceptor; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/mapper/ArticleBodyMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.zhiliaoAdmin.dao.pojo.ArticleBody; 5 | 6 | public interface ArticleBodyMapper extends BaseMapper { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/mapper/ArticleMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.zhiliaoAdmin.dao.pojo.Article; 5 | 6 | public interface ArticleMapper extends BaseMapper
{ 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/mapper/ArticleTagMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.zhiliaoAdmin.dao.pojo.ArticleTag; 5 | 6 | public interface ArticleTagMapper extends BaseMapper { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/mapper/ArticleVOMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.zhiliaoAdmin.vo.ArticleVO; 5 | 6 | public interface ArticleVOMapper extends BaseMapper { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/mapper/CategoryMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.zhiliaoAdmin.dao.pojo.Category; 5 | 6 | public interface CategoryMapper extends BaseMapper { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/mapper/CommentMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.zhiliaoAdmin.dao.pojo.Comment; 5 | 6 | public interface CommentMapper extends BaseMapper { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/mapper/CommentVOMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.zhiliaoAdmin.vo.CommentVO; 5 | 6 | public interface CommentVOMapper extends BaseMapper { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/mapper/PermissionMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.zhiliaoAdmin.dao.pojo.Permission; 5 | 6 | import java.util.List; 7 | 8 | public interface PermissionMapper extends BaseMapper { 9 | List findPermissionsByAdminId(Long adminId); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/mapper/SysUserMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.zhiliaoAdmin.dao.pojo.SysUser; 5 | 6 | public interface SysUserMapper extends BaseMapper { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/mapper/TagMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.zhiliaoAdmin.dao.pojo.Tag; 5 | 6 | public interface TagMapper extends BaseMapper { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.zhiliaoAdmin.dao.pojo.Admin; 5 | 6 | public interface UserMapper extends BaseMapper { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/pojo/Admin.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.fasterxml.jackson.annotation.JsonFormat; 6 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 7 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 8 | import lombok.Data; 9 | 10 | import java.util.Date; 11 | 12 | @Data 13 | public class Admin { 14 | 15 | @TableId(type = IdType.AUTO) 16 | @JsonSerialize(using = ToStringSerializer.class) 17 | private Long id; 18 | 19 | private String account; 20 | 21 | private String email; 22 | 23 | private String password; 24 | 25 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 26 | private Date createDate; 27 | 28 | private String creator; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/pojo/Article.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 6 | import lombok.Data; 7 | 8 | @Data 9 | public class Article { 10 | 11 | public static final int Article_TOP = 1; 12 | 13 | public static final int Article_Common = 0; 14 | @JsonSerialize(using = ToStringSerializer.class) 15 | private Long id; 16 | 17 | private String title; 18 | 19 | private Integer commentCounts; 20 | 21 | private Integer viewCounts; 22 | 23 | /** 24 | * 作者id 25 | */ 26 | @JsonSerialize(using = ToStringSerializer.class) 27 | private Long authorId; 28 | 29 | /** 30 | *类别id 31 | */ 32 | @JsonSerialize(using = ToStringSerializer.class) 33 | private Long categoryId; 34 | 35 | private String summary; 36 | 37 | private Long bodyId; 38 | /** 39 | * 创建时间 40 | */ 41 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 42 | private Long createDate; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/pojo/ArticleBody.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.pojo; 2 | 3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 5 | import lombok.Data; 6 | 7 | @Data 8 | public class ArticleBody { 9 | @JsonSerialize(using = ToStringSerializer.class) 10 | private Long id; 11 | 12 | private String content; 13 | 14 | private String contentHtml; 15 | 16 | @JsonSerialize(using = ToStringSerializer.class) 17 | private Long articleId; 18 | } 19 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/pojo/ArticleTag.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.pojo; 2 | 3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 5 | import lombok.Data; 6 | 7 | @Data 8 | public class ArticleTag { 9 | @JsonSerialize(using = ToStringSerializer.class) 10 | private Long id; 11 | 12 | @JsonSerialize(using = ToStringSerializer.class) 13 | private Long articleId; 14 | 15 | @JsonSerialize(using = ToStringSerializer.class) 16 | private Long tagId; 17 | } 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/pojo/Category.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 6 | import lombok.Data; 7 | 8 | @Data 9 | public class Category { 10 | @JsonSerialize(using = ToStringSerializer.class) 11 | private Long id; 12 | 13 | private String avatar; 14 | 15 | private String categoryName; 16 | 17 | private String description; 18 | 19 | private String creator; 20 | 21 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 22 | private Long createDate; 23 | } 24 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/pojo/Comment.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 6 | import lombok.Data; 7 | 8 | @Data 9 | public class Comment { 10 | 11 | @JsonSerialize(using = ToStringSerializer.class) 12 | private Long id; 13 | 14 | private String content; 15 | 16 | /** 17 | * 作者id 18 | */ 19 | @JsonSerialize(using = ToStringSerializer.class) 20 | private Long authorId; 21 | 22 | 23 | 24 | @JsonSerialize(using = ToStringSerializer.class) 25 | private Long articleId; 26 | 27 | /** 28 | * 创建时间 29 | */ 30 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 31 | private Long createDate; 32 | 33 | @JsonSerialize(using = ToStringSerializer.class) 34 | private Long parentId; 35 | 36 | @JsonSerialize(using = ToStringSerializer.class) 37 | private Long toUid; 38 | 39 | @JsonSerialize(using = ToStringSerializer.class) 40 | private String level; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/pojo/Permission.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import lombok.Data; 6 | 7 | @Data 8 | public class Permission { 9 | 10 | @TableId(type = IdType.AUTO) 11 | private Long id; 12 | 13 | private String name; 14 | 15 | private String path; 16 | 17 | private String description; 18 | } 19 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/pojo/SysUser.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 6 | import lombok.Data; 7 | 8 | @Data 9 | public class SysUser { 10 | @JsonSerialize(using = ToStringSerializer.class) 11 | private Long id; 12 | 13 | private String account; 14 | 15 | private String admin; 16 | 17 | private String avatar; 18 | 19 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 20 | private Long createDate; 21 | 22 | private String deleted; 23 | 24 | private String email; 25 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 26 | private Long lastLogin; 27 | 28 | private String mobilePhoneNumber; 29 | 30 | private String nickname; 31 | 32 | private String password; 33 | 34 | private String salt; 35 | 36 | private String status; 37 | } 38 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/dao/pojo/Tag.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.dao.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 6 | import lombok.Data; 7 | 8 | @Data 9 | public class Tag { 10 | @JsonSerialize(using = ToStringSerializer.class) 11 | private Long id; 12 | 13 | private String avatar; 14 | 15 | private String tagName; 16 | 17 | private String creator; 18 | 19 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 20 | private Long createDate; 21 | } 22 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/service/AuthService.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.service; 2 | 3 | import com.lin.zhiliaoAdmin.dao.pojo.Admin; 4 | import com.lin.zhiliaoAdmin.dao.pojo.Permission; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.apache.commons.lang3.StringUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.security.core.Authentication; 9 | import org.springframework.security.core.userdetails.UserDetails; 10 | import org.springframework.stereotype.Service; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | import java.util.List; 14 | 15 | @Service 16 | @Slf4j 17 | public class AuthService { 18 | 19 | @Autowired 20 | private UserService userService; 21 | 22 | public boolean auth(HttpServletRequest request, Authentication authentication) { 23 | String requestURI = request.getRequestURI(); 24 | log.info("request url:{}", requestURI); 25 | // true代表放行 false 代表拦截 26 | Object principal = authentication.getPrincipal(); 27 | if (principal == null || "anonymousUser".equals(principal)) { 28 | // 未登录 29 | return false; 30 | } 31 | UserDetails userDetails = (UserDetails) principal; 32 | String username = userDetails.getUsername(); 33 | Admin admin = userService.selectAdminByAccount(username); 34 | if (admin == null) { 35 | return false; 36 | } 37 | if (admin.getId() == 1) { 38 | // 认为是超级管理员 39 | return true; 40 | } 41 | List permissions = userService.findPermissionsByAdminId(admin.getId()); 42 | requestURI = StringUtils.split(requestURI, '?')[0]; 43 | for (Permission permission : permissions) { 44 | if (requestURI.equals(permission.getPath())) { 45 | log.info("权限通过"); 46 | return true; 47 | } 48 | } 49 | return false; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/service/MySimpleGrantedAuthority.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.service; 2 | 3 | import org.springframework.security.core.GrantedAuthority; 4 | 5 | public class MySimpleGrantedAuthority implements GrantedAuthority { 6 | private String authority; 7 | private String path; 8 | 9 | public MySimpleGrantedAuthority() { 10 | } 11 | 12 | public MySimpleGrantedAuthority(String authority) { 13 | this.authority = authority; 14 | } 15 | 16 | public MySimpleGrantedAuthority(String authority, String path) { 17 | this.authority = authority; 18 | this.path = path; 19 | } 20 | 21 | @Override 22 | public String getAuthority() { 23 | return authority; 24 | } 25 | 26 | public String getPath() { 27 | return path; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/service/PermissionService.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.service; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.lin.zhiliaoAdmin.dao.mapper.PermissionMapper; 6 | import com.lin.zhiliaoAdmin.dao.pojo.Permission; 7 | import com.lin.zhiliaoAdmin.vo.PageResult; 8 | import com.lin.zhiliaoAdmin.vo.Result; 9 | import com.lin.zhiliaoAdmin.vo.params.PageParam; 10 | import org.apache.commons.lang3.StringUtils; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Service; 13 | 14 | @Service 15 | public class PermissionService { 16 | 17 | @Autowired 18 | private PermissionMapper permissionMapper; 19 | 20 | public Result listPermission(PageParam pageParam) { 21 | Page page = new Page<>(pageParam.getCurrentPage(), pageParam.getPageSize()); 22 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 23 | queryWrapper.like(StringUtils.isNotBlank(pageParam.getQueryString()), Permission::getName, pageParam.getQueryString()); 24 | Page permissionPage = this.permissionMapper.selectPage(page, queryWrapper); 25 | PageResult pageResult = new PageResult<>(); 26 | pageResult.setList(permissionPage.getRecords()); 27 | pageResult.setTotal(permissionPage.getTotal()); 28 | return Result.success(pageResult); 29 | } 30 | 31 | public Result add(Permission permission) { 32 | this.permissionMapper.insert(permission); 33 | return Result.success(null); 34 | } 35 | 36 | public Result update(Permission permission) { 37 | this.permissionMapper.updateById(permission); 38 | return Result.success(null); 39 | } 40 | 41 | public Result delete(Long id) { 42 | this.permissionMapper.deleteById(id); 43 | return Result.success(null); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/service/SecurityUserService.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.service; 2 | 3 | import com.lin.zhiliaoAdmin.dao.pojo.Admin; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.security.core.GrantedAuthority; 7 | import org.springframework.security.core.userdetails.User; 8 | import org.springframework.security.core.userdetails.UserDetails; 9 | import org.springframework.security.core.userdetails.UserDetailsService; 10 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 11 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 12 | import org.springframework.stereotype.Component; 13 | 14 | import java.util.ArrayList; 15 | 16 | @Component 17 | @Slf4j 18 | public class SecurityUserService implements UserDetailsService { 19 | @Autowired 20 | private UserService userService; 21 | 22 | @Override 23 | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { 24 | log.info("username:{}", username); 25 | // 当用户登录的时候,springSecurity 就会将请求 转发到此 26 | // 根据用户名 查找用户,不存在 抛出异常,存在 将用户名,密码,授权列表 组装成springSecurity的User对象 并返回 27 | Admin adminUser = userService.selectAdminByAccount(username); 28 | if (adminUser == null) { 29 | throw new UsernameNotFoundException("用户名不存在"); 30 | } 31 | ArrayList authorities = new ArrayList<>(); 32 | UserDetails userDetails = new User(username, adminUser.getPassword(), authorities); 33 | // 剩下的认证 就由框架帮我们完成 34 | return userDetails; 35 | } 36 | 37 | public static void main(String[] args) { 38 | System.out.println(new BCryptPasswordEncoder().encode("123456")); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/utils/JWTUtil.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.utils; 2 | 3 | 4 | import io.jsonwebtoken.Jwt; 5 | import io.jsonwebtoken.JwtBuilder; 6 | import io.jsonwebtoken.Jwts; 7 | import io.jsonwebtoken.SignatureAlgorithm; 8 | 9 | import java.util.Date; 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | 13 | public class JWTUtil { 14 | 15 | private static final String jwtToken = "5054lansufang!@@!$%&"; 16 | 17 | public static String createToken(Long userId) { 18 | Map claims = new HashMap<>(); 19 | claims.put("userId", userId); 20 | JwtBuilder jwtBuilder = Jwts.builder() 21 | .signWith(SignatureAlgorithm.HS256, jwtToken) // 签发算法,秘钥为jwtToken 22 | .setClaims(claims) // body数据,要唯一,自行设置 23 | .setIssuedAt(new Date()) // 设置签发时间 24 | .setExpiration(new Date(System.currentTimeMillis() + 24 * 60 * 60 * 60 * 1000));// 一天的有效时间 25 | String token = jwtBuilder.compact(); 26 | return token; 27 | } 28 | 29 | public static Map checkToken(String token) { 30 | try { 31 | Jwt parse = Jwts.parser().setSigningKey(jwtToken).parse(token); 32 | return (Map) parse.getBody(); 33 | } catch (Exception e) { 34 | e.printStackTrace(); 35 | } 36 | return null; 37 | 38 | } 39 | 40 | } 41 | 42 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/vo/ArticleVO.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.vo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 6 | import lombok.Data; 7 | 8 | @Data 9 | public class ArticleVO { 10 | @JsonSerialize(using = ToStringSerializer.class) 11 | private Long id; 12 | 13 | private String title; 14 | 15 | 16 | 17 | private Integer commentCounts; 18 | 19 | private Integer viewCounts; 20 | 21 | 22 | /** 23 | * 创建时间 24 | */ 25 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 26 | private Long createDate; 27 | 28 | /** 29 | * 作者 30 | */ 31 | private String authorName; 32 | 33 | private String summary; 34 | 35 | private String body; 36 | 37 | private String categoryName; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/vo/CommentVO.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.vo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 6 | import lombok.Data; 7 | 8 | @Data 9 | public class CommentVO { 10 | 11 | @JsonSerialize(using = ToStringSerializer.class) 12 | private Long id; 13 | 14 | @JsonSerialize(using = ToStringSerializer.class) 15 | private Long articleId; 16 | 17 | private String content; 18 | 19 | 20 | private String author; 21 | 22 | 23 | private String articleTitle; 24 | 25 | /** 26 | * 创建时间 27 | */ 28 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 29 | private Long createDate; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/vo/ErrorCode.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.vo; 2 | 3 | public enum ErrorCode { 4 | MUST_NOT_BE_NULL(400, "必填项信息不允许为空"), 5 | ACCOUNT_IS_EXIST(401, "用户名已存在"), 6 | EMAIL_EXIST(402, "该邮箱已注册"), 7 | CATEGORY_IS_NOT_EXIST(403, "无该分类"), 8 | CATEGORY_IS_EXIST(405, "该分类已存在"), 9 | ACCOUNT_IS_NOT_EXIST(406, "无该用户"), 10 | COMMENTS_IS_NOT_EXIST(407, "评论已被删除"), 11 | MUST_IS_LONG(408, "请输入正确的编号"), 12 | TAG_IS_EXIST(409, "该标签已存在"), 13 | NICKNAME_IS_EXIST(410, "该昵称已存在") 14 | ; 15 | 16 | private int code; 17 | private String msg; 18 | 19 | ErrorCode(int code, String msg){ 20 | this.code = code; 21 | this.msg = msg; 22 | } 23 | 24 | public int getCode() { 25 | return code; 26 | } 27 | 28 | public void setCode(int code) { 29 | this.code = code; 30 | } 31 | 32 | public String getMsg() { 33 | return msg; 34 | } 35 | 36 | public void setMsg(String msg) { 37 | this.msg = msg; 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/vo/PageResult.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class PageResult { 9 | 10 | private List list; 11 | 12 | private Long total; 13 | } 14 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/vo/Result.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.vo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class Result { 9 | 10 | private boolean success; 11 | 12 | private int code; 13 | 14 | private String msg; 15 | 16 | private Object data; 17 | 18 | 19 | public static Result success(Object data) { 20 | return new Result(true, 200, "success", data); 21 | } 22 | 23 | public static Result fail(int code, String msg) { 24 | return new Result(false, code, msg, null); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/java/com/lin/zhiliaoAdmin/vo/params/PageParam.java: -------------------------------------------------------------------------------- 1 | package com.lin.zhiliaoAdmin.vo.params; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class PageParam { 7 | 8 | private Integer currentPage; 9 | 10 | private Integer pageSize; 11 | 12 | private String queryString; 13 | } 14 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8889 2 | spring.application.name=zhiliao_admin 3 | 4 | # datasource 5 | spring.datasource.url=jdbc:mysql://localhost:3306/blog?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 6 | spring.datasource.username=root 7 | spring.datasource.password=123456 8 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 9 | 10 | # mybatis-plus 11 | mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl 12 | # ???????b_ 13 | mybatis-plus.global-config.db-config.table-prefix=b_ 14 | # ??redis 15 | spring.redis.host=localhost 16 | spring.redis.port=6379 17 | # redis?token??? 18 | redis.token.max=3 19 | # ?????? 20 | mybatis-plus.configuration.map-underscore-to-camel-case=true 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/com/lin/zhiliaoAdmin/mapper/PermissionMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/css/bootstrap/assets/ie10-viewport-bug-workaround.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | /* 8 | * See the Getting Started docs for more information: 9 | * http://getbootstrap.com/getting-started/#support-ie10-width 10 | */ 11 | @-ms-viewport { width: device-width; } 12 | @-o-viewport { width: device-width; } 13 | @viewport { width: device-width; } 14 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/css/dashboard.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Base structure 3 | */ 4 | 5 | /* Move down content because we have a fixed navbar that is 50px tall */ 6 | body { 7 | padding-top: 50px; 8 | } 9 | 10 | 11 | /* 12 | * Global add-ons 13 | */ 14 | 15 | .sub-header { 16 | padding-bottom: 10px; 17 | border-bottom: 1px solid #eee; 18 | } 19 | 20 | /* 21 | * Top navigation 22 | * Hide default border to remove 1px line. 23 | */ 24 | .navbar-fixed-top { 25 | border: 0; 26 | } 27 | 28 | /* 29 | * Sidebar 30 | */ 31 | 32 | /* Hide for mobile, show later */ 33 | .sidebar { 34 | display: none; 35 | } 36 | @media (min-width: 768px) { 37 | .sidebar { 38 | position: fixed; 39 | top: 51px; 40 | bottom: 0; 41 | left: 0; 42 | z-index: 1000; 43 | display: block; 44 | padding: 20px; 45 | overflow-x: hidden; 46 | overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ 47 | background-color: #f5f5f5; 48 | border-right: 1px solid #eee; 49 | } 50 | } 51 | 52 | /* Sidebar navigation */ 53 | .nav-sidebar { 54 | margin-right: -21px; /* 20px padding + 1px border */ 55 | margin-bottom: 20px; 56 | margin-left: -20px; 57 | } 58 | .nav-sidebar > li > a { 59 | padding-right: 20px; 60 | padding-left: 20px; 61 | } 62 | .nav-sidebar > .active > a, 63 | .nav-sidebar > .active > a:hover, 64 | .nav-sidebar > .active > a:focus { 65 | color: #fff; 66 | background-color: #428bca; 67 | } 68 | 69 | 70 | /* 71 | * Main content 72 | */ 73 | 74 | .main { 75 | padding: 20px; 76 | } 77 | @media (min-width: 768px) { 78 | .main { 79 | padding-right: 40px; 80 | padding-left: 40px; 81 | } 82 | } 83 | .main .page-header { 84 | margin-top: 0; 85 | } 86 | 87 | 88 | /* 89 | * Placeholder dashboard ideas 90 | */ 91 | 92 | .placeholders { 93 | margin-bottom: 30px; 94 | text-align: center; 95 | } 96 | .placeholders h4 { 97 | margin-bottom: 0; 98 | } 99 | .placeholder { 100 | margin-bottom: 20px; 101 | } 102 | .placeholder img { 103 | display: inline-block; 104 | border-radius: 50%; 105 | } 106 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/css/font/summernote.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/css/font/summernote.eot -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/css/font/summernote.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/css/font/summernote.ttf -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/css/font/summernote.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/css/font/summernote.woff -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/css/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/css/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/css/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/css/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/css/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/css/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/css/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/css/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/css/pages-login-manage.css: -------------------------------------------------------------------------------- 1 | .loginmanage{height:500px;width:1920px;background:url(../img/_/manage-bg.png);vertical-align:middle;display:table-cell}.loginmanage .manage-title{width:420px;margin:0 auto;font-size:30px;color:#fff;letter-spacing:5px;text-shadow:2px 2px 0 #646464}.loginform{width:380px;background:#fff;margin:45px auto 0;position:relative;padding:20px}img{display:block;margin:0 auto}.sui-form{margin-top:15px}span.loginname{background-image:url(../img/icons.png);background-position:-10px -201px}.sui-form .input-prepend{margin-bottom:16px}.sui-nav.nav-tabs.tab-wraped>li{width:50%}.sui-nav.nav-tabs.tab-wraped>li.active>a{padding-top:0;border-top:1px solid #28a3ef}.sui-nav.nav-tabs.tab-wraped>li>a{padding:0}.sui-nav.nav-tabs.tab-wraped>li.active h3{color:#c8111a}.sui-form .input-prepend .add-on{padding:6px 5px;background-color:#cfcdcd;width:25px;height:23px;*float:left}.sui-form input[type=text],.sui-form input[type=password]{height:23px}.sui-form input.span2{width:284px;*float:left}.loginpwd{background-image:url(../img/icons.png);background-position:-72px -201px;display:block;width:25px;height:23px}.setting{position:relative;margin:0 0 15px}.setting .forget{position:absolute;right:0}.btn-danger{background-color:#c81623;padding:6px;border-radius:0;font-size:16px;font-family:微软雅黑;word-spacing:4px}.otherlogin{position:relative;margin-top:30px}.otherlogin .register{position:absolute;top:10px;right:10px;font-size:15px}.types ul li{list-style-type:none;display:inline-block;*display:inline;*zoom:1;width:40px;height:55px}#slider{width:300px;height:40px;position:relative;border-radius:2px;background-color:#dae2d0;overflow:hidden;text-align:center;user-select:none;-moz-user-select:none;-webkit-user-select:none}#slider_bg{position:absolute;left:0;top:0;height:100%;background-color:#7AC23C;z-index:1}#label{width:46px;position:absolute;left:0;top:0;height:38px;line-height:38px;border:1px solid #ccc;background:#fff;z-index:3;cursor:move;color:#ff9e77;font-size:16px;font-weight:900}#labelTip{position:absolute;left:0;width:100%;height:100%;font-size:13px;font-family:'Microsoft Yahei',serif;color:#787878;line-height:38px;text-align:center;z-index:2}.copyright{margin-top:10px;text-align:center}.copyright ul li{list-style-type:none;display:inline-block;*display:inline;*zoom:1;border-right:1px solid #e4e4e4;padding:0 20px;margin:15px 0}.copyright ul li:last-child{border-right:0} -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/css/signin.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 40px; 3 | padding-bottom: 40px; 4 | background-color: #eee; 5 | } 6 | 7 | .form-signin { 8 | max-width: 330px; 9 | padding: 15px; 10 | margin: 0 auto; 11 | } 12 | .form-signin .form-signin-heading, 13 | .form-signin .checkbox { 14 | margin-bottom: 10px; 15 | } 16 | .form-signin .checkbox { 17 | font-weight: normal; 18 | } 19 | .form-signin .form-control { 20 | position: relative; 21 | height: auto; 22 | -webkit-box-sizing: border-box; 23 | -moz-box-sizing: border-box; 24 | box-sizing: border-box; 25 | padding: 10px; 26 | font-size: 16px; 27 | } 28 | .form-signin .form-control:focus { 29 | z-index: 2; 30 | } 31 | .form-signin input[type="email"] { 32 | margin-bottom: -1px; 33 | border-bottom-right-radius: 0; 34 | border-bottom-left-radius: 0; 35 | } 36 | .form-signin input[type="password"] { 37 | margin-bottom: 10px; 38 | border-top-left-radius: 0; 39 | border-top-right-radius: 0; 40 | } 41 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/css/spin.css: -------------------------------------------------------------------------------- 1 | @keyframes spinner-line-fade-more { 2 | 0%, 100% { 3 | opacity: 0; /* minimum opacity */ 4 | } 5 | 1% { 6 | opacity: 1; 7 | } 8 | } 9 | 10 | @keyframes spinner-line-fade-quick { 11 | 0%, 39%, 100% { 12 | opacity: 0.25; /* minimum opacity */ 13 | } 14 | 40% { 15 | opacity: 1; 16 | } 17 | } 18 | 19 | @keyframes spinner-line-fade-default { 20 | 0%, 100% { 21 | opacity: 0.22; /* minimum opacity */ 22 | } 23 | 1% { 24 | opacity: 1; 25 | } 26 | } -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/img/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/img/bg.jpg -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/img/head_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/img/head_img.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/img/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/img/icons.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/img/left_hidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/img/left_hidden.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/js/bootstrap/assets/ie-emulation-modes-warning.js: -------------------------------------------------------------------------------- 1 | // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT 2 | // IT'S JUST JUNK FOR OUR DOCS! 3 | // ++++++++++++++++++++++++++++++++++++++++++ 4 | /*! 5 | * Copyright 2014-2015 Twitter, Inc. 6 | * 7 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 8 | * details, see https://creativecommons.org/licenses/by/3.0/. 9 | */ 10 | // Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes. 11 | (function () { 12 | 'use strict'; 13 | 14 | function emulatedIEMajorVersion() { 15 | var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent) 16 | if (groups === null) { 17 | return null 18 | } 19 | var ieVersionNum = parseInt(groups[1], 10) 20 | var ieMajorVersion = Math.floor(ieVersionNum) 21 | return ieMajorVersion 22 | } 23 | 24 | function actualNonEmulatedIEMajorVersion() { 25 | // Detects the actual version of IE in use, even if it's in an older-IE emulation mode. 26 | // IE JavaScript conditional compilation docs: https://msdn.microsoft.com/library/121hztk3%28v=vs.94%29.aspx 27 | // @cc_on docs: https://msdn.microsoft.com/library/8ka90k2e%28v=vs.94%29.aspx 28 | var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line 29 | if (jscriptVersion === undefined) { 30 | return 11 // IE11+ not in emulation mode 31 | } 32 | if (jscriptVersion < 9) { 33 | return 8 // IE8 (or lower; haven't tested on IE<8) 34 | } 35 | return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode 36 | } 37 | 38 | var ua = window.navigator.userAgent 39 | if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) { 40 | return // Opera, which might pretend to be IE 41 | } 42 | var emulated = emulatedIEMajorVersion() 43 | if (emulated === null) { 44 | return // Not IE 45 | } 46 | var nonEmulated = actualNonEmulatedIEMajorVersion() 47 | 48 | if (emulated !== nonEmulated) { 49 | window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!') 50 | } 51 | })(); 52 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/js/bootstrap/assets/ie10-viewport-bug-workaround.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // See the Getting Started docs for more information: 8 | // http://getbootstrap.com/getting-started/#support-ie10-width 9 | 10 | (function () { 11 | 'use strict'; 12 | 13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 14 | var msViewportStyle = document.createElement('style') 15 | msViewportStyle.appendChild( 16 | document.createTextNode( 17 | '@-ms-viewport{width:auto!important}' 18 | ) 19 | ) 20 | document.querySelector('head').appendChild(msViewportStyle) 21 | } 22 | 23 | })(); 24 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/js/bootstrap/assets/ie8-responsive-file-warning.js: -------------------------------------------------------------------------------- 1 | // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT 2 | // IT'S JUST JUNK FOR OUR DOCS! 3 | // ++++++++++++++++++++++++++++++++++++++++++ 4 | /*! 5 | * Copyright 2011-2015 Twitter, Inc. 6 | * 7 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 8 | * details, see https://creativecommons.org/licenses/by/3.0/. 9 | */ 10 | // Intended to prevent false-positive bug reports about responsive styling supposedly not working in IE8. 11 | if (window.location.protocol == 'file:') { 12 | window.alert('ERROR: Bootstrap\'s responsive CSS is disabled!\nSee getbootstrap.com/getting-started/#respond-file-proto for details.') 13 | } 14 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/js/plugins/jquery-placeholder/jquery.placeholder.min.js: -------------------------------------------------------------------------------- 1 | /*! http://mths.be/placeholder v2.0.7 by @mathias */ 2 | ;(function(f,h,$){var a='placeholder' in h.createElement('input'),d='placeholder' in h.createElement('textarea'),i=$.fn,c=$.valHooks,k,j;if(a&&d){j=i.placeholder=function(){return this};j.input=j.textarea=true}else{j=i.placeholder=function(){var l=this;l.filter((a?'textarea':':input')+'[placeholder]').not('.placeholder').bind({'focus.placeholder':b,'blur.placeholder':e}).data('placeholder-enabled',true).trigger('blur.placeholder');return l};j.input=a;j.textarea=d;k={get:function(m){var l=$(m);return l.data('placeholder-enabled')&&l.hasClass('placeholder')?'':m.value},set:function(m,n){var l=$(m);if(!l.data('placeholder-enabled')){return m.value=n}if(n==''){m.value=n;if(m!=h.activeElement){e.call(m)}}else{if(l.hasClass('placeholder')){b.call(m,true,n)||(m.value=n)}else{m.value=n}}return l}};a||(c.input=k);d||(c.textarea=k);$(function(){$(h).delegate('form','submit.placeholder',function(){var l=$('.placeholder',this).each(b);setTimeout(function(){l.each(e)},10)})});$(f).bind('beforeunload.placeholder',function(){$('.placeholder').each(function(){this.value=''})})}function g(m){var l={},n=/^jQuery\d+$/;$.each(m.attributes,function(p,o){if(o.specified&&!n.test(o.name)){l[o.name]=o.value}});return l}function b(m,n){var l=this,o=$(l);if(l.value==o.attr('placeholder')&&o.hasClass('placeholder')){if(o.data('placeholder-password')){o=o.hide().next().show().attr('id',o.removeAttr('id').data('placeholder-id'));if(m===true){return o[0].value=n}o.focus()}else{l.value='';o.removeClass('placeholder');l==h.activeElement&&l.select()}}}function e(){var q,l=this,p=$(l),m=p,o=this.id;if(l.value==''){if(l.type=='password'){if(!p.data('placeholder-textinput')){try{q=p.clone().attr({type:'text'})}catch(n){q=$('').attr($.extend(g(this),{type:'text'}))}q.removeAttr('name').data({'placeholder-password':true,'placeholder-id':o}).bind('focus.placeholder',b);p.data({'placeholder-textinput':q,'placeholder-id':o}).before(q)}p=p.removeAttr('id').hide().prev().attr('id',o).show()}p.addClass('placeholder');p[0].value=p.attr('placeholder')}else{p.removeClass('placeholder')}}}(this,document,jQuery)); -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/js/plugins/jquery.jqzoom/zoom.js: -------------------------------------------------------------------------------- 1 | /*放大镜效果*/ 2 | //=====================全局函数======================== 3 | //Tab控制函数 4 | function tabs(tabId, tabNum){ 5 | //设置点击后的切换样式 6 | $(tabId + " .tab li").removeClass("curr"); 7 | $(tabId + " .tab li").eq(tabNum).addClass("curr"); 8 | //根据参数决定显示内容 9 | $(tabId + " .tabcon").hide(); 10 | $(tabId + " .tabcon").eq(tabNum).show(); 11 | } 12 | //=====================全局函数======================== 13 | 14 | //==================图片详细页函数===================== 15 | //鼠标经过预览图片函数 16 | function preview(img){ 17 | $("#preview .jqzoom img").attr("src",$(img).attr("src")); 18 | $("#preview .jqzoom img").attr("jqimg",$(img).attr("bimg")); 19 | } 20 | 21 | //图片放大镜效果 22 | $(function(){ 23 | $(".jqzoom").jqueryzoom({xzoom:400,yzoom:400}); 24 | }); 25 | 26 | //图片预览小图移动效果,页面加载时触发 27 | $(function(){ 28 | var tempLength = 0; //临时变量,当前移动的长度 29 | var viewNum = 5; //设置每次显示图片的个数量 30 | var moveNum = 2; //每次移动的数量 31 | var moveTime = 300; //移动速度,毫秒 32 | var scrollDiv = $(".spec-scroll .items ul"); //进行移动动画的容器 33 | var scrollItems = $(".spec-scroll .items ul li"); //移动容器里的集合 34 | var moveLength = scrollItems.eq(0).width() * moveNum; //计算每次移动的长度 35 | var countLength = (scrollItems.length - viewNum) * scrollItems.eq(0).width(); //计算总长度,总个数*单个长度 36 | 37 | //下一张 38 | $(".spec-scroll .next").bind("click",function(){ 39 | if(tempLength < countLength){ 40 | if((countLength - tempLength) > moveLength){ 41 | scrollDiv.animate({left:"-=" + moveLength + "px"}, moveTime); 42 | tempLength += moveLength; 43 | }else{ 44 | scrollDiv.animate({left:"-=" + (countLength - tempLength) + "px"}, moveTime); 45 | tempLength += (countLength - tempLength); 46 | } 47 | } 48 | }); 49 | //上一张 50 | $(".spec-scroll .prev").bind("click",function(){ 51 | if(tempLength > 0){ 52 | if(tempLength > moveLength){ 53 | scrollDiv.animate({left: "+=" + moveLength + "px"}, moveTime); 54 | tempLength -= moveLength; 55 | }else{ 56 | scrollDiv.animate({left: "+=" + tempLength + "px"}, moveTime); 57 | tempLength = 0; 58 | } 59 | } 60 | }); 61 | }); 62 | //==================图片详细页函数===================== -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/js/user_main.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/js/user_main.js -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/css/alt/AdminLTE-fullcalendar.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Plugin: Full Calendar 3 | * --------------------- 4 | */ 5 | .fc-button { 6 | background: #f4f4f4; 7 | background-image: none; 8 | color: #444; 9 | border-color: #ddd; 10 | border-bottom-color: #ddd; 11 | } 12 | .fc-button:hover, 13 | .fc-button:active, 14 | .fc-button.hover { 15 | background-color: #e9e9e9; 16 | } 17 | .fc-header-title h2 { 18 | font-size: 15px; 19 | line-height: 1.6em; 20 | color: #666; 21 | margin-left: 10px; 22 | } 23 | .fc-header-right { 24 | padding-right: 10px; 25 | } 26 | .fc-header-left { 27 | padding-left: 10px; 28 | } 29 | .fc-widget-header { 30 | background: #fafafa; 31 | } 32 | .fc-grid { 33 | width: 100%; 34 | border: 0; 35 | } 36 | .fc-widget-header:first-of-type, 37 | .fc-widget-content:first-of-type { 38 | border-left: 0; 39 | border-right: 0; 40 | } 41 | .fc-widget-header:last-of-type, 42 | .fc-widget-content:last-of-type { 43 | border-right: 0; 44 | } 45 | .fc-toolbar { 46 | padding: 10px; 47 | margin: 0; 48 | } 49 | .fc-day-number { 50 | font-size: 20px; 51 | font-weight: 300; 52 | padding-right: 10px; 53 | } 54 | .fc-color-picker { 55 | list-style: none; 56 | margin: 0; 57 | padding: 0; 58 | } 59 | .fc-color-picker > li { 60 | float: left; 61 | font-size: 30px; 62 | margin-right: 5px; 63 | line-height: 30px; 64 | } 65 | .fc-color-picker > li .fa { 66 | -webkit-transition: -webkit-transform linear 0.3s; 67 | -moz-transition: -moz-transform linear 0.3s; 68 | -o-transition: -o-transform linear 0.3s; 69 | transition: transform linear 0.3s; 70 | } 71 | .fc-color-picker > li .fa:hover { 72 | -webkit-transform: rotate(30deg); 73 | -ms-transform: rotate(30deg); 74 | -o-transform: rotate(30deg); 75 | transform: rotate(30deg); 76 | } 77 | #add-new-event { 78 | -webkit-transition: all linear 0.3s; 79 | -o-transition: all linear 0.3s; 80 | transition: all linear 0.3s; 81 | } 82 | .external-event { 83 | padding: 5px 10px; 84 | font-weight: bold; 85 | margin-bottom: 4px; 86 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); 87 | text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); 88 | border-radius: 3px; 89 | cursor: move; 90 | } 91 | .external-event:hover { 92 | box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.2); 93 | } 94 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/css/alt/AdminLTE-fullcalendar.min.css: -------------------------------------------------------------------------------- 1 | .fc-button{background:#f4f4f4;background-image:none;color:#444;border-color:#ddd;border-bottom-color:#ddd}.fc-button:hover,.fc-button:active,.fc-button.hover{background-color:#e9e9e9}.fc-header-title h2{font-size:15px;line-height:1.6em;color:#666;margin-left:10px}.fc-header-right{padding-right:10px}.fc-header-left{padding-left:10px}.fc-widget-header{background:#fafafa}.fc-grid{width:100%;border:0}.fc-widget-header:first-of-type,.fc-widget-content:first-of-type{border-left:0;border-right:0}.fc-widget-header:last-of-type,.fc-widget-content:last-of-type{border-right:0}.fc-toolbar{padding:10px;margin:0}.fc-day-number{font-size:20px;font-weight:300;padding-right:10px}.fc-color-picker{list-style:none;margin:0;padding:0}.fc-color-picker>li{float:left;font-size:30px;margin-right:5px;line-height:30px}.fc-color-picker>li .fa{-webkit-transition:-webkit-transform linear .3s;-moz-transition:-moz-transform linear .3s;-o-transition:-o-transform linear .3s;transition:transform linear .3s}.fc-color-picker>li .fa:hover{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);-o-transform:rotate(30deg);transform:rotate(30deg)}#add-new-event{-webkit-transition:all linear .3s;-o-transition:all linear .3s;transition:all linear .3s}.external-event{padding:5px 10px;font-weight:bold;margin-bottom:4px;box-shadow:0 1px 1px rgba(0,0,0,0.1);text-shadow:0 1px 1px rgba(0,0,0,0.1);border-radius:3px;cursor:move}.external-event:hover{box-shadow:inset 0 0 90px rgba(0,0,0,0.2)} -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/avatar.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/avatar04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/avatar04.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/avatar2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/avatar2.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/avatar3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/avatar3.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/avatar5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/avatar5.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/boxed-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/boxed-bg.jpg -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/boxed-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/boxed-bg.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/credit/american-express.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/credit/american-express.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/credit/cirrus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/credit/cirrus.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/credit/mastercard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/credit/mastercard.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/credit/mestro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/credit/mestro.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/credit/paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/credit/paypal.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/credit/paypal2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/credit/paypal2.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/credit/visa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/credit/visa.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/default-50x50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/default-50x50.gif -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/icons.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/photo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/photo1.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/photo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/photo2.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/photo3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/photo3.jpg -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/photo4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/photo4.jpg -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user1-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user1-128x128.jpg -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user2-160x160.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user2-160x160.jpg -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user3-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user3-128x128.jpg -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user4-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user4-128x128.jpg -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user5-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user5-128x128.jpg -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user6-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user6-128x128.jpg -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user7-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user7-128x128.jpg -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user8-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/adminLTE/img/user8-128x128.jpg -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/angularjs/pagination.css: -------------------------------------------------------------------------------- 1 | .page-list .pagination {float:left;} 2 | .page-list .pagination span {cursor: pointer;} 3 | .page-list .pagination .separate span{cursor: default; border-top:none;border-bottom:none;} 4 | .page-list .pagination .separate span:hover {background: none;} 5 | .page-list .page-total {float:left; margin: 25px 20px;} 6 | .page-list .page-total input, .page-list .page-total select{height: 26px; border: 1px solid #ddd;} 7 | .page-list .page-total input {width: 40px; padding-left:3px;} 8 | .page-list .page-total select {width: 50px;} -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/elementui/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/elementui/fonts/element-icons.woff -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/font-awesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/font-awesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/quill/examples/bubble.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bubble Theme - Quill Rich Text Editor 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 40 | 41 | 42 | 43 | 44 | 45 |
46 |
47 |
48 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "select2", 3 | "version": "3.4.8", 4 | "main": [ 5 | "select2.js", 6 | "select2.css", 7 | "select2.png", 8 | "select2x2.png", 9 | "select2-spinner.gif" 10 | ], 11 | "dependencies": { 12 | "jquery": ">= 1.7.1" 13 | }, 14 | "homepage": "https://github.com/ivaynberg/select2", 15 | "_release": "3.4.8", 16 | "_resolution": { 17 | "type": "version", 18 | "tag": "3.4.8", 19 | "commit": "ee0f36a47e2133b23330fbec740b2d3a17a0d9c2" 20 | }, 21 | "_source": "git://github.com/ivaynberg/select2.git", 22 | "_target": "~3.4.8", 23 | "_originalSource": "select2", 24 | "_direct": true 25 | } -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Igor Vaynberg 2 | 3 | Version: @@ver@@ Timestamp: @@timestamp@@ 4 | 5 | This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU 6 | General Public License version 2 (the "GPL License"). You may choose either license to govern your 7 | use of this software only upon the condition that you accept all of the terms of either the Apache 8 | License or the GPL License. 9 | 10 | You may obtain a copy of the Apache License and the GPL License at: 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | http://www.gnu.org/licenses/gpl-2.0.html 14 | 15 | Unless required by applicable law or agreed to in writing, software distributed under the Apache License 16 | or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 17 | either express or implied. See the Apache License and the GPL License for the specific language governing 18 | permissions and limitations under the Apache License and the GPL License. 19 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "select2", 3 | "version": "3.4.8", 4 | "main": ["select2.js", "select2.css", "select2.png", "select2x2.png", "select2-spinner.gif"], 5 | "dependencies": { 6 | "jquery": ">= 1.7.1" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "select2", 3 | "repo": "ivaynberg/select2", 4 | "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.", 5 | "version": "3.4.8", 6 | "demo": "http://ivaynberg.github.io/select2/", 7 | "keywords": [ 8 | "jquery" 9 | ], 10 | "main": "select2.js", 11 | "styles": [ 12 | "select2.css", 13 | "select2-bootstrap.css" 14 | ], 15 | "scripts": [ 16 | "select2.js", 17 | "select2_locale_ar.js", 18 | "select2_locale_bg.js", 19 | "select2_locale_ca.js", 20 | "select2_locale_cs.js", 21 | "select2_locale_da.js", 22 | "select2_locale_de.js", 23 | "select2_locale_el.js", 24 | "select2_locale_es.js", 25 | "select2_locale_et.js", 26 | "select2_locale_eu.js", 27 | "select2_locale_fa.js", 28 | "select2_locale_fi.js", 29 | "select2_locale_fr.js", 30 | "select2_locale_gl.js", 31 | "select2_locale_he.js", 32 | "select2_locale_hr.js", 33 | "select2_locale_hu.js", 34 | "select2_locale_id.js", 35 | "select2_locale_is.js", 36 | "select2_locale_it.js", 37 | "select2_locale_ja.js", 38 | "select2_locale_ka.js", 39 | "select2_locale_ko.js", 40 | "select2_locale_lt.js", 41 | "select2_locale_lv.js", 42 | "select2_locale_mk.js", 43 | "select2_locale_ms.js", 44 | "select2_locale_nl.js", 45 | "select2_locale_no.js", 46 | "select2_locale_pl.js", 47 | "select2_locale_pt-BR.js", 48 | "select2_locale_pt-PT.js", 49 | "select2_locale_ro.js", 50 | "select2_locale_ru.js", 51 | "select2_locale_sk.js", 52 | "select2_locale_sv.js", 53 | "select2_locale_th.js", 54 | "select2_locale_tr.js", 55 | "select2_locale_uk.js", 56 | "select2_locale_vi.js", 57 | "select2_locale_zh-CN.js", 58 | "select2_locale_zh-TW.js" 59 | ], 60 | "images": [ 61 | "select2-spinner.gif", 62 | "select2.png", 63 | "select2x2.png" 64 | ], 65 | "license": "MIT" 66 | } 67 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": 3 | "ivaynberg/select2", 4 | "description": "Select2 is a jQuery based replacement for select boxes.", 5 | "version": "3.4.8", 6 | "type": "component", 7 | "homepage": "http://ivaynberg.github.io/select2/", 8 | "license": "Apache-2.0", 9 | "require": { 10 | "robloach/component-installer": "*", 11 | "components/jquery": ">=1.7.1" 12 | }, 13 | "extra": { 14 | "component": { 15 | "scripts": [ 16 | "select2.js" 17 | ], 18 | "files": [ 19 | "select2.js", 20 | "select2_locale_*.js", 21 | "select2.css", 22 | "select2-bootstrap.css", 23 | "select2-spinner.gif", 24 | "select2.png", 25 | "select2x2.png" 26 | ] 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "Select2", 3 | "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.", 4 | "homepage": "http://ivaynberg.github.io/select2", 5 | "author": "Igor Vaynberg", 6 | "repository": {"type": "git", "url": "git://github.com/ivaynberg/select2.git"}, 7 | "main": "select2.js", 8 | "version": "3.4.8", 9 | "jspm": { 10 | "main": "select2", 11 | "files": ["select2.js", "select2.png", "select2.css", "select2-spinner.gif"], 12 | "shim": { 13 | "select2": { 14 | "imports": ["jquery", "./select2.css!"], 15 | "exports": "$" 16 | } 17 | }, 18 | "buildConfig": { "uglify": true } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | echo -n "Enter the version for this release: " 5 | 6 | read ver 7 | 8 | if [ ! $ver ]; then 9 | echo "Invalid version." 10 | exit 11 | fi 12 | 13 | name="select2" 14 | js="$name.js" 15 | mini="$name.min.js" 16 | css="$name.css" 17 | release="$name-$ver" 18 | tag="$ver" 19 | branch="build-$ver" 20 | curbranch=`git branch | grep "*" | sed "s/* //"` 21 | timestamp=$(date) 22 | tokens="s/@@ver@@/$ver/g;s/\@@timestamp@@/$timestamp/g" 23 | remote="github" 24 | 25 | echo "Pulling from origin" 26 | 27 | git pull 28 | 29 | echo "Updating Version Identifiers" 30 | 31 | sed -E -e "s/\"version\": \"([0-9\.]+)\",/\"version\": \"$ver\",/g" -i -- bower.json select2.jquery.json component.json composer.json package.json 32 | 33 | git add bower.json 34 | git add select2.jquery.json 35 | git add component.json 36 | git add composer.json 37 | git add package.json 38 | 39 | git commit -m "modified version identifiers in descriptors for release $ver" 40 | git push 41 | 42 | git branch "$branch" 43 | git checkout "$branch" 44 | 45 | echo "Tokenizing..." 46 | 47 | find . -name "$js" | xargs -I{} sed -e "$tokens" -i -- {} 48 | find . -name "$css" | xargs -I{} sed -e "$tokens" -i -- {} 49 | 50 | sed -e "s/latest/$ver/g" -i -- bower.json 51 | 52 | git add "$js" 53 | git add "$css" 54 | 55 | echo "Minifying..." 56 | 57 | echo "/*" > "$mini" 58 | cat LICENSE | sed "$tokens" >> "$mini" 59 | echo "*/" >> "$mini" 60 | 61 | curl -s \ 62 | --data-urlencode "js_code@$js" \ 63 | http://marijnhaverbeke.nl/uglifyjs \ 64 | >> "$mini" 65 | 66 | git add "$mini" 67 | 68 | git commit -m "release $ver" 69 | 70 | echo "Tagging..." 71 | git tag -a "$tag" -m "tagged version $ver" 72 | git push "$remote" --tags 73 | 74 | echo "Cleaning Up..." 75 | 76 | git checkout "$curbranch" 77 | git branch -D "$branch" 78 | 79 | echo "Done" 80 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2-spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/select2/select2-spinner.gif -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2.jquery.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "select2", 3 | "title": "Select2", 4 | "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.", 5 | "keywords": [ 6 | "select", 7 | "autocomplete", 8 | "typeahead", 9 | "dropdown", 10 | "multiselect", 11 | "tag", 12 | "tagging" 13 | ], 14 | "version": "3.4.8", 15 | "author": { 16 | "name": "Igor Vaynberg", 17 | "url": "https://github.com/ivaynberg" 18 | }, 19 | "licenses": [ 20 | { 21 | "type": "Apache", 22 | "url": "http://www.apache.org/licenses/LICENSE-2.0" 23 | }, 24 | { 25 | "type": "GPL v2", 26 | "url": "http://www.gnu.org/licenses/gpl-2.0.html" 27 | } 28 | ], 29 | "bugs": "https://github.com/ivaynberg/select2/issues", 30 | "homepage": "http://ivaynberg.github.com/select2", 31 | "docs": "http://ivaynberg.github.com/select2/", 32 | "download": "https://github.com/ivaynberg/select2/tags", 33 | "dependencies": { 34 | "jquery": ">=1.7.1" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/select2/select2.png -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_ar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Arabic translation. 3 | * 4 | * Author: Adel KEDJOUR 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "لم يتم العثور على مطابقات"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; if (n == 1){ return "الرجاء إدخال حرف واحد على الأكثر"; } return n == 2 ? "الرجاء إدخال حرفين على الأكثر" : "الرجاء إدخال " + n + " على الأكثر"; }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; if (n == 1){ return "الرجاء إدخال حرف واحد على الأقل"; } return n == 2 ? "الرجاء إدخال حرفين على الأقل" : "الرجاء إدخال " + n + " على الأقل "; }, 13 | formatSelectionTooBig: function (limit) { if (n == 1){ return "يمكنك أن تختار إختيار واحد فقط"; } return n == 2 ? "يمكنك أن تختار إختيارين فقط" : "يمكنك أن تختار " + n + " إختيارات فقط"; }, 14 | formatLoadMore: function (pageNumber) { return "تحميل المزيد من النتائج…"; }, 15 | formatSearching: function () { return "البحث…"; } 16 | }); 17 | })(jQuery); 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_bg.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Bulgarian translation. 3 | * 4 | * @author Lubomir Vikev 5 | * @author Uriy Efremochkin 6 | */ 7 | (function ($) { 8 | "use strict"; 9 | 10 | $.extend($.fn.select2.defaults, { 11 | formatNoMatches: function () { return "Няма намерени съвпадения"; }, 12 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Моля въведете още " + n + " символ" + (n > 1 ? "а" : ""); }, 13 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Моля въведете с " + n + " по-малко символ" + (n > 1 ? "а" : ""); }, 14 | formatSelectionTooBig: function (limit) { return "Можете да направите до " + limit + (limit > 1 ? " избора" : " избор"); }, 15 | formatLoadMore: function (pageNumber) { return "Зареждат се още…"; }, 16 | formatSearching: function () { return "Търсене…"; } 17 | }); 18 | })(jQuery); 19 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_ca.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Catalan translation. 3 | * 4 | * Author: David Planella 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "No s'ha trobat cap coincidència"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduïu " + n + " caràcter" + (n == 1 ? "" : "s") + " més"; }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Introduïu " + n + " caràcter" + (n == 1? "" : "s") + "menys"; }, 13 | formatSelectionTooBig: function (limit) { return "Només podeu seleccionar " + limit + " element" + (limit == 1 ? "" : "s"); }, 14 | formatLoadMore: function (pageNumber) { return "S'estan carregant més resultats…"; }, 15 | formatSearching: function () { return "S'està cercant…"; } 16 | }); 17 | })(jQuery); 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_cs.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Czech translation. 3 | * 4 | * Author: Michal Marek 5 | * Author - sklonovani: David Vallner 6 | */ 7 | (function ($) { 8 | "use strict"; 9 | // use text for the numbers 2 through 4 10 | var smallNumbers = { 11 | 2: function(masc) { return (masc ? "dva" : "dvě"); }, 12 | 3: function() { return "tři"; }, 13 | 4: function() { return "čtyři"; } 14 | } 15 | $.extend($.fn.select2.defaults, { 16 | formatNoMatches: function () { return "Nenalezeny žádné položky"; }, 17 | formatInputTooShort: function (input, min) { 18 | var n = min - input.length; 19 | if (n == 1) { 20 | return "Prosím zadejte ještě jeden znak"; 21 | } else if (n <= 4) { 22 | return "Prosím zadejte ještě další "+smallNumbers[n](true)+" znaky"; 23 | } else { 24 | return "Prosím zadejte ještě dalších "+n+" znaků"; 25 | } 26 | }, 27 | formatInputTooLong: function (input, max) { 28 | var n = input.length - max; 29 | if (n == 1) { 30 | return "Prosím zadejte o jeden znak méně"; 31 | } else if (n <= 4) { 32 | return "Prosím zadejte o "+smallNumbers[n](true)+" znaky méně"; 33 | } else { 34 | return "Prosím zadejte o "+n+" znaků méně"; 35 | } 36 | }, 37 | formatSelectionTooBig: function (limit) { 38 | if (limit == 1) { 39 | return "Můžete zvolit jen jednu položku"; 40 | } else if (limit <= 4) { 41 | return "Můžete zvolit maximálně "+smallNumbers[limit](false)+" položky"; 42 | } else { 43 | return "Můžete zvolit maximálně "+limit+" položek"; 44 | } 45 | }, 46 | formatLoadMore: function (pageNumber) { return "Načítají se další výsledky…"; }, 47 | formatSearching: function () { return "Vyhledávání…"; } 48 | }); 49 | })(jQuery); 50 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_da.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Danish translation. 3 | * 4 | * Author: Anders Jenbo 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "Ingen resultater fundet"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Angiv venligst " + n + " tegn mere"; }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Angiv venligst " + n + " tegn mindre"; }, 13 | formatSelectionTooBig: function (limit) { return "Du kan kun vælge " + limit + " emne" + (limit === 1 ? "" : "r"); }, 14 | formatLoadMore: function (pageNumber) { return "Indlæser flere resultater…"; }, 15 | formatSearching: function () { return "Søger…"; } 16 | }); 17 | })(jQuery); 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_de.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 German translation 3 | */ 4 | (function ($) { 5 | "use strict"; 6 | 7 | $.extend($.fn.select2.defaults, { 8 | formatNoMatches: function () { return "Keine Übereinstimmungen gefunden"; }, 9 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Bitte " + n + " Zeichen mehr eingeben"; }, 10 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Bitte " + n + " Zeichen weniger eingeben"; }, 11 | formatSelectionTooBig: function (limit) { return "Sie können nur " + limit + " Eintr" + (limit === 1 ? "ag" : "äge") + " auswählen"; }, 12 | formatLoadMore: function (pageNumber) { return "Lade mehr Ergebnisse…"; }, 13 | formatSearching: function () { return "Suche…"; } 14 | }); 15 | })(jQuery); -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_el.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Greek translation. 3 | * 4 | * @author Uriy Efremochkin 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "Δεν βρέθηκαν αποτελέσματα"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Παρακαλούμε εισάγετε " + n + " περισσότερο" + (n > 1 ? "υς" : "") + " χαρακτήρ" + (n > 1 ? "ες" : "α"); }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Παρακαλούμε διαγράψτε " + n + " χαρακτήρ" + (n > 1 ? "ες" : "α"); }, 13 | formatSelectionTooBig: function (limit) { return "Μπορείτε να επιλέξετε μόνο " + limit + " αντικείμεν" + (limit > 1 ? "α" : "ο"); }, 14 | formatLoadMore: function (pageNumber) { return "Φόρτωση περισσότερων…"; }, 15 | formatSearching: function () { return "Αναζήτηση…"; } 16 | }); 17 | })(jQuery); -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_en.js.template: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 translation. 3 | * 4 | * Author: Your Name 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatMatches: function (matches) { return matches + " results are available, use up and down arrow keys to navigate."; }, 11 | formatNoMatches: function () { return "No matches found"; }, 12 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " more character" + (n == 1 ? "" : "s"); }, 13 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1 ? "" : "s"); }, 14 | formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); }, 15 | formatLoadMore: function (pageNumber) { return "Loading more results…"; }, 16 | formatSearching: function () { return "Searching…"; } 17 | }); 18 | })(jQuery); 19 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Spanish translation 3 | */ 4 | (function ($) { 5 | "use strict"; 6 | 7 | $.extend($.fn.select2.defaults, { 8 | formatNoMatches: function () { return "No se encontraron resultados"; }, 9 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Por favor, introduzca " + n + " car" + (n == 1? "ácter" : "acteres"); }, 10 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Por favor, elimine " + n + " car" + (n == 1? "ácter" : "acteres"); }, 11 | formatSelectionTooBig: function (limit) { return "Sólo puede seleccionar " + limit + " elemento" + (limit == 1 ? "" : "s"); }, 12 | formatLoadMore: function (pageNumber) { return "Cargando más resultados…"; }, 13 | formatSearching: function () { return "Buscando…"; } 14 | }); 15 | })(jQuery); 16 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_et.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Estonian translation. 3 | * 4 | * Author: Kuldar Kalvik 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "Tulemused puuduvad"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Sisesta " + n + " täht" + (n == 1 ? "" : "e") + " rohkem"; }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Sisesta " + n + " täht" + (n == 1? "" : "e") + " vähem"; }, 13 | formatSelectionTooBig: function (limit) { return "Saad vaid " + limit + " tulemus" + (limit == 1 ? "e" : "t") + " valida"; }, 14 | formatLoadMore: function (pageNumber) { return "Laen tulemusi.."; }, 15 | formatSearching: function () { return "Otsin.."; } 16 | }); 17 | })(jQuery); 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_eu.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Basque translation. 3 | * 4 | * Author: Julen Ruiz Aizpuru 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { 11 | return "Ez da bat datorrenik aurkitu"; 12 | }, 13 | formatInputTooShort: function (input, min) { 14 | var n = min - input.length; 15 | if (n === 1) { 16 | return "Idatzi karaktere bat gehiago"; 17 | } else { 18 | return "Idatzi " + n + " karaktere gehiago"; 19 | } 20 | }, 21 | formatInputTooLong: function (input, max) { 22 | var n = input.length - max; 23 | if (n === 1) { 24 | return "Idatzi karaktere bat gutxiago"; 25 | } else { 26 | return "Idatzi " + n + " karaktere gutxiago"; 27 | } 28 | }, 29 | formatSelectionTooBig: function (limit) { 30 | if (limit === 1 ) { 31 | return "Elementu bakarra hauta dezakezu"; 32 | } else { 33 | return limit + " elementu hauta ditzakezu soilik"; 34 | } 35 | }, 36 | formatLoadMore: function (pageNumber) { 37 | return "Emaitza gehiago kargatzen…"; 38 | }, 39 | formatSearching: function () { 40 | return "Bilatzen…"; 41 | } 42 | }); 43 | })(jQuery); 44 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_fa.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Persian translation. 3 | * 4 | * Author: Ali Choopan 5 | * Author: Ebrahim Byagowi 6 | */ 7 | (function ($) { 8 | "use strict"; 9 | 10 | $.extend($.fn.select2.defaults, { 11 | formatMatches: function (matches) { return matches + " نتیجه موجود است، کلیدهای جهت بالا و پایین را برای گشتن استفاده کنید."; }, 12 | formatNoMatches: function () { return "نتیجه‌ای یافت نشد."; }, 13 | formatInputTooShort: function (input, min) { var n = min - input.length; return "لطفاً " + n + " نویسه بیشتر وارد نمایید"; }, 14 | formatInputTooLong: function (input, max) { var n = input.length - max; return "لطفاً " + n + " نویسه را حذف کنید."; }, 15 | formatSelectionTooBig: function (limit) { return "شما فقط می‌توانید " + limit + " مورد را انتخاب کنید"; }, 16 | formatLoadMore: function (pageNumber) { return "در حال بارگیری موارد بیشتر…"; }, 17 | formatSearching: function () { return "در حال جستجو…"; } 18 | }); 19 | })(jQuery); 20 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_fi.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Finnish translation 3 | */ 4 | (function ($) { 5 | "use strict"; 6 | $.extend($.fn.select2.defaults, { 7 | formatNoMatches: function () { 8 | return "Ei tuloksia"; 9 | }, 10 | formatInputTooShort: function (input, min) { 11 | var n = min - input.length; 12 | return "Ole hyvä ja anna " + n + " merkkiä lisää"; 13 | }, 14 | formatInputTooLong: function (input, max) { 15 | var n = input.length - max; 16 | return "Ole hyvä ja anna " + n + " merkkiä vähemmän"; 17 | }, 18 | formatSelectionTooBig: function (limit) { 19 | return "Voit valita ainoastaan " + limit + " kpl"; 20 | }, 21 | formatLoadMore: function (pageNumber) { 22 | return "Ladataan lisää tuloksia…"; 23 | }, 24 | formatSearching: function () { 25 | return "Etsitään…"; 26 | } 27 | }); 28 | })(jQuery); 29 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_fr.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 French translation 3 | */ 4 | (function ($) { 5 | "use strict"; 6 | 7 | $.extend($.fn.select2.defaults, { 8 | formatMatches: function (matches) { return matches + " résultats sont disponibles, utilisez les flèches haut et bas pour naviguer."; }, 9 | formatNoMatches: function () { return "Aucun résultat trouvé"; }, 10 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Merci de saisir " + n + " caractère" + (n == 1 ? "" : "s") + " de plus"; }, 11 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Merci de supprimer " + n + " caractère" + (n == 1 ? "" : "s"); }, 12 | formatSelectionTooBig: function (limit) { return "Vous pouvez seulement sélectionner " + limit + " élément" + (limit == 1 ? "" : "s"); }, 13 | formatLoadMore: function (pageNumber) { return "Chargement de résultats supplémentaires…"; }, 14 | formatSearching: function () { return "Recherche en cours…"; } 15 | }); 16 | })(jQuery); 17 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_gl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Galician translation 3 | * 4 | * Author: Leandro Regueiro 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { 11 | return "Non se atoparon resultados"; 12 | }, 13 | formatInputTooShort: function (input, min) { 14 | var n = min - input.length; 15 | if (n === 1) { 16 | return "Engada un carácter"; 17 | } else { 18 | return "Engada " + n + " caracteres"; 19 | } 20 | }, 21 | formatInputTooLong: function (input, max) { 22 | var n = input.length - max; 23 | if (n === 1) { 24 | return "Elimine un carácter"; 25 | } else { 26 | return "Elimine " + n + " caracteres"; 27 | } 28 | }, 29 | formatSelectionTooBig: function (limit) { 30 | if (limit === 1 ) { 31 | return "Só pode seleccionar un elemento"; 32 | } else { 33 | return "Só pode seleccionar " + limit + " elementos"; 34 | } 35 | }, 36 | formatLoadMore: function (pageNumber) { 37 | return "Cargando máis resultados…"; 38 | }, 39 | formatSearching: function () { 40 | return "Buscando…"; 41 | } 42 | }); 43 | })(jQuery); 44 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_he.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Hebrew translation. 3 | * 4 | * Author: Yakir Sitbon 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "לא נמצאו התאמות"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "נא להזין עוד " + n + " תווים נוספים"; }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "נא להזין פחות " + n + " תווים"; }, 13 | formatSelectionTooBig: function (limit) { return "ניתן לבחור " + limit + " פריטים"; }, 14 | formatLoadMore: function (pageNumber) { return "טוען תוצאות נוספות…"; }, 15 | formatSearching: function () { return "מחפש…"; } 16 | }); 17 | })(jQuery); 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_hr.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Croatian translation. 3 | * 4 | * @author Edi Modrić 5 | * @author Uriy Efremochkin 6 | */ 7 | (function ($) { 8 | "use strict"; 9 | 10 | $.extend($.fn.select2.defaults, { 11 | formatNoMatches: function () { return "Nema rezultata"; }, 12 | formatInputTooShort: function (input, min) { return "Unesite još" + character(min - input.length); }, 13 | formatInputTooLong: function (input, max) { return "Unesite" + character(input.length - max) + " manje"; }, 14 | formatSelectionTooBig: function (limit) { return "Maksimalan broj odabranih stavki je " + limit; }, 15 | formatLoadMore: function (pageNumber) { return "Učitavanje rezultata…"; }, 16 | formatSearching: function () { return "Pretraga…"; } 17 | }); 18 | 19 | function character (n) { 20 | return " " + n + " znak" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "a" : "" : "ova"); 21 | } 22 | })(jQuery); 23 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_hu.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Hungarian translation 3 | */ 4 | (function ($) { 5 | "use strict"; 6 | 7 | $.extend($.fn.select2.defaults, { 8 | formatNoMatches: function () { return "Nincs találat."; }, 9 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Túl rövid. Még " + n + " karakter hiányzik."; }, 10 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Túl hosszú. " + n + " karakterrel több, mint kellene."; }, 11 | formatSelectionTooBig: function (limit) { return "Csak " + limit + " elemet lehet kiválasztani."; }, 12 | formatLoadMore: function (pageNumber) { return "Töltés…"; }, 13 | formatSearching: function () { return "Keresés…"; } 14 | }); 15 | })(jQuery); 16 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_id.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Indonesian translation. 3 | * 4 | * Author: Ibrahim Yusuf 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "Tidak ada data yang sesuai"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Masukkan " + n + " huruf lagi" + (n == 1 ? "" : "s"); }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Hapus " + n + " huruf" + (n == 1 ? "" : "s"); }, 13 | formatSelectionTooBig: function (limit) { return "Anda hanya dapat memilih " + limit + " pilihan" + (limit == 1 ? "" : "s"); }, 14 | formatLoadMore: function (pageNumber) { return "Mengambil data…"; }, 15 | formatSearching: function () { return "Mencari…"; } 16 | }); 17 | })(jQuery); 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_is.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Icelandic translation. 3 | */ 4 | (function ($) { 5 | "use strict"; 6 | 7 | $.extend($.fn.select2.defaults, { 8 | formatNoMatches: function () { return "Ekkert fannst"; }, 9 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Vinsamlegast skrifið " + n + " staf" + (n > 1 ? "i" : "") + " í viðbót"; }, 10 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Vinsamlegast styttið texta um " + n + " staf" + (n > 1 ? "i" : ""); }, 11 | formatSelectionTooBig: function (limit) { return "Þú getur aðeins valið " + limit + " atriði"; }, 12 | formatLoadMore: function (pageNumber) { return "Sæki fleiri niðurstöður…"; }, 13 | formatSearching: function () { return "Leita…"; } 14 | }); 15 | })(jQuery); 16 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_it.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Italian translation 3 | */ 4 | (function ($) { 5 | "use strict"; 6 | 7 | $.extend($.fn.select2.defaults, { 8 | formatNoMatches: function () { return "Nessuna corrispondenza trovata"; }, 9 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Inserisci ancora " + n + " caratter" + (n == 1? "e" : "i"); }, 10 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Inserisci " + n + " caratter" + (n == 1? "e" : "i") + " in meno"; }, 11 | formatSelectionTooBig: function (limit) { return "Puoi selezionare solo " + limit + " element" + (limit == 1 ? "o" : "i"); }, 12 | formatLoadMore: function (pageNumber) { return "Caricamento in corso…"; }, 13 | formatSearching: function () { return "Ricerca…"; } 14 | }); 15 | })(jQuery); -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_ja.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Japanese translation. 3 | */ 4 | (function ($) { 5 | "use strict"; 6 | 7 | $.extend($.fn.select2.defaults, { 8 | formatNoMatches: function () { return "該当なし"; }, 9 | formatInputTooShort: function (input, min) { var n = min - input.length; return "後" + n + "文字入れてください"; }, 10 | formatInputTooLong: function (input, max) { var n = input.length - max; return "検索文字列が" + n + "文字長すぎます"; }, 11 | formatSelectionTooBig: function (limit) { return "最多で" + limit + "項目までしか選択できません"; }, 12 | formatLoadMore: function (pageNumber) { return "読込中・・・"; }, 13 | formatSearching: function () { return "検索中・・・"; } 14 | }); 15 | })(jQuery); 16 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_ka.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Georgian (Kartuli) translation. 3 | * 4 | * Author: Dimitri Kurashvili dimakura@gmail.com 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "ვერ მოიძებნა"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "გთხოვთ შეიყვანოთ კიდევ " + n + " სიმბოლო"; }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "გთხოვთ წაშალოთ " + n + " სიმბოლო"; }, 13 | formatSelectionTooBig: function (limit) { return "თქვენ შეგიძლიათ მხოლოდ " + limit + " ჩანაწერის მონიშვნა"; }, 14 | formatLoadMore: function (pageNumber) { return "შედეგის ჩატვირთვა…"; }, 15 | formatSearching: function () { return "ძებნა…"; } 16 | }); 17 | })(jQuery); 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_ko.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Korean translation. 3 | * 4 | * @author Swen Mun 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "결과 없음"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "너무 짧습니다. "+n+"글자 더 입력해주세요."; }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "너무 깁니다. "+n+"글자 지워주세요."; }, 13 | formatSelectionTooBig: function (limit) { return "최대 "+limit+"개까지만 선택하실 수 있습니다."; }, 14 | formatLoadMore: function (pageNumber) { return "불러오는 중…"; }, 15 | formatSearching: function () { return "검색 중…"; } 16 | }); 17 | })(jQuery); 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_lt.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Lithuanian translation. 3 | * 4 | * @author CRONUS Karmalakas 5 | * @author Uriy Efremochkin 6 | */ 7 | (function ($) { 8 | "use strict"; 9 | 10 | $.extend($.fn.select2.defaults, { 11 | formatNoMatches: function () { return "Atitikmenų nerasta"; }, 12 | formatInputTooShort: function (input, min) { return "Įrašykite dar" + character(min - input.length); }, 13 | formatInputTooLong: function (input, max) { return "Pašalinkite" + character(input.length - max); }, 14 | formatSelectionTooBig: function (limit) { 15 | return "Jūs galite pasirinkti tik " + limit + " element" + ((limit%100 > 9 && limit%100 < 21) || limit%10 == 0 ? "ų" : limit%10 > 1 ? "us" : "ą"); 16 | }, 17 | formatLoadMore: function (pageNumber) { return "Kraunama daugiau rezultatų…"; }, 18 | formatSearching: function () { return "Ieškoma…"; } 19 | }); 20 | 21 | function character (n) { 22 | return " " + n + " simbol" + ((n%100 > 9 && n%100 < 21) || n%10 == 0 ? "ių" : n%10 > 1 ? "ius" : "į"); 23 | } 24 | })(jQuery); 25 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_lv.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Latvian translation. 3 | * 4 | * @author Uriy Efremochkin 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "Sakritību nav"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Lūdzu ievadiet vēl " + n + " simbol" + (n == 11 ? "us" : n%10 == 1 ? "u" : "us"); }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Lūdzu ievadiet par " + n + " simbol" + (n == 11 ? "iem" : n%10 == 1 ? "u" : "iem") + " mazāk"; }, 13 | formatSelectionTooBig: function (limit) { return "Jūs varat izvēlēties ne vairāk kā " + limit + " element" + (limit == 11 ? "us" : limit%10 == 1 ? "u" : "us"); }, 14 | formatLoadMore: function (pageNumber) { return "Datu ielāde…"; }, 15 | formatSearching: function () { return "Meklēšana…"; } 16 | }); 17 | })(jQuery); 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_mk.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Macedonian translation. 3 | * 4 | * Author: Marko Aleksic 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "Нема пронајдено совпаѓања"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Ве молиме внесете уште " + n + " карактер" + (n == 1 ? "" : "и"); }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Ве молиме внесете " + n + " помалку карактер" + (n == 1? "" : "и"); }, 13 | formatSelectionTooBig: function (limit) { return "Можете да изберете само " + limit + " ставк" + (limit == 1 ? "а" : "и"); }, 14 | formatLoadMore: function (pageNumber) { return "Вчитување резултати…"; }, 15 | formatSearching: function () { return "Пребарување…"; } 16 | }); 17 | })(jQuery); -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_ms.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Malay translation. 3 | * 4 | * Author: Kepoweran 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "Tiada padanan yang ditemui"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Sila masukkan " + n + " aksara lagi"; }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Sila hapuskan " + n + " aksara"; }, 13 | formatSelectionTooBig: function (limit) { return "Anda hanya boleh memilih " + limit + " pilihan"; }, 14 | formatLoadMore: function (pageNumber) { return "Sedang memuatkan keputusan…"; }, 15 | formatSearching: function () { return "Mencari…"; } 16 | }); 17 | })(jQuery); 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_nl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Dutch translation 3 | */ 4 | (function ($) { 5 | "use strict"; 6 | 7 | $.extend($.fn.select2.defaults, { 8 | formatNoMatches: function () { return "Geen resultaten gevonden"; }, 9 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Vul " + n + " karakter" + (n == 1? "" : "s") + " meer in"; }, 10 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Vul " + n + " karakter" + (n == 1? "" : "s") + " minder in"; }, 11 | formatSelectionTooBig: function (limit) { return "Maximaal " + limit + " item" + (limit == 1 ? "" : "s") + " toegestaan"; }, 12 | formatLoadMore: function (pageNumber) { return "Meer resultaten laden…"; }, 13 | formatSearching: function () { return "Zoeken…"; } 14 | }); 15 | })(jQuery); -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_no.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Norwegian translation. 3 | * 4 | * Author: Torgeir Veimo 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "Ingen treff"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Vennligst skriv inn " + n + (n>1 ? " flere tegn" : " tegn til"); }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Vennligst fjern " + n + " tegn"; }, 13 | formatSelectionTooBig: function (limit) { return "Du kan velge maks " + limit + " elementer"; }, 14 | formatLoadMore: function (pageNumber) { return "Laster flere resultater…"; }, 15 | formatSearching: function () { return "Søker…"; } 16 | }); 17 | })(jQuery); 18 | 19 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_pl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Polish translation. 3 | * 4 | * @author Jan Kondratowicz 5 | * @author Uriy Efremochkin 6 | */ 7 | (function ($) { 8 | "use strict"; 9 | 10 | $.extend($.fn.select2.defaults, { 11 | formatNoMatches: function () { return "Brak wyników"; }, 12 | formatInputTooShort: function (input, min) { return "Wpisz jeszcze" + character(min - input.length, "znak", "i"); }, 13 | formatInputTooLong: function (input, max) { return "Wpisana fraza jest za długa o" + character(input.length - max, "znak", "i"); }, 14 | formatSelectionTooBig: function (limit) { return "Możesz zaznaczyć najwyżej" + character(limit, "element", "y"); }, 15 | formatLoadMore: function (pageNumber) { return "Ładowanie wyników…"; }, 16 | formatSearching: function () { return "Szukanie…"; } 17 | }); 18 | 19 | function character (n, word, pluralSuffix) { 20 | return " " + n + " " + word + (n == 1 ? "" : n%10 < 5 && n%10 > 1 && (n%100 < 5 || n%100 > 20) ? pluralSuffix : "ów"); 21 | } 22 | })(jQuery); 23 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_pt-BR.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Brazilian Portuguese translation 3 | */ 4 | (function ($) { 5 | "use strict"; 6 | 7 | $.extend($.fn.select2.defaults, { 8 | formatNoMatches: function () { return "Nenhum resultado encontrado"; }, 9 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Digite mais " + n + " caracter" + (n == 1? "" : "es"); }, 10 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " caracter" + (n == 1? "" : "es"); }, 11 | formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); }, 12 | formatLoadMore: function (pageNumber) { return "Carregando mais resultados…"; }, 13 | formatSearching: function () { return "Buscando…"; } 14 | }); 15 | })(jQuery); 16 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_pt-PT.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Portuguese (Portugal) translation 3 | */ 4 | (function ($) { 5 | "use strict"; 6 | 7 | $.extend($.fn.select2.defaults, { 8 | formatNoMatches: function () { return "Nenhum resultado encontrado"; }, 9 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduza " + n + " car" + (n == 1 ? "ácter" : "acteres"); }, 10 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " car" + (n == 1 ? "ácter" : "acteres"); }, 11 | formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); }, 12 | formatLoadMore: function (pageNumber) { return "A carregar mais resultados…"; }, 13 | formatSearching: function () { return "A pesquisar…"; } 14 | }); 15 | })(jQuery); 16 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_ro.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Romanian translation. 3 | */ 4 | (function ($) { 5 | "use strict"; 6 | 7 | $.extend($.fn.select2.defaults, { 8 | formatNoMatches: function () { return "Nu a fost găsit nimic"; }, 9 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Vă rugăm să introduceți incă " + n + " caracter" + (n == 1 ? "" : "e"); }, 10 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Vă rugăm să introduceți mai puțin de " + n + " caracter" + (n == 1? "" : "e"); }, 11 | formatSelectionTooBig: function (limit) { return "Aveți voie să selectați cel mult " + limit + " element" + (limit == 1 ? "" : "e"); }, 12 | formatLoadMore: function (pageNumber) { return "Se încarcă…"; }, 13 | formatSearching: function () { return "Căutare…"; } 14 | }); 15 | })(jQuery); 16 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_rs.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Serbian translation. 3 | * 4 | * @author Limon Monte 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "Ništa nije pronađeno"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Ukucajte bar još " + n + " simbol" + (n % 10 == 1 && n % 100 != 11 ? "" : "a"); }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Obrišite " + n + " simbol" + (n % 10 == 1 && n % 100 != 11 ? "" : "a"); }, 13 | formatSelectionTooBig: function (limit) { return "Možete izabrati samo " + limit + " stavk" + (limit % 10 == 1 && limit % 100 != 11 ? "u" : (limit % 10 >= 2 && limit % 10 <= 4 && (limit % 100 < 12 || limit % 100 > 14)? "e" : "i")); }, 14 | formatLoadMore: function (pageNumber) { return "Preuzimanje još rezultata…"; }, 15 | formatSearching: function () { return "Pretraga…"; } 16 | }); 17 | })(jQuery); 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_ru.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Russian translation. 3 | * 4 | * @author Uriy Efremochkin 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "Совпадений не найдено"; }, 11 | formatInputTooShort: function (input, min) { return "Пожалуйста, введите еще" + character(min - input.length); }, 12 | formatInputTooLong: function (input, max) { return "Пожалуйста, введите на" + character(input.length - max) + " меньше"; }, 13 | formatSelectionTooBig: function (limit) { return "Вы можете выбрать не более " + limit + " элемент" + (limit%10 == 1 && limit%100 != 11 ? "а" : "ов"); }, 14 | formatLoadMore: function (pageNumber) { return "Загрузка данных…"; }, 15 | formatSearching: function () { return "Поиск…"; } 16 | }); 17 | 18 | function character (n) { 19 | return " " + n + " символ" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 20) ? n%10 > 1 ? "a" : "" : "ов"); 20 | } 21 | })(jQuery); 22 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_sk.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Slovak translation. 3 | * 4 | * Author: David Vallner 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | // use text for the numbers 2 through 4 9 | var smallNumbers = { 10 | 2: function(masc) { return (masc ? "dva" : "dve"); }, 11 | 3: function() { return "tri"; }, 12 | 4: function() { return "štyri"; } 13 | } 14 | $.extend($.fn.select2.defaults, { 15 | formatNoMatches: function () { return "Nenašli sa žiadne položky"; }, 16 | formatInputTooShort: function (input, min) { 17 | var n = min - input.length; 18 | if (n == 1) { 19 | return "Prosím zadajte ešte jeden znak"; 20 | } else if (n <= 4) { 21 | return "Prosím zadajte ešte ďalšie "+smallNumbers[n](true)+" znaky"; 22 | } else { 23 | return "Prosím zadajte ešte ďalších "+n+" znakov"; 24 | } 25 | }, 26 | formatInputTooLong: function (input, max) { 27 | var n = input.length - max; 28 | if (n == 1) { 29 | return "Prosím zadajte o jeden znak menej"; 30 | } else if (n <= 4) { 31 | return "Prosím zadajte o "+smallNumbers[n](true)+" znaky menej"; 32 | } else { 33 | return "Prosím zadajte o "+n+" znakov menej"; 34 | } 35 | }, 36 | formatSelectionTooBig: function (limit) { 37 | if (limit == 1) { 38 | return "Môžete zvoliť len jednu položku"; 39 | } else if (limit <= 4) { 40 | return "Môžete zvoliť najviac "+smallNumbers[limit](false)+" položky"; 41 | } else { 42 | return "Môžete zvoliť najviac "+limit+" položiek"; 43 | } 44 | }, 45 | formatLoadMore: function (pageNumber) { return "Načítavajú sa ďalšie výsledky…"; }, 46 | formatSearching: function () { return "Vyhľadávanie…"; } 47 | }); 48 | })(jQuery); 49 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_sv.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Swedish translation. 3 | * 4 | * Author: Jens Rantil 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "Inga träffar"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Var god skriv in " + n + (n>1 ? " till tecken" : " tecken till"); }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Var god sudda ut " + n + " tecken"; }, 13 | formatSelectionTooBig: function (limit) { return "Du kan max välja " + limit + " element"; }, 14 | formatLoadMore: function (pageNumber) { return "Laddar fler resultat…"; }, 15 | formatSearching: function () { return "Söker…"; } 16 | }); 17 | })(jQuery); 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_th.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Thai translation. 3 | * 4 | * Author: Atsawin Chaowanakritsanakul 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "ไม่พบข้อมูล"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "โปรดพิมพ์เพิ่มอีก " + n + " ตัวอักษร"; }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "โปรดลบออก " + n + " ตัวอักษร"; }, 13 | formatSelectionTooBig: function (limit) { return "คุณสามารถเลือกได้ไม่เกิน " + limit + " รายการ"; }, 14 | formatLoadMore: function (pageNumber) { return "กำลังค้นข้อมูลเพิ่ม…"; }, 15 | formatSearching: function () { return "กำลังค้นข้อมูล…"; } 16 | }); 17 | })(jQuery); 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_tr.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Turkish translation. 3 | * 4 | * Author: Salim KAYABAŞI 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "Sonuç bulunamadı"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "En az " + n + " karakter daha girmelisiniz"; }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return n + " karakter azaltmalısınız"; }, 13 | formatSelectionTooBig: function (limit) { return "Sadece " + limit + " seçim yapabilirsiniz"; }, 14 | formatLoadMore: function (pageNumber) { return "Daha fazla…"; }, 15 | formatSearching: function () { return "Aranıyor…"; } 16 | }); 17 | })(jQuery); 18 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_uk.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Ukrainian translation. 3 | * 4 | * @author bigmihail 5 | * @author Uriy Efremochkin 6 | */ 7 | (function ($) { 8 | "use strict"; 9 | 10 | $.extend($.fn.select2.defaults, { 11 | formatMatches: function (matches) { return character(matches, "результат") + " знайдено, використовуйте клавіші зі стрілками вверх та вниз для навігації."; }, 12 | formatNoMatches: function () { return "Нічого не знайдено"; }, 13 | formatInputTooShort: function (input, min) { return "Введіть буль ласка ще " + character(min - input.length, "символ"); }, 14 | formatInputTooLong: function (input, max) { return "Введіть буль ласка на " + character(input.length - max, "символ") + " менше"; }, 15 | formatSelectionTooBig: function (limit) { return "Ви можете вибрати лише " + character(limit, "елемент"); }, 16 | formatLoadMore: function (pageNumber) { return "Завантаження даних…"; }, 17 | formatSearching: function () { return "Пошук…"; } 18 | }); 19 | 20 | function character (n, word) { 21 | return n + " " + word + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "и" : "" : "ів"); 22 | } 23 | })(jQuery); 24 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_vi.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Vietnamese translation. 3 | * 4 | * Author: Long Nguyen 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $.extend($.fn.select2.defaults, { 10 | formatNoMatches: function () { return "Không tìm thấy kết quả"; }, 11 | formatInputTooShort: function (input, min) { var n = min - input.length; return "Vui lòng nhập nhiều hơn " + n + " ký tự" + (n == 1 ? "" : "s"); }, 12 | formatInputTooLong: function (input, max) { var n = input.length - max; return "Vui lòng nhập ít hơn " + n + " ký tự" + (n == 1? "" : "s"); }, 13 | formatSelectionTooBig: function (limit) { return "Chỉ có thể chọn được " + limit + " tùy chọn" + (limit == 1 ? "" : "s"); }, 14 | formatLoadMore: function (pageNumber) { return "Đang lấy thêm kết quả…"; }, 15 | formatSearching: function () { return "Đang tìm…"; } 16 | }); 17 | })(jQuery); 18 | 19 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_zh-CN.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Chinese translation 3 | */ 4 | (function ($) { 5 | "use strict"; 6 | $.extend($.fn.select2.defaults, { 7 | formatNoMatches: function () { return "没有找到匹配项"; }, 8 | formatInputTooShort: function (input, min) { var n = min - input.length; return "请再输入" + n + "个字符";}, 9 | formatInputTooLong: function (input, max) { var n = input.length - max; return "请删掉" + n + "个字符";}, 10 | formatSelectionTooBig: function (limit) { return "你只能选择最多" + limit + "项"; }, 11 | formatLoadMore: function (pageNumber) { return "加载结果中…"; }, 12 | formatSearching: function () { return "搜索中…"; } 13 | }); 14 | })(jQuery); 15 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2_locale_zh-TW.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Select2 Traditional Chinese translation 3 | */ 4 | (function ($) { 5 | "use strict"; 6 | $.extend($.fn.select2.defaults, { 7 | formatNoMatches: function () { return "沒有找到相符的項目"; }, 8 | formatInputTooShort: function (input, min) { var n = min - input.length; return "請再輸入" + n + "個字元";}, 9 | formatInputTooLong: function (input, max) { var n = input.length - max; return "請刪掉" + n + "個字元";}, 10 | formatSelectionTooBig: function (limit) { return "你只能選擇最多" + limit + "項"; }, 11 | formatLoadMore: function (pageNumber) { return "載入中…"; }, 12 | formatSearching: function () { return "搜尋中…"; } 13 | }); 14 | })(jQuery); 15 | -------------------------------------------------------------------------------- /zhiliao-admin/src/main/resources/static/plugins/select2/select2x2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WannabeDeer/zhiliao/84cc59ea076c4d4ce87a436ce78be8cc3e94034b/zhiliao-admin/src/main/resources/static/plugins/select2/select2x2.png -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/common/aop/LimitType.java: -------------------------------------------------------------------------------- 1 | package com.lin.common.aop; 2 | 3 | public enum LimitType { 4 | /** 5 | * 默认策略全局限流,例如:A接口1分钟内允许访问100次 6 | */ 7 | DEFAULT, 8 | 9 | /** 10 | * 根据请求者IP进行限流,例如:ip地址A可以在1分钟内访问接口50次 11 | */ 12 | IP 13 | } 14 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/common/aop/LogAnnotation.java: -------------------------------------------------------------------------------- 1 | package com.lin.common.aop; 2 | 3 | import java.lang.annotation.*; 4 | 5 | //Type 代表可以放在类上面 Method 代表可以放在方法上 6 | @Target({ElementType.METHOD}) 7 | @Retention(RetentionPolicy.RUNTIME) 8 | @Documented 9 | public @interface LogAnnotation { 10 | 11 | String module() default ""; 12 | 13 | String operator() default ""; 14 | } 15 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/common/aop/RateLimiter.java: -------------------------------------------------------------------------------- 1 | package com.lin.common.aop; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Target(ElementType.METHOD) 6 | @Retention(RetentionPolicy.RUNTIME) 7 | @Documented 8 | public @interface RateLimiter { 9 | /** 10 | * 限流key名称 11 | */ 12 | public String key() default "rate_limit:"; 13 | 14 | /** 15 | * 限流时间,单位秒 16 | */ 17 | public int time() default 60; 18 | 19 | /** 20 | * 限流次数 21 | */ 22 | public int count() default 100; 23 | 24 | /** 25 | * 限流类型 26 | */ 27 | public LimitType limitType() default LimitType.DEFAULT; 28 | } 29 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/common/cache/Cache.java: -------------------------------------------------------------------------------- 1 | package com.lin.common.cache; 2 | 3 | 4 | import java.lang.annotation.*; 5 | 6 | //以下是元注解 7 | 8 | /** 9 | * @author linqiwang 10 | */ 11 | //target注解的作用表示可以注解作用的范围 12 | @Target({ElementType.METHOD})//作用域是在方法上 13 | //retention表示什么时候有效 其中runtime包括class包括sources(源码级别) 14 | @Retention(RetentionPolicy.RUNTIME)//运行时有效 15 | //Documented表示是否将我们的注解生成在Javadoc中 16 | @Documented 17 | public @interface Cache { 18 | 19 | //缓存时间 20 | long expire() default 1 * 60 * 1000; 21 | 22 | //缓存标识 key 23 | String name() default ""; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/common/verificationCode/Captcha.java: -------------------------------------------------------------------------------- 1 | package com.lin.common.verificationCode; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Captcha { 7 | 8 | /** 9 | * 随机字符串 10 | **/ 11 | private String nonceStr; 12 | /** 13 | * 验证值 14 | **/ 15 | private String value; 16 | /** 17 | * 生成的画布的base64 18 | **/ 19 | private String canvasSrc; 20 | /** 21 | * 画布宽度 22 | **/ 23 | private Integer canvasWidth; 24 | /** 25 | * 画布高度 26 | **/ 27 | private Integer canvasHeight; 28 | /** 29 | * 生成的阻塞块的base64 30 | **/ 31 | private String blockSrc; 32 | /** 33 | * 阻塞块宽度 34 | **/ 35 | private Integer blockWidth; 36 | /** 37 | * 阻塞块高度 38 | **/ 39 | private Integer blockHeight; 40 | /** 41 | * 阻塞块凸凹半径 42 | **/ 43 | private Integer blockRadius; 44 | /** 45 | * 阻塞块的横轴坐标 46 | **/ 47 | private Integer blockX; 48 | /** 49 | * 阻塞块的纵轴坐标 50 | **/ 51 | private Integer blockY; 52 | /** 53 | * 图片获取位置 54 | **/ 55 | private Integer place; 56 | } 57 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/common/webSocket/WebSocketConfig.java: -------------------------------------------------------------------------------- 1 | package com.lin.common.webSocket; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.socket.server.standard.ServerEndpointExporter; 6 | @Configuration 7 | public class WebSocketConfig { 8 | 9 | /** 10 | * 注入一个ServerEndpointExporter,该Bean会自动注册使用@ServerEndpoint注解申明的websocket endpoint 11 | */ 12 | @Bean 13 | public ServerEndpointExporter serverEndpointExporter() { 14 | return new ServerEndpointExporter(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.lin.config; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; 4 | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; 5 | import org.mybatis.spring.annotation.MapperScan; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | @Configuration 10 | @MapperScan("com.lin.dao.mapper") 11 | public class MybatisPlusConfig { 12 | 13 | //分页插件 14 | @Bean 15 | public MybatisPlusInterceptor mybatisPlusInterceptor() { 16 | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); 17 | interceptor.addInnerInterceptor(new PaginationInnerInterceptor()); 18 | return interceptor; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/config/Swagger3Config.java: -------------------------------------------------------------------------------- 1 | package com.lin.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.RequestHandlerSelectors; 6 | import springfox.documentation.service.ApiInfo; 7 | import springfox.documentation.service.Contact; 8 | import springfox.documentation.spi.DocumentationType; 9 | import springfox.documentation.spring.web.plugins.Docket; 10 | 11 | import java.util.ArrayList; 12 | 13 | @Configuration 14 | public class Swagger3Config { 15 | 16 | @Bean 17 | public Docket createRestApi() { 18 | return new Docket(DocumentationType.OAS_30) 19 | .groupName("文章业务组") 20 | .select() 21 | .apis(RequestHandlerSelectors.basePackage("com.lin.controller"))//选择指定路径的api 22 | .build() 23 | .apiInfo(createApiInfo()) 24 | .enable(true);//正式环境必须为false 25 | } 26 | 27 | @Bean 28 | public ApiInfo createApiInfo() { 29 | return new ApiInfo("zhiliao Swagger", 30 | "zhiliao Api Documentation", 31 | "3.0", 32 | "http:zhiliao.com", 33 | new Contact("小林", "http:zhiliao.com", "@qq.com"), 34 | "Apache 2.0", 35 | "http://www.apache.org/licenses/LICENSE-2.0", 36 | new ArrayList<>()); 37 | } 38 | 39 | @Bean 40 | public Docket createRestApi2() { 41 | return new Docket(DocumentationType.OAS_30) 42 | .groupName("登录业务组") 43 | .select() 44 | .apis(RequestHandlerSelectors.basePackage("com.lin.controller"))//选择指定路径的api 45 | .build() 46 | .apiInfo(createApiInfo2()) 47 | .enable(true);//正式环境必须为false 48 | } 49 | 50 | @Bean 51 | public ApiInfo createApiInfo2() { 52 | return new ApiInfo("zhiliao Swagger", 53 | "zhiliao Api Documentation", 54 | "3.0", 55 | "http:zhiliao.com", 56 | new Contact("晓棋", "http:zhiliao.com", "@qq.com"), 57 | "Apache 2.0", 58 | "http://www.apache.org/licenses/LICENSE-2.0", 59 | new ArrayList<>()); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/config/ThreadPoolConfig.java: -------------------------------------------------------------------------------- 1 | package com.lin.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.scheduling.annotation.EnableAsync; 6 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; 7 | 8 | import java.util.concurrent.Executor; 9 | import java.util.concurrent.ThreadPoolExecutor; 10 | 11 | @Configuration 12 | @EnableAsync //开启多线程 13 | public class ThreadPoolConfig { 14 | 15 | @Bean("taskExecutor") 16 | public Executor asyncServiceExecutor() { 17 | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); 18 | // 设置核心线程数 19 | executor.setCorePoolSize(5); 20 | // 设置最大线程数 21 | executor.setMaxPoolSize(20); 22 | //配置队列大小 核心线程数/每个任务花费的时间*系统允许的最大响应时间 23 | executor.setQueueCapacity(80); 24 | // 设置线程空闲时间,当超过核心线程之外的线程在空闲到达之后会被销毁(秒) 25 | executor.setKeepAliveSeconds(60); 26 | // 设置默认线程名称 27 | executor.setThreadNamePrefix("redisCountThread"); 28 | // 等待所有任务结束后再关闭线程池 29 | executor.setWaitForTasksToCompleteOnShutdown(true); 30 | //执行初始化 31 | executor.initialize(); 32 | return executor; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/config/WebMVCConfig.java: -------------------------------------------------------------------------------- 1 | package com.lin.config; 2 | 3 | import com.lin.handler.LoginInterceptor; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 7 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 9 | 10 | @Configuration 11 | public class WebMVCConfig implements WebMvcConfigurer { 12 | @Autowired 13 | private LoginInterceptor loginInterceptor; 14 | 15 | @Override 16 | public void addCorsMappings(CorsRegistry registry) { 17 | //跨域配置 18 | registry.addMapping("/**") 19 | .allowedMethods("DELETE", "GET", "POST", "OPTIONS", "PUT") 20 | .allowedOrigins("http://localhost:8080"); 21 | } 22 | 23 | @Override 24 | public void addInterceptors(InterceptorRegistry registry) { 25 | //拦截test接口,后续实际遇到需要拦截的接口时,在配置为真正的拦截接口 26 | registry.addInterceptor(loginInterceptor) 27 | .addPathPatterns("/test") 28 | .addPathPatterns("/comments/create/change") 29 | .addPathPatterns("/articles/publish") 30 | .addPathPatterns("/like/islike") 31 | .addPathPatterns("/users/findUserByAccount/*")//根据账号查找用户信息 32 | .addPathPatterns("/users/updateUser")//修改用户信息 33 | .addPathPatterns("addInterceptors/**");//点赞接口 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/controller/AdController.java: -------------------------------------------------------------------------------- 1 | package com.lin.controller; 2 | 3 | import java.util.List; 4 | 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.lin.dao.pojo.Ad; 7 | import com.lin.dao.pojo.AdType; 8 | import com.lin.service.AdService; 9 | import com.lin.vo.Result; 10 | import com.lin.vo.params.AdTypePageParam; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.web.bind.annotation.*; 14 | 15 | /** 16 | * adController 17 | * 18 | * @author lqw 19 | */ 20 | @Controller 21 | @RequestMapping("/ads") 22 | public class AdController { 23 | 24 | @Autowired 25 | private AdService adService; 26 | 27 | /** 28 | * 查询广告类型列表 29 | */ 30 | @GetMapping("/{adId}") 31 | @ResponseBody 32 | public Result getAdTypeId(@PathVariable Long adId) { 33 | Ad ad = adService.selectAdByAdId(adId); 34 | return Result.success(ad); 35 | } 36 | 37 | 38 | /** 39 | * 查询ad列表 40 | */ 41 | @PostMapping("/adList") 42 | @ResponseBody 43 | public Result list(AdTypePageParam ad) { 44 | IPage ads = adService.selectAdList(ad); 45 | return Result.success(ads); 46 | } 47 | 48 | 49 | /** 50 | * 新增保存ad 51 | */ 52 | @PostMapping("/ad") 53 | @ResponseBody 54 | public Result addSave(Ad ad) { 55 | return Result.success(adService.insertAd(ad)); 56 | } 57 | 58 | 59 | /** 60 | * 修改保存ad 61 | */ 62 | @PutMapping("/ad") 63 | @ResponseBody 64 | public Result editSave(Ad ad) { 65 | return Result.success(adService.updateAd(ad)); 66 | } 67 | 68 | /** 69 | * 删除ad 70 | */ 71 | @DeleteMapping("/{adID}") 72 | @ResponseBody 73 | public Result remove(@PathVariable Long adID) { 74 | return Result.success(adService.deleteAdByAdId(adID)); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/controller/AdTypeController.java: -------------------------------------------------------------------------------- 1 | package com.lin.controller; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.lin.dao.pojo.AdType; 5 | import com.lin.service.AdTypeService; 6 | import com.lin.vo.Result; 7 | import com.lin.vo.params.AdTypePageParam; 8 | import com.lin.vo.params.PageParams; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * 广告类型Controller 17 | * 18 | * @author lqw 19 | */ 20 | @Controller 21 | @RequestMapping("/adTypes") 22 | public class AdTypeController { 23 | 24 | @Autowired 25 | private AdTypeService adTypeService; 26 | 27 | 28 | /** 29 | * 查询广告类型列表 30 | */ 31 | @GetMapping("/{adTypeId}") 32 | @ResponseBody 33 | public Result getAdTypeId(@PathVariable Long adTypeId) { 34 | AdType adType = adTypeService.selectAdTypeByAdTyepId(adTypeId); 35 | return Result.success(adType); 36 | } 37 | 38 | 39 | /** 40 | * 查询广告类型列表 41 | */ 42 | @PostMapping("/list") 43 | @ResponseBody 44 | //@RequestBody只能一个 45 | public Result getAsTypeList(@RequestBody AdTypePageParam params) { 46 | IPage adTypeIPage = adTypeService.selectAdTypeList(params); 47 | return Result.success(adTypeIPage); 48 | } 49 | 50 | 51 | /** 52 | * 新增保存广告类型 53 | */ 54 | @PostMapping("/adType") 55 | @ResponseBody 56 | public Result addSave(AdType adType) { 57 | return Result.success(adTypeService.insertAdType(adType)); 58 | } 59 | 60 | 61 | /** 62 | * 修改保存广告类型 63 | */ 64 | @PutMapping("/") 65 | @ResponseBody 66 | public Result editSave(AdType adType) { 67 | return Result.success(adTypeService.updateAdType(adType)); 68 | } 69 | 70 | /** 71 | * 删除广告类型 72 | */ 73 | @DeleteMapping("/{adTypeId}") 74 | @ResponseBody 75 | public Result remove(@PathVariable Long adTypeId) { 76 | return Result.success(adTypeService.deleteAdTypeByAdTyepId(adTypeId)); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/controller/CategoryController.java: -------------------------------------------------------------------------------- 1 | package com.lin.controller; 2 | 3 | import com.lin.vo.Result; 4 | import com.lin.service.CategoryService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | @RestController 12 | @RequestMapping("categorys") 13 | public class CategoryController { 14 | 15 | @Autowired 16 | private CategoryService categoryService; 17 | 18 | 19 | /** 20 | * 写文章 获取文章分类 21 | * 22 | * @return 23 | */ 24 | @GetMapping 25 | public Result categories() { 26 | return categoryService.findAll(); 27 | } 28 | 29 | 30 | /** 31 | * 获取导航栏分类信息 32 | * 33 | * @return 34 | */ 35 | @GetMapping("detail") 36 | public Result categoriesDetail() { 37 | return categoryService.findAllDetail(); 38 | } 39 | 40 | ///category/detail/{id} 41 | 42 | /** 43 | * 显示分类详情 44 | * 45 | * @param id 46 | * @return 47 | */ 48 | @GetMapping("detail/{id}") 49 | public Result categoryDetailById(@PathVariable("id") Long id) { 50 | return categoryService.categoryDetailById(id); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/controller/CommentsController.java: -------------------------------------------------------------------------------- 1 | package com.lin.controller; 2 | 3 | import com.lin.common.aop.LogAnnotation; 4 | import com.lin.vo.Result; 5 | import com.lin.service.CommentsService; 6 | import com.lin.vo.params.CommentParam; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | @RestController 11 | @RequestMapping("comments") 12 | public class CommentsController { 13 | @Autowired 14 | private CommentsService commentsService; 15 | 16 | /** 17 | * 评论 18 | * 19 | * @param id 20 | * @return 21 | */ 22 | @GetMapping("article/{id}") 23 | public Result comments(@PathVariable("id") Long id) { 24 | return commentsService.commentsByArticleId(id); 25 | } 26 | 27 | 28 | @PostMapping("create/change") 29 | @LogAnnotation(module = "评论", operator = "添加评论接口") 30 | public Result comment(@RequestBody CommentParam commentParam) { 31 | return commentsService.comment(commentParam); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/controller/LikeAriticleController.java: -------------------------------------------------------------------------------- 1 | package com.lin.controller; 2 | 3 | import com.lin.common.aop.LogAnnotation; 4 | import com.lin.service.LikeService; 5 | import com.lin.vo.Result; 6 | import com.lin.vo.params.LikeParam; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | @RestController 11 | @RequestMapping("/like") 12 | public class LikeAriticleController { 13 | 14 | @Autowired 15 | LikeService likeService; 16 | 17 | /** 18 | * 查询当前点赞个数 19 | * 20 | * @param likeParam 21 | * @return 22 | */ 23 | @PostMapping("/num") 24 | public Result like(@RequestBody LikeParam likeParam) { 25 | Long num = likeService.findLikeNum(likeParam); 26 | return Result.success(num); 27 | } 28 | 29 | /** 30 | * 改变点赞状态 要文章id,用户id 31 | * 32 | * @param likeParam 33 | * @return 34 | */ 35 | @PostMapping("/islike") 36 | @LogAnnotation(module = "点赞", operator = "添加点赞接口") 37 | public Result islike(@RequestBody LikeParam likeParam) { 38 | boolean flag = likeService.findLike(likeParam); 39 | return Result.success(flag); 40 | } 41 | 42 | /** 43 | * 查询点赞初始状态 要文章id,用户id 44 | * 45 | * @param 46 | * @return 47 | */ 48 | @PostMapping("/initlike") 49 | public Result initlike(@RequestBody LikeParam likeParam) { 50 | boolean flag = likeService.selectLike(likeParam); 51 | return Result.success(flag); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.lin.controller; 2 | 3 | import com.lin.common.aop.LogAnnotation; 4 | import com.lin.common.verificationCode.Captcha; 5 | import com.lin.service.CaptchaService; 6 | import com.lin.vo.CodeVo; 7 | import com.lin.vo.Result; 8 | import com.lin.service.LoginService; 9 | import com.lin.vo.params.LoginParam; 10 | import io.swagger.annotations.ApiOperation; 11 | import org.apache.commons.lang3.StringUtils; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.data.redis.core.StringRedisTemplate; 14 | import org.springframework.web.bind.annotation.*; 15 | 16 | @RestController 17 | @RequestMapping("login") 18 | public class LoginController { 19 | 20 | @Autowired 21 | private LoginService loginService; 22 | 23 | @Autowired 24 | private CaptchaService captchaService; 25 | 26 | @Autowired 27 | private StringRedisTemplate stringRedisTemplate; 28 | 29 | @PostMapping 30 | @ApiOperation("登录接口") 31 | @LogAnnotation(module = "登录", operator = "登录接口") 32 | public Result login(@RequestBody LoginParam loginParam) { 33 | //登录=》 验证用户 =》 访问用户表 34 | return loginService.login(loginParam); 35 | } 36 | 37 | @PostMapping("/checkCode") 38 | @ApiOperation("验证码") 39 | public Result checkCode(@RequestBody Captcha captcha) { 40 | return Result.success(captchaService.getCaptcha(captcha)); 41 | } 42 | 43 | @PostMapping("/checkCheckCode") 44 | @ApiOperation("验证验证码") 45 | @LogAnnotation(module = "登录", operator = "验证验证码接口") 46 | public Result checkCheckCode(@RequestBody CodeVo codeVo) { 47 | String msg = captchaService.checkImageCode(codeVo.getNonceStr(),codeVo.getValue()); 48 | if (StringUtils.isNotBlank(msg)) { 49 | return Result.fail(666,"验证失败"); 50 | }else { 51 | String redisKey = "LOGINCOUNT::USER::LOGINNAME::" + codeVo.getAccount(); 52 | stringRedisTemplate.delete(redisKey); 53 | } 54 | return Result.success("验证成功"); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/controller/LogoutController.java: -------------------------------------------------------------------------------- 1 | package com.lin.controller; 2 | 3 | import com.lin.common.aop.LogAnnotation; 4 | import com.lin.vo.Result; 5 | import com.lin.service.LoginService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.*; 8 | 9 | @RestController 10 | @RequestMapping("logout") 11 | public class LogoutController { 12 | 13 | @Autowired 14 | private LoginService loginService; 15 | 16 | @PostMapping 17 | @LogAnnotation(module = "退出", operator = "登出接口") 18 | public Result logout(@RequestHeader("Authorization") String token) { 19 | return loginService.logout(token); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/controller/RegisterController.java: -------------------------------------------------------------------------------- 1 | package com.lin.controller; 2 | 3 | import com.lin.common.aop.LogAnnotation; 4 | import com.lin.vo.Result; 5 | import com.lin.service.LoginService; 6 | import com.lin.vo.params.LoginParam; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestBody; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | /** 14 | * 注册 15 | */ 16 | @RestController 17 | @RequestMapping("register") 18 | public class RegisterController { 19 | 20 | @Autowired 21 | private LoginService loginService; 22 | 23 | @PostMapping 24 | @LogAnnotation(module = "注册", operator = "注册接口") 25 | public Result register(@RequestBody LoginParam loginParam) { 26 | return loginService.register(loginParam); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/controller/TagsController.java: -------------------------------------------------------------------------------- 1 | package com.lin.controller; 2 | 3 | import com.lin.service.TagService; 4 | import com.lin.vo.Result; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | @RestController 12 | @RequestMapping("tags") 13 | public class TagsController { 14 | @Autowired 15 | private TagService tagService; 16 | 17 | /** 18 | * 最热标签 19 | * 20 | * @return 21 | */ 22 | @GetMapping("hot") 23 | public Result hot() { 24 | int limit = 6; 25 | return tagService.hots(limit); 26 | } 27 | 28 | /** 29 | * 写文章 获取文章标签 30 | * 31 | * @return 32 | */ 33 | @GetMapping 34 | public Result findAll() { 35 | return tagService.findAll(); 36 | } 37 | 38 | /** 39 | * 查询标签详情(只有标签) 40 | * 41 | * @return 42 | */ 43 | @GetMapping("detail") 44 | public Result findAllDetail() { 45 | return tagService.findAllDetail(); 46 | } 47 | 48 | /** 49 | * 查询标签列表 50 | * 51 | * @param id 52 | * @return 53 | */ 54 | @GetMapping("detail/{id}") 55 | public Result findDetailById(@PathVariable("id") Long id) { 56 | return tagService.findDetailById(id); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.lin.controller; 2 | 3 | import com.lin.dao.pojo.SysUser; 4 | import com.lin.utils.UserThreadLocal; 5 | import com.lin.vo.Result; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | @RequestMapping("test") 11 | public class TestController { 12 | 13 | @RequestMapping 14 | public Result test() { 15 | SysUser sysUser = UserThreadLocal.get(); 16 | System.out.println(sysUser); 17 | return Result.success(null); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/controller/UploadController.java: -------------------------------------------------------------------------------- 1 | package com.lin.controller; 2 | 3 | import com.lin.common.aop.LogAnnotation; 4 | import com.lin.utils.QiniuUtils; 5 | import com.lin.vo.Result; 6 | import org.apache.commons.lang3.StringUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.RestController; 12 | import org.springframework.web.multipart.MultipartFile; 13 | 14 | import java.util.UUID; 15 | 16 | @RestController 17 | @RequestMapping("upload") 18 | public class UploadController { 19 | 20 | @Autowired 21 | private QiniuUtils qiniuUtils; 22 | 23 | /** 24 | * 上传图片 25 | * 26 | * @param file 27 | * @return 28 | */ 29 | @PostMapping 30 | @LogAnnotation(module = "OSS", operator = "上传图片接口") 31 | public Result upload(@RequestParam("image") MultipartFile file) { 32 | //原始文件名称 比如 aa.png 33 | String originalFilename = file.getOriginalFilename(); 34 | //唯一的文件名称 StringUtils.substringAfterLast(a,b)把a按b分开,取b后面的值 35 | String fileName = UUID.randomUUID().toString() + "." + StringUtils.substringAfterLast(originalFilename, "."); 36 | 37 | boolean upload = qiniuUtils.upload(file, fileName); 38 | if (upload) { 39 | return Result.success(QiniuUtils.url + fileName); 40 | } 41 | return Result.fail(20001, "上传失败"); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/controller/UsersController.java: -------------------------------------------------------------------------------- 1 | package com.lin.controller; 2 | 3 | import com.lin.common.aop.LogAnnotation; 4 | import com.lin.dao.pojo.SysUser; 5 | import com.lin.service.SysUserService; 6 | import com.lin.vo.Result; 7 | import com.lin.vo.params.UserPatam; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | @RestController 12 | @RequestMapping("users") 13 | public class UsersController { 14 | 15 | @Autowired 16 | private SysUserService sysUserService; 17 | 18 | 19 | /** 20 | * 获取用户信息 21 | * 22 | * @param token:@RequestHeader("Authorization") String token获取头部token 23 | * @return 24 | */ 25 | ///users/currentUser 26 | @GetMapping("currentUser") 27 | public Result currentUser(@RequestHeader("Authorization") String token) { 28 | return sysUserService.findUserByToken(token); 29 | } 30 | 31 | /** 32 | * 根据账户查找用户 33 | * 34 | * @return 35 | */ 36 | @GetMapping("findUserByAccount/{account}") 37 | public Result findUserByAccount(@PathVariable("account") String account) { 38 | SysUser userByAccount = sysUserService.findUserByAccount(account); 39 | userByAccount.setPassword(null); 40 | return Result.success(userByAccount); 41 | } 42 | 43 | /** 44 | * 修改用户信息 45 | */ 46 | @PutMapping("updateUser") 47 | @LogAnnotation(module = "用户信息", operator = "修改用户信息接口") 48 | public Result updateUser(@RequestBody UserPatam userPatam) { 49 | return sysUserService.updateUser(userPatam); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/dos/Archives.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.dos; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Archives { 7 | 8 | private Integer year; 9 | 10 | private Integer month; 11 | 12 | private Long count; 13 | } 14 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/mapper/AdMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.lin.dao.pojo.Ad; 5 | import com.lin.dao.pojo.AdType; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | 9 | /** 10 | * adMapper接口 11 | * @author lqw 12 | */ 13 | public interface AdMapper { 14 | /** 15 | * 查询ad 16 | * 17 | * @param adId ad主键 18 | * @return ad 19 | */ 20 | public Ad selectAdByAdId(Long adId); 21 | 22 | /** 23 | * 查询ad列表 24 | * 25 | * @param ad ad 26 | * @return ad集合 27 | */ 28 | public IPage selectAdList(IPage page,@Param("ad") Ad ad); 29 | 30 | /** 31 | * 新增ad 32 | * 33 | * @param ad ad 34 | * @return 结果 35 | */ 36 | public int insertAd(Ad ad); 37 | 38 | /** 39 | * 修改ad 40 | * 41 | * @param ad ad 42 | * @return 结果 43 | */ 44 | public int updateAd(Ad ad); 45 | 46 | /** 47 | * 删除ad 48 | * 49 | * @param adId ad主键 50 | * @return 结果 51 | */ 52 | public int deleteAdByAdId(Long adId); 53 | 54 | 55 | 56 | /** 57 | * 通过广告类型信息删除同类型广告 58 | * 59 | * @param adId adID 60 | * @return 结果 61 | */ 62 | public int deleteAdTypeByAdTyepId(Long adId); 63 | } 64 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/mapper/AdTypeMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.lin.dao.pojo.AdType; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 广告类型Mapper接口 11 | * 12 | * @author lqw 13 | */ 14 | public interface AdTypeMapper 15 | { 16 | /** 17 | * 查询广告类型 18 | * 19 | * @param adTyepId 广告类型主键 20 | * @return 广告类型 21 | */ 22 | public AdType selectAdTypeByAdTyepId(Long adTyepId); 23 | 24 | /** 25 | * 查询广告类型列表 26 | * 27 | * @param adType 广告类型 28 | * @return 广告类型集合 29 | */ 30 | public IPage selectAdTypeList(IPage page,@Param("adType") AdType adType); 31 | 32 | /** 33 | * 新增广告类型 34 | * 35 | * @param adType 广告类型 36 | * @return 结果 37 | */ 38 | public int insertAdType(AdType adType); 39 | 40 | /** 41 | * 修改广告类型 42 | * 43 | * @param adType 广告类型 44 | * @return 结果 45 | */ 46 | public int updateAdType(AdType adType); 47 | 48 | /** 49 | * 删除广告类型 50 | * 51 | * @param adTyepId 广告类型主键 52 | * @return 结果 53 | */ 54 | public int deleteAdTypeByAdTyepId(Long adTyepId); 55 | 56 | } 57 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/mapper/ArticleBodyMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.dao.pojo.ArticleBody; 5 | 6 | public interface ArticleBodyMapper extends BaseMapper { 7 | } 8 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/mapper/ArticleMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.lin.dao.dos.Archives; 7 | import com.lin.dao.pojo.Article; 8 | 9 | import java.util.List; 10 | 11 | public interface ArticleMapper extends BaseMapper
{ 12 | 13 | 14 | List listArchives(); 15 | 16 | 17 | IPage
listArticle(Page
page, 18 | Long categoryId, 19 | Long tagId, 20 | String year, 21 | String month, 22 | String keyWord); 23 | 24 | /** 25 | * 修改文章是否可用 26 | * 27 | * @param articleId 28 | * @return 29 | */ 30 | boolean updateAvailableById(Long articleId); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/mapper/ArticleTagMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.dao.pojo.ArticleTag; 5 | 6 | public interface ArticleTagMapper extends BaseMapper { 7 | } 8 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/mapper/CategoryMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.dao.pojo.Category; 5 | 6 | public interface CategoryMapper extends BaseMapper { 7 | } 8 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/mapper/CommentMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.dao.pojo.Comment; 5 | 6 | public interface CommentMapper extends BaseMapper { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/mapper/OpenaiAnswersMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.dao.pojo.OpenaiAnswers; 5 | 6 | public interface OpenaiAnswersMapper extends BaseMapper { 7 | } 8 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/mapper/SysUserMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.dao.pojo.SysUser; 5 | 6 | public interface SysUserMapper extends BaseMapper { 7 | } 8 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/mapper/TagMapper.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lin.dao.pojo.Tag; 5 | 6 | import java.util.List; 7 | 8 | public interface TagMapper extends BaseMapper { 9 | /** 10 | * 根据文章id查询标签列表 11 | * 12 | * @param articleId 13 | * @return 14 | */ 15 | List findTagsByArticleId(Long articleId); 16 | 17 | /** 18 | * 查询最热的标签的id 前n条 19 | * 20 | * @param limit 21 | * @return 22 | */ 23 | List findHotsTagIds(int limit); 24 | 25 | /** 26 | * 根据id返回最热标签名称 27 | * 28 | * @param tagIds 29 | * @return 30 | */ 31 | List findTagsByTagIds(List tagIds); 32 | } 33 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/pojo/Article.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.pojo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Article { 7 | 8 | public static final int Article_TOP = 1; 9 | 10 | public static final int Article_Common = 0; 11 | 12 | private Long id; 13 | 14 | private String title; 15 | 16 | private String summary; 17 | 18 | private Integer commentCounts; 19 | 20 | private Integer viewCounts; 21 | 22 | /** 23 | * 作者id 24 | */ 25 | private Long authorId; 26 | /** 27 | * 内容id 28 | */ 29 | private Long bodyId; 30 | /** 31 | * 类别id 32 | */ 33 | private Long categoryId; 34 | 35 | /** 36 | * 置顶 37 | */ 38 | private Integer weight; 39 | 40 | 41 | /** 42 | * 创建时间 43 | */ 44 | private Long createDate; 45 | 46 | /** 47 | * 点赞数 48 | */ 49 | private Long likeUserCount; 50 | 51 | /** 52 | * 是否可用 53 | */ 54 | private Long available; 55 | } 56 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/pojo/ArticleBody.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.pojo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ArticleBody { 7 | 8 | private Long id; 9 | private String content; 10 | private String contentHtml; 11 | private Long articleId; 12 | } 13 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/pojo/ArticleTag.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.pojo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ArticleTag { 7 | 8 | private Long id; 9 | 10 | private Long articleId; 11 | 12 | private Long tagId; 13 | } 14 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/pojo/Category.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.pojo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Category { 7 | 8 | private Long id; 9 | 10 | private String avatar; 11 | 12 | private String categoryName; 13 | 14 | private String description; 15 | } 16 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/pojo/Comment.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.pojo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Comment { 7 | 8 | private Long id; 9 | 10 | private String content; 11 | 12 | private Long createDate; 13 | 14 | private Long articleId; 15 | 16 | private Long authorId; 17 | 18 | private Long parentId; 19 | 20 | private Long toUid; 21 | 22 | private Integer level; 23 | } 24 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/pojo/OpenaiAnswers.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.pojo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class OpenaiAnswers { 7 | private Long id; 8 | 9 | private String articleId; 10 | 11 | private String answer; 12 | } 13 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/pojo/SysUser.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import lombok.Data; 6 | 7 | @Data 8 | public class SysUser { 9 | 10 | // @TableId(type = IdType.ASSIGN_ID) // 默认id类型 (雪花算法) 11 | // @TableId(type = IdType.AUTO) 数据库自增 12 | private Long id; 13 | 14 | private String account; 15 | 16 | private Integer admin; 17 | 18 | private String avatar; 19 | 20 | private Long createDate; 21 | 22 | private Integer deleted; 23 | 24 | private String email; 25 | 26 | private Long lastLogin; 27 | 28 | private String mobilePhoneNumber; 29 | 30 | private String nickname; 31 | 32 | private String password; 33 | 34 | private String salt; 35 | 36 | private String status; 37 | 38 | private String birthday; 39 | 40 | private String ip; 41 | /** 42 | * 性别 0;未知 1:男 2:女 43 | */ 44 | private Long sex; 45 | 46 | private String openid; 47 | } 48 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/dao/pojo/Tag.java: -------------------------------------------------------------------------------- 1 | package com.lin.dao.pojo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Tag { 7 | 8 | private Long id; 9 | 10 | private String avatar; 11 | 12 | private String tagName; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/handler/AllExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.lin.handler; 2 | 3 | import com.lin.vo.Result; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.web.bind.annotation.ControllerAdvice; 6 | import org.springframework.web.bind.annotation.ExceptionHandler; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | 9 | //对加了@Controller注解的方法进行拦截处理 AOP的实现 10 | @ControllerAdvice 11 | @Slf4j 12 | public class AllExceptionHandler { 13 | //进行异常处理,处理Exception.class的异常 14 | @ExceptionHandler(Exception.class) 15 | @ResponseBody //返回json数据 16 | public Result doException(Exception ex) { 17 | //打印异常堆栈信息 18 | ex.printStackTrace(); 19 | log.error(String.valueOf(ex)); 20 | return Result.fail(520, "系统维护中"); 21 | } 22 | 23 | //进行异常处理,处理ServiceException.class的异常 24 | @ExceptionHandler(ServiceException.class) 25 | @ResponseBody //返回json数据 26 | public Result doServiceException(ServiceException ex) { 27 | // ex.printStackTrace(); 28 | log.error(String.valueOf(ex)); 29 | return Result.fail(521, "请勿频繁操作"); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/handler/ServiceException.java: -------------------------------------------------------------------------------- 1 | package com.lin.handler; 2 | 3 | public final class ServiceException extends RuntimeException{ 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | /** 8 | * 错误码 9 | */ 10 | private Integer code; 11 | 12 | /** 13 | * 错误提示 14 | */ 15 | private String message; 16 | 17 | /** 18 | * 错误明细,内部调试错误 19 | * 20 | * 21 | */ 22 | private String detailMessage; 23 | 24 | /** 25 | * 空构造方法,避免反序列化问题 26 | */ 27 | public ServiceException() {} 28 | 29 | public ServiceException(String message) { 30 | this.message = message; 31 | } 32 | 33 | public ServiceException(String message, Integer code) { 34 | this.message = message; 35 | this.code = code; 36 | } 37 | 38 | public String getDetailMessage() { 39 | return detailMessage; 40 | } 41 | 42 | @Override 43 | public String getMessage() { 44 | return message; 45 | } 46 | 47 | public Integer getCode() { 48 | return code; 49 | } 50 | 51 | public ServiceException setMessage(String message) { 52 | this.message = message; 53 | return this; 54 | } 55 | 56 | public ServiceException setDetailMessage(String detailMessage) { 57 | this.detailMessage = detailMessage; 58 | return this; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/service/AdService.java: -------------------------------------------------------------------------------- 1 | package com.lin.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.lin.dao.pojo.Ad; 5 | import com.lin.vo.params.AdTypePageParam; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * adService接口 11 | * 12 | * @author lqw 13 | * @date 2022-12-06 14 | */ 15 | public interface AdService { 16 | /** 17 | * 查询ad 18 | * 19 | * @param adId ad主键 20 | * @return ad 21 | */ 22 | public Ad selectAdByAdId(Long adId); 23 | 24 | /** 25 | * 查询ad列表 26 | * 27 | * @param ad ad 28 | * @return ad集合 29 | */ 30 | public IPage selectAdList(AdTypePageParam ad); 31 | 32 | /** 33 | * 新增ad 34 | * 35 | * @param ad ad 36 | * @return 结果 37 | */ 38 | public int insertAd(Ad ad); 39 | 40 | /** 41 | * 修改ad 42 | * 43 | * @param ad ad 44 | * @return 结果 45 | */ 46 | public int updateAd(Ad ad); 47 | 48 | 49 | /** 50 | * 删除ad信息 51 | * 52 | * @param adId ad主键 53 | * @return 结果 54 | */ 55 | public int deleteAdByAdId(Long adId); 56 | } 57 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/service/AdTypeService.java: -------------------------------------------------------------------------------- 1 | package com.lin.service; 2 | 3 | import java.util.List; 4 | 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.lin.dao.pojo.AdType; 7 | import com.lin.vo.params.AdTypePageParam; 8 | import com.lin.vo.params.PageParams; 9 | import org.springframework.data.domain.Page; 10 | 11 | /** 12 | * 广告类型Service接口 13 | * 14 | * @author lqw 15 | */ 16 | public interface AdTypeService { 17 | /** 18 | * 查询广告类型 19 | * 20 | * @param adTyepId 广告类型主键 21 | * @return 广告类型 22 | */ 23 | public AdType selectAdTypeByAdTyepId(Long adTyepId); 24 | 25 | /** 26 | * 查询广告类型列表 27 | * 28 | * @param adType 广告类型 29 | * @return 广告类型集合 30 | */ 31 | public IPage selectAdTypeList(AdTypePageParam params); 32 | 33 | /** 34 | * 新增广告类型 35 | * 36 | * @param adType 广告类型 37 | * @return 结果 38 | */ 39 | public int insertAdType(AdType adType); 40 | 41 | /** 42 | * 修改广告类型 43 | * 44 | * @param adType 广告类型 45 | * @return 结果 46 | */ 47 | public int updateAdType(AdType adType); 48 | 49 | 50 | /** 51 | * 删除广告类型信息 52 | * 53 | * @param adTyepId 广告类型主键 54 | * @return 结果 55 | */ 56 | public int deleteAdTypeByAdTyepId(Long adTyepId); 57 | } 58 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/service/ArticleService.java: -------------------------------------------------------------------------------- 1 | package com.lin.service; 2 | 3 | import com.lin.vo.Result; 4 | import com.lin.vo.params.ArticleParam; 5 | import com.lin.vo.params.PageParams; 6 | import com.lin.vo.params.PageSearchParams; 7 | 8 | import java.io.IOException; 9 | 10 | public interface ArticleService { 11 | /** 12 | * 分页查询 文章列表 13 | * 14 | * @param pageParams 15 | * @return 16 | */ 17 | Result listArticle(PageParams pageParams); 18 | 19 | /** 20 | * 分页查询 文章列表 21 | * 22 | * @param pageSearchParams 23 | * @return 24 | */ 25 | Result listSearchArticle(PageSearchParams pageSearchParams); 26 | 27 | /** 28 | * 最热文章 29 | * 30 | * @param limit 31 | * @return 32 | */ 33 | Result hotArticle(int limit); 34 | 35 | /** 36 | * 最新文章 37 | * 38 | * @param limit 39 | * @return 40 | */ 41 | Result newArticles(int limit); 42 | 43 | /** 44 | * 文章归档 45 | * 46 | * @return 47 | */ 48 | Result listArchives(); 49 | 50 | /** 51 | * 查看文章详情 52 | * 53 | * @param articleId 54 | * @return 55 | */ 56 | Result findArticleById(Long articleId); 57 | 58 | /** 59 | * 文章发布服务 60 | * 61 | * @param articleParam 62 | * @return 63 | */ 64 | Result publish(ArticleParam articleParam) throws IOException; 65 | 66 | Result delAticleById(Long articleId); 67 | 68 | Result searchArticle(String search); 69 | } 70 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/service/CaptchaService.java: -------------------------------------------------------------------------------- 1 | package com.lin.service; 2 | 3 | import com.lin.common.verificationCode.Captcha; 4 | 5 | 6 | public interface CaptchaService { 7 | 8 | String checkImageCode(String imageKey, String imageCode); 9 | 10 | Object getCaptcha(Captcha captcha); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/service/CategoryService.java: -------------------------------------------------------------------------------- 1 | package com.lin.service; 2 | 3 | import com.lin.vo.CategoryVo; 4 | import com.lin.vo.Result; 5 | 6 | public interface CategoryService { 7 | 8 | CategoryVo findCategoryById(Long categoryId); 9 | 10 | Result findAll(); 11 | 12 | Result findAllDetail(); 13 | 14 | Result categoryDetailById(Long id); 15 | } 16 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/service/CommentsService.java: -------------------------------------------------------------------------------- 1 | package com.lin.service; 2 | 3 | import com.lin.vo.Result; 4 | import com.lin.vo.params.CommentParam; 5 | 6 | public interface CommentsService { 7 | /** 8 | * 根据文章id 查询所有的评论列表 9 | * 10 | * @param id 11 | * @return 12 | */ 13 | Result commentsByArticleId(Long id); 14 | 15 | Result comment(CommentParam commentParam); 16 | } 17 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/service/LikeService.java: -------------------------------------------------------------------------------- 1 | package com.lin.service; 2 | 3 | 4 | import com.lin.vo.params.LikeParam; 5 | 6 | public interface LikeService { 7 | 8 | 9 | Long findLikeNum(LikeParam likeParam); 10 | 11 | boolean findLike(LikeParam likeParam); 12 | 13 | boolean selectLike(LikeParam likeParam); 14 | } 15 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/service/LoginService.java: -------------------------------------------------------------------------------- 1 | package com.lin.service; 2 | 3 | import com.lin.vo.Result; 4 | import com.lin.dao.pojo.SysUser; 5 | import com.lin.vo.params.LoginParam; 6 | 7 | public interface LoginService { 8 | /** 9 | * 登录功能 10 | * 11 | * @param loginParam 12 | * @return 13 | */ 14 | Result login(LoginParam loginParam); 15 | 16 | SysUser checkToken(String token); 17 | 18 | /** 19 | * 退出登录 20 | * 21 | * @param token 22 | * @return 23 | */ 24 | Result logout(String token); 25 | 26 | /** 27 | * 注册 28 | * 29 | * @param loginParam 30 | * @return 31 | */ 32 | Result register(LoginParam loginParam); 33 | } 34 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/service/OpenAIService.java: -------------------------------------------------------------------------------- 1 | package com.lin.service; 2 | 3 | import java.io.IOException; 4 | 5 | public interface OpenAIService { 6 | String doChatGPT(String question) throws IOException; 7 | 8 | void generateAnswers(String content, Long id, Boolean isEdit) throws IOException; 9 | } 10 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/service/SysUserService.java: -------------------------------------------------------------------------------- 1 | package com.lin.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.lin.vo.Result; 5 | import com.lin.vo.UserVo; 6 | import com.lin.dao.pojo.SysUser; 7 | import com.lin.vo.params.UserPatam; 8 | 9 | public interface SysUserService { 10 | 11 | UserVo findUserVoById(Long id); 12 | 13 | SysUser findUserById(Long id); 14 | 15 | /** 16 | * 根据openID查是否有用户存在 17 | * 18 | * @param openId 19 | * @return 20 | */ 21 | SysUser findUserByOpenId(String openId); 22 | 23 | SysUser findUser(String account, String password); 24 | 25 | /** 26 | * 根据token查询用户信息 27 | * 28 | * @param token 29 | * @return 30 | */ 31 | Result findUserByToken(String token); 32 | 33 | /** 34 | * 根据账户查找用户 35 | * 36 | * @param account 37 | * @return 38 | */ 39 | SysUser findUserByAccount(String account); 40 | 41 | /** 42 | * 保存用户 43 | * 44 | * @param sysUser 45 | */ 46 | void save(SysUser sysUser); 47 | 48 | void updateLastlogin(SysUser sysUser); 49 | 50 | Result updateUser(UserPatam userPatam); 51 | } 52 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/service/TagService.java: -------------------------------------------------------------------------------- 1 | package com.lin.service; 2 | 3 | import com.lin.vo.Result; 4 | import com.lin.vo.TagVo; 5 | 6 | import java.util.List; 7 | 8 | public interface TagService { 9 | 10 | /** 11 | * 查询对应文章的标签 12 | * 13 | * @param articleId 14 | * @return 15 | */ 16 | List findTagsByArticleId(Long articleId); 17 | 18 | /** 19 | * 最热标签 20 | * 21 | * @param limit 22 | * @return 23 | */ 24 | Result hots(int limit); 25 | 26 | /** 27 | * 查询所有的文章标签 28 | * 29 | * @return 30 | */ 31 | Result findAll(); 32 | 33 | Result findAllDetail(); 34 | 35 | Result findDetailById(Long id); 36 | } 37 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/service/ThreadService.java: -------------------------------------------------------------------------------- 1 | package com.lin.service; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 4 | import com.lin.dao.mapper.ArticleMapper; 5 | import com.lin.dao.pojo.Article; 6 | import org.springframework.scheduling.annotation.Async; 7 | import org.springframework.stereotype.Component; 8 | 9 | @Component 10 | public class ThreadService { 11 | 12 | //期望此操作在线程池 执行 不会影响原有的主线程、用于更新阅读数 13 | @Async("taskExecutor") 14 | public void updateArticleViewCount(ArticleMapper articleMapper, Article article) { 15 | 16 | int viewCounts = article.getViewCounts(); 17 | Article articleUpdate = new Article(); 18 | articleUpdate.setViewCounts(viewCounts + 1); 19 | LambdaUpdateWrapper
updateWrapper = new LambdaUpdateWrapper<>(); 20 | updateWrapper.eq(Article::getId, article.getId()); 21 | //设置一个 为了在多线程的环境下 线程安全 22 | updateWrapper.eq(Article::getViewCounts, viewCounts); 23 | // update article set view_count=100 where view_count=99 and id=11 版本控制 24 | articleMapper.update(articleUpdate, updateWrapper); 25 | // try { 26 | // Thread.sleep(5000); 27 | // System.out.println("更新完成了...."); 28 | // } catch (InterruptedException e) { 29 | // e.printStackTrace(); 30 | // } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/service/impl/LikeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.lin.service.impl; 2 | 3 | import com.lin.service.LikeService; 4 | import com.lin.vo.params.LikeParam; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | 7 | import org.springframework.data.redis.core.StringRedisTemplate; 8 | import org.springframework.stereotype.Service; 9 | 10 | 11 | @Service 12 | public class LikeServiceImpl implements LikeService { 13 | @Autowired 14 | StringRedisTemplate redisTemplate; 15 | 16 | @Override 17 | public Long findLikeNum(LikeParam likeParam) { 18 | //计算集合大小 19 | Long size = redisTemplate.opsForSet().size("articleId_" + likeParam.getArticleId()); 20 | return size; 21 | } 22 | 23 | /** 24 | * 点赞后 25 | * 26 | * @param likeParam 27 | * @return 28 | */ 29 | @Override 30 | public boolean findLike(LikeParam likeParam) { 31 | boolean bl; 32 | boolean flag = redisTemplate.opsForSet().isMember("articleId_" + likeParam.getArticleId(), likeParam.getUserId()); 33 | if (flag) { 34 | redisTemplate.opsForSet().remove("articleId_" + likeParam.getArticleId(), likeParam.getUserId()); 35 | bl = false; 36 | } else { 37 | redisTemplate.opsForSet().add("articleId_" + likeParam.getArticleId(), likeParam.getUserId()); 38 | bl = true; 39 | } 40 | return bl; 41 | } 42 | 43 | /** 44 | * 初始查询 45 | */ 46 | @Override 47 | public boolean selectLike(LikeParam likeParam) { 48 | boolean flag = redisTemplate.opsForSet().isMember("articleId_" + likeParam.getArticleId(), likeParam.getUserId()); 49 | return flag; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/service/mq/ArticleListener.java: -------------------------------------------------------------------------------- 1 | package com.lin.service.mq; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.lin.service.ArticleService; 5 | import com.lin.vo.ArticleMessage; 6 | import com.lin.vo.Result; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.apache.commons.codec.digest.DigestUtils; 9 | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; 10 | import org.apache.rocketmq.spring.core.RocketMQListener; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.data.redis.core.StringRedisTemplate; 13 | import org.springframework.stereotype.Component; 14 | 15 | import java.time.Duration; 16 | import java.util.Set; 17 | 18 | 19 | @Slf4j 20 | @Component 21 | @RocketMQMessageListener(topic = "api-update-article", 22 | selectorExpression = "SEND_ARTICLE_MSG", 23 | consumerGroup = "api-update-article-group") 24 | public class ArticleListener implements RocketMQListener { 25 | 26 | @Autowired 27 | private ArticleService articleService; 28 | @Autowired 29 | private StringRedisTemplate redisTemplate; 30 | 31 | @Override 32 | public void onMessage(ArticleMessage articleMessage) { 33 | log.info("收到的消息:{}", articleMessage); 34 | //1. 更新查看文章详情的缓存 35 | Long articleId = articleMessage.getArticleId(); 36 | String params = DigestUtils.md5Hex(articleId.toString()); 37 | String redisKey = "view_article::ArticleController::findArticleById::" + params; 38 | //查询文章数据,从线程中修改阅读数,并返回对应vo 39 | Result articleResult = articleService.findArticleById(articleId); 40 | //修改对应key的values的值 41 | redisTemplate.opsForValue().set(redisKey, JSON.toJSONString(articleResult), Duration.ofMillis(5 * 60 * 1000)); 42 | log.info("更新了缓存:{}", redisKey); 43 | //2. 文章列表的缓存 不知道参数,解决办法 直接删除缓存 44 | Set keys = redisTemplate.keys("listArticle*"); 45 | keys.forEach(s -> { 46 | redisTemplate.delete(s); 47 | log.info("删除了文章列表的缓存:{}", s); 48 | }); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/task/ScheduleTask.java: -------------------------------------------------------------------------------- 1 | package com.lin.task; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 4 | import com.lin.dao.mapper.ArticleMapper; 5 | import com.lin.dao.pojo.Article; 6 | import com.lin.service.impl.LikeServiceImpl; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.data.redis.core.BoundSetOperations; 10 | import org.springframework.data.redis.core.StringRedisTemplate; 11 | import org.springframework.scheduling.annotation.Scheduled; 12 | import org.springframework.stereotype.Component; 13 | 14 | import java.text.SimpleDateFormat; 15 | import java.util.Date; 16 | import java.util.Set; 17 | 18 | 19 | @Component 20 | @Slf4j 21 | public class ScheduleTask { 22 | 23 | @Autowired 24 | StringRedisTemplate redisTemplate; 25 | @Autowired 26 | private ArticleMapper articleMapper; 27 | 28 | // @Scheduled(cron = "0/3 * * * * ? ") 29 | public void redisLikeDataToMysql() { 30 | // SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 31 | // log.info("time:{},开始执行Redis数据持久化到MySQL任务", df.format(new Date())); 32 | // //根据articleId_查找key 33 | // Set keys = redisTemplate.keys("articleId_*"); 34 | // assert keys != null; 35 | // for (String key : keys) { 36 | // //切割articleId_,留下有效的文章id 37 | // String[] articleIdKeys = key.split("articleId_"); 38 | // //文章id 39 | // String articleIdKey = articleIdKeys[1]; 40 | // BoundSetOperations setOperations = redisTemplate.boundSetOps(key); 41 | // Article articleUpdate = new Article(); 42 | // //setOperations.size()点赞数 43 | // articleUpdate.setLikeUserCount(setOperations.size()); 44 | // LambdaUpdateWrapper
updateWrapper = new LambdaUpdateWrapper<>(); 45 | // //文章id相等的时候 46 | // updateWrapper.eq(Article::getBodyId,articleIdKey); 47 | // articleMapper.update(articleUpdate,updateWrapper); 48 | //集合 49 | // System.out.println(setOperations.members()); 50 | // } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/utils/ConstantPropertiesUtil.java: -------------------------------------------------------------------------------- 1 | package com.lin.utils; 2 | 3 | import org.springframework.beans.factory.InitializingBean; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class ConstantPropertiesUtil implements InitializingBean { 9 | 10 | @Value("${wx.open.app_id}") 11 | private String appId; 12 | 13 | @Value("${wx.open.app_secret}") 14 | private String appSecret; 15 | 16 | @Value("${wx.open.redirect_url}") 17 | private String redirectUrl; 18 | 19 | @Value("${yygh.baseUrl}") 20 | private String yyghBaseUrl; 21 | 22 | public static String WX_OPEN_APP_ID; 23 | public static String WX_OPEN_APP_SECRET; 24 | public static String WX_OPEN_REDIRECT_URL; 25 | 26 | public static String YYGH_BASE_URL; 27 | 28 | @Override 29 | public void afterPropertiesSet() throws Exception { 30 | WX_OPEN_APP_ID = appId; 31 | WX_OPEN_APP_SECRET = appSecret; 32 | WX_OPEN_REDIRECT_URL = redirectUrl; 33 | YYGH_BASE_URL = yyghBaseUrl; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/utils/HttpContextUtils.java: -------------------------------------------------------------------------------- 1 | package com.lin.utils; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.stereotype.Component; 5 | import org.springframework.web.context.request.RequestContextHolder; 6 | import org.springframework.web.context.request.ServletRequestAttributes; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | 10 | /** 11 | * HttpServletRequest 12 | */ 13 | public class HttpContextUtils { 14 | 15 | public static HttpServletRequest getHttpServletRequest() { 16 | return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/utils/IpUtils.java: -------------------------------------------------------------------------------- 1 | package com.lin.utils; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.apache.commons.lang3.StringUtils; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | 8 | /** 9 | * 获取Ip 10 | */ 11 | @Slf4j 12 | public class IpUtils { 13 | 14 | /** 15 | * 获取IP地址 16 | *

17 | * 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址 18 | * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址 19 | */ 20 | public static String getIpAddr(HttpServletRequest request) { 21 | String ip = null, unknown = "unknown", seperator = ","; 22 | int maxLength = 15; 23 | try { 24 | ip = request.getHeader("x-forwarded-for"); 25 | if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { 26 | ip = request.getHeader("Proxy-Client-IP"); 27 | } 28 | if (StringUtils.isEmpty(ip) || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) { 29 | ip = request.getHeader("WL-Proxy-Client-IP"); 30 | } 31 | if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { 32 | ip = request.getHeader("HTTP_CLIENT_IP"); 33 | } 34 | if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { 35 | ip = request.getHeader("HTTP_X_FORWARDED_FOR"); 36 | } 37 | if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { 38 | ip = request.getRemoteAddr(); 39 | } 40 | } catch (Exception e) { 41 | log.error("IpUtils ERROR ", e); 42 | } 43 | 44 | // 使用代理,则获取第一个IP地址 45 | if (StringUtils.isEmpty(ip) && ip.length() > maxLength) { 46 | int idx = ip.indexOf(seperator); 47 | if (idx > 0) { 48 | ip = ip.substring(0, idx); 49 | } 50 | } 51 | 52 | return ip; 53 | } 54 | 55 | /** 56 | * 获取ip地址 57 | * 58 | * @return 59 | */ 60 | public static String getIpAddr() { 61 | HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); 62 | return getIpAddr(request); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/utils/JWTUtils.java: -------------------------------------------------------------------------------- 1 | package com.lin.utils; 2 | 3 | import io.jsonwebtoken.Jwt; 4 | import io.jsonwebtoken.JwtBuilder; 5 | import io.jsonwebtoken.Jwts; 6 | import io.jsonwebtoken.SignatureAlgorithm; 7 | 8 | import java.util.Date; 9 | import java.util.HashMap; 10 | import java.util.Map; 11 | 12 | public class JWTUtils { 13 | 14 | private static final String jwtToken = "5054lansufang!@@!$%&"; 15 | 16 | public static String createToken(Long userId) { 17 | Map claims = new HashMap<>(); 18 | claims.put("userId", userId); 19 | JwtBuilder jwtBuilder = Jwts.builder() 20 | .signWith(SignatureAlgorithm.HS256, jwtToken) // 签发算法,秘钥为jwtToken 21 | .setClaims(claims) // body数据,要唯一,自行设置 22 | .setIssuedAt(new Date()) // 设置签发时间 23 | .setExpiration(new Date(System.currentTimeMillis() + 24 * 60 * 60 * 60 * 1000));// 一天的有效时间 24 | String token = jwtBuilder.compact(); 25 | return token; 26 | } 27 | 28 | public static Map checkToken(String token) { 29 | try { 30 | Jwt parse = Jwts.parser().setSigningKey(jwtToken).parse(token); 31 | return (Map) parse.getBody(); 32 | } catch (Exception e) { 33 | e.printStackTrace(); 34 | } 35 | return null; 36 | } 37 | 38 | public static void main(String[] args) { 39 | String token = JWTUtils.createToken(1404446129264832513L); 40 | System.out.println(token); 41 | Map map = JWTUtils.checkToken("eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NTQzOTM3NzgsInVzZXJJZCI6bnVsbCwiaWF0IjoxNjUzNTA0NzQ1fQ.4Wijgjv7k3R7nJFJ_23flkNXKSxEst7xE2PSGlL22Y0"); 42 | System.out.println(map.get("userId")); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/utils/QiniuUtils.java: -------------------------------------------------------------------------------- 1 | package com.lin.utils; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.qiniu.http.Response; 5 | import com.qiniu.storage.Configuration; 6 | import com.qiniu.storage.Region; 7 | import com.qiniu.storage.UploadManager; 8 | import com.qiniu.storage.model.DefaultPutRet; 9 | import com.qiniu.util.Auth; 10 | import org.apache.commons.lang3.StringUtils; 11 | import org.springframework.beans.factory.annotation.Value; 12 | import org.springframework.stereotype.Component; 13 | import org.springframework.web.multipart.MultipartFile; 14 | 15 | @Component 16 | public class QiniuUtils { 17 | 18 | public static final String url = "http://rjoaw9l4w.hn-bkt.clouddn.com/"; 19 | 20 | @Value("${qiniu.name}") 21 | private String name; 22 | 23 | @Value("${qiniu.accessKey}") 24 | private String accessKey; 25 | @Value("${qiniu.accessSecretKey}") 26 | private String accessSecretKey; 27 | 28 | public boolean upload(MultipartFile file, String fileName) { 29 | 30 | //构造一个带指定 Region 对象的配置类 修改指定地点 31 | Configuration cfg = new Configuration(Region.huanan()); 32 | //...其他参数参考类注释 33 | UploadManager uploadManager = new UploadManager(cfg); 34 | //...生成上传凭证,然后准备上传 35 | String bucket = name; 36 | //默认不指定key的情况下,以文件内容的hash值作为文件名 37 | try { 38 | byte[] uploadBytes = file.getBytes(); 39 | Auth auth = Auth.create(accessKey, accessSecretKey); 40 | String upToken = auth.uploadToken(bucket); 41 | Response response = uploadManager.put(uploadBytes, fileName, upToken); 42 | //解析上传成功的结果 43 | DefaultPutRet putRet = JSON.parseObject(response.bodyString(), DefaultPutRet.class); 44 | return true; 45 | } catch (Exception ex) { 46 | ex.printStackTrace(); 47 | } 48 | return false; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/utils/UserThreadLocal.java: -------------------------------------------------------------------------------- 1 | package com.lin.utils; 2 | 3 | import com.lin.dao.pojo.SysUser; 4 | 5 | public class UserThreadLocal { 6 | 7 | private UserThreadLocal() { 8 | } 9 | 10 | //线程变量隔离 11 | private static final ThreadLocal LOCAL = new ThreadLocal<>(); 12 | 13 | //存user 14 | public static void put(SysUser sysUser) { 15 | LOCAL.set(sysUser); 16 | } 17 | 18 | //取user 19 | public static SysUser get() { 20 | return LOCAL.get(); 21 | } 22 | 23 | //移除user 24 | public static void remove() { 25 | LOCAL.remove(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/utils/text/CharsetKit.java: -------------------------------------------------------------------------------- 1 | package com.lin.utils.text; 2 | 3 | import java.nio.charset.Charset; 4 | import java.nio.charset.StandardCharsets; 5 | 6 | /** 7 | * 字符集工具类 8 | * 9 | * @author lqw 10 | */ 11 | public class CharsetKit { 12 | 13 | /** ISO-8859-1 */ 14 | public static final String ISO_8859_1 = "ISO-8859-1"; 15 | /** UTF-8 */ 16 | public static final String UTF_8 = "UTF-8"; 17 | /** GBK */ 18 | public static final String GBK = "GBK"; 19 | 20 | /** ISO-8859-1 */ 21 | public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1); 22 | /** UTF-8 */ 23 | public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8); 24 | /** GBK */ 25 | public static final Charset CHARSET_GBK = Charset.forName(GBK); 26 | 27 | /** 28 | * 转换为Charset对象 29 | * 30 | * @param charset 字符集,为空则返回默认字符集 31 | * @return Charset 32 | */ 33 | public static Charset charset(String charset) 34 | { 35 | return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset); 36 | } 37 | 38 | /** 39 | * 转换字符串的字符集编码 40 | * 41 | * @param source 字符串 42 | * @param srcCharset 源字符集,默认ISO-8859-1 43 | * @param destCharset 目标字符集,默认UTF-8 44 | * @return 转换后的字符集 45 | */ 46 | public static String convert(String source, String srcCharset, String destCharset) 47 | { 48 | return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); 49 | } 50 | 51 | /** 52 | * 转换字符串的字符集编码 53 | * 54 | * @param source 字符串 55 | * @param srcCharset 源字符集,默认ISO-8859-1 56 | * @param destCharset 目标字符集,默认UTF-8 57 | * @return 转换后的字符集 58 | */ 59 | public static String convert(String source, Charset srcCharset, Charset destCharset) 60 | { 61 | if (null == srcCharset) 62 | { 63 | srcCharset = StandardCharsets.ISO_8859_1; 64 | } 65 | 66 | if (null == destCharset) 67 | { 68 | destCharset = StandardCharsets.UTF_8; 69 | } 70 | 71 | if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) 72 | { 73 | return source; 74 | } 75 | return new String(source.getBytes(srcCharset), destCharset); 76 | } 77 | 78 | /** 79 | * @return 系统字符集编码 80 | */ 81 | public static String systemCharset() 82 | { 83 | return Charset.defaultCharset().name(); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/ArticleBodyVo.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ArticleBodyVo { 7 | 8 | private String content; 9 | } 10 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/ArticleMessage.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class ArticleMessage implements Serializable { 9 | private Long articleId; 10 | } 11 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/ArticleVo.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo; 2 | 3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | public class ArticleVo { 11 | 12 | // @JsonSerialize(using = ToStringSerializer.class) 13 | private String id; 14 | 15 | private String title; 16 | 17 | private String summary; 18 | 19 | private Integer commentCounts; 20 | 21 | private Integer viewCounts; 22 | 23 | private Integer weight; 24 | /** 25 | * 创建时间 26 | */ 27 | private String createDate; 28 | 29 | private String author; 30 | 31 | private String authorId; 32 | 33 | private ArticleBodyVo body; 34 | 35 | private List tags; 36 | 37 | private CategoryVo category; 38 | 39 | /** 40 | * ai 放回值 41 | */ 42 | private String answer; 43 | } 44 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/CategoryVo.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CategoryVo { 7 | 8 | private String id; 9 | 10 | private String avatar; 11 | 12 | private String categoryName; 13 | 14 | private String description; 15 | } 16 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/CodeVo.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CodeVo { 7 | 8 | private String account; 9 | private String nonceStr; 10 | 11 | private String value; 12 | } 13 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/CommentVo.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class CommentVo { 9 | //防止前端 精度损失 把id转为string 10 | // @JsonSerialize(using = ToStringSerializer.class) 11 | private String id; 12 | 13 | private UserVo author; 14 | 15 | private String content; 16 | 17 | private List childrens; 18 | 19 | private String createDate; 20 | 21 | private Integer level; 22 | 23 | private UserVo toUser; 24 | } 25 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/ErrorCode.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo; 2 | 3 | /** 4 | * 枚举返回参数 5 | */ 6 | public enum ErrorCode { 7 | 8 | PARAMS_ERROR(10001, "参数有误"), 9 | ACCOUNT_PWD_NOT_EXIST(10002, "用户名或密码不正确"), 10 | TOKEN_ERROR(10003, "token不合法"), 11 | ACCOUNT_EXIST(10004, "账号已存在"), 12 | ACCOUNT_DELETE(10005, "账号已注销"), 13 | ACCOUNT_BLOCKED(10006, "账号被封"), 14 | ACCOUNT_FREQUENTLY(10007, "账号登录频繁"), 15 | NO_PERMISSION(70001, "无访问权限"), 16 | SESSION_TIME_OUT(90001, "会话超时"), 17 | NO_LOGIN(90002, "未登录"), 18 | UPDATE_ERROR(10007, "修改失败"),; 19 | 20 | private int code; 21 | private String msg; 22 | 23 | ErrorCode(int code, String msg) { 24 | this.code = code; 25 | this.msg = msg; 26 | } 27 | 28 | public int getCode() { 29 | return code; 30 | } 31 | 32 | public void setCode(int code) { 33 | this.code = code; 34 | } 35 | 36 | public String getMsg() { 37 | return msg; 38 | } 39 | 40 | public void setMsg(String msg) { 41 | this.msg = msg; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/LoginUserVo.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoginUserVo { 7 | 8 | private String id; 9 | 10 | private String account; 11 | 12 | private String nickname; 13 | 14 | private String avatar; 15 | 16 | private String status; 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/Result.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | @Data 10 | @AllArgsConstructor 11 | public class Result { 12 | 13 | private boolean success; 14 | 15 | private int code; 16 | 17 | private String msg; 18 | 19 | private Object data; 20 | 21 | 22 | public static Result success(Object data) { 23 | return new Result(true, 200, "success", data); 24 | } 25 | 26 | 27 | public static Result fail(int code, String msg) { 28 | return new Result(false, code, msg, null); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/TagVo.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class TagVo { 7 | 8 | private String id; 9 | 10 | private String tagName; 11 | 12 | private String avatar; 13 | } 14 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/UserVo.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class UserVo { 7 | 8 | private String nickname; 9 | 10 | private String avatar; 11 | 12 | private String id; 13 | } 14 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/ai/AIAnswer.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo.ai; 2 | 3 | 4 | import java.util.List; 5 | 6 | public class AIAnswer { 7 | 8 | private String id; 9 | 10 | private String object; 11 | 12 | private int created; 13 | 14 | private String model; 15 | 16 | private List choices; 17 | 18 | public void setId(String id){ 19 | this.id = id; 20 | } 21 | public String getId(){ 22 | return this.id; 23 | } 24 | public void setObject(String object){ 25 | this.object = object; 26 | } 27 | public String getObject(){ 28 | return this.object; 29 | } 30 | public void setCreated(int created){ 31 | this.created = created; 32 | } 33 | public int getCreated(){ 34 | return this.created; 35 | } 36 | public void setModel(String model){ 37 | this.model = model; 38 | } 39 | public String getModel(){ 40 | return this.model; 41 | } 42 | public void setChoices(List choices){ 43 | this.choices = choices; 44 | } 45 | public List getChoices(){ 46 | return this.choices; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/ai/Choices.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo.ai; 2 | 3 | 4 | public class Choices { 5 | 6 | private String text; 7 | 8 | private int index; 9 | 10 | private String logprobs; 11 | 12 | private String finish_reason; 13 | 14 | public String getText() { 15 | return text; 16 | } 17 | 18 | public void setText(String text) { 19 | this.text = text; 20 | } 21 | 22 | public int getIndex() { 23 | return index; 24 | } 25 | 26 | public void setIndex(int index) { 27 | this.index = index; 28 | } 29 | 30 | public String getLogprobs() { 31 | return logprobs; 32 | } 33 | 34 | public void setLogprobs(String logprobs) { 35 | this.logprobs = logprobs; 36 | } 37 | 38 | public String getFinish_reason() { 39 | return finish_reason; 40 | } 41 | 42 | public void setFinish_reason(String finish_reason) { 43 | this.finish_reason = finish_reason; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/params/AdTypePageParam.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo.params; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AdTypePageParam { 7 | private int page = 1; 8 | 9 | private int pageSize = 10; 10 | 11 | 12 | /** 删除标志(0代表存在 2代表删除) */ 13 | private String delFlag; 14 | 15 | /** 状态(0正常 1停用) */ 16 | private String status; 17 | } 18 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/params/ArticleBodyParam.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo.params; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ArticleBodyParam { 7 | 8 | private String content; 9 | 10 | private String contentHtml; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/params/ArticleParam.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo.params; 2 | 3 | import com.lin.vo.CategoryVo; 4 | import com.lin.vo.TagVo; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | public class ArticleParam { 11 | 12 | private Long id; 13 | 14 | private ArticleBodyParam body; 15 | 16 | private CategoryVo category; 17 | 18 | private String summary; 19 | 20 | private List tags; 21 | 22 | private String title; 23 | 24 | private String search; 25 | } 26 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/params/CommentParam.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo.params; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CommentParam { 7 | 8 | private Long articleId; 9 | 10 | private String content; 11 | 12 | private Long parent; 13 | 14 | private Long toUserId; 15 | } 16 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/params/LikeParam.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo.params; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LikeParam { 7 | //文章id 8 | private String articleId; 9 | //用户id 10 | private String userId; 11 | } 12 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/params/LoginParam.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo.params; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoginParam { 7 | 8 | private String account; 9 | 10 | private String password; 11 | 12 | private String nickname; 13 | } 14 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/params/PageParams.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo.params; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class PageParams { 7 | 8 | private int page = 1; 9 | 10 | private int pageSize = 10; 11 | 12 | private Long categoryId; 13 | 14 | private Long tagId; 15 | 16 | private String year; 17 | 18 | private String month; 19 | 20 | private String keyWord; 21 | 22 | public String getMonth() { 23 | if (this.month != null && this.month.length() == 1) { 24 | return "0" + this.month; 25 | } 26 | return this.month; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/params/PageSearchParams.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo.params; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class PageSearchParams { 7 | 8 | 9 | private int page = 1; 10 | 11 | private int pageSize = 10; 12 | 13 | private Long categoryId; 14 | 15 | private Long tagId; 16 | 17 | private String year; 18 | 19 | private String month; 20 | private String keyWord; 21 | 22 | public String getMonth() { 23 | if (this.month != null && this.month.length() == 1) { 24 | return "0" + this.month; 25 | } 26 | return this.month; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/vo/params/UserPatam.java: -------------------------------------------------------------------------------- 1 | package com.lin.vo.params; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class UserPatam { 7 | 8 | private String account; 9 | 10 | private String nickname; 11 | 12 | private String email; 13 | 14 | private String sex; 15 | 16 | private String birthday; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/java/com/lin/zhiliaoApplication.java: -------------------------------------------------------------------------------- 1 | package com.lin; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | import springfox.documentation.oas.annotations.EnableOpenApi; 8 | 9 | @SpringBootApplication 10 | @EnableScheduling //该注解表名在启动定时任务 11 | @EnableOpenApi //开启swagger http://localhost:8160/swagger-ui/index.html 12 | public class zhiliaoApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(zhiliaoApplication.class, args); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- 1 | server.port=8160 2 | spring.application.name=zhiliao_api 3 | spring.mvc.servlet.path=/api 4 | # datasource 5 | spring.datasource.url=jdbc:mysql://localhost:3306/blog?useUnicode=true&characterEncoding=UTF-8&serverTimeZone=UTC 6 | spring.datasource.username=root 7 | spring.datasource.password=123456 8 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 9 | #mybatis-plus 10 | #mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl 11 | mybatis-plus.global-config.db-config.table-prefix=b_ 12 | spring.redis.host=localhost 13 | spring.redis.port=6379 14 | spring.servlet.multipart.max-request-size=20MB 15 | spring.servlet.multipart.max-file-size=2MB 16 | qiniu.accessKey=lz4ynjPJIT9zxaPAowi8S2swpB3ysoOfKe89iGi8 17 | qiniu.accessSecretKey=-w_GdwjFFuJ3O72Ixh9NME-hRDFTV_KCNLwM3pab 18 | qiniu.name=zhiliaosq 19 | #rocketmq 20 | #rocketmq.name-server=106.12.106.46:9876 21 | rocketmq.name-server=127.0.0.1:9876 22 | rocketmq.producer.group=api_group 23 | #wechat 24 | wx.open.app_id=wxed9954c01bb89b47 25 | wx.open.app_secret=a7482517235173ddb4083788de60b90e 26 | wx.open.redirect_url=http://localhost:8160/api/ucenter/wx/callback 27 | yygh.baseUrl=http://localhost:8080 28 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/resources/com/lin/dao/mapper/ArticleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | update b_article set available=0 21 | 22 | 23 | id=#{articleId} 24 | 25 | 26 | 27 | 28 | 32 | 33 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /zhiliao-api/src/main/resources/com/lin/dao/mapper/TagMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 13 | 14 | 17 | 18 | 25 | 26 | -------------------------------------------------------------------------------- /zhiliao-api/zhiliao-api.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | --------------------------------------------------------------------------------