diff --git a/src/main/java/com/rymcu/vertical/config/HpeisShiroRealm.java b/src/main/java/com/rymcu/vertical/config/HpeisShiroRealm.java index ee3bc7a..d305b61 100644 --- a/src/main/java/com/rymcu/vertical/config/HpeisShiroRealm.java +++ b/src/main/java/com/rymcu/vertical/config/HpeisShiroRealm.java @@ -2,11 +2,10 @@ package com.rymcu.vertical.config; import com.rymcu.vertical.core.constant.ShiroConstants; import com.rymcu.vertical.core.exception.CaptchaException; -import com.rymcu.vertical.core.exception.ServiceException; -import com.rymcu.vertical.entity.Menu; +import com.rymcu.vertical.entity.Permission; import com.rymcu.vertical.entity.Role; import com.rymcu.vertical.entity.User; -import com.rymcu.vertical.service.MenuService; +import com.rymcu.vertical.service.PermissionService; import com.rymcu.vertical.service.RoleService; import com.rymcu.vertical.service.UserService; import com.rymcu.vertical.util.Encodes; @@ -36,7 +35,7 @@ public class HpeisShiroRealm extends AuthorizingRealm { private RoleService roleService; @Resource - private MenuService menuService; + private PermissionService permissionService; @Resource private UserService userService; @@ -56,10 +55,10 @@ public class HpeisShiroRealm extends AuthorizingRealm { authorizationInfo.addRole(role.getInputCode()); } } - List permissions = menuService.selectMenuByUser(user); - for (Menu perm : permissions) { - if (perm.getPermission() != null) { - authorizationInfo.addStringPermission(perm.getPermission()); + List permissions = permissionService.selectMenuByUser(user); + for (Permission perm : permissions) { + if (perm.getPermissionCategory() != null) { + authorizationInfo.addStringPermission(perm.getPermissionCategory()); } } // 添加用户权限 diff --git a/src/main/java/com/rymcu/vertical/config/WebMvcConfigurer.java b/src/main/java/com/rymcu/vertical/config/WebMvcConfigurer.java index 2879de4..c694516 100644 --- a/src/main/java/com/rymcu/vertical/config/WebMvcConfigurer.java +++ b/src/main/java/com/rymcu/vertical/config/WebMvcConfigurer.java @@ -71,7 +71,7 @@ public class WebMvcConfigurer extends WebMvcConfigurationSupport { public void addInterceptors(InterceptorRegistry registry) { // TODO 先不拦截接口,进行测试 registry.addInterceptor(restAuthTokenInterceptor()).addPathPatterns("/api/**") - .excludePathPatterns("/api/v1/console/**","/api/v1/article/articles/**","/api/v1/article/detail/**"); + .excludePathPatterns("/api/v1/console/**","/api/v1/article/articles/**","/api/v1/article/detail/**","/api/v1/topic/**"); } diff --git a/src/main/java/com/rymcu/vertical/core/result/ResultCode.java b/src/main/java/com/rymcu/vertical/core/result/ResultCode.java index 0994c2a..b284cd0 100644 --- a/src/main/java/com/rymcu/vertical/core/result/ResultCode.java +++ b/src/main/java/com/rymcu/vertical/core/result/ResultCode.java @@ -13,7 +13,7 @@ public enum ResultCode { - ; + ; private int code; private String message; diff --git a/src/main/java/com/rymcu/vertical/dto/ArticleDTO.java b/src/main/java/com/rymcu/vertical/dto/ArticleDTO.java index f811ef1..db942a7 100644 --- a/src/main/java/com/rymcu/vertical/dto/ArticleDTO.java +++ b/src/main/java/com/rymcu/vertical/dto/ArticleDTO.java @@ -30,7 +30,7 @@ public class ArticleDTO { /** 文章内容html */ private String articleContentHtml; /** 评论总数 */ - private Integer commentCount; + private Integer articleCommentCount; /** 过去时长 */ private String timeAgo; /** 文章永久链接 */ diff --git a/src/main/java/com/rymcu/vertical/dto/UserDTO.java b/src/main/java/com/rymcu/vertical/dto/UserDTO.java new file mode 100644 index 0000000..d8b5b29 --- /dev/null +++ b/src/main/java/com/rymcu/vertical/dto/UserDTO.java @@ -0,0 +1,17 @@ +package com.rymcu.vertical.dto; + +import lombok.Data; + +@Data +public class UserDTO { + + private Integer idUser; + + private String account; + + private String avatarType; + + private String avatarUrl; + + private String nickname; +} diff --git a/src/main/java/com/rymcu/vertical/entity/Article.java b/src/main/java/com/rymcu/vertical/entity/Article.java index f35c013..aa63e9b 100644 --- a/src/main/java/com/rymcu/vertical/entity/Article.java +++ b/src/main/java/com/rymcu/vertical/entity/Article.java @@ -5,38 +5,42 @@ import lombok.Data; import javax.persistence.Column; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.Table; import java.io.Serializable; import java.util.Date; @Data +@Table(name = "vertical_article") public class Article implements Serializable,Cloneable { /** 主键 */ @Id @GeneratedValue(generator = "JDBC") @Column(name = "id") - private Integer idArticle ; + private Integer idArticle; /** 文章标题 */ - private String articleTitle ; + private String articleTitle; /** 文章缩略图 */ - private String articleThumbnailUrl ; + private String articleThumbnailUrl; /** 文章作者id */ - private Integer articleAuthorId ; + private Integer articleAuthorId; /** 文章类型 */ - private String articleType ; + private String articleType; /** 文章标签 */ - private String articleTags ; + private String articleTags; /** 浏览总数 */ private Integer articleViewCount; /** 预览内容 */ - private String articlePreviewContent ; + private String articlePreviewContent; /** 评论总数 */ - private Integer commentCount ; + private Integer articleCommentCount; + /** 0:非优选1:优选;0 */ + private String articlePerfect; /** 文章永久链接 */ - private String articlePermalink ; + private String articlePermalink; /** 站内链接 */ - private String articleLink ; + private String articleLink; /** 创建时间 */ - private Date createdTime ; + private Date createdTime; /** 更新时间 */ - private Date updatedTime ; + private Date updatedTime; } diff --git a/src/main/java/com/rymcu/vertical/entity/ArticleContent.java b/src/main/java/com/rymcu/vertical/entity/ArticleContent.java index 6503a88..5e4d080 100644 --- a/src/main/java/com/rymcu/vertical/entity/ArticleContent.java +++ b/src/main/java/com/rymcu/vertical/entity/ArticleContent.java @@ -2,11 +2,19 @@ package com.rymcu.vertical.entity; import lombok.Data; +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; import java.util.Date; @Data +@Table(name = "vertical_article_content") public class ArticleContent { + @Id + @Column(name = "id") + @GeneratedValue(generator = "JDBC") private Integer idArticle; private String articleContent; diff --git a/src/main/java/com/rymcu/vertical/entity/Menu.java b/src/main/java/com/rymcu/vertical/entity/Menu.java deleted file mode 100644 index 00c0415..0000000 --- a/src/main/java/com/rymcu/vertical/entity/Menu.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.rymcu.vertical.entity; - -import lombok.Data; -import org.apache.ibatis.type.JdbcType; -import tk.mybatis.mapper.annotation.ColumnType; - -import javax.persistence.Column; -import javax.persistence.Id; -import javax.persistence.Table; -import java.io.Serializable; -import java.util.Date; - -@Data -@Table(name = "SYS_MENU") -public class Menu implements Serializable,Cloneable { - - @Id - @Column(name = "id") - private Integer idMenu; - - /** - * 上级菜单ID - * */ - @Column(name = "parent_id") - private String parentId; - - /** - * 菜单名称 - * */ - @Column(name = "NAME") - private String name; - - /** - * 排序 - * */ - @Column(name = "SORT") - private Integer sort; - - /** - * 路径 - * */ - @Column(name = "HREF") - private String href; - - /** - * 菜单类型 - * */ - @Column(name = "MENU_TYPE") - private String menuType; - - /** - * 权限标识 - * */ - @ColumnType(column = "PERMISSION", - jdbcType = JdbcType.VARCHAR) - private String permission; - - /** - * 创建时间 - * */ - @Column(name = "created_time") - private Date createdTime; - - /** - * 状态 - * */ - @Column(name = "status") - private String status; -} \ No newline at end of file diff --git a/src/main/java/com/rymcu/vertical/entity/Permission.java b/src/main/java/com/rymcu/vertical/entity/Permission.java new file mode 100644 index 0000000..5fc7688 --- /dev/null +++ b/src/main/java/com/rymcu/vertical/entity/Permission.java @@ -0,0 +1,28 @@ +package com.rymcu.vertical.entity; + +import lombok.Data; +import org.apache.ibatis.type.JdbcType; +import tk.mybatis.mapper.annotation.ColumnType; + +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import java.io.Serializable; +import java.util.Date; + +@Data +@Table(name = "vertical_permission") +public class Permission implements Serializable,Cloneable { + + @Id + @Column(name = "id") + @GeneratedValue(generator = "JDBC") + private Integer idPermission; + + /** + * 权限标识 + * */ + @ColumnType(column = "permission_category") + private String permissionCategory; +} \ No newline at end of file diff --git a/src/main/java/com/rymcu/vertical/entity/Role.java b/src/main/java/com/rymcu/vertical/entity/Role.java index 1790720..ea795c6 100644 --- a/src/main/java/com/rymcu/vertical/entity/Role.java +++ b/src/main/java/com/rymcu/vertical/entity/Role.java @@ -3,16 +3,18 @@ package com.rymcu.vertical.entity; import lombok.Data; import javax.persistence.Column; +import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; import java.io.Serializable; import java.util.Date; @Data -@Table(name = "sys_role") +@Table(name = "vertical_role") public class Role implements Serializable,Cloneable { @Id @Column(name = "id") + @GeneratedValue(generator = "JDBC") private Integer idRole; /** diff --git a/src/main/java/com/rymcu/vertical/entity/Tag.java b/src/main/java/com/rymcu/vertical/entity/Tag.java index fbb9308..3ce0f77 100644 --- a/src/main/java/com/rymcu/vertical/entity/Tag.java +++ b/src/main/java/com/rymcu/vertical/entity/Tag.java @@ -5,28 +5,36 @@ import lombok.Data; import javax.persistence.Column; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.Table; +import java.io.Serializable; import java.util.Date; @Data -public class Tag { +@Table(name = "vertical_tag") +public class Tag implements Serializable,Cloneable { /** 主键 */ @Id @Column(name = "id") - private Integer idTag ; + @GeneratedValue(generator = "JDBC") + private Integer idTag; /** 标签名 */ - private String tagName ; + private String tagTitle; /** 标签图标 */ - private String tagIconUrl ; + private String tagIconPath; /** 标签uri */ - private String tagUri ; + private String tagUri; /** 描述 */ - private String tagDescription ; + private String tagDescription; /** 浏览量 */ - private Integer tagViewCount ; + private Integer tagViewCount; /** 关联文章总数 */ - private Integer tagArticleCount ; + private Integer tagArticleCount; + /** 标签广告 */ + private String tagAd; + /** 是否显示全站侧边栏广告 */ + private String tagShowSideAd; /** 创建时间 */ - private Date createdTime ; + private Date createdTime; /** 更新时间 */ - private Date updatedTime ; + private Date updatedTime; } diff --git a/src/main/java/com/rymcu/vertical/entity/Topic.java b/src/main/java/com/rymcu/vertical/entity/Topic.java new file mode 100644 index 0000000..0e7561e --- /dev/null +++ b/src/main/java/com/rymcu/vertical/entity/Topic.java @@ -0,0 +1,43 @@ +package com.rymcu.vertical.entity; + +import lombok.Data; + +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import java.util.Date; + +@Data +@Table(name = "vertical_topic") +public class Topic { + + /** 主键 */ + @Id + @Column(name = "id") + @GeneratedValue(generator = "JDBC") + private Integer idTopic; + /** 专题标题 */ + private String topicTitle; + /** 专题路径 */ + private String topicUri; + /** 专题描述 */ + private String topicDescription; + /** 专题类型 */ + private String topicType; + /** 专题序号;10 */ + private Integer topicSort; + /** 专题图片路径 */ + private String topicIconPath; + /** 0:作为导航1:不作为导航;0 */ + private String topicNva; + /** 专题下标签总数;0 */ + private Integer topicTagCount; + /** 0:正常1:禁用;0 */ + private String topicStatus; + /** 创建时间 */ + private Date createdTime; + /** 更新时间 */ + private Date updatedTime; + +} diff --git a/src/main/java/com/rymcu/vertical/entity/User.java b/src/main/java/com/rymcu/vertical/entity/User.java index 0c9bf0e..e89a3bd 100644 --- a/src/main/java/com/rymcu/vertical/entity/User.java +++ b/src/main/java/com/rymcu/vertical/entity/User.java @@ -5,16 +5,18 @@ import org.apache.ibatis.type.JdbcType; import tk.mybatis.mapper.annotation.ColumnType; import javax.persistence.Column; +import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; import java.io.Serializable; import java.util.Date; -@Table(name = "sys_user") +@Table(name = "vertical_user") @Data public class User implements Serializable,Cloneable { @Id @Column(name = "id") + @GeneratedValue(generator = "JDBC") private Integer idUser; /** diff --git a/src/main/java/com/rymcu/vertical/mapper/ArticleMapper.java b/src/main/java/com/rymcu/vertical/mapper/ArticleMapper.java index 261cae0..8bf3682 100644 --- a/src/main/java/com/rymcu/vertical/mapper/ArticleMapper.java +++ b/src/main/java/com/rymcu/vertical/mapper/ArticleMapper.java @@ -21,4 +21,10 @@ public interface ArticleMapper extends Mapper
{ Integer updateArticleContent(@Param("idArticle") Integer idArticle, @Param("articleContent") String articleContent, @Param("articleContentHtml") String articleContentHtml); ArticleContent selectArticleContent(@Param("idArticle") Integer idArticle); + + List selectArticlesByTopicName(@Param("topicName") String topicName); + + List selectArticlesByTagName(@Param("tagName") String tagName); + + List selectUserArticles(@Param("idUser") Integer idUser); } diff --git a/src/main/java/com/rymcu/vertical/mapper/MenuMapper.java b/src/main/java/com/rymcu/vertical/mapper/MenuMapper.java deleted file mode 100644 index bcb4769..0000000 --- a/src/main/java/com/rymcu/vertical/mapper/MenuMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.rymcu.vertical.mapper; - -import com.rymcu.vertical.core.mapper.Mapper; -import com.rymcu.vertical.dto.MenuDTO; -import com.rymcu.vertical.entity.Menu; -import com.rymcu.vertical.entity.Role; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface MenuMapper extends Mapper { - - List selectMenuByIdRole(@Param("role") Integer role); -} \ No newline at end of file diff --git a/src/main/java/com/rymcu/vertical/mapper/PermissionMapper.java b/src/main/java/com/rymcu/vertical/mapper/PermissionMapper.java new file mode 100644 index 0000000..a880b4d --- /dev/null +++ b/src/main/java/com/rymcu/vertical/mapper/PermissionMapper.java @@ -0,0 +1,12 @@ +package com.rymcu.vertical.mapper; + +import com.rymcu.vertical.core.mapper.Mapper; +import com.rymcu.vertical.entity.Permission; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface PermissionMapper extends Mapper { + + List selectMenuByIdRole(@Param("role") Integer role); +} \ No newline at end of file diff --git a/src/main/java/com/rymcu/vertical/mapper/TagMapper.java b/src/main/java/com/rymcu/vertical/mapper/TagMapper.java index 0952be8..6c3543b 100644 --- a/src/main/java/com/rymcu/vertical/mapper/TagMapper.java +++ b/src/main/java/com/rymcu/vertical/mapper/TagMapper.java @@ -2,6 +2,14 @@ package com.rymcu.vertical.mapper; import com.rymcu.vertical.core.mapper.Mapper; import com.rymcu.vertical.entity.Tag; +import org.apache.ibatis.annotations.Param; public interface TagMapper extends Mapper { + Integer insertTagArticle(@Param("idTag") Integer idTag, @Param("idArticle") Integer idArticle); + + Integer selectCountTagArticleById(@Param("idTag") Integer idTag, @Param("idArticle") Integer idArticle); + + Integer selectCountUserTagById(@Param("idUser") Integer idUser, @Param("idTag") Integer idTag); + + Integer insertUserTag(@Param("idTag") Integer idTag, @Param("idUser") Integer idUser, @Param("type") Integer type); } diff --git a/src/main/java/com/rymcu/vertical/mapper/TopicMapper.java b/src/main/java/com/rymcu/vertical/mapper/TopicMapper.java new file mode 100644 index 0000000..7c7b9ff --- /dev/null +++ b/src/main/java/com/rymcu/vertical/mapper/TopicMapper.java @@ -0,0 +1,10 @@ +package com.rymcu.vertical.mapper; + +import com.rymcu.vertical.core.mapper.Mapper; +import com.rymcu.vertical.entity.Topic; + +import java.util.List; + +public interface TopicMapper extends Mapper { + List selectTopicNav(); +} diff --git a/src/main/java/com/rymcu/vertical/mapper/UserMapper.java b/src/main/java/com/rymcu/vertical/mapper/UserMapper.java index 38dfdfb..30e2a3b 100644 --- a/src/main/java/com/rymcu/vertical/mapper/UserMapper.java +++ b/src/main/java/com/rymcu/vertical/mapper/UserMapper.java @@ -1,6 +1,7 @@ package com.rymcu.vertical.mapper; import com.rymcu.vertical.core.mapper.Mapper; +import com.rymcu.vertical.dto.UserDTO; import com.rymcu.vertical.dto.UserInfoDTO; import com.rymcu.vertical.entity.User; import org.apache.ibatis.annotations.Param; @@ -12,4 +13,6 @@ public interface UserMapper extends Mapper { Integer insertUserRole(@Param("idUser") Integer idUser, @Param("idRole") Integer idRole); UserInfoDTO findUserInfoByAccount(@Param("account") String account); + + UserDTO selectUserDTOByNickname(@Param("nickname") String nickname); } \ No newline at end of file diff --git a/src/main/java/com/rymcu/vertical/service/ArticleService.java b/src/main/java/com/rymcu/vertical/service/ArticleService.java index fe2331f..a9b5c7f 100644 --- a/src/main/java/com/rymcu/vertical/service/ArticleService.java +++ b/src/main/java/com/rymcu/vertical/service/ArticleService.java @@ -6,13 +6,20 @@ import com.rymcu.vertical.entity.Article; import com.rymcu.vertical.web.api.exception.MallApiException; import javax.servlet.http.HttpServletRequest; +import java.io.UnsupportedEncodingException; import java.util.List; import java.util.Map; public interface ArticleService extends Service
{ - List articles(String searchText, String tag); + List findArticles(String searchText, String tag); - Map postArticle(Integer idArticle, String articleTitle, String articleContent, String articleContentHtml, String articleTags, HttpServletRequest request) throws MallApiException; + Map postArticle(Integer idArticle, String articleTitle, String articleContent, String articleContentHtml, String articleTags, HttpServletRequest request) throws MallApiException, UnsupportedEncodingException; ArticleDTO findArticleDTOById(Integer id, int i); + + List findArticlesByTopicName(String name); + + List findArticlesByTagName(String name); + + List findUserArticlesByIdUser(Integer idUser); } diff --git a/src/main/java/com/rymcu/vertical/service/MenuService.java b/src/main/java/com/rymcu/vertical/service/PermissionService.java similarity index 53% rename from src/main/java/com/rymcu/vertical/service/MenuService.java rename to src/main/java/com/rymcu/vertical/service/PermissionService.java index fb6decf..8f5f7b2 100644 --- a/src/main/java/com/rymcu/vertical/service/MenuService.java +++ b/src/main/java/com/rymcu/vertical/service/PermissionService.java @@ -1,8 +1,7 @@ package com.rymcu.vertical.service; import com.rymcu.vertical.core.service.Service; -import com.rymcu.vertical.dto.MenuDTO; -import com.rymcu.vertical.entity.Menu; +import com.rymcu.vertical.entity.Permission; import com.rymcu.vertical.entity.User; import java.util.List; @@ -11,7 +10,7 @@ import java.util.List; /** * Created by CodeGenerator on 2018/05/29. */ -public interface MenuService extends Service { +public interface PermissionService extends Service { - List selectMenuByUser(User sysUser); + List selectMenuByUser(User sysUser); } diff --git a/src/main/java/com/rymcu/vertical/service/TagService.java b/src/main/java/com/rymcu/vertical/service/TagService.java index 737edef..87dcec4 100644 --- a/src/main/java/com/rymcu/vertical/service/TagService.java +++ b/src/main/java/com/rymcu/vertical/service/TagService.java @@ -1,7 +1,13 @@ package com.rymcu.vertical.service; import com.rymcu.vertical.core.service.Service; +import com.rymcu.vertical.entity.Article; import com.rymcu.vertical.entity.Tag; +import com.rymcu.vertical.web.api.exception.MallApiException; + +import java.io.UnsupportedEncodingException; public interface TagService extends Service { + + void saveTagArticle(Article article) throws UnsupportedEncodingException, MallApiException; } diff --git a/src/main/java/com/rymcu/vertical/service/TopicService.java b/src/main/java/com/rymcu/vertical/service/TopicService.java new file mode 100644 index 0000000..e957844 --- /dev/null +++ b/src/main/java/com/rymcu/vertical/service/TopicService.java @@ -0,0 +1,10 @@ +package com.rymcu.vertical.service; + +import com.rymcu.vertical.core.service.Service; +import com.rymcu.vertical.entity.Topic; + +import java.util.List; + +public interface TopicService extends Service { + List findTopicNav(); +} diff --git a/src/main/java/com/rymcu/vertical/service/UserService.java b/src/main/java/com/rymcu/vertical/service/UserService.java index 3100e04..40b4fdc 100644 --- a/src/main/java/com/rymcu/vertical/service/UserService.java +++ b/src/main/java/com/rymcu/vertical/service/UserService.java @@ -1,6 +1,7 @@ package com.rymcu.vertical.service; import com.rymcu.vertical.core.service.Service; +import com.rymcu.vertical.dto.UserDTO; import com.rymcu.vertical.entity.User; import org.apache.ibatis.exceptions.TooManyResultsException; @@ -18,4 +19,6 @@ public interface UserService extends Service { Map register(String email, String password, String code); Map login(String account, String password); + + UserDTO findUserDTOByNickname(String nickname); } diff --git a/src/main/java/com/rymcu/vertical/service/impl/ArticleServiceImpl.java b/src/main/java/com/rymcu/vertical/service/impl/ArticleServiceImpl.java index 127a6f8..65a05b7 100644 --- a/src/main/java/com/rymcu/vertical/service/impl/ArticleServiceImpl.java +++ b/src/main/java/com/rymcu/vertical/service/impl/ArticleServiceImpl.java @@ -3,10 +3,14 @@ package com.rymcu.vertical.service.impl; import com.rymcu.vertical.core.service.AbstractService; import com.rymcu.vertical.dto.ArticleDTO; import com.rymcu.vertical.dto.Author; +import com.rymcu.vertical.dto.UserDTO; import com.rymcu.vertical.entity.Article; import com.rymcu.vertical.entity.ArticleContent; +import com.rymcu.vertical.entity.User; import com.rymcu.vertical.mapper.ArticleMapper; import com.rymcu.vertical.service.ArticleService; +import com.rymcu.vertical.service.TagService; +import com.rymcu.vertical.service.UserService; import com.rymcu.vertical.util.Html2TextUtil; import com.rymcu.vertical.util.UserUtils; import com.rymcu.vertical.util.Utils; @@ -17,21 +21,23 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.io.UnsupportedEncodingException; +import java.util.*; @Service public class ArticleServiceImpl extends AbstractService
implements ArticleService { @Resource private ArticleMapper articleMapper; + @Resource + private TagService tagService; + @Resource + private UserService userService; private static final String DOMAIN = "https://rymcu.com"; @Override - public List articles(String searchText, String tag) { + public List findArticles(String searchText, String tag) { List list = articleMapper.selectArticles(searchText, tag); list.forEach(article->{ article = genArticle(article,0); @@ -41,13 +47,14 @@ public class ArticleServiceImpl extends AbstractService
implements Arti @Override @Transactional - public Map postArticle(Integer idArticle, String articleTitle, String articleContent, String articleContentHtml, String articleTags, HttpServletRequest request) throws MallApiException { + public Map postArticle(Integer idArticle, String articleTitle, String articleContent, String articleContentHtml, String articleTags, HttpServletRequest request) throws MallApiException, UnsupportedEncodingException { Map map = new HashMap(); Article article; + User user = UserUtils.getWxCurrentUser(); if(idArticle == null || idArticle == 0){ article = new Article(); article.setArticleTitle(articleTitle); - article.setArticleAuthorId(UserUtils.getWxCurrentUser().getIdUser()); + article.setArticleAuthorId(user.getIdUser()); article.setArticleTags(articleTags); article.setCreatedTime(new Date()); article.setUpdatedTime(article.getCreatedTime()); @@ -57,8 +64,8 @@ public class ArticleServiceImpl extends AbstractService
implements Arti articleMapper.insertArticleContent(article.getIdArticle(),articleContent,articleContentHtml); } else { article = articleMapper.selectByPrimaryKey(idArticle); - if(UserUtils.getWxCurrentUser().getIdUser() != article.getIdArticle()){ - map.put("message","非法用户!"); + if(user.getIdUser() != article.getArticleAuthorId()){ + map.put("message","非法访问!"); return map; } article.setArticleTitle(articleTitle); @@ -74,7 +81,9 @@ public class ArticleServiceImpl extends AbstractService
implements Arti article.setUpdatedTime(new Date()); articleMapper.updateArticleContent(article.getIdArticle(),articleContent,articleContentHtml); } + tagService.saveTagArticle(article); articleMapper.updateByPrimaryKeySelective(article); + map.put("id", article.getIdArticle()); return map; } @@ -86,6 +95,27 @@ public class ArticleServiceImpl extends AbstractService
implements Arti return articleDTO; } + @Override + public List findArticlesByTopicName(String name) { + List articleDTOS = articleMapper.selectArticlesByTopicName(name); + return articleDTOS; + } + + @Override + public List findArticlesByTagName(String name) { + List articleDTOS = articleMapper.selectArticlesByTagName(name); + return articleDTOS; + } + + @Override + public List findUserArticlesByIdUser(Integer idUser) { + List list = articleMapper.selectUserArticles(idUser); + list.forEach(article->{ + article = genArticle(article,0); + }); + return list; + } + private ArticleDTO genArticle(ArticleDTO article,Integer type) { Author author = articleMapper.selectAuthor(article.getArticleAuthorId()); article.setArticleAuthor(author); diff --git a/src/main/java/com/rymcu/vertical/service/impl/MenuServiceImpl.java b/src/main/java/com/rymcu/vertical/service/impl/PermissionServiceImpl.java similarity index 57% rename from src/main/java/com/rymcu/vertical/service/impl/MenuServiceImpl.java rename to src/main/java/com/rymcu/vertical/service/impl/PermissionServiceImpl.java index 1c3a15d..0631561 100644 --- a/src/main/java/com/rymcu/vertical/service/impl/MenuServiceImpl.java +++ b/src/main/java/com/rymcu/vertical/service/impl/PermissionServiceImpl.java @@ -1,15 +1,12 @@ package com.rymcu.vertical.service.impl; import com.rymcu.vertical.core.service.AbstractService; -import com.rymcu.vertical.dto.MenuDTO; -import com.rymcu.vertical.entity.Menu; +import com.rymcu.vertical.entity.Permission; import com.rymcu.vertical.entity.Role; import com.rymcu.vertical.entity.User; -import com.rymcu.vertical.mapper.MenuMapper; -import com.rymcu.vertical.service.MenuService; +import com.rymcu.vertical.mapper.PermissionMapper; +import com.rymcu.vertical.service.PermissionService; import com.rymcu.vertical.service.RoleService; -import com.rymcu.vertical.util.BeanCopierUtil; -import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -17,7 +14,6 @@ import javax.annotation.Resource; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.UUID; /** @@ -25,18 +21,18 @@ import java.util.UUID; */ @Service @Transactional -public class MenuServiceImpl extends AbstractService implements MenuService { +public class PermissionServiceImpl extends AbstractService implements PermissionService { @Resource - private MenuMapper menuMapper; + private PermissionMapper permissionMapper; @Resource private RoleService roleService; @Override - public List selectMenuByUser(User sysUser) { - List list = new ArrayList(); + public List selectMenuByUser(User sysUser) { + List list = new ArrayList(); List roles = roleService.selectRoleByUser(sysUser); - roles.forEach(role -> list.addAll(menuMapper.selectMenuByIdRole(role.getIdRole()))); + roles.forEach(role -> list.addAll(permissionMapper.selectMenuByIdRole(role.getIdRole()))); HashSet hashSet = new HashSet(list); list.clear(); list.addAll(hashSet); diff --git a/src/main/java/com/rymcu/vertical/service/impl/TagServiceImpl.java b/src/main/java/com/rymcu/vertical/service/impl/TagServiceImpl.java index dd6e925..b97839b 100644 --- a/src/main/java/com/rymcu/vertical/service/impl/TagServiceImpl.java +++ b/src/main/java/com/rymcu/vertical/service/impl/TagServiceImpl.java @@ -1,10 +1,67 @@ package com.rymcu.vertical.service.impl; import com.rymcu.vertical.core.service.AbstractService; +import com.rymcu.vertical.entity.Article; import com.rymcu.vertical.entity.Tag; +import com.rymcu.vertical.entity.User; +import com.rymcu.vertical.mapper.TagMapper; import com.rymcu.vertical.service.TagService; +import com.rymcu.vertical.util.UserUtils; +import com.rymcu.vertical.web.api.exception.MallApiException; +import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.Date; @Service public class TagServiceImpl extends AbstractService implements TagService { + + @Resource + private TagMapper tagMapper; + + @Override + @Transactional + public void saveTagArticle(Article article) throws UnsupportedEncodingException, MallApiException { + User user = UserUtils.getWxCurrentUser(); + String articleTags = article.getArticleTags(); + if(StringUtils.isNotBlank(articleTags)){ + String[] tags = articleTags.split(","); + for (int i = 0; i < tags.length; i++) { + boolean addTagArticle = false; + boolean addUserTag = false; + Tag tag = new Tag(); + tag.setTagTitle(tags[i]); + tag = tagMapper.selectOne(tag); + if(tag == null){ + tag = new Tag(); + tag.setTagTitle(tags[i]); + tag.setTagUri(URLEncoder.encode(tag.getTagTitle(),"UTF-8")); + tag.setCreatedTime(new Date()); + tag.setUpdatedTime(tag.getCreatedTime()); + tagMapper.insertSelective(tag); + addTagArticle = true; + addUserTag = true; + } else { + Integer count = tagMapper.selectCountTagArticleById(tag.getIdTag(),article.getIdArticle()); + if(count == 0){ + addTagArticle = true; + } + Integer countUserTag = tagMapper.selectCountUserTagById(user.getIdUser(),tag.getIdTag()); + if(countUserTag == 0){ + addUserTag = true; + } + } + if(addTagArticle){ + tagMapper.insertTagArticle(tag.getIdTag(),article.getIdArticle()); + } + if(addUserTag){ + tagMapper.insertUserTag(tag.getIdTag(),user.getIdUser(),1); + } + } + } + } } diff --git a/src/main/java/com/rymcu/vertical/service/impl/TopicServiceImpl.java b/src/main/java/com/rymcu/vertical/service/impl/TopicServiceImpl.java new file mode 100644 index 0000000..66a7888 --- /dev/null +++ b/src/main/java/com/rymcu/vertical/service/impl/TopicServiceImpl.java @@ -0,0 +1,23 @@ +package com.rymcu.vertical.service.impl; + +import com.rymcu.vertical.core.service.AbstractService; +import com.rymcu.vertical.entity.Topic; +import com.rymcu.vertical.mapper.TopicMapper; +import com.rymcu.vertical.service.TopicService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class TopicServiceImpl extends AbstractService implements TopicService { + + @Resource + private TopicMapper topicMapper; + + @Override + public List findTopicNav() { + List topics = topicMapper.selectTopicNav(); + return topics; + } +} diff --git a/src/main/java/com/rymcu/vertical/service/impl/UserServiceImpl.java b/src/main/java/com/rymcu/vertical/service/impl/UserServiceImpl.java index 9cf05f6..4807359 100644 --- a/src/main/java/com/rymcu/vertical/service/impl/UserServiceImpl.java +++ b/src/main/java/com/rymcu/vertical/service/impl/UserServiceImpl.java @@ -3,12 +3,13 @@ package com.rymcu.vertical.service.impl; import com.rymcu.vertical.core.service.AbstractService; import com.rymcu.vertical.core.service.redis.RedisService; import com.rymcu.vertical.dto.TUser; -import com.rymcu.vertical.dto.UserInfoDTO; +import com.rymcu.vertical.dto.UserDTO; import com.rymcu.vertical.entity.Role; import com.rymcu.vertical.entity.User; import com.rymcu.vertical.jwt.service.TokenManager; import com.rymcu.vertical.mapper.RoleMapper; import com.rymcu.vertical.mapper.UserMapper; +import com.rymcu.vertical.service.ArticleService; import com.rymcu.vertical.service.UserService; import com.rymcu.vertical.util.BeanCopierUtil; import com.rymcu.vertical.util.Utils; @@ -56,7 +57,7 @@ public class UserServiceImpl extends AbstractService implements UserServic } else { user = new User(); user.setAccount(email); - user.setNickname(email); + user.setNickname(email.split("@")[0]); user.setEmail(email); user.setPassword(Utils.entryptPassword(password)); user.setCreatedTime(new Date()); @@ -96,4 +97,10 @@ public class UserServiceImpl extends AbstractService implements UserServic } return map; } + + @Override + public UserDTO findUserDTOByNickname(String nickname) { + UserDTO user = userMapper.selectUserDTOByNickname(nickname); + return user; + } } diff --git a/src/main/java/com/rymcu/vertical/web/api/article/ArticleController.java b/src/main/java/com/rymcu/vertical/web/api/article/ArticleController.java index 661e01b..4cdd51d 100644 --- a/src/main/java/com/rymcu/vertical/web/api/article/ArticleController.java +++ b/src/main/java/com/rymcu/vertical/web/api/article/ArticleController.java @@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.io.UnsupportedEncodingException; import java.util.Map; @RestController @@ -20,7 +21,7 @@ public class ArticleController { @PostMapping("/post") public GlobalResult postArticle(@RequestParam(name = "idArticle",defaultValue = "0") Integer idArticle,@RequestParam(name = "articleTitle",defaultValue = "") String articleTitle, @RequestParam(name = "articleContent",defaultValue = "") String articleContent,@RequestParam(name = "articleContentHtml",defaultValue = "") String articleContentHtml, - @RequestParam(name = "articleTags",defaultValue = "") String articleTags, HttpServletRequest request) throws MallApiException { + @RequestParam(name = "articleTags",defaultValue = "") String articleTags, HttpServletRequest request) throws MallApiException, UnsupportedEncodingException { Map map = articleService.postArticle(idArticle,articleTitle,articleContent,articleContentHtml,articleTags,request); return GlobalResultGenerator.genSuccessResult(map); } @@ -28,7 +29,7 @@ public class ArticleController { @PutMapping("/post") public GlobalResult updateArticle(@RequestParam(name = "idArticle",defaultValue = "0") Integer idArticle,@RequestParam(name = "articleTitle",defaultValue = "") String articleTitle, @RequestParam(name = "articleContent",defaultValue = "") String articleContent,@RequestParam(name = "articleContentHtml",defaultValue = "") String articleContentHtml, - @RequestParam(name = "articleTags",defaultValue = "") String articleTags, HttpServletRequest request) throws MallApiException { + @RequestParam(name = "articleTags",defaultValue = "") String articleTags, HttpServletRequest request) throws MallApiException, UnsupportedEncodingException { Map map = articleService.postArticle(idArticle,articleTitle,articleContent,articleContentHtml,articleTags,request); return GlobalResultGenerator.genSuccessResult(map); } diff --git a/src/main/java/com/rymcu/vertical/web/api/common/CommonApiController.java b/src/main/java/com/rymcu/vertical/web/api/common/CommonApiController.java index b6f75f7..fc9dfe2 100644 --- a/src/main/java/com/rymcu/vertical/web/api/common/CommonApiController.java +++ b/src/main/java/com/rymcu/vertical/web/api/common/CommonApiController.java @@ -47,6 +47,23 @@ public class CommonApiController { return GlobalResultGenerator.genSuccessResult(map); } + @ApiOperation(value = "获取找回密码邮件验证码") + @PostMapping("/get-forget-email-code") + public GlobalResult getForgetEmailCode(@RequestParam("email") String email) { + Map map = new HashMap(); + map.put("message",GlobalResultMessage.SEND_SUCCESS.getMessage()); + User user = userService.findByAccount(email); + if (user != null) { + Integer result = javaMailService.sendEmailCode(email); + if(result == 0){ + map.put("message",GlobalResultMessage.SEND_FAIL.getMessage()); + } + } else { + map.put("message","该邮箱未注册!"); + } + return GlobalResultGenerator.genSuccessResult(map); + } + @PostMapping("/register") public GlobalResult register(@RequestParam("email") String email, @RequestParam("password") String password, @RequestParam("code") String code){ Map map = userService.register(email,password,code); @@ -67,7 +84,7 @@ public class CommonApiController { @GetMapping("/articles") public GlobalResult articles(@RequestParam(defaultValue = "0") Integer page,@RequestParam(defaultValue = "10") Integer rows,@RequestParam(defaultValue = "") String searchText,@RequestParam(defaultValue = "") String tag){ PageHelper.startPage(page, rows); - List list = articleService.articles(searchText,tag); + List list = articleService.findArticles(searchText,tag); PageInfo pageInfo = new PageInfo(list); Map map = new HashMap(); map.put("articles", pageInfo.getList()); diff --git a/src/main/java/com/rymcu/vertical/web/api/tag/TagController.java b/src/main/java/com/rymcu/vertical/web/api/tag/TagController.java new file mode 100644 index 0000000..b4f23c6 --- /dev/null +++ b/src/main/java/com/rymcu/vertical/web/api/tag/TagController.java @@ -0,0 +1,37 @@ +package com.rymcu.vertical.web.api.tag; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.rymcu.vertical.core.result.GlobalResult; +import com.rymcu.vertical.core.result.GlobalResultGenerator; +import com.rymcu.vertical.dto.ArticleDTO; +import com.rymcu.vertical.service.ArticleService; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/api/v1/tag") +public class TagController { + + @Resource + private ArticleService articleService; + + @GetMapping("/{name}") + public GlobalResult articles(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows, @PathVariable String name){ + PageHelper.startPage(page, rows); + List list = articleService.findArticlesByTagName(name); + PageInfo pageInfo = new PageInfo(list); + Map map = new HashMap(); + map.put("articles", pageInfo.getList()); + Map pagination = new HashMap(); + pagination.put("paginationPageCount",pageInfo.getPages()); + pagination.put("paginationPageNums",pageInfo.getNavigatepageNums()); + pagination.put("currentPage",pageInfo.getPageNum()); + map.put("pagination", pagination); + return GlobalResultGenerator.genSuccessResult(map); + } +} diff --git a/src/main/java/com/rymcu/vertical/web/api/topic/TopicController.java b/src/main/java/com/rymcu/vertical/web/api/topic/TopicController.java new file mode 100644 index 0000000..6bad0c7 --- /dev/null +++ b/src/main/java/com/rymcu/vertical/web/api/topic/TopicController.java @@ -0,0 +1,47 @@ +package com.rymcu.vertical.web.api.topic; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.rymcu.vertical.core.result.GlobalResult; +import com.rymcu.vertical.core.result.GlobalResultGenerator; +import com.rymcu.vertical.dto.ArticleDTO; +import com.rymcu.vertical.entity.Topic; +import com.rymcu.vertical.service.ArticleService; +import com.rymcu.vertical.service.TopicService; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@SuppressWarnings("ALL") +@RestController +@RequestMapping("/api/v1/topic") +public class TopicController { + @Resource + private ArticleService articleService; + @Resource + private TopicService topicService; + + @GetMapping("/topic-nav") + public GlobalResult topicNav(){ + List topics = topicService.findTopicNav(); + return GlobalResultGenerator.genSuccessResult(topics); + } + + @GetMapping("/{name}") + public GlobalResult articles(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows, @PathVariable String name){ + PageHelper.startPage(page, rows); + List list = articleService.findArticlesByTopicName(name); + PageInfo pageInfo = new PageInfo(list); + Map map = new HashMap(); + map.put("articles", pageInfo.getList()); + Map pagination = new HashMap(); + pagination.put("paginationPageCount",pageInfo.getPages()); + pagination.put("paginationPageNums",pageInfo.getNavigatepageNums()); + pagination.put("currentPage",pageInfo.getPageNum()); + map.put("pagination", pagination); + return GlobalResultGenerator.genSuccessResult(map); + } +} diff --git a/src/main/java/com/rymcu/vertical/web/api/user/UserController.java b/src/main/java/com/rymcu/vertical/web/api/user/UserController.java new file mode 100644 index 0000000..5d834fa --- /dev/null +++ b/src/main/java/com/rymcu/vertical/web/api/user/UserController.java @@ -0,0 +1,53 @@ +package com.rymcu.vertical.web.api.user; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.rymcu.vertical.core.result.GlobalResult; +import com.rymcu.vertical.core.result.GlobalResultGenerator; +import com.rymcu.vertical.dto.ArticleDTO; +import com.rymcu.vertical.dto.UserDTO; +import com.rymcu.vertical.service.ArticleService; +import com.rymcu.vertical.service.UserService; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/api/v1/user") +public class UserController { + + @Resource + private UserService userService; + @Resource + private ArticleService articleService; + + @GetMapping("/{nickname}") + public GlobalResult detail(@PathVariable String nickname){ + UserDTO userDTO = userService.findUserDTOByNickname(nickname); + return GlobalResultGenerator.genSuccessResult(userDTO); + } + + @GetMapping("/{nickname}/articles") + public GlobalResult userArticles(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows, @PathVariable String nickname){ + UserDTO userDTO = userService.findUserDTOByNickname(nickname); + if (userDTO == null){ + return GlobalResultGenerator.genErrorResult("用户不存在!"); + } + PageHelper.startPage(page, rows); + List list = articleService.findUserArticlesByIdUser(userDTO.getIdUser()); + PageInfo pageInfo = new PageInfo(list); + Map map = new HashMap(); + map.put("articles", pageInfo.getList()); + Map pagination = new HashMap(); + pagination.put("paginationPageCount",pageInfo.getPages()); + pagination.put("paginationPageNums",pageInfo.getNavigatepageNums()); + pagination.put("currentPage",pageInfo.getPageNum()); + map.put("pagination", pagination); + return GlobalResultGenerator.genSuccessResult(map); + } + +} diff --git a/src/main/java/mapper/ArticleMapper.xml b/src/main/java/mapper/ArticleMapper.xml index 536c814..881c4a4 100644 --- a/src/main/java/mapper/ArticleMapper.xml +++ b/src/main/java/mapper/ArticleMapper.xml @@ -13,7 +13,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -50,22 +50,31 @@ - insert into article_content (id_article,article_content,article_content_html,created_time,updated_time) + insert into vertical_article_content (id_article,article_content,article_content_html,created_time,updated_time) values (#{idArticle},#{articleContent},#{articleContentHtml},sysdate(),sysdate()) - update article_content set article_content = #{articleContent},article_content_html = #{articleContentHtml},updated_time = sysdate() where id_article = #{idArticle} + update vertical_article_content set article_content = #{articleContent},article_content_html = #{articleContentHtml},updated_time = sysdate() where id_article = #{idArticle} + + + \ No newline at end of file diff --git a/src/main/java/mapper/MenuMapper.xml b/src/main/java/mapper/MenuMapper.xml deleted file mode 100644 index 84cfa1b..0000000 --- a/src/main/java/mapper/MenuMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/mapper/PermissionMapper.xml b/src/main/java/mapper/PermissionMapper.xml new file mode 100644 index 0000000..106503b --- /dev/null +++ b/src/main/java/mapper/PermissionMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/mapper/RoleMapper.xml b/src/main/java/mapper/RoleMapper.xml index e164e5d..1ac3699 100644 --- a/src/main/java/mapper/RoleMapper.xml +++ b/src/main/java/mapper/RoleMapper.xml @@ -20,10 +20,10 @@ \ No newline at end of file diff --git a/src/main/java/mapper/TagMapper.xml b/src/main/java/mapper/TagMapper.xml index 6e84e2b..ad5504e 100644 --- a/src/main/java/mapper/TagMapper.xml +++ b/src/main/java/mapper/TagMapper.xml @@ -5,6 +5,28 @@ - + + + + + + + + + + + + + insert into vertical_tag_article (id_tag,id_article,created_time,updated_time) values (#{idTag},#{idArticle},sysdate(),sysdate()) + + + insert into vertical_user_tag (id_tag,id_user,type,created_time,updated_time) values (#{idTag},#{idUser},#{type},sysdate(),sysdate()) + + + \ No newline at end of file diff --git a/src/main/java/mapper/TopicMapper.xml b/src/main/java/mapper/TopicMapper.xml new file mode 100644 index 0000000..4b1c83f --- /dev/null +++ b/src/main/java/mapper/TopicMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/mapper/UserMapper.xml b/src/main/java/mapper/UserMapper.xml index 4bd1fd7..26cb49b 100644 --- a/src/main/java/mapper/UserMapper.xml +++ b/src/main/java/mapper/UserMapper.xml @@ -5,41 +5,51 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + - insert into sys_user_role (id_user,id_role,created_time) values (#{idUser},#{idRole},sysdate()) + insert into vertical_user_role (id_user,id_role,created_time) values (#{idUser},#{idRole},sysdate()) + \ No newline at end of file diff --git a/src/main/resources/application-pord.yml b/src/main/resources/application-pord.yml index 59d5d01..8ac0993 100644 --- a/src/main/resources/application-pord.yml +++ b/src/main/resources/application-pord.yml @@ -10,7 +10,7 @@ spring: redis: host: 127.0.0.1 port: 6379 - password: #密码 + password: d9d2j9w2 database: 1 timeout: 3000 jedis: @@ -20,17 +20,17 @@ spring: max-idle: 500 min-idle: 0 datasource: - url: jdbc:mysql://127.0.0.1:3306/vertical?characterEncoding=UTF-8&autoReconnect=true&useSSL=false - username: #你的账号 - password: #你的密码 + url: jdbc:mysql://101.132.182.12:3306/vertical?characterEncoding=UTF-8&autoReconnect=true&useSSL=false + username: root + password: d9d2j9w2.RYMCU driver-class-name: com.mysql.cj.jdbc.Driver resources: add-mappings: true mail: host: smtp.ym.163.com port: 465 - username: #你的邮箱账号 - password: #你的邮箱密码 + username: service@rymcu.com + password: Aa12345678 servlet: multipart: max-file-size: 10MB @@ -38,8 +38,8 @@ spring: wx: miniapp: configs: - - appid: # - secret: # + - appid: wxf57df4f171606a26 + secret: 574ff86cb48a42f3980b221e942c53b1 token: #微信小程序消息服务器配置的token aesKey: #微信小程序消息服务器配置的EncodingAESKey msgDataFormat: JSON @@ -48,7 +48,8 @@ logging: file: path: /logs/vertical level: - root: info + com: + rymcu: warn server: port: 8099 compression: diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 1e9c41c..b912d34 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: - profiles: - active: pord +# profiles: +# active: pord thymeleaf: prefix: classpath:/templates/ suffix: .html @@ -10,7 +10,8 @@ spring: content-type: text/html cache: false redis: - host: 127.0.0.1:6379 + host: 127.0.0.1 + port: 6379 password: d9d2j9w2 database: 1 timeout: 3000 @@ -23,20 +24,20 @@ spring: datasource: url: jdbc:mysql://localhost:3306/vertical?characterEncoding=UTF-8&autoReconnect=true&useSSL=false username: root - password: d9d2j9w2 + password: d9d2j9w2.RYMCU driver-class-name: com.mysql.cj.jdbc.Driver resources: add-mappings: true mail: host: smtp.ym.163.com port: 465 - username: #你的邮箱账号 - password: #你的邮箱密码 + username: service@rymcu.com + password: Aa12345678 wx: miniapp: configs: - - appid: # - secret: # + - appid: wxf57df4f171606a26 + secret: 574ff86cb48a42f3980b221e942c53b1 token: #微信小程序消息服务器配置的token aesKey: #微信小程序消息服务器配置的EncodingAESKey msgDataFormat: JSON @@ -45,6 +46,9 @@ logging: file: path: f:/logs/vertical server: - port: 8082 + port: 8099 servlet: - context-path: /vertical \ No newline at end of file + context-path: /vertical +version: 1.0 +resource: + file-path: https://rymcu.com/vertical \ No newline at end of file