├── .gitignore ├── README.md ├── Resources ├── WebNav-Admin.zip ├── WebNav.zip ├── WebNav初始数据库.sql ├── WebNav表结构.sql ├── angular使用nginx部署.jpg ├── webnav-1.0.0-SNAPSHOT.jar ├── webnav-admin-1.0.0-SNAPSHOT.jar ├── website_screenshot.jpg ├── 仿制最终效果图.jpg ├── 兰客导航网址部分代码分析抓取脚本.py ├── 兰客导航页面部分html代码.txt ├── 前端网站接口设计.md ├── 前端网站接口设计.pdf ├── 微信收款.JPG ├── 打包.png ├── 支付宝收款.JPG ├── 数据库结构设计(PDMan打开).json ├── 数据库结构设计(PDMan打开).json.pdman.json ├── 文件目录.jpg ├── 管理后台-分类管理.jpg ├── 管理后台-友链管理.jpg ├── 管理后台-搜索管理.jpg ├── 管理后台-欢迎页.jpg ├── 管理后台-网址管理.jpg └── 管理后台-轮播图管理.jpg ├── WebNav-Admin-API ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── igreat │ │ └── webnav │ │ ├── WebNavAdminApiApplication.java │ │ ├── aop │ │ └── HttpAspect.java │ │ ├── constant │ │ ├── Constants.java │ │ └── ErrorCode.java │ │ ├── controller │ │ ├── BannerController.java │ │ ├── CommonController.java │ │ ├── NavigationCateController.java │ │ ├── NavigationCommonController.java │ │ ├── NavigationFloatController.java │ │ ├── NavigationUrlsController.java │ │ └── SearchNavUrlsController.java │ │ ├── domain │ │ ├── BaseModel.java │ │ ├── NavigationCate.java │ │ ├── NavigationCommon.java │ │ ├── NavigationFloat.java │ │ ├── NavigationUrls.java │ │ ├── SearchNavUrls.java │ │ └── SiteBanner.java │ │ ├── dto │ │ ├── BannerDTO.java │ │ ├── NavigationCateDTO.java │ │ ├── NavigationCommonDTO.java │ │ ├── NavigationFloatDTO.java │ │ ├── NavigationUrlDTO.java │ │ └── SearchUrlDTO.java │ │ ├── exception │ │ └── WebNavExceptionHandler.java │ │ ├── repository │ │ ├── BannerDAO.java │ │ ├── NavigationCateDAO.java │ │ ├── NavigationCommonDAO.java │ │ ├── NavigationFloatDAO.java │ │ ├── NavigationUrlsDAO.java │ │ └── SearchNavUrlsDao.java │ │ ├── result │ │ ├── PageResult.java │ │ └── ResultWrapper.java │ │ ├── service │ │ ├── BannerService.java │ │ ├── NavigationCateService.java │ │ ├── NavigationCommonService.java │ │ ├── NavigationFloatService.java │ │ ├── NavigationUrlsService.java │ │ ├── SearchNavUrlService.java │ │ └── impl │ │ │ ├── BannerServiceImpl.java │ │ │ ├── NavigationCateServiceImpl.java │ │ │ ├── NavigationCommonServiceImpl.java │ │ │ ├── NavigationFloatServiceImpl.java │ │ │ ├── NavigationUrlsServiceImpl.java │ │ │ └── SearchNavUrlServiceImpl.java │ │ └── utils │ │ └── ResultUtils.java │ └── resources │ ├── application-dev.yml │ ├── application-prod.yml │ ├── application-test.yml │ ├── application.yml │ ├── banner.txt │ └── logback │ └── logback-spring.xml ├── WebNav-Admin ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── browserslist ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.less │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── constants.ts │ │ ├── icons-provider.module.ts │ │ └── pages │ │ │ ├── banner │ │ │ ├── banner-http-service.service.spec.ts │ │ │ ├── banner-http-service.service.ts │ │ │ ├── banner-routing.module.ts │ │ │ ├── banner.component.html │ │ │ ├── banner.component.less │ │ │ ├── banner.component.spec.ts │ │ │ ├── banner.component.ts │ │ │ ├── banner.module.ts │ │ │ └── banner.ts │ │ │ ├── friend-chain │ │ │ ├── friend-chain-http-service.service.ts │ │ │ ├── friend-chain-routing.module.ts │ │ │ ├── friend-chain.component.html │ │ │ ├── friend-chain.component.less │ │ │ ├── friend-chain.component.spec.ts │ │ │ ├── friend-chain.component.ts │ │ │ ├── friend-chain.module.ts │ │ │ └── friend-chain.ts │ │ │ ├── navigation-cate │ │ │ ├── navigation-cate-http-service.service.ts │ │ │ ├── navigation-cate-routing.module.ts │ │ │ ├── navigation-cate.component.html │ │ │ ├── navigation-cate.component.less │ │ │ ├── navigation-cate.component.spec.ts │ │ │ ├── navigation-cate.component.ts │ │ │ ├── navigation-cate.module.ts │ │ │ └── navigation-cate.ts │ │ │ ├── navigation-url │ │ │ ├── navigation-url-http-service.service.ts │ │ │ ├── navigation-url-routing.module.ts │ │ │ ├── navigation-url.component.html │ │ │ ├── navigation-url.component.less │ │ │ ├── navigation-url.component.spec.ts │ │ │ ├── navigation-url.component.ts │ │ │ ├── navigation-url.module.ts │ │ │ └── navigation-url.ts │ │ │ ├── search-navigation │ │ │ ├── search-nav-http-service.service.ts │ │ │ ├── search-navigation-routing.module.ts │ │ │ ├── search-navigation.component.html │ │ │ ├── search-navigation.component.less │ │ │ ├── search-navigation.component.spec.ts │ │ │ ├── search-navigation.component.ts │ │ │ ├── search-navigation.module.ts │ │ │ └── search-navigation.ts │ │ │ └── welcome │ │ │ ├── welcome-routing.module.ts │ │ │ ├── welcome.component.css │ │ │ ├── welcome.component.html │ │ │ ├── welcome.component.ts │ │ │ └── welcome.module.ts │ ├── assets │ │ ├── .gitkeep │ │ └── images │ │ │ ├── logo.png │ │ │ └── website_screenshot.jpg │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.less │ └── test.ts ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.spec.json └── tslint.json ├── WebNav-Web-API ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── README.MD ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ └── main │ ├── .DS_Store │ ├── java │ ├── .DS_Store │ └── com │ │ ├── .DS_Store │ │ └── igreat │ │ ├── .DS_Store │ │ └── webnav │ │ ├── WebnavApplication.java │ │ ├── aop │ │ └── HttpAspect.java │ │ ├── controller │ │ └── IndexController.java │ │ ├── domain │ │ ├── BaseModel.java │ │ ├── NavigationCate.java │ │ ├── NavigationCommon.java │ │ ├── NavigationFloat.java │ │ ├── NavigationUrls.java │ │ ├── SearchNavUrls.java │ │ └── SiteBanner.java │ │ ├── repository │ │ ├── BannerDAO.java │ │ ├── NavigationCateDAO.java │ │ ├── NavigationCommonDAO.java │ │ ├── NavigationFloatDAO.java │ │ ├── NavigationUrlsDAO.java │ │ └── SearchNavUrlsDao.java │ │ ├── result │ │ └── ResultWrapper.java │ │ ├── service │ │ ├── IndexService.java │ │ └── serviceImpl │ │ │ └── IndexServiceImpl.java │ │ └── utils │ │ └── ResultUtils.java │ └── resources │ ├── application-dev.yml │ ├── application-prod.yml │ ├── application-test.yml │ ├── application.yml │ ├── banner.txt │ └── logback │ └── logback-spring.xml └── WebNav ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── browserslist ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── proxy.config.json ├── src ├── app │ ├── apiservice.service.spec.ts │ ├── apiservice.service.ts │ ├── app.component.html │ ├── app.component.less │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── float-url-pipe.pipe.spec.ts │ └── float-url-pipe.pipe.ts ├── assets │ ├── .gitkeep │ └── images │ │ ├── b1.png │ │ ├── b4.png │ │ ├── drop_search.svg │ │ ├── logo.png │ │ ├── music.svg │ │ └── search.png ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts ├── polyfills.ts ├── styles.less └── test.ts ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.spec.json └── tslint.json /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | node_modules 3 | dist 4 | build 5 | 6 | # General 7 | .DS_Store 8 | .AppleDouble 9 | .LSOverride 10 | 11 | # Icon must end with two \r 12 | Icon 13 | 14 | # Thumbnails 15 | ._* 16 | 17 | # Files that might appear in the root of a volume 18 | .DocumentRevisions-V100 19 | .fseventsd 20 | .Spotlight-V100 21 | .TemporaryItems 22 | .Trashes 23 | .VolumeIcon.icns 24 | .com.apple.timemachine.donotpresent 25 | 26 | # Directories potentially created on remote AFP share 27 | .AppleDB 28 | .AppleDesktop 29 | Network Trash Folder 30 | Temporary Items 31 | .apdisk -------------------------------------------------------------------------------- /Resources/WebNav-Admin.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/WebNav-Admin.zip -------------------------------------------------------------------------------- /Resources/WebNav.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/WebNav.zip -------------------------------------------------------------------------------- /Resources/angular使用nginx部署.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/angular使用nginx部署.jpg -------------------------------------------------------------------------------- /Resources/webnav-1.0.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/webnav-1.0.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /Resources/webnav-admin-1.0.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/webnav-admin-1.0.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /Resources/website_screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/website_screenshot.jpg -------------------------------------------------------------------------------- /Resources/仿制最终效果图.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/仿制最终效果图.jpg -------------------------------------------------------------------------------- /Resources/兰客导航网址部分代码分析抓取脚本.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import pymysql 4 | 5 | import traceback 6 | 7 | file_path = "/Users/chenwei/Downloads/兰客导航地址.txt" 8 | file_content = '' 9 | with open(file_path,'r') as f: 10 | file_content = f.read() 11 | url_pattern = r'\s*\s*
(.*?)
' 12 | 13 | pattern = re.compile(url_pattern) 14 | result = pattern.findall(file_content) 15 | 16 | db = pymysql.connect(host="localhost",user="root",password="cCNuQrQJ]nBuD>)4",database="WebNav",charset="UTF8",use_unicode=True) 17 | cursor = db.cursor() 18 | 19 | cateId = 6 20 | canAddNode = ['豆瓣电影本周口碑榜 - 在线观看','Bensound - 免费商用背景音乐 Free','Videvo - 免费库存视频素材','下厨房 - 美食爱好者的分享平台', 21 | 'Google Play - 谷歌应用商店','攝影札記 - 新奇好玩的攝影資訊','PngImg - 免费透明PNG图像','Sketch Swap - 一画换一画','Stahlseite - 光影很强重工业摄影图片','SocialBeta - 社交媒体和数字营销平台','Archdaily - 世界最受欢迎的建筑网站','rdlp.jp - 商品销售页面设计','Type is Beautiful - 文字排版','Rafael-Varona - 清新小众的动图世界','Vector Magic - 最强大的位图转矢量','Qbrushes - 高质量笔刷下载网站','logomoose - 标志灵感','Colourco 在线颜色搭配工具','Vaufonts - 在线生成艺术字体']#可对cateId进行自增的节点 22 | 23 | try: 24 | for item in result: 25 | address = item[0] 26 | # 处理链接中通过lackk.com平台进行跳转的链接 27 | if address.startswith('http://lackk.com/go/?url='): 28 | address = address.replace('http://lackk.com/go/?url=','') 29 | icon = item[1] 30 | # 处理lackk.com平台图片没有前缀的问题 31 | if icon.startswith('img'): 32 | icon = "http://lackk.com/nav/%s" %(icon) 33 | longName = item[2] 34 | shortName = longName 35 | # 将文字中前半部分的名称作为shortName,以-分隔 36 | if shortName.find('-')>-1: 37 | shortName = shortName.split('-')[0].strip() 38 | print(address) 39 | sql = "insert into navigation_urls(icon,short_name,long_name,url,created_by,created_time,order_value,cate_id) values('%s',\'%s\',\'%s\','%s',1,'2019-08-28 18:27:28',0,%d)" %(icon,pymysql.escape_string(shortName),pymysql.escape_string(longName),address,cateId) 40 | cursor.execute(sql) 41 | if longName in canAddNode: 42 | cateId += 1 43 | db.commit() 44 | except Exception as e: 45 | print("出现异常....") 46 | traceback.print_exc() 47 | print(e) 48 | db.rollback() 49 | db.close() 50 | -------------------------------------------------------------------------------- /Resources/前端网站接口设计.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/前端网站接口设计.pdf -------------------------------------------------------------------------------- /Resources/微信收款.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/微信收款.JPG -------------------------------------------------------------------------------- /Resources/打包.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/打包.png -------------------------------------------------------------------------------- /Resources/支付宝收款.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/支付宝收款.JPG -------------------------------------------------------------------------------- /Resources/文件目录.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/文件目录.jpg -------------------------------------------------------------------------------- /Resources/管理后台-分类管理.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/管理后台-分类管理.jpg -------------------------------------------------------------------------------- /Resources/管理后台-友链管理.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/管理后台-友链管理.jpg -------------------------------------------------------------------------------- /Resources/管理后台-搜索管理.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/管理后台-搜索管理.jpg -------------------------------------------------------------------------------- /Resources/管理后台-欢迎页.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/管理后台-欢迎页.jpg -------------------------------------------------------------------------------- /Resources/管理后台-网址管理.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/管理后台-网址管理.jpg -------------------------------------------------------------------------------- /Resources/管理后台-轮播图管理.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/Resources/管理后台-轮播图管理.jpg -------------------------------------------------------------------------------- /WebNav-Admin-API/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /WebNav-Admin-API/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav-Admin-API/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /WebNav-Admin-API/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /WebNav-Admin-API/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.7.RELEASE 9 | 10 | 11 | com.igreat 12 | webnav-admin 13 | 1.0.0-SNAPSHOT 14 | WebNav-Admin-Api 15 | 网址导航管理后台API接口 16 | 17 | 18 | UTF-8 19 | UTF-8 20 | 1.8 21 | 22 | 23 | 24 | org.springframework.boot 25 | spring-boot-starter-data-jpa 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-web 30 | 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-devtools 35 | runtime 36 | true 37 | 38 | 39 | mysql 40 | mysql-connector-java 41 | 42 | 43 | 44 | org.springframework.boot 45 | spring-boot-starter-test 46 | test 47 | 48 | 49 | 50 | commons-lang 51 | commons-lang 52 | 2.6 53 | 54 | 55 | 56 | 57 | 58 | 59 | org.springframework.boot 60 | spring-boot-maven-plugin 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/WebNavAdminApiApplication.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class WebNavAdminApiApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(WebNavAdminApiApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/aop/HttpAspect.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.aop; 2 | 3 | import org.apache.commons.lang.StringUtils; 4 | import org.apache.tomcat.util.http.fileupload.IOUtils; 5 | import org.aspectj.lang.JoinPoint; 6 | import org.aspectj.lang.annotation.Aspect; 7 | import org.aspectj.lang.annotation.Before; 8 | import org.aspectj.lang.annotation.Pointcut; 9 | import org.slf4j.Logger; 10 | import org.slf4j.LoggerFactory; 11 | import org.springframework.stereotype.Component; 12 | import org.springframework.web.context.request.RequestContextHolder; 13 | import org.springframework.web.context.request.ServletRequestAttributes; 14 | 15 | import javax.servlet.http.HttpServletRequest; 16 | import java.io.BufferedReader; 17 | import java.io.IOException; 18 | import java.io.InputStreamReader; 19 | import java.util.Map; 20 | 21 | /** 22 | * Created by D丶Cheng on 2018/7/4. 23 | */ 24 | @Aspect 25 | @Component 26 | public class HttpAspect { 27 | 28 | private final static Logger logger = LoggerFactory.getLogger(HttpAspect.class); 29 | 30 | //切入点 31 | @Pointcut("execution(public * com.igreat.webnav.controller.*.*(..))") 32 | private void auth() { 33 | 34 | } 35 | 36 | @Before("auth()") 37 | private void before(JoinPoint joinPoint) throws Exception { 38 | ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); 39 | HttpServletRequest request = attributes.getRequest(); 40 | logger.info("--------------------------------------------start----------------------------------------------"); 41 | //url 42 | logger.info("url={}", request.getRequestURL()); 43 | //method 44 | logger.info("method={}", request.getMethod()); 45 | //ip 46 | logger.info("ip={}", getIp(request)); 47 | //类名 、 类方法 48 | logger.info("method_class={}", joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName()); 49 | //参数 50 | logger.info("args={}", showParamter(request.getParameterMap())); 51 | 52 | 53 | logger.info("--------------------------------------------end----------------------------------------------"); 54 | } 55 | 56 | 57 | public String showParamter(Map map) { 58 | String result = ""; 59 | for (String key : map.keySet()) { 60 | result += key + ":" + String.valueOf(map.get(key)[0]) + " "; 61 | } 62 | return result; 63 | } 64 | 65 | public static String getIp(HttpServletRequest request) { 66 | String ip = request.getHeader("X-Forwarded-For"); 67 | if (StringUtils.isNotEmpty(ip) && !"unKnown".equalsIgnoreCase(ip)) { 68 | //多次反向代理后会有多个ip值,第一个ip才是真实ip 69 | int index = ip.indexOf(","); 70 | if (index != -1) { 71 | return ip.substring(0, index); 72 | } else { 73 | return ip; 74 | } 75 | } 76 | ip = request.getHeader("X-Real-IP"); 77 | if (StringUtils.isNotEmpty(ip) && !"unKnown".equalsIgnoreCase(ip)) { 78 | return ip; 79 | } 80 | return request.getRemoteAddr(); 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/constant/Constants.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.constant; 2 | 3 | /** 4 | *
 5 |  *     author : 陈伟
 6 |  *     e-mail : chenwei@njbandou.com
 7 |  *     time   : 2019/08/31
 8 |  *     desc   : say something
 9 |  *     version: 1.0
10 |  * 
11 | */ 12 | public class Constants { 13 | /** 14 | * 文件上传路径 15 | */ 16 | public static final String UPLOAD_FILE_PATH = "/Users/chenwei/Downloads"; 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/constant/ErrorCode.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.constant; 2 | 3 | /** 4 | *
 5 |  *     author : 陈伟
 6 |  *     e-mail : chenwei@njbandou.com
 7 |  *     time   : 2019/08/29
 8 |  *     desc   : say something
 9 |  *     version: 1.0
10 |  * 
11 | */ 12 | public interface ErrorCode { 13 | /** 14 | * -1 未知错误 15 | * 0 成功 16 | * 1-1000 逻辑错误 17 | * 1000~ 系统错误 18 | * 1001 参数错误 19 | * 1002 上传文件为空 20 | * 1003 上传文件失败 21 | * 1004 上传文件大小超过指定大小 22 | * 1005 操作的对象不存在 23 | * 1006 节点包含关联关系未解除 24 | */ 25 | public static final int ERR_UNKNOWN = -1; 26 | 27 | public static final int ERR_SUCCESS = 0; 28 | 29 | public static final int ERR_PARAMS = 1001; 30 | 31 | public static final int ERROR_FILE_UPLOAD_EMPTY = 1002; 32 | 33 | public static final int ERROR_FILE_UPLOAD_FAIL = 1003; 34 | 35 | public static final int ERROR_FILE_UPLOAD_MAX_LIMIT = 1004; 36 | 37 | public static final int ERROR_OBJECT_NOT_EXIST = 1005; 38 | 39 | public static final int ERROR_NODE_CONTAIN_ASSOCIATED = 1006; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/controller/BannerController.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.controller; 2 | 3 | import com.igreat.webnav.dto.BannerDTO; 4 | import com.igreat.webnav.result.ResultWrapper; 5 | import com.igreat.webnav.service.BannerService; 6 | import com.igreat.webnav.utils.ResultUtils; 7 | import org.springframework.validation.annotation.Validated; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | import javax.annotation.Resource; 11 | 12 | /** 13 | *
14 |  *     author : 陈伟
15 |  *     e-mail : chenwei@njbandou.com
16 |  *     time   : 2019/08/29
17 |  *     desc   : say something
18 |  *     version: 1.0
19 |  * 
20 | */ 21 | @RestController 22 | @RequestMapping("/banner") 23 | @CrossOrigin("*") 24 | public class BannerController { 25 | 26 | @Resource 27 | BannerService bannerService; 28 | 29 | @GetMapping("/list") 30 | public ResultWrapper findByConditions(@RequestParam(required = false) String keywords, 31 | @RequestParam(required = false, defaultValue = "10") Integer pageSize, 32 | @RequestParam(required = false, defaultValue = "0") Integer pageIndex) { 33 | return ResultUtils.success(bannerService.findList(keywords, pageIndex, pageSize)); 34 | } 35 | 36 | @PostMapping("/addOrUpdate") 37 | public ResultWrapper addOrUpdate(@RequestBody @Validated BannerDTO bannerDTO) { 38 | ResultWrapper resultWrapper = null; 39 | if (bannerDTO.getPkId() != null) { 40 | resultWrapper = bannerService.update(bannerDTO); 41 | } else { 42 | resultWrapper = bannerService.add(bannerDTO); 43 | } 44 | return resultWrapper; 45 | } 46 | 47 | @PostMapping("/delete") 48 | public ResultWrapper delete(@RequestBody Integer[] ids) { 49 | return bannerService.delete(ids); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/controller/CommonController.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.controller; 2 | 3 | import com.igreat.webnav.constant.Constants; 4 | import com.igreat.webnav.constant.ErrorCode; 5 | import com.igreat.webnav.result.ResultWrapper; 6 | import com.igreat.webnav.utils.ResultUtils; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.beans.factory.annotation.Value; 10 | import org.springframework.web.bind.annotation.*; 11 | import org.springframework.web.multipart.MultipartFile; 12 | 13 | import java.io.File; 14 | import java.io.IOException; 15 | import java.text.SimpleDateFormat; 16 | import java.util.Date; 17 | import java.util.HashMap; 18 | 19 | 20 | /** 21 | *
22 |  *     author : 陈伟
23 |  *     e-mail : chenwei@njbandou.com
24 |  *     time   : 2019/08/31
25 |  *     desc   : say something
26 |  *     version: 1.0
27 |  * 
28 | */ 29 | @RestController 30 | @RequestMapping("/common") 31 | @CrossOrigin("*") 32 | public class CommonController { 33 | private static final Logger logger = LoggerFactory.getLogger(CommonController.class); 34 | 35 | @Value("${app.file.location}") 36 | private String fileSaveDirectory = null; 37 | 38 | /** 39 | * 环境目录前缀 40 | * server : 服务器本地 41 | * qiniu: 七牛云 42 | * oss: 阿里云OSS 43 | */ 44 | @Value("${app.file.suffix}") 45 | private String envDirSuffix = null; 46 | 47 | @PostMapping("/upload") 48 | public ResultWrapper uploadFile(@RequestParam("file") MultipartFile file) { 49 | if (file.isEmpty()) { 50 | return ResultUtils.fail(ErrorCode.ERROR_FILE_UPLOAD_EMPTY,"上传文件不能为空"); 51 | } 52 | String suffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); 53 | String filename = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + suffix; 54 | File saveFile = new File(new File(fileSaveDirectory,envDirSuffix), filename); 55 | if (!saveFile.getParentFile().exists()) { 56 | saveFile.getParentFile().mkdirs(); 57 | } 58 | try { 59 | file.transferTo(saveFile); 60 | HashMap map = new HashMap(); 61 | map.put("path", envDirSuffix + filename); 62 | return ResultUtils.success(map); 63 | } catch (IOException e) { 64 | e.printStackTrace(); 65 | } 66 | return ResultUtils.fail(ErrorCode.ERROR_FILE_UPLOAD_FAIL, "服务器文件保存错误,请重试!"); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/controller/NavigationCateController.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.controller; 2 | 3 | import com.igreat.webnav.aop.HttpAspect; 4 | import com.igreat.webnav.dto.NavigationCateDTO; 5 | import com.igreat.webnav.dto.SearchUrlDTO; 6 | import com.igreat.webnav.result.ResultWrapper; 7 | import com.igreat.webnav.service.NavigationCateService; 8 | import com.igreat.webnav.utils.ResultUtils; 9 | import org.slf4j.LoggerFactory; 10 | import org.springframework.validation.annotation.Validated; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import javax.annotation.Resource; 14 | import java.util.logging.Logger; 15 | 16 | /** 17 | *
18 |  *     author : 陈伟
19 |  *     e-mail : chenwei@njbandou.com
20 |  *     time   : 2019/08/29
21 |  *     desc   : say something
22 |  *     version: 1.0
23 |  * 
24 | */ 25 | @RestController 26 | @RequestMapping("/navigation-cate") 27 | @CrossOrigin("*") 28 | public class NavigationCateController { 29 | private final static org.slf4j.Logger logger = LoggerFactory.getLogger(NavigationCateController.class); 30 | 31 | @Resource 32 | NavigationCateService navigationCateService; 33 | 34 | @GetMapping("/list") 35 | public ResultWrapper findByConditions(@RequestParam(required = false) String keywords, 36 | @RequestParam(required = false, defaultValue = "-1") Integer parentId) { 37 | return ResultUtils.success(navigationCateService.findList(keywords,parentId)); 38 | } 39 | 40 | @PostMapping("/addOrUpdate") 41 | public ResultWrapper addOrUpdate(@RequestBody @Validated NavigationCateDTO bannerDTO) { 42 | ResultWrapper resultWrapper = null; 43 | if (bannerDTO.getPkId() != null) { 44 | resultWrapper = navigationCateService.update(bannerDTO); 45 | } else { 46 | resultWrapper = navigationCateService.add(bannerDTO); 47 | } 48 | return resultWrapper; 49 | } 50 | 51 | @PostMapping("/delete") 52 | public ResultWrapper delete(@RequestBody Integer[] ids) { 53 | return navigationCateService.delete(ids); 54 | } 55 | 56 | } -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/controller/NavigationCommonController.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.controller; 2 | 3 | import com.igreat.webnav.dto.NavigationCommonDTO; 4 | import com.igreat.webnav.dto.NavigationFloatDTO; 5 | import com.igreat.webnav.result.ResultWrapper; 6 | import com.igreat.webnav.service.NavigationCommonService; 7 | import com.igreat.webnav.utils.ResultUtils; 8 | import org.springframework.validation.annotation.Validated; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import javax.annotation.Resource; 12 | 13 | /** 14 | *
15 |  *     author : 陈伟
16 |  *     e-mail : chenwei@njbandou.com
17 |  *     time   : 2019/08/29
18 |  *     desc   : say something
19 |  *     version: 1.0
20 |  * 
21 | */ 22 | @RestController 23 | @RequestMapping("/navigation-common") 24 | @CrossOrigin("*") 25 | public class NavigationCommonController { 26 | 27 | @Resource 28 | NavigationCommonService navigationCommonService; 29 | 30 | @GetMapping("/list") 31 | public ResultWrapper findByConditions(@RequestParam(required = false) String keywords, 32 | @RequestParam(required = false, defaultValue = "10") Integer pageSize, 33 | @RequestParam(required = false, defaultValue = "0") Integer pageIndex) { 34 | return ResultUtils.success(navigationCommonService.findList(keywords, pageIndex, pageSize)); 35 | } 36 | 37 | @PostMapping("/addOrUpdate") 38 | public ResultWrapper addOrUpdate(@RequestBody @Validated NavigationCommonDTO bannerDTO) { 39 | ResultWrapper resultWrapper = null; 40 | if (bannerDTO.getPkId() != null) { 41 | resultWrapper = navigationCommonService.update(bannerDTO); 42 | } else { 43 | resultWrapper = navigationCommonService.add(bannerDTO); 44 | } 45 | return resultWrapper; 46 | } 47 | 48 | @PostMapping("/delete") 49 | public ResultWrapper delete(@RequestBody Integer[] ids) { 50 | return navigationCommonService.delete(ids); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/controller/NavigationFloatController.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.controller; 2 | 3 | import com.igreat.webnav.dto.NavigationFloatDTO; 4 | import com.igreat.webnav.result.ResultWrapper; 5 | import com.igreat.webnav.service.NavigationFloatService; 6 | import com.igreat.webnav.utils.ResultUtils; 7 | import org.springframework.validation.annotation.Validated; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | import javax.annotation.Resource; 11 | 12 | /** 13 | *
14 |  *     author : 陈伟
15 |  *     e-mail : chenwei@njbandou.com
16 |  *     time   : 2019/08/29
17 |  *     desc   : say something
18 |  *     version: 1.0
19 |  * 
20 | */ 21 | @RestController 22 | @RequestMapping("/navigation-float") 23 | @CrossOrigin("*") 24 | public class NavigationFloatController { 25 | 26 | @Resource 27 | NavigationFloatService navigationFloatService; 28 | 29 | @GetMapping("/list") 30 | public ResultWrapper findByConditions(@RequestParam(required = false) String keywords, 31 | @RequestParam(required = false, defaultValue = "10") Integer pageSize, 32 | @RequestParam(required = false, defaultValue = "0") Integer pageIndex, 33 | @RequestParam(required = false, defaultValue = "0") Integer level) { 34 | return ResultUtils.success(navigationFloatService.findList(keywords, pageIndex, pageSize,level)); 35 | } 36 | 37 | @PostMapping("/addOrUpdate") 38 | public ResultWrapper addOrUpdate(@RequestBody @Validated NavigationFloatDTO bannerDTO) { 39 | ResultWrapper resultWrapper = null; 40 | if (bannerDTO.getPkId() != null) { 41 | resultWrapper = navigationFloatService.update(bannerDTO); 42 | } else { 43 | resultWrapper = navigationFloatService.add(bannerDTO); 44 | } 45 | return resultWrapper; 46 | } 47 | 48 | @PostMapping("/delete") 49 | public ResultWrapper delete(@RequestBody Integer[] ids) { 50 | return navigationFloatService.delete(ids); 51 | } 52 | 53 | } 54 | 55 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/controller/NavigationUrlsController.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.controller; 2 | 3 | import com.igreat.webnav.dto.NavigationUrlDTO; 4 | import com.igreat.webnav.dto.SearchUrlDTO; 5 | import com.igreat.webnav.result.ResultWrapper; 6 | import com.igreat.webnav.service.NavigationUrlsService; 7 | import com.igreat.webnav.utils.ResultUtils; 8 | import org.springframework.validation.annotation.Validated; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import javax.annotation.Resource; 12 | 13 | /** 14 | *
15 |  *     author : 陈伟
16 |  *     e-mail : chenwei@njbandou.com
17 |  *     time   : 2019/08/29
18 |  *     desc   : say something
19 |  *     version: 1.0
20 |  * 
21 | */ 22 | @RestController 23 | @RequestMapping("/navigation-urls") 24 | @CrossOrigin("*") 25 | public class NavigationUrlsController { 26 | 27 | @Resource 28 | NavigationUrlsService navigationUrlsService; 29 | 30 | @GetMapping("/list") 31 | public ResultWrapper findByConditions(@RequestParam(required = false) String keywords, 32 | @RequestParam(required = false, defaultValue = "10") Integer pageSize, 33 | @RequestParam(required = false, defaultValue = "0") Integer pageIndex, 34 | @RequestParam(required = false, defaultValue = "-1") Integer cateId) { 35 | return ResultUtils.success(navigationUrlsService.findList(keywords, pageIndex, pageSize,cateId)); 36 | } 37 | 38 | @PostMapping("/addOrUpdate") 39 | public ResultWrapper addOrUpdate(@RequestBody @Validated NavigationUrlDTO bannerDTO) { 40 | ResultWrapper resultWrapper = null; 41 | if (bannerDTO.getPkId() != null) { 42 | resultWrapper = navigationUrlsService.update(bannerDTO); 43 | } else { 44 | resultWrapper = navigationUrlsService.add(bannerDTO); 45 | } 46 | return resultWrapper; 47 | } 48 | 49 | @PostMapping("/delete") 50 | public ResultWrapper delete(@RequestBody Integer[] ids) { 51 | return navigationUrlsService.delete(ids); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/controller/SearchNavUrlsController.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.controller; 2 | 3 | import com.igreat.webnav.dto.SearchUrlDTO; 4 | import com.igreat.webnav.result.ResultWrapper; 5 | import com.igreat.webnav.service.SearchNavUrlService; 6 | import com.igreat.webnav.utils.ResultUtils; 7 | import org.springframework.validation.annotation.Validated; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | import javax.annotation.Resource; 11 | 12 | /** 13 | *
14 |  *     author : 陈伟
15 |  *     e-mail : chenwei@njbandou.com
16 |  *     time   : 2019/08/29
17 |  *     desc   : say something
18 |  *     version: 1.0
19 |  * 
20 | */ 21 | @RestController 22 | @RequestMapping("/search-nav") 23 | @CrossOrigin("*") 24 | public class SearchNavUrlsController { 25 | 26 | @Resource 27 | SearchNavUrlService searchNavUrlService; 28 | 29 | @GetMapping("/list") 30 | public ResultWrapper findByConditions(@RequestParam(required = false) String keywords, 31 | @RequestParam(required = false, defaultValue = "10") Integer pageSize, 32 | @RequestParam(required = false, defaultValue = "0") Integer pageIndex, 33 | @RequestParam(required = false, defaultValue = "-1") Integer leaderId) { 34 | return ResultUtils.success(searchNavUrlService.findList(keywords, pageIndex, pageSize,leaderId)); 35 | } 36 | 37 | @PostMapping("/addOrUpdate") 38 | public ResultWrapper addOrUpdate(@RequestBody @Validated SearchUrlDTO bannerDTO) { 39 | ResultWrapper resultWrapper = null; 40 | if (bannerDTO.getPkId() != null) { 41 | resultWrapper = searchNavUrlService.update(bannerDTO); 42 | } else { 43 | resultWrapper = searchNavUrlService.add(bannerDTO); 44 | } 45 | return resultWrapper; 46 | } 47 | 48 | @PostMapping("/delete") 49 | public ResultWrapper delete(@RequestBody Integer[] ids) { 50 | return searchNavUrlService.delete(ids); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/domain/BaseModel.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.domain; 2 | 3 | import javax.persistence.GeneratedValue; 4 | import javax.persistence.GenerationType; 5 | import javax.persistence.Id; 6 | import javax.persistence.MappedSuperclass; 7 | import java.util.Date; 8 | 9 | /** 10 | *
11 |  *     author : 陈伟
12 |  *     e-mail : chenwei@njbandou.com
13 |  *     time   : 2019/08/28
14 |  *     desc   : say something
15 |  *     version: 1.0
16 |  * 
17 | */ 18 | @MappedSuperclass 19 | public class BaseModel { 20 | @Id 21 | @GeneratedValue(strategy = GenerationType.IDENTITY) 22 | private Integer pkId; 23 | /** 24 | * 创建时间 25 | */ 26 | private Date createdTime; 27 | /** 28 | * 创建人 29 | */ 30 | private Integer createdBy; 31 | /** 32 | * 更新时间 33 | */ 34 | private Date updatedTime; 35 | /** 36 | * 更新人 37 | */ 38 | private Integer updatedBy; 39 | 40 | /** 41 | * 排序值 42 | */ 43 | private Integer orderValue; 44 | 45 | public Integer getPkId() { 46 | return pkId; 47 | } 48 | 49 | public void setPkId(Integer pkId) { 50 | this.pkId = pkId; 51 | } 52 | 53 | public Integer getOrderValue() { 54 | return orderValue; 55 | } 56 | 57 | public void setOrderValue(Integer orderValue) { 58 | this.orderValue = orderValue; 59 | } 60 | 61 | public Date getCreatedTime() { 62 | return createdTime; 63 | } 64 | 65 | public void setCreatedTime(Date createdTime) { 66 | this.createdTime = createdTime; 67 | } 68 | 69 | public Integer getCreatedBy() { 70 | return createdBy; 71 | } 72 | 73 | public void setCreatedBy(Integer createdBy) { 74 | this.createdBy = createdBy; 75 | } 76 | 77 | public Date getUpdatedTime() { 78 | return updatedTime; 79 | } 80 | 81 | public void setUpdatedTime(Date updatedTime) { 82 | this.updatedTime = updatedTime; 83 | } 84 | 85 | public Integer getUpdatedBy() { 86 | return updatedBy; 87 | } 88 | 89 | public void setUpdatedBy(Integer updatedBy) { 90 | this.updatedBy = updatedBy; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/domain/NavigationCate.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | 6 | /** 7 | *
  8 |  *     author : 陈伟
  9 |  *     e-mail : chenwei@njbandou.com
 10 |  *     time   : 2019/08/28
 11 |  *     desc   : say something
 12 |  *     version: 1.0
 13 |  * 
14 | */ 15 | @Entity 16 | @Table(name = "navigation_cate") 17 | public class NavigationCate extends BaseModel { 18 | /** 19 | * 分类名称 20 | */ 21 | private String name; 22 | /** 23 | * 图标 24 | */ 25 | private String icon; 26 | /** 27 | * 主题颜色;以十六进制表示,以#号开头 28 | */ 29 | private String themeColor; 30 | /** 31 | * 简介;简短说明,不宜过长 32 | */ 33 | private String intro; 34 | /** 35 | * 父级标识;顶级为0 36 | */ 37 | private Integer parentId; 38 | /** 39 | * 级别;从0开始 40 | */ 41 | private Integer level; 42 | 43 | /** 44 | * 分类名称 45 | */ 46 | public String getName() { 47 | return this.name; 48 | } 49 | 50 | /** 51 | * 分类名称 52 | */ 53 | public void setName(String name) { 54 | this.name = name; 55 | } 56 | 57 | /** 58 | * 图标 59 | */ 60 | public String getIcon() { 61 | return this.icon; 62 | } 63 | 64 | /** 65 | * 图标 66 | */ 67 | public void setIcon(String icon) { 68 | this.icon = icon; 69 | } 70 | 71 | /** 72 | * 主题颜色;以十六进制表示,以#号开头 73 | */ 74 | public String getThemeColor() { 75 | return this.themeColor; 76 | } 77 | 78 | /** 79 | * 主题颜色;以十六进制表示,以#号开头 80 | */ 81 | public void setThemeColor(String themeColor) { 82 | this.themeColor = themeColor; 83 | } 84 | 85 | /** 86 | * 简介;简短说明,不宜过长 87 | */ 88 | public String getIntro() { 89 | return this.intro; 90 | } 91 | 92 | /** 93 | * 简介;简短说明,不宜过长 94 | */ 95 | public void setIntro(String intro) { 96 | this.intro = intro; 97 | } 98 | 99 | /** 100 | * 父级标识;顶级为0 101 | */ 102 | public Integer getParentId() { 103 | return this.parentId; 104 | } 105 | 106 | /** 107 | * 父级标识;顶级为0 108 | */ 109 | public void setParentId(Integer parentId) { 110 | this.parentId = parentId; 111 | } 112 | 113 | /** 114 | * 级别;从0开始 115 | */ 116 | public Integer getLevel() { 117 | return this.level; 118 | } 119 | 120 | /** 121 | * 级别;从0开始 122 | */ 123 | public void setLevel(Integer level) { 124 | this.level = level; 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/domain/NavigationCommon.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/08/28
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | @Entity 16 | @Table(name = "navigation_common") 17 | public class NavigationCommon extends BaseModel { 18 | /** 19 | * 图标 20 | */ 21 | private String icon; 22 | /** 23 | * 名称 24 | */ 25 | private String name; 26 | /** 27 | * 链接地址 28 | */ 29 | private String url; 30 | 31 | /** 32 | * 图标 33 | */ 34 | public String getIcon() { 35 | return this.icon; 36 | } 37 | 38 | /** 39 | * 图标 40 | */ 41 | public void setIcon(String icon) { 42 | this.icon = icon; 43 | } 44 | 45 | /** 46 | * 名称 47 | */ 48 | public String getName() { 49 | return this.name; 50 | } 51 | 52 | /** 53 | * 名称 54 | */ 55 | public void setName(String name) { 56 | this.name = name; 57 | } 58 | 59 | /** 60 | * 链接地址 61 | */ 62 | public String getUrl() { 63 | return this.url; 64 | } 65 | 66 | /** 67 | * 链接地址 68 | */ 69 | public void setUrl(String url) { 70 | this.url = url; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/domain/NavigationFloat.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/08/28
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | @Entity 16 | @Table(name = "navigation_float") 17 | public class NavigationFloat extends BaseModel { 18 | /** 19 | * 名称 20 | */ 21 | private String name; 22 | /** 23 | * 链接地址 24 | */ 25 | private String url; 26 | /** 27 | * 颜色;十六进制表示,以#号开头 28 | */ 29 | private String textColor; 30 | /** 31 | * 层;显示在上层还是下层,1表示上层,2表示下层 32 | */ 33 | private Integer level; 34 | 35 | /** 36 | * 名称 37 | */ 38 | public String getName() { 39 | return this.name; 40 | } 41 | 42 | /** 43 | * 名称 44 | */ 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | /** 50 | * 链接地址 51 | */ 52 | public String getUrl() { 53 | return this.url; 54 | } 55 | 56 | /** 57 | * 链接地址 58 | */ 59 | public void setUrl(String url) { 60 | this.url = url; 61 | } 62 | 63 | /** 64 | * 颜色;十六进制表示,以#号开头 65 | */ 66 | public String getTextColor() { 67 | return this.textColor; 68 | } 69 | 70 | /** 71 | * 颜色;十六进制表示,以#号开头 72 | */ 73 | public void setTextColor(String textColor) { 74 | this.textColor = textColor; 75 | } 76 | 77 | /** 78 | * 层;显示在上层还是下层,1表示上层,2表示下层 79 | */ 80 | public Integer getLevel() { 81 | return this.level; 82 | } 83 | 84 | /** 85 | * 层;显示在上层还是下层,1表示上层,2表示下层 86 | */ 87 | public void setLevel(Integer level) { 88 | this.level = level; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/domain/NavigationUrls.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | 6 | /** 7 | *
  8 |  *     author : 陈伟
  9 |  *     e-mail : chenwei@njbandou.com
 10 |  *     time   : 2019/08/28
 11 |  *     desc   : say something
 12 |  *     version: 1.0
 13 |  * 
14 | */ 15 | @Entity 16 | @Table(name = "navigation_urls") 17 | public class NavigationUrls extends BaseModel { 18 | /** 19 | * 图标 20 | */ 21 | private String icon; 22 | /** 23 | * 短名称 24 | */ 25 | private String shortName; 26 | /** 27 | * 长名称 28 | */ 29 | private String longName; 30 | /** 31 | * 链接地址 32 | */ 33 | private String url; 34 | 35 | /** 36 | * 所属分类编号 37 | */ 38 | private Integer cateId; 39 | 40 | /** 41 | * 图标 42 | */ 43 | public String getIcon() { 44 | return this.icon; 45 | } 46 | 47 | /** 48 | * 图标 49 | */ 50 | public void setIcon(String icon) { 51 | this.icon = icon; 52 | } 53 | 54 | /** 55 | * 短名称 56 | */ 57 | public String getShortName() { 58 | return this.shortName; 59 | } 60 | 61 | /** 62 | * 短名称 63 | */ 64 | public void setShortName(String shortName) { 65 | this.shortName = shortName; 66 | } 67 | 68 | /** 69 | * 长名称 70 | */ 71 | public String getLongName() { 72 | return this.longName; 73 | } 74 | 75 | /** 76 | * 长名称 77 | */ 78 | public void setLongName(String longName) { 79 | this.longName = longName; 80 | } 81 | 82 | /** 83 | * 链接地址 84 | */ 85 | public String getUrl() { 86 | return this.url; 87 | } 88 | 89 | /** 90 | * 链接地址 91 | */ 92 | public void setUrl(String url) { 93 | this.url = url; 94 | } 95 | 96 | /** 97 | * 所属分类编号 98 | */ 99 | public Integer getCateId() { 100 | return this.cateId; 101 | } 102 | 103 | /** 104 | * 所属分类编号 105 | */ 106 | public void setCateId(Integer cateId) { 107 | this.cateId = cateId; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/domain/SearchNavUrls.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/08/28
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | @Entity 16 | @Table(name = "search_nav_urls") 17 | public class SearchNavUrls extends BaseModel { 18 | /** 19 | * 图标 20 | */ 21 | private String icon; 22 | /** 23 | * 名称 24 | */ 25 | private String name; 26 | /** 27 | * 链接地址 28 | */ 29 | private String url; 30 | /** 31 | * 领导编号;上级领导编号,为0表示该链接为领导链接。即在页面上第一个显示的链接,其它只有在鼠标悬停后再显示 32 | */ 33 | private Integer leaderId; 34 | 35 | /** 36 | * 图标 37 | */ 38 | public String getIcon() { 39 | return this.icon; 40 | } 41 | 42 | /** 43 | * 图标 44 | */ 45 | public void setIcon(String icon) { 46 | this.icon = icon; 47 | } 48 | 49 | /** 50 | * 名称 51 | */ 52 | public String getName() { 53 | return this.name; 54 | } 55 | 56 | /** 57 | * 名称 58 | */ 59 | public void setName(String name) { 60 | this.name = name; 61 | } 62 | 63 | /** 64 | * 链接地址 65 | */ 66 | public String getUrl() { 67 | return this.url; 68 | } 69 | 70 | /** 71 | * 链接地址 72 | */ 73 | public void setUrl(String url) { 74 | this.url = url; 75 | } 76 | 77 | /** 78 | * 领导编号;上级领导编号,为0表示该链接为领导链接。即在页面上第一个显示的链接,其它只有在鼠标悬停后再显示 79 | */ 80 | public Integer getLeaderId() { 81 | return this.leaderId; 82 | } 83 | 84 | /** 85 | * 领导编号;上级领导编号,为0表示该链接为领导链接。即在页面上第一个显示的链接,其它只有在鼠标悬停后再显示 86 | */ 87 | public void setLeaderId(Integer leaderId) { 88 | this.leaderId = leaderId; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/domain/SiteBanner.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/08/28
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | @Entity 16 | @Table(name = "site_banner") 17 | public class SiteBanner extends BaseModel { 18 | /** 19 | * 广告标题;长度不超过8个中文字符 20 | */ 21 | private String title; 22 | /** 23 | * 图片;支持jpg/png/gif 24 | */ 25 | private String image; 26 | 27 | /** 28 | * 广告标题;长度不超过8个中文字符 29 | */ 30 | public String getTitle() { 31 | return this.title; 32 | } 33 | 34 | /** 35 | * 广告标题;长度不超过8个中文字符 36 | */ 37 | public void setTitle(String title) { 38 | this.title = title; 39 | } 40 | 41 | /** 42 | * 图片;支持jpg/png/gif 43 | */ 44 | public String getImage() { 45 | return this.image; 46 | } 47 | 48 | /** 49 | * 图片;支持jpg/png/gif 50 | */ 51 | public void setImage(String image) { 52 | this.image = image; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/dto/BannerDTO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.dto; 2 | 3 | import javax.validation.constraints.Min; 4 | import javax.validation.constraints.NotBlank; 5 | import javax.validation.constraints.NotEmpty; 6 | import javax.validation.constraints.NotNull; 7 | 8 | /** 9 | *
10 |  *     author : 陈伟
11 |  *     e-mail : chenwei@njbandou.com
12 |  *     time   : 2019/08/29
13 |  *     desc   : say something
14 |  *     version: 1.0
15 |  * 
16 | */ 17 | public class BannerDTO { 18 | private Integer pkId; 19 | @NotBlank(message = "轮播图标题不能为空") 20 | private String title; 21 | @NotBlank(message = "图片路径不能为空") 22 | private String image; 23 | // @NotNull(message = "排序值不能为空") 24 | private Integer orderValue; 25 | 26 | public Integer getPkId() { 27 | return pkId; 28 | } 29 | 30 | public void setPkId(Integer pkId) { 31 | this.pkId = pkId; 32 | } 33 | 34 | public String getTitle() { 35 | return title; 36 | } 37 | 38 | public void setTitle(String title) { 39 | this.title = title; 40 | } 41 | 42 | public String getImage() { 43 | return image; 44 | } 45 | 46 | public void setImage(String image) { 47 | this.image = image; 48 | } 49 | 50 | public Integer getOrderValue() { 51 | return orderValue; 52 | } 53 | 54 | public void setOrderValue(Integer orderValue) { 55 | this.orderValue = orderValue; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/dto/NavigationCateDTO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.dto; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | import javax.validation.constraints.NotNull; 5 | 6 | /** 7 | *
  8 |  *     author : 陈伟
  9 |  *     e-mail : chenwei@njbandou.com
 10 |  *     time   : 2019/09/03
 11 |  *     desc   : say something
 12 |  *     version: 1.0
 13 |  * 
14 | */ 15 | public class NavigationCateDTO { 16 | private Integer pkId; 17 | @NotBlank(message = "名称不能为空") 18 | private String name; 19 | // @NotNull(message = "图标不能为空") 20 | private String icon; 21 | // @NotNull(message = "分类字体颜色不能为空") 22 | private String themeColor; 23 | // @NotNull(message = "intro参数不能为空") 24 | private String intro; 25 | @NotNull(message = "orderValue参数不能为空") 26 | private Integer orderValue; 27 | @NotNull(message = "parentId参数不能为空") 28 | private Integer parentId; 29 | @NotNull(message = "level参数不能为空") 30 | private Integer level; 31 | 32 | public Integer getPkId() { 33 | return pkId; 34 | } 35 | 36 | public void setPkId(Integer pkId) { 37 | this.pkId = pkId; 38 | } 39 | 40 | public String getIcon() { 41 | return icon; 42 | } 43 | 44 | public void setIcon(String icon) { 45 | this.icon = icon; 46 | } 47 | 48 | public String getThemeColor() { 49 | return themeColor; 50 | } 51 | 52 | public void setThemeColor(String themeColor) { 53 | this.themeColor = themeColor; 54 | } 55 | 56 | public String getIntro() { 57 | return intro; 58 | } 59 | 60 | public void setIntro(String intro) { 61 | this.intro = intro; 62 | } 63 | 64 | public Integer getOrderValue() { 65 | return orderValue; 66 | } 67 | 68 | public void setOrderValue(Integer orderValue) { 69 | this.orderValue = orderValue; 70 | } 71 | 72 | public Integer getParentId() { 73 | return parentId; 74 | } 75 | 76 | public void setParentId(Integer parentId) { 77 | this.parentId = parentId; 78 | } 79 | 80 | public Integer getLevel() { 81 | return level; 82 | } 83 | 84 | public void setLevel(Integer level) { 85 | this.level = level; 86 | } 87 | 88 | public String getName() { 89 | return name; 90 | } 91 | 92 | public void setName(String name) { 93 | this.name = name; 94 | } 95 | 96 | @Override 97 | public String toString() { 98 | return "NavigationCateDTO{" + 99 | "pkId=" + pkId + 100 | ", name='" + name + '\'' + 101 | ", icon='" + icon + '\'' + 102 | ", themeColor='" + themeColor + '\'' + 103 | ", intro='" + intro + '\'' + 104 | ", orderValue=" + orderValue + 105 | ", parentId=" + parentId + 106 | ", level=" + level + 107 | '}'; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/dto/NavigationCommonDTO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.dto; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | import javax.validation.constraints.NotNull; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/09/03
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | public class NavigationCommonDTO { 16 | private Integer pkId; 17 | @NotBlank(message = "图标不能为空") 18 | private String icon; 19 | @NotBlank(message = "链接地址不能为空") 20 | private String url; 21 | @NotBlank(message = "名称不能为空") 22 | private String name; 23 | // @NotBlank(message = "排序值不能为空") 24 | private Integer orderValue; 25 | 26 | public String getIcon() { 27 | return icon; 28 | } 29 | 30 | public void setIcon(String icon) { 31 | this.icon = icon; 32 | } 33 | 34 | public String getUrl() { 35 | return url; 36 | } 37 | 38 | public void setUrl(String url) { 39 | this.url = url; 40 | } 41 | 42 | public String getName() { 43 | return name; 44 | } 45 | 46 | public void setName(String name) { 47 | this.name = name; 48 | } 49 | 50 | public Integer getOrderValue() { 51 | return orderValue; 52 | } 53 | 54 | public void setOrderValue(Integer orderValue) { 55 | this.orderValue = orderValue; 56 | } 57 | 58 | public Integer getPkId() { 59 | return pkId; 60 | } 61 | 62 | public void setPkId(Integer pkId) { 63 | this.pkId = pkId; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/dto/NavigationFloatDTO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.dto; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | import javax.validation.constraints.NotNull; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/09/03
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | public class NavigationFloatDTO { 16 | private Integer pkId; 17 | @NotBlank(message = "名称不能为空") 18 | private String name; 19 | @NotBlank(message = "链接地址不能为空") 20 | private String url; 21 | @NotBlank(message = "颜色不能为空") 22 | private String textColor; 23 | @NotNull(message = "显示位置不能为空") 24 | private Integer level; 25 | // @NotBlank(message = "排序值不能为空") 26 | private Integer orderValue; 27 | 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | public void setName(String name) { 33 | this.name = name; 34 | } 35 | 36 | public String getUrl() { 37 | return url; 38 | } 39 | 40 | public void setUrl(String url) { 41 | this.url = url; 42 | } 43 | 44 | public String getTextColor() { 45 | return textColor; 46 | } 47 | 48 | public void setTextColor(String textColor) { 49 | this.textColor = textColor; 50 | } 51 | 52 | public Integer getLevel() { 53 | return level; 54 | } 55 | 56 | public void setLevel(Integer level) { 57 | this.level = level; 58 | } 59 | 60 | public Integer getOrderValue() { 61 | return orderValue; 62 | } 63 | 64 | public void setOrderValue(Integer orderValue) { 65 | this.orderValue = orderValue; 66 | } 67 | 68 | public Integer getPkId() { 69 | return pkId; 70 | } 71 | 72 | public void setPkId(Integer pkId) { 73 | this.pkId = pkId; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/dto/NavigationUrlDTO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.dto; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | import javax.validation.constraints.NotNull; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/09/03
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | public class NavigationUrlDTO { 16 | private Integer pkId; 17 | @NotBlank(message = "图标不能为空") 18 | private String icon; 19 | @NotBlank(message = "网站简称不能为空") 20 | private String shortName; 21 | @NotBlank(message = "网站长名不能为空") 22 | private String longName; 23 | @NotBlank(message = "链接不能为空") 24 | private String url; 25 | @NotNull 26 | private Integer orderValue; 27 | @NotNull 28 | private Integer cateId; 29 | 30 | public Integer getPkId() { 31 | return pkId; 32 | } 33 | 34 | public void setPkId(Integer pkId) { 35 | this.pkId = pkId; 36 | } 37 | 38 | public String getIcon() { 39 | return icon; 40 | } 41 | 42 | public void setIcon(String icon) { 43 | this.icon = icon; 44 | } 45 | 46 | public String getShortName() { 47 | return shortName; 48 | } 49 | 50 | public void setShortName(String shortName) { 51 | this.shortName = shortName; 52 | } 53 | 54 | public String getLongName() { 55 | return longName; 56 | } 57 | 58 | public void setLongName(String longName) { 59 | this.longName = longName; 60 | } 61 | 62 | public String getUrl() { 63 | return url; 64 | } 65 | 66 | public void setUrl(String url) { 67 | this.url = url; 68 | } 69 | 70 | public Integer getOrderValue() { 71 | return orderValue; 72 | } 73 | 74 | public void setOrderValue(Integer orderValue) { 75 | this.orderValue = orderValue; 76 | } 77 | 78 | public Integer getCateId() { 79 | return cateId; 80 | } 81 | 82 | public void setCateId(Integer cateId) { 83 | this.cateId = cateId; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/dto/SearchUrlDTO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.dto; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | import javax.validation.constraints.NotNull; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/09/03
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | public class SearchUrlDTO { 16 | private Integer pkId; 17 | @NotBlank(message = "图标不能为空") 18 | private String icon; 19 | @NotBlank(message = "网站名称不能为空") 20 | private String name; 21 | @NotBlank(message = "链接不能为空") 22 | private String url; 23 | @NotNull 24 | private Integer orderValue; 25 | @NotNull 26 | private Integer leaderId; 27 | 28 | public Integer getPkId() { 29 | return pkId; 30 | } 31 | 32 | public void setPkId(Integer pkId) { 33 | this.pkId = pkId; 34 | } 35 | 36 | public String getIcon() { 37 | return icon; 38 | } 39 | 40 | public void setIcon(String icon) { 41 | this.icon = icon; 42 | } 43 | 44 | public String getName() { 45 | return name; 46 | } 47 | 48 | public void setName(String name) { 49 | this.name = name; 50 | } 51 | 52 | public String getUrl() { 53 | return url; 54 | } 55 | 56 | public void setUrl(String url) { 57 | this.url = url; 58 | } 59 | 60 | public Integer getOrderValue() { 61 | return orderValue; 62 | } 63 | 64 | public void setOrderValue(Integer orderValue) { 65 | this.orderValue = orderValue; 66 | } 67 | 68 | public Integer getLeaderId() { 69 | return leaderId; 70 | } 71 | 72 | public void setLeaderId(Integer leaderId) { 73 | this.leaderId = leaderId; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/exception/WebNavExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.exception; 2 | 3 | import com.igreat.webnav.constant.ErrorCode; 4 | import com.igreat.webnav.result.ResultWrapper; 5 | import com.igreat.webnav.utils.ResultUtils; 6 | import org.apache.tomcat.util.http.fileupload.FileUploadBase; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.validation.BindingResult; 10 | import org.springframework.web.bind.MethodArgumentNotValidException; 11 | import org.springframework.web.bind.annotation.ExceptionHandler; 12 | import org.springframework.web.bind.annotation.RestControllerAdvice; 13 | 14 | /** 15 | *
16 |  *     author : 陈伟
17 |  *     e-mail : chenwei@njbandou.com
18 |  *     time   : 2019/08/29
19 |  *     desc   : say something
20 |  *     version: 1.0
21 |  * 
22 | */ 23 | @RestControllerAdvice 24 | public class WebNavExceptionHandler { 25 | 26 | private static final Logger logger = LoggerFactory.getLogger(WebNavExceptionHandler.class); 27 | 28 | @ExceptionHandler(value = MethodArgumentNotValidException.class) 29 | public ResultWrapper methodArgumentNoValid(MethodArgumentNotValidException ex) { 30 | logger.error("捕获到MethodArgumentNotValidException异常",ex); 31 | BindingResult bindingResult = ex.getBindingResult(); 32 | return ResultUtils.fail(ErrorCode.ERR_PARAMS, bindingResult.getFieldError().getDefaultMessage()); 33 | } 34 | 35 | @ExceptionHandler(value = Exception.class) 36 | public ResultWrapper globalExceptionHandler(Exception e) { 37 | logger.error("捕获到Exception异常",e); 38 | return ResultUtils.fail(ErrorCode.ERR_UNKNOWN, e.getMessage()); 39 | } 40 | 41 | @ExceptionHandler(value = FileUploadBase.SizeLimitExceededException.class) 42 | public ResultWrapper fileSizeLimitExceptionHandler(FileUploadBase.SizeLimitExceededException e) { 43 | logger.error("捕获到SizeLimitExceededException异常",e); 44 | return ResultUtils.fail(ErrorCode.ERROR_FILE_UPLOAD_MAX_LIMIT, "上传的文件超出了指定大小"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/repository/BannerDAO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.repository; 2 | 3 | import com.igreat.webnav.domain.SiteBanner; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | *
 9 |  *     author : 陈伟
10 |  *     e-mail : chenwei@njbandou.com
11 |  *     time   : 2019/08/28
12 |  *     desc   : say something
13 |  *     version: 1.0
14 |  * 
15 | */ 16 | @Repository 17 | public interface BannerDAO extends JpaRepository { 18 | } 19 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/repository/NavigationCateDAO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.repository; 2 | 3 | import com.igreat.webnav.domain.NavigationCate; 4 | import com.igreat.webnav.domain.NavigationUrls; 5 | import com.igreat.webnav.domain.SearchNavUrls; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *
13 |  *     author : 陈伟
14 |  *     e-mail : chenwei@njbandou.com
15 |  *     time   : 2019/08/28
16 |  *     desc   : say something
17 |  *     version: 1.0
18 |  * 
19 | */ 20 | public interface NavigationCateDAO extends JpaRepository, JpaSpecificationExecutor { 21 | public List findAllByParentId(Integer parentId); 22 | } 23 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/repository/NavigationCommonDAO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.repository; 2 | 3 | import com.igreat.webnav.domain.NavigationCommon; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/08/28
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | public interface NavigationCommonDAO extends JpaRepository { 16 | } 17 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/repository/NavigationFloatDAO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.repository; 2 | 3 | import com.igreat.webnav.domain.NavigationFloat; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/08/28
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | public interface NavigationFloatDAO extends JpaRepository { 16 | } 17 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/repository/NavigationUrlsDAO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.repository; 2 | 3 | import com.igreat.webnav.domain.NavigationCate; 4 | import com.igreat.webnav.domain.NavigationUrls; 5 | import org.springframework.data.domain.Page; 6 | import org.springframework.data.domain.Pageable; 7 | import org.springframework.data.jpa.repository.JpaRepository; 8 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 9 | import org.springframework.data.jpa.repository.Modifying; 10 | import org.springframework.data.jpa.repository.Query; 11 | import org.springframework.data.repository.query.Param; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | *
17 |  *     author : 陈伟
18 |  *     e-mail : chenwei@njbandou.com
19 |  *     time   : 2019/08/28
20 |  *     desc   : say something
21 |  *     version: 1.0
22 |  * 
23 | */ 24 | public interface NavigationUrlsDAO extends JpaRepository, JpaSpecificationExecutor { 25 | public List findAllByCateId(Integer cateId); 26 | } 27 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/repository/SearchNavUrlsDao.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.repository; 2 | 3 | import com.igreat.webnav.domain.SearchNavUrls; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *
10 |  *     author : 陈伟
11 |  *     e-mail : chenwei@njbandou.com
12 |  *     time   : 2019/08/28
13 |  *     desc   : say something
14 |  *     version: 1.0
15 |  * 
16 | */ 17 | public interface SearchNavUrlsDao extends JpaRepository { 18 | public List findAllByLeaderId(Integer leaderId); 19 | } 20 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/result/PageResult.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.result; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | *
 7 |  *     author : 陈伟
 8 |  *     e-mail : chenwei@njbandou.com
 9 |  *     time   : 2019/08/29
10 |  *     desc   : say something
11 |  *     version: 1.0
12 |  * 
13 | */ 14 | public class PageResult { 15 | private Long totalCount; 16 | private List list; 17 | 18 | public PageResult(Long totalCount, List list) { 19 | this.totalCount = totalCount; 20 | this.list = list; 21 | } 22 | 23 | public Long getTotalCount() { 24 | return totalCount; 25 | } 26 | 27 | public void setTotalCount(Long totalCount) { 28 | this.totalCount = totalCount; 29 | } 30 | 31 | public List getList() { 32 | return list; 33 | } 34 | 35 | public void setList(List list) { 36 | this.list = list; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return "PageResult{" + 42 | "totalCount=" + totalCount + 43 | ", list=" + list + 44 | '}'; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/result/ResultWrapper.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.result; 2 | 3 | /** 4 | *
 5 |  *     author : 陈伟
 6 |  *     e-mail : chenwei@njbandou.com
 7 |  *     time   : 2019/08/28
 8 |  *     desc   : say something
 9 |  *     version: 1.0
10 |  * 
11 | */ 12 | public class ResultWrapper { 13 | /** 14 | * 返回码 15 | */ 16 | private int code; 17 | /** 18 | * 返回提示信息 19 | */ 20 | private String msg; 21 | /** 22 | * 返回的数据结构体 23 | */ 24 | private T data; 25 | 26 | public ResultWrapper(int code, String msg, T data) { 27 | this.code = code; 28 | this.msg = msg; 29 | this.data = data; 30 | } 31 | 32 | public int getCode() { 33 | return code; 34 | } 35 | 36 | public void setCode(int code) { 37 | this.code = code; 38 | } 39 | 40 | public String getMsg() { 41 | return msg; 42 | } 43 | 44 | public void setMsg(String msg) { 45 | this.msg = msg; 46 | } 47 | 48 | public T getData() { 49 | return data; 50 | } 51 | 52 | public void setData(T data) { 53 | this.data = data; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/service/BannerService.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.service; 2 | 3 | import com.igreat.webnav.domain.SiteBanner; 4 | import com.igreat.webnav.dto.BannerDTO; 5 | import com.igreat.webnav.repository.BannerDAO; 6 | import com.igreat.webnav.result.PageResult; 7 | import com.igreat.webnav.result.ResultWrapper; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *
13 |  *     author : 陈伟
14 |  *     e-mail : chenwei@njbandou.com
15 |  *     time   : 2019/08/29
16 |  *     desc   : say something
17 |  *     version: 1.0
18 |  * 
19 | */ 20 | public interface BannerService { 21 | /** 22 | * 查找轮播图 23 | * @param keyword 24 | * @param pageIndex 25 | * @param pageSize 26 | * @return 27 | */ 28 | public PageResult findList(String keyword, Integer pageIndex, Integer pageSize); 29 | 30 | /** 31 | * 添加轮播图 32 | * @param bannerDTO 33 | * @return 34 | */ 35 | public ResultWrapper add(BannerDTO bannerDTO); 36 | 37 | /** 38 | * 更新轮播图 39 | * @param bannerDTO 40 | * @return 41 | */ 42 | public ResultWrapper update(BannerDTO bannerDTO); 43 | 44 | /** 45 | * 删除轮播图 46 | * @param ids 47 | * @return 48 | */ 49 | public ResultWrapper delete(Integer[] ids); 50 | } 51 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/service/NavigationCateService.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.service; 2 | 3 | import com.igreat.webnav.dto.NavigationCateDTO; 4 | import com.igreat.webnav.dto.SearchUrlDTO; 5 | import com.igreat.webnav.result.PageResult; 6 | import com.igreat.webnav.result.ResultWrapper; 7 | 8 | /** 9 | *
10 |  *     author : 陈伟
11 |  *     e-mail : chenwei@njbandou.com
12 |  *     time   : 2019/08/29
13 |  *     desc   : say something
14 |  *     version: 1.0
15 |  * 
16 | */ 17 | public interface NavigationCateService { 18 | /** 19 | * 查找 20 | * @param keyword 21 | * @return 22 | */ 23 | public PageResult findList(String keyword, Integer parentId); 24 | 25 | /** 26 | * 添加 27 | * @param entityDTO 28 | * @return 29 | */ 30 | public ResultWrapper add(NavigationCateDTO entityDTO); 31 | 32 | /** 33 | * 更新 34 | * @param entityDTO 35 | * @return 36 | */ 37 | public ResultWrapper update(NavigationCateDTO entityDTO); 38 | 39 | /** 40 | * 删除 41 | * @param ids 42 | * @return 43 | */ 44 | public ResultWrapper delete(Integer[] ids); 45 | } 46 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/service/NavigationCommonService.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.service; 2 | 3 | import com.igreat.webnav.dto.NavigationCommonDTO; 4 | import com.igreat.webnav.result.PageResult; 5 | import com.igreat.webnav.result.ResultWrapper; 6 | 7 | /** 8 | *
 9 |  *     author : 陈伟
10 |  *     e-mail : chenwei@njbandou.com
11 |  *     time   : 2019/08/29
12 |  *     desc   : say something
13 |  *     version: 1.0
14 |  * 
15 | */ 16 | public interface NavigationCommonService { 17 | /** 18 | * 查找 19 | * @param keyword 20 | * @param pageIndex 21 | * @param pageSize 22 | * @return 23 | */ 24 | public PageResult findList(String keyword, Integer pageIndex, Integer pageSize); 25 | 26 | /** 27 | * 添加 28 | * @param entityDTO 29 | * @return 30 | */ 31 | public ResultWrapper add(NavigationCommonDTO entityDTO); 32 | 33 | /** 34 | * 更新 35 | * @param entityDTO 36 | * @return 37 | */ 38 | public ResultWrapper update(NavigationCommonDTO entityDTO); 39 | 40 | /** 41 | * 删除 42 | * @param ids 43 | * @return 44 | */ 45 | public ResultWrapper delete(Integer[] ids); 46 | } 47 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/service/NavigationFloatService.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.service; 2 | 3 | import com.igreat.webnav.dto.NavigationFloatDTO; 4 | import com.igreat.webnav.result.PageResult; 5 | import com.igreat.webnav.result.ResultWrapper; 6 | 7 | /** 8 | *
 9 |  *     author : 陈伟
10 |  *     e-mail : chenwei@njbandou.com
11 |  *     time   : 2019/08/29
12 |  *     desc   : say something
13 |  *     version: 1.0
14 |  * 
15 | */ 16 | public interface NavigationFloatService { 17 | /** 18 | * 查找 19 | * @param keyword 20 | * @param pageIndex 21 | * @param pageSize 22 | * @param level 23 | * @return 24 | */ 25 | public PageResult findList(String keyword, Integer pageIndex, Integer pageSize,Integer level); 26 | 27 | /** 28 | * 添加 29 | * @param entityDTO 30 | * @return 31 | */ 32 | public ResultWrapper add(NavigationFloatDTO entityDTO); 33 | 34 | /** 35 | * 更新 36 | * @param entityDTO 37 | * @return 38 | */ 39 | public ResultWrapper update(NavigationFloatDTO entityDTO); 40 | 41 | /** 42 | * 删除 43 | * @param ids 44 | * @return 45 | */ 46 | public ResultWrapper delete(Integer[] ids); 47 | } 48 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/service/NavigationUrlsService.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.service; 2 | 3 | import com.igreat.webnav.dto.NavigationUrlDTO; 4 | import com.igreat.webnav.dto.SearchUrlDTO; 5 | import com.igreat.webnav.result.PageResult; 6 | import com.igreat.webnav.result.ResultWrapper; 7 | 8 | /** 9 | *
10 |  *     author : 陈伟
11 |  *     e-mail : chenwei@njbandou.com
12 |  *     time   : 2019/08/29
13 |  *     desc   : say something
14 |  *     version: 1.0
15 |  * 
16 | */ 17 | public interface NavigationUrlsService { 18 | /** 19 | * 查找 20 | * @param keyword 21 | * @param pageIndex 22 | * @param pageSize 23 | * @return 24 | */ 25 | public PageResult findList(String keyword, Integer pageIndex, Integer pageSize,Integer cateId); 26 | 27 | /** 28 | * 添加 29 | * @param entityDTO 30 | * @return 31 | */ 32 | public ResultWrapper add(NavigationUrlDTO entityDTO); 33 | 34 | /** 35 | * 更新 36 | * @param entityDTO 37 | * @return 38 | */ 39 | public ResultWrapper update(NavigationUrlDTO entityDTO); 40 | 41 | /** 42 | * 删除 43 | * @param ids 44 | * @return 45 | */ 46 | public ResultWrapper delete(Integer[] ids); 47 | } 48 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/service/SearchNavUrlService.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.service; 2 | 3 | import com.igreat.webnav.dto.NavigationCommonDTO; 4 | import com.igreat.webnav.dto.SearchUrlDTO; 5 | import com.igreat.webnav.result.PageResult; 6 | import com.igreat.webnav.result.ResultWrapper; 7 | 8 | /** 9 | *
10 |  *     author : 陈伟
11 |  *     e-mail : chenwei@njbandou.com
12 |  *     time   : 2019/08/29
13 |  *     desc   : say something
14 |  *     version: 1.0
15 |  * 
16 | */ 17 | public interface SearchNavUrlService { 18 | /** 19 | * 查找 20 | * @param keyword 21 | * @param pageIndex 22 | * @param pageSize 23 | * @return 24 | */ 25 | public PageResult findList(String keyword, Integer pageIndex, Integer pageSize,Integer leaderId); 26 | 27 | /** 28 | * 添加 29 | * @param entityDTO 30 | * @return 31 | */ 32 | public ResultWrapper add(SearchUrlDTO entityDTO); 33 | 34 | /** 35 | * 更新 36 | * @param entityDTO 37 | * @return 38 | */ 39 | public ResultWrapper update(SearchUrlDTO entityDTO); 40 | 41 | /** 42 | * 删除 43 | * @param ids 44 | * @return 45 | */ 46 | public ResultWrapper delete(Integer[] ids); 47 | } 48 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/service/impl/BannerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.service.impl; 2 | 3 | import com.igreat.webnav.constant.ErrorCode; 4 | import com.igreat.webnav.domain.SiteBanner; 5 | import com.igreat.webnav.dto.BannerDTO; 6 | import com.igreat.webnav.repository.BannerDAO; 7 | import com.igreat.webnav.result.PageResult; 8 | import com.igreat.webnav.result.ResultWrapper; 9 | import com.igreat.webnav.service.BannerService; 10 | import com.igreat.webnav.utils.ResultUtils; 11 | import org.springframework.data.domain.*; 12 | import org.springframework.stereotype.Service; 13 | import org.springframework.transaction.annotation.Transactional; 14 | 15 | import javax.annotation.Resource; 16 | import java.util.Date; 17 | import java.util.Optional; 18 | 19 | /** 20 | *
 21 |  *     author : 陈伟
 22 |  *     e-mail : chenwei@njbandou.com
 23 |  *     time   : 2019/08/29
 24 |  *     desc   : say something
 25 |  *     version: 1.0
 26 |  * 
27 | */ 28 | @Service 29 | public class BannerServiceImpl implements BannerService { 30 | 31 | @Resource 32 | BannerDAO bannerDAO; 33 | 34 | @Override 35 | public PageResult findList(String keyword, Integer pageIndex, Integer pageSize) { 36 | Sort sort = new Sort(Sort.Direction.DESC, "orderValue"); 37 | Pageable pageable = PageRequest.of(pageIndex, pageSize, sort); 38 | //创建匹配器,即如何使用查询条件 39 | ExampleMatcher matcher = ExampleMatcher.matching()//构建对象 40 | .withStringMatcher(ExampleMatcher.StringMatcher.CONTAINING)//改变默认字符串匹配方式:模糊查询 41 | .withIgnoreCase(true)//改变默认大小写忽略方式:忽略大小写 42 | .withMatcher("title", ExampleMatcher.GenericPropertyMatchers.contains())//采用“包含匹配”的方式查询 43 | .withIgnoreNullValues(); //让空值也参与查询 44 | SiteBanner bannerEntity = new SiteBanner(); 45 | bannerEntity.setTitle(keyword); 46 | 47 | //创建实例 48 | Example example = Example.of(bannerEntity,matcher); 49 | 50 | Page pages = bannerDAO.findAll(example,pageable); 51 | 52 | return new PageResult(pages.getTotalElements(),pages.getContent()); 53 | } 54 | 55 | @Override 56 | @Transactional(rollbackFor = Exception.class) 57 | public ResultWrapper add(BannerDTO bannerDTO) { 58 | Date date = new Date(); 59 | SiteBanner bannerEntity = new SiteBanner(); 60 | bannerEntity.setTitle(bannerDTO.getTitle()); 61 | bannerEntity.setImage(bannerDTO.getImage()); 62 | bannerEntity.setCreatedTime(date); 63 | bannerEntity.setOrderValue(bannerDTO.getOrderValue()==null?0:bannerDTO.getOrderValue()); 64 | //未建立账户体系暂时默认为1 65 | bannerEntity.setCreatedBy(1); 66 | SiteBanner saveBanner = bannerDAO.save(bannerEntity); 67 | return ResultUtils.success(saveBanner); 68 | } 69 | 70 | @Override 71 | @Transactional(rollbackFor = Exception.class) 72 | public ResultWrapper update(BannerDTO bannerDTO) { 73 | Optional bannerOptional = bannerDAO.findById(bannerDTO.getPkId()); 74 | if (bannerOptional.isPresent()) { 75 | Date date = new Date(); 76 | SiteBanner bannerEntity = bannerOptional.get(); 77 | bannerEntity.setTitle(bannerDTO.getTitle()); 78 | bannerEntity.setImage(bannerDTO.getImage()); 79 | bannerEntity.setUpdatedTime(date); 80 | bannerEntity.setOrderValue(bannerDTO.getOrderValue()==null?bannerEntity.getOrderValue():bannerDTO.getOrderValue()); 81 | //未建立账户体系暂时默认为1 82 | bannerEntity.setUpdatedBy(1); 83 | SiteBanner saveBanner = bannerDAO.saveAndFlush(bannerEntity); 84 | return ResultUtils.success(saveBanner); 85 | } 86 | return ResultUtils.fail(ErrorCode.ERROR_OBJECT_NOT_EXIST,"修改的广告不存在"); 87 | } 88 | 89 | @Override 90 | @Transactional(rollbackFor = Exception.class) 91 | public ResultWrapper delete(Integer[] ids) { 92 | for (Integer id : ids) { 93 | Optional banner = bannerDAO.findById(id); 94 | if (banner.isPresent()) { 95 | bannerDAO.deleteById(id); 96 | } 97 | } 98 | return ResultUtils.success(null); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/java/com/igreat/webnav/utils/ResultUtils.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.utils; 2 | 3 | import com.igreat.webnav.result.ResultWrapper; 4 | 5 | /** 6 | *
 7 |  *     author : 陈伟
 8 |  *     e-mail : chenwei@njbandou.com
 9 |  *     time   : 2019/08/28
10 |  *     desc   : say something
11 |  *     version: 1.0
12 |  * 
13 | */ 14 | public class ResultUtils { 15 | public static ResultWrapper returnResult(int code, String msg, T t){ 16 | return new ResultWrapper(code,msg,t); 17 | } 18 | 19 | /** 20 | * 请求成功 21 | * @param t 22 | * @param 23 | * @return 24 | */ 25 | public static ResultWrapper success(T t){ 26 | return returnResult(0,"请求成功",t); 27 | } 28 | 29 | /** 30 | * 请求失败 31 | * @param code 32 | * @param msg 33 | * @return 34 | */ 35 | public static ResultWrapper fail(int code, String msg){ 36 | return returnResult(code, msg, null); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | driver-class-name: com.mysql.jdbc.Driver 4 | url: jdbc:mysql://localhost:3306/WebNav?charset=utf8mb4&useSSL=false 5 | username: root 6 | password: cCNuQrQJ]nBuD>)4 7 | hikari: 8 | maximum-pool-size: 20 9 | minimum-idle: 5 10 | jpa: 11 | database-platform: org.hibernate.dialect.MySQL5InnoDBDialect 12 | show-sql: true 13 | jackson: 14 | #返回指定格式的时间 15 | date-format: yyyy-MM-dd HH:mm:ss 16 | time-zone: GMT+8 17 | serialization: 18 | # 返回格式化好的Json串 19 | indent-output: true 20 | #返回时间戳 21 | #write-dates-as-timestamps: true 22 | mvc: 23 | date-format: yyyy-MM-dd HH:mm:ss 24 | http: 25 | encoding: 26 | charset: UTF-8 27 | servlet: 28 | multipart: 29 | max-file-size: 1MB 30 | max-request-size: 10MB 31 | # location: /Users/chenwei/Downloads/temp/ 上传文件的临时目录 32 | # 配置热部署 33 | devtools: 34 | restart: 35 | # 热部署生效 36 | enabled: true 37 | # 设置重启的目录 38 | additional-paths: src/main/java/ 39 | # classpath目录下的WEB-INF文件夹内容修改不重启 40 | exclude: WEB-INF/** 41 | 42 | server: 43 | port: 8889 44 | servlet: 45 | context-path: /admin-api 46 | 47 | debug: true 48 | logging: 49 | config: classpath:logback/logback-spring.xml 50 | 51 | app: 52 | file: 53 | # location: /Users/chenwei/Downloads/upload/ 54 | location: /usr/local/var/www/ 55 | suffix: server/ 56 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/resources/application-prod.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | driver-class-name: com.mysql.jdbc.Driver 4 | url: jdbc:mysql://localhost:3306/WebNav?charset=utf8mb4&useSSL=false 5 | username: root 6 | password: 4ri55vqMOp)s 7 | hikari: 8 | maximum-pool-size: 20 9 | minimum-idle: 5 10 | jpa: 11 | database-platform: org.hibernate.dialect.MySQL5InnoDBDialect 12 | show-sql: true 13 | jackson: 14 | #返回指定格式的时间 15 | date-format: yyyy-MM-dd HH:mm:ss 16 | time-zone: GMT+8 17 | serialization: 18 | # 返回格式化好的Json串 19 | indent-output: true 20 | #返回时间戳 21 | #write-dates-as-timestamps: true 22 | mvc: 23 | date-format: yyyy-MM-dd HH:mm:ss 24 | http: 25 | encoding: 26 | charset: UTF-8 27 | servlet: 28 | multipart: 29 | max-file-size: 1MB 30 | max-request-size: 10MB 31 | # location: /Users/chenwei/Downloads/temp/ 上传文件的临时目录 32 | # 配置热部署 33 | devtools: 34 | restart: 35 | # 热部署生效 36 | enabled: true 37 | # 设置重启的目录 38 | additional-paths: src/main/java/ 39 | # classpath目录下的WEB-INF文件夹内容修改不重启 40 | exclude: WEB-INF/** 41 | 42 | server: 43 | port: 8889 44 | servlet: 45 | context-path: /admin-api 46 | 47 | debug: false 48 | logging: 49 | config: classpath:logback/logback-spring.xml 50 | 51 | app: 52 | file: 53 | # location: /Users/chenwei/Downloads/upload/ 54 | location: /usr/local/nginx/html/ 55 | suffix: server/ 56 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | driver-class-name: com.mysql.jdbc.Driver 4 | url: jdbc:mysql://localhost:3306/webnav?charset=utf8mb4&useSSL=false 5 | username: root 6 | password: cCNuQrQJ]nBuD>)4 7 | hikari: 8 | maximum-pool-size: 20 9 | minimum-idle: 5 10 | jpa: 11 | database-platform: org.hibernate.dialect.MySQL5InnoDBDialect 12 | show-sql: true 13 | jackson: 14 | #返回指定格式的时间 15 | date-format: yyyy-MM-dd HH:mm:ss 16 | time-zone: GMT+8 17 | serialization: 18 | # 返回格式化好的Json串 19 | indent-output: true 20 | #返回时间戳 21 | #write-dates-as-timestamps: true 22 | mvc: 23 | date-format: yyyy-MM-dd HH:mm:ss 24 | http: 25 | encoding: 26 | charset: UTF-8 27 | servlet: 28 | multipart: 29 | max-file-size: 1MB 30 | max-request-size: 10MB 31 | # location: /Users/chenwei/Downloads/temp/ 上传文件的临时目录 32 | # 配置热部署 33 | devtools: 34 | restart: 35 | # 热部署生效 36 | enabled: true 37 | # 设置重启的目录 38 | additional-paths: src/main/java/ 39 | # classpath目录下的WEB-INF文件夹内容修改不重启 40 | exclude: WEB-INF/** 41 | 42 | server: 43 | port: 8889 44 | servlet: 45 | context-path: /admin-api 46 | 47 | debug: false 48 | logging: 49 | config: classpath:logback/logback-spring.xml 50 | 51 | app: 52 | file: 53 | # location: /Users/chenwei/Downloads/upload/ 54 | location: /usr/local/var/www/ 55 | suffix: server/ -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | profiles: 3 | active: prod -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_RED} 2 | _________ _______ _______ _______ _______ _________ 3 | \__ __/( ____ \( ____ )( ____ \( ___ )\__ __/ 4 | ) ( | ( \/| ( )|| ( \/| ( ) | ) ( 5 | | | | | | (____)|| (__ | (___) | | | 6 | | | | | ____ | __)| __) | ___ | | | 7 | | | | | \_ )| (\ ( | ( | ( ) | | | 8 | ___) (___| (___) || ) \ \__| (____/\| ) ( | | | 9 | \_______/(_______)|/ \__/(_______/|/ \| )_( 10 | ${AnsiColor.BRIGHT_RED} 11 | Application Version: ${application.version}${application.formatted-version} 12 | Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version} 13 | ${AnsiColor.DEFAULT} 14 | -------------------------------------------------------------------------------- /WebNav-Admin-API/src/main/resources/logback/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | ${PATTERN} 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | ${TEST_FILE_PATH}/debug.%d{yyyy-MM-dd}.log 31 | 32 | 30 33 | 34 | 35 | ${PATTERN} 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | INFO 48 | ACCEPT 49 | DENY 50 | 51 | 52 | ${PROD_FILE_PATH}/info.%d{yyyy-MM-dd}.log 53 | 30 54 | 55 | 56 | ${PATTERN} 57 | 58 | 59 | 60 | 61 | WARN 62 | ACCEPT 63 | DENY 64 | 65 | 66 | ${PROD_FILE_PATH}/warn.%d{yyyy-MM-dd}.log 67 | 30 68 | 69 | 70 | ${PATTERN} 71 | 72 | 73 | 74 | 75 | ERROR 76 | ACCEPT 77 | DENY 78 | 79 | 80 | ${PROD_FILE_PATH}/error.%d{yyyy-MM-dd}.log 81 | 30 82 | 83 | 84 | ${PATTERN} 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /WebNav-Admin/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /WebNav-Admin/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events*.json 15 | speed-measure-plugin*.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .classpath 21 | .c9/ 22 | *.launch 23 | .settings/ 24 | *.sublime-workspace 25 | 26 | # IDE - VSCode 27 | .vscode/* 28 | !.vscode/settings.json 29 | !.vscode/tasks.json 30 | !.vscode/launch.json 31 | !.vscode/extensions.json 32 | .history/* 33 | 34 | # misc 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | -------------------------------------------------------------------------------- /WebNav-Admin/README.md: -------------------------------------------------------------------------------- 1 | # WebNavAdmin 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.2. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /WebNav-Admin/browserslist: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /WebNav-Admin/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | 'browserName': 'chrome' 17 | }, 18 | directConnect: true, 19 | baseUrl: 'http://localhost:4200/', 20 | framework: 'jasmine', 21 | jasmineNodeOpts: { 22 | showColors: true, 23 | defaultTimeoutInterval: 30000, 24 | print: function() {} 25 | }, 26 | onPrepare() { 27 | require('ts-node').register({ 28 | project: require('path').join(__dirname, './tsconfig.json') 29 | }); 30 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 31 | } 32 | }; -------------------------------------------------------------------------------- /WebNav-Admin/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Welcome to WebNav-Admin!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /WebNav-Admin/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /WebNav-Admin/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /WebNav-Admin/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, './coverage/WebNav-Admin'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /WebNav-Admin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web-nav-admin", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build --base-href / --prod", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~8.2.0", 15 | "@angular/cdk": "8.1.4", 16 | "@angular/common": "~8.2.0", 17 | "@angular/compiler": "~8.2.0", 18 | "@angular/core": "~8.2.0", 19 | "@angular/forms": "~8.2.0", 20 | "@angular/platform-browser": "~8.2.0", 21 | "@angular/platform-browser-dynamic": "~8.2.0", 22 | "@angular/router": "~8.2.0", 23 | "ng-zorro-antd": "^8.1.2", 24 | "ngx-color-picker": "^8.1.0", 25 | "rxjs": "~6.4.0", 26 | "tslib": "^1.10.0", 27 | "zone.js": "~0.9.1" 28 | }, 29 | "devDependencies": { 30 | "@angular-devkit/build-angular": "~0.802.2", 31 | "@angular/cli": "~8.2.2", 32 | "@angular/compiler-cli": "~8.2.0", 33 | "@angular/language-service": "~8.2.0", 34 | "@types/node": "~8.9.4", 35 | "@types/jasmine": "~3.3.8", 36 | "@types/jasminewd2": "~2.0.3", 37 | "codelyzer": "^5.0.0", 38 | "jasmine-core": "~3.4.0", 39 | "jasmine-spec-reporter": "~4.2.1", 40 | "karma": "~4.1.0", 41 | "karma-chrome-launcher": "~2.2.0", 42 | "karma-coverage-istanbul-reporter": "~2.0.1", 43 | "karma-jasmine": "~2.0.1", 44 | "karma-jasmine-html-reporter": "^1.4.0", 45 | "protractor": "~5.4.0", 46 | "ts-node": "~7.0.0", 47 | "tslint": "~5.15.0", 48 | "typescript": "~3.5.3" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | const routes: Routes = [ 5 | { path: '', pathMatch: 'full', redirectTo: '/welcome' }, 6 | { path: 'welcome', loadChildren: () => import('./pages/welcome/welcome.module').then(m => m.WelcomeModule) }, 7 | { path: 'banner', loadChildren: () => import('./pages/banner/banner.module').then(m => m.BannerModule) }, 8 | { path: 'friend-chain', loadChildren: () => import('./pages/friend-chain/friend-chain.module').then(m => m.FriendChainModule) }, 9 | { path: 'navigation-cate', loadChildren: () => import('./pages/navigation-cate/navigation-cate.module').then(m => m.NavigationCateModule) }, 10 | { path: 'navigation-url', loadChildren: () => import('./pages/navigation-url/navigation-url.module').then(m => m.NavigationUrlModule) }, 11 | { path: 'search-navigation', loadChildren: () => import('./pages/search-navigation/search-navigation.module').then(m => m.SearchNavigationModule) } 12 | ]; 13 | 14 | @NgModule({ 15 | imports: [RouterModule.forRoot(routes)], 16 | exports: [RouterModule] 17 | }) 18 | export class AppRoutingModule { } 19 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | :host { 2 | display: flex; 3 | text-rendering: optimizeLegibility; 4 | -webkit-font-smoothing: antialiased; 5 | -moz-osx-font-smoothing: grayscale; 6 | } 7 | 8 | .app-layout { 9 | height: 100vh; 10 | } 11 | 12 | .menu-sidebar { 13 | position: relative; 14 | z-index: 10; 15 | min-height: 100vh; 16 | box-shadow: 2px 0 6px rgba(0,21,41,.35); 17 | } 18 | 19 | .header-trigger { 20 | height: 64px; 21 | padding: 20px 24px; 22 | font-size: 20px; 23 | cursor: pointer; 24 | transition: all .3s,padding 0s; 25 | } 26 | 27 | .trigger:hover { 28 | color: #1890ff; 29 | } 30 | 31 | .sidebar-logo { 32 | position: relative; 33 | height: 64px; 34 | padding-left: 24px; 35 | overflow: hidden; 36 | line-height: 64px; 37 | background: #001529; 38 | transition: all .3s; 39 | } 40 | 41 | .sidebar-logo img { 42 | display: inline-block; 43 | height: 32px; 44 | width: 32px; 45 | vertical-align: middle; 46 | } 47 | 48 | .sidebar-logo h1 { 49 | display: inline-block; 50 | margin: 0 0 0 20px; 51 | color: #fff; 52 | font-weight: 600; 53 | font-size: 14px; 54 | font-family: Avenir,Helvetica Neue,Arial,Helvetica,sans-serif; 55 | vertical-align: middle; 56 | } 57 | 58 | nz-header { 59 | padding: 0; 60 | width: 100%; 61 | z-index: 2; 62 | } 63 | 64 | .app-header { 65 | position: relative; 66 | height: 64px; 67 | padding: 0; 68 | background: #fff; 69 | box-shadow: 0 1px 4px rgba(0,21,41,.08); 70 | } 71 | 72 | nz-content { 73 | margin: 24px; 74 | } 75 | 76 | .inner-content { 77 | padding: 24px; 78 | background: #fff; 79 | border-radius: 5px; 80 | } 81 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 8 |
14 | 39 | 40 | 41 | 42 |
43 | 44 | 48 | 49 |
50 |
51 | 52 |
53 | 54 |
55 |
56 |
57 | 58 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/app.component.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav-Admin/src/app/app.component.less -------------------------------------------------------------------------------- /WebNav-Admin/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async(() => { 7 | TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | })); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.debugElement.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'WebNav-Admin'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.debugElement.componentInstance; 26 | expect(app.title).toEqual('WebNav-Admin'); 27 | }); 28 | 29 | it('should render title in a h1 tag', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.debugElement.nativeElement; 33 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to WebNav-Admin!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | isCollapsed = false; 10 | } 11 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppRoutingModule } from './app-routing.module'; 5 | import { AppComponent } from './app.component'; 6 | import { IconsProviderModule } from './icons-provider.module'; 7 | import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd'; 8 | import { FormsModule,ReactiveFormsModule } from '@angular/forms'; 9 | import { HttpClientModule } from '@angular/common/http'; 10 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 11 | import { registerLocaleData } from '@angular/common'; 12 | import zh from '@angular/common/locales/zh'; 13 | import { DragDropModule } from '@angular/cdk/drag-drop'; 14 | registerLocaleData(zh); 15 | 16 | @NgModule({ 17 | declarations: [ 18 | AppComponent 19 | ], 20 | imports: [ 21 | BrowserModule, 22 | AppRoutingModule, 23 | IconsProviderModule, 24 | NgZorroAntdModule, 25 | FormsModule, 26 | HttpClientModule, 27 | BrowserAnimationsModule, 28 | DragDropModule, 29 | ReactiveFormsModule 30 | ], 31 | providers: [{ provide: NZ_I18N, useValue: zh_CN }], 32 | bootstrap: [AppComponent] 33 | }) 34 | export class AppModule { } 35 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/constants.ts: -------------------------------------------------------------------------------- 1 | export const Constants = Object.freeze({ 2 | HTTP_SERVER:"http://47.96.98.193:8889/admin-api/", 3 | IMAGE_SERVER_LOCATION: "http://47.96.98.193/", 4 | IMAGE_UPLOAD_URL:"http://47.96.98.193:8889/admin-api/common/upload" 5 | }); -------------------------------------------------------------------------------- /WebNav-Admin/src/app/icons-provider.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { NZ_ICONS } from 'ng-zorro-antd'; 3 | 4 | import { 5 | MenuFoldOutline, 6 | MenuUnfoldOutline, 7 | FormOutline, 8 | DashboardOutline 9 | } from '@ant-design/icons-angular/icons'; 10 | 11 | const icons = [MenuFoldOutline, MenuUnfoldOutline, DashboardOutline, FormOutline]; 12 | 13 | @NgModule({ 14 | providers: [ 15 | { provide: NZ_ICONS, useValue: icons } 16 | ] 17 | }) 18 | export class IconsProviderModule { 19 | } 20 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/banner/banner-http-service.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { BannerHttpServiceService } from './banner-http-service.service'; 4 | 5 | describe('BannerHttpServiceService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: BannerHttpServiceService = TestBed.get(BannerHttpServiceService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/banner/banner-http-service.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable} from '@angular/core'; 2 | import { HttpClient, HttpParams,HttpHeaders} from '@angular/common/http'; 3 | import {Banner} from './banner'; 4 | import {Constants} from '../../constants'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class BannerHttpServiceService{ 10 | 11 | ngOnInit(): void { 12 | 13 | } 14 | 15 | constructor( 16 | private http: HttpClient 17 | ) { } 18 | 19 | /** 20 | * 请求列表 21 | * @param keyword 关键词 22 | * @param pageIndex 页面索引,从1开始 23 | * @param pageSize 每页显示的数量 24 | */ 25 | list(keyword:string,pageIndex: number,pageSize: number){ 26 | const params = new HttpParams() 27 | .set('keywords', keyword) 28 | .set('pageIndex', pageIndex+'') 29 | .set('pageSize',pageSize+''); 30 | return this.http.get(Constants.HTTP_SERVER + "banner/list",{params}); 31 | } 32 | 33 | /** 34 | * 添加和修改轮播图 35 | * @param banner 36 | */ 37 | addOrUpdate(banner: Banner){ 38 | const httpOptions = { 39 | headers: new HttpHeaders({ 'Content-Type': 'application/json' }) 40 | }; 41 | const params = { 42 | "pkId": banner.pkId, 43 | "title": banner.title, 44 | "image": banner.image, 45 | "orderValue": banner.orderValue?banner.orderValue:0 46 | } 47 | return this.http.post(Constants.HTTP_SERVER + "banner/addOrUpdate",params,httpOptions); 48 | } 49 | 50 | /** 51 | * 批量删除 52 | * @param ids 需要删除的id集合 53 | */ 54 | batDelete(ids: number[]){ 55 | const httpOptions = { 56 | headers: new HttpHeaders({ 'Content-Type': 'application/json' }) 57 | }; 58 | const params = ids; 59 | return this.http.post(Constants.HTTP_SERVER + "banner/delete",params,httpOptions); 60 | } 61 | 62 | /** 63 | * 单个删除 64 | * @param id 单个对象的id 65 | */ 66 | delete(id: number){ 67 | return this.batDelete([id]); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/banner/banner-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { BannerComponent } from './banner.component'; 4 | 5 | 6 | const routes: Routes = [ 7 | { 8 | path: '', component: BannerComponent 9 | } 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [RouterModule.forChild(routes)], 14 | exports: [RouterModule] 15 | }) 16 | export class BannerRoutingModule { } 17 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/banner/banner.component.less: -------------------------------------------------------------------------------- 1 | .content{ 2 | .tableHead{ 3 | .operate-button{ 4 | [nz-button] { 5 | margin-right: 8px; 6 | margin-bottom: 12px; 7 | } 8 | .filter-condition{ 9 | width: 30%; 10 | text-align: right; 11 | float:right; 12 | } 13 | } 14 | } 15 | .table-container{ 16 | position: relative; 17 | .tableImg{ 18 | width: 300px; 19 | height: 100px; 20 | } 21 | .sort-cell{ 22 | text-align: center; 23 | } 24 | } 25 | } 26 | ::ng-deep .vertical-center-modal { 27 | display: flex; 28 | align-items: center; 29 | justify-content: center; 30 | ::ng-deep .ant-modal{ 31 | max-width: 100%; 32 | width: auto !important; 33 | } 34 | 35 | } 36 | 37 | .image 38 | { 39 | width: 300px !important; 40 | height: 100px !important; 41 | } 42 | 43 | 44 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/banner/banner.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BannerComponent } from './banner.component'; 4 | 5 | describe('BannerComponent', () => { 6 | let component: BannerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ BannerComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(BannerComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/banner/banner.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { BannerRoutingModule } from './banner-routing.module'; 4 | import { BannerComponent } from './banner.component' 5 | import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd'; 6 | import { FormsModule,ReactiveFormsModule } from '@angular/forms'; 7 | 8 | @NgModule({ 9 | declarations: [BannerComponent], 10 | imports: [ 11 | CommonModule, 12 | BannerRoutingModule, 13 | NgZorroAntdModule, 14 | FormsModule, 15 | ReactiveFormsModule 16 | ], 17 | exports: [BannerComponent] 18 | }) 19 | export class BannerModule { } 20 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/banner/banner.ts: -------------------------------------------------------------------------------- 1 | export class Banner{ 2 | pkId: number; 3 | title: string; 4 | image: string; 5 | orderValue: number; 6 | } -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/friend-chain/friend-chain-http-service.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable} from '@angular/core'; 2 | import { HttpClient, HttpParams,HttpHeaders} from '@angular/common/http'; 3 | import {FriendChain} from './friend-chain'; 4 | import {Constants} from '../../constants'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class FriendChainHttpServiceService{ 10 | 11 | ngOnInit(): void { 12 | 13 | } 14 | 15 | constructor( 16 | private http: HttpClient 17 | ) { } 18 | 19 | /** 20 | * 请求列表 21 | * @param keyword 关键词 22 | * @param pageIndex 页面索引,从1开始 23 | * @param pageSize 每页显示的数量 24 | */ 25 | list(keyword:string,pageIndex: number,pageSize: number,level:number){ 26 | const params = new HttpParams() 27 | .set('keywords', keyword) 28 | .set('pageIndex', pageIndex+'') 29 | .set('pageSize',pageSize+'') 30 | .set('level',level+''); 31 | return this.http.get(Constants.HTTP_SERVER + "navigation-float/list",{params}); 32 | } 33 | 34 | /** 35 | * 添加和修改 36 | * @param friendChain 37 | */ 38 | addOrUpdate(friendChain: FriendChain){ 39 | const httpOptions = { 40 | headers: new HttpHeaders({ 'Content-Type': 'application/json' }) 41 | }; 42 | const params = { 43 | "pkId": friendChain.pkId, 44 | "name": friendChain.name, 45 | "url": friendChain.url, 46 | "level": friendChain.level, 47 | "textColor": friendChain.textColor, 48 | "orderValue": friendChain.orderValue?friendChain.orderValue:0 49 | } 50 | return this.http.post(Constants.HTTP_SERVER + "navigation-float/addOrUpdate",params,httpOptions); 51 | } 52 | 53 | /** 54 | * 批量删除 55 | * @param ids 需要删除的id集合 56 | */ 57 | batDelete(ids: number[]){ 58 | const httpOptions = { 59 | headers: new HttpHeaders({ 'Content-Type': 'application/json' }) 60 | }; 61 | const params = ids; 62 | return this.http.post(Constants.HTTP_SERVER + "navigation-float/delete",params,httpOptions); 63 | } 64 | 65 | /** 66 | * 单个删除 67 | * @param id 单个对象的id 68 | */ 69 | delete(id: number){ 70 | return this.batDelete([id]); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/friend-chain/friend-chain-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { FriendChainComponent } from './friend-chain.component' 4 | 5 | 6 | const routes: Routes = [ 7 | { 8 | path: '', component: FriendChainComponent 9 | } 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [RouterModule.forChild(routes)], 14 | exports: [RouterModule] 15 | }) 16 | export class FriendChainRoutingModule { } 17 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/friend-chain/friend-chain.component.less: -------------------------------------------------------------------------------- 1 | .content{ 2 | .tableHead{ 3 | .operate-button{ 4 | [nz-button] { 5 | margin-right: 8px; 6 | margin-bottom: 12px; 7 | } 8 | .filter-condition{ 9 | width: 30%; 10 | text-align: right; 11 | float:right; 12 | } 13 | } 14 | } 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/friend-chain/friend-chain.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FriendChainComponent } from './friend-chain.component'; 4 | 5 | describe('FriendChainComponent', () => { 6 | let component: FriendChainComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FriendChainComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FriendChainComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/friend-chain/friend-chain.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { FriendChainRoutingModule } from './friend-chain-routing.module'; 5 | 6 | import { FriendChainComponent } from './friend-chain.component'; 7 | 8 | import { FormsModule,ReactiveFormsModule } from '@angular/forms'; 9 | import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd'; 10 | import { ColorPickerModule } from 'ngx-color-picker'; 11 | 12 | @NgModule({ 13 | declarations: [FriendChainComponent], 14 | imports: [ 15 | CommonModule, 16 | FriendChainRoutingModule, 17 | FormsModule, 18 | ReactiveFormsModule, 19 | NgZorroAntdModule, 20 | ColorPickerModule 21 | ], 22 | exports: [FriendChainComponent] 23 | }) 24 | export class FriendChainModule { } 25 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/friend-chain/friend-chain.ts: -------------------------------------------------------------------------------- 1 | export class FriendChain{ 2 | pkId: number; 3 | name: string; 4 | url: string; 5 | level: string; 6 | textColor: string; 7 | orderValue: number; 8 | } -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/navigation-cate/navigation-cate-http-service.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable} from '@angular/core'; 2 | import { HttpClient, HttpParams,HttpHeaders} from '@angular/common/http'; 3 | import {NavCate} from './navigation-cate'; 4 | import {Constants} from '../../constants'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class NavCateHttpServiceService{ 10 | 11 | ngOnInit(): void { 12 | 13 | } 14 | 15 | constructor( 16 | private http: HttpClient 17 | ) { } 18 | 19 | /** 20 | * 请求列表 21 | */ 22 | list(keyword:string,parentId:number = -1){ 23 | const params = new HttpParams() 24 | .set('keywords',keyword) 25 | .set('parentId',parentId+""); 26 | return this.http.get(Constants.HTTP_SERVER + "navigation-cate/list",{params}); 27 | } 28 | 29 | /** 30 | * 添加和修改 31 | * @param nav 32 | */ 33 | addOrUpdate(nav: NavCate){ 34 | const httpOptions = { 35 | headers: new HttpHeaders({ 'Content-Type': 'application/json' }) 36 | }; 37 | const params = { 38 | "pkId": nav.pkId, 39 | "name": nav.name, 40 | "icon": nav.icon, 41 | "themeColor": nav.themeColor, 42 | "intro": nav.intro, 43 | "parentId": nav.parentId, 44 | "level": nav.level, 45 | "orderValue": nav.orderValue?nav.orderValue:0 46 | } 47 | return this.http.post(Constants.HTTP_SERVER + "navigation-cate/addOrUpdate",params,httpOptions); 48 | } 49 | 50 | /** 51 | * 批量删除 52 | * @param ids 需要删除的id集合 53 | */ 54 | batDelete(ids: number[]){ 55 | const httpOptions = { 56 | headers: new HttpHeaders({ 'Content-Type': 'application/json' }) 57 | }; 58 | const params = ids; 59 | return this.http.post(Constants.HTTP_SERVER + "navigation-cate/delete",params,httpOptions); 60 | } 61 | 62 | /** 63 | * 单个删除 64 | * @param id 单个对象的id 65 | */ 66 | delete(id: number){ 67 | return this.batDelete([id]); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/navigation-cate/navigation-cate-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { NavigationCateComponent } from './navigation-cate.component'; 5 | 6 | const routes: Routes = [ 7 | { 8 | path: '', component: NavigationCateComponent 9 | } 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [RouterModule.forChild(routes)], 14 | exports: [RouterModule] 15 | }) 16 | export class NavigationCateRoutingModule { } 17 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/navigation-cate/navigation-cate.component.less: -------------------------------------------------------------------------------- 1 | .content{ 2 | .tableHead{ 3 | .operate-button{ 4 | [nz-button] { 5 | margin-right: 8px; 6 | margin-bottom: 12px; 7 | } 8 | .filter-condition{ 9 | width: 30%; 10 | text-align: right; 11 | float:right; 12 | } 13 | } 14 | } 15 | .table-container{ 16 | position: relative; 17 | .tableImg{ 18 | width: 20px; 19 | height: 20px; 20 | } 21 | .sort-cell{ 22 | text-align: center; 23 | } 24 | } 25 | } 26 | .image 27 | { 28 | width: 100px !important; 29 | height: 100px !important; 30 | } 31 | .ant-cascader-picker { 32 | width: 300px; 33 | } -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/navigation-cate/navigation-cate.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { NavigationCateComponent } from './navigation-cate.component'; 4 | 5 | describe('NavigationCateComponent', () => { 6 | let component: NavigationCateComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ NavigationCateComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(NavigationCateComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/navigation-cate/navigation-cate.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { NavigationCateRoutingModule } from './navigation-cate-routing.module'; 5 | 6 | import { NavigationCateComponent } from './navigation-cate.component'; 7 | import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd'; 8 | import { FormsModule,ReactiveFormsModule } from '@angular/forms'; 9 | import { ColorPickerModule } from 'ngx-color-picker'; 10 | 11 | 12 | @NgModule({ 13 | declarations: [NavigationCateComponent], 14 | imports: [ 15 | CommonModule, 16 | NavigationCateRoutingModule, 17 | NgZorroAntdModule, 18 | FormsModule, 19 | ReactiveFormsModule, 20 | ColorPickerModule 21 | ], 22 | exports: [NavigationCateComponent] 23 | }) 24 | export class NavigationCateModule { } 25 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/navigation-cate/navigation-cate.ts: -------------------------------------------------------------------------------- 1 | export class NavCate{ 2 | pkId:number; 3 | name:string; 4 | icon:string; 5 | themeColor:string; 6 | intro:string; 7 | parentId:number; 8 | level:number; 9 | orderValue: number; 10 | } -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/navigation-url/navigation-url-http-service.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable} from '@angular/core'; 2 | import { HttpClient, HttpParams,HttpHeaders} from '@angular/common/http'; 3 | import {NavigationUrl} from './navigation-url'; 4 | import {Constants} from '../../constants'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class NavigationUrlHttpServiceService{ 10 | 11 | ngOnInit(): void { 12 | 13 | } 14 | 15 | constructor( 16 | private http: HttpClient 17 | ) { } 18 | 19 | /** 20 | * 请求列表 21 | * @param keyword 关键词 22 | * @param pageIndex 页面索引,从1开始 23 | * @param pageSize 每页显示的数量 24 | */ 25 | list(keyword:string,pageIndex: number,pageSize: number,cateId:number){ 26 | const params = new HttpParams() 27 | .set('keywords', keyword) 28 | .set('pageIndex', pageIndex+'') 29 | .set('pageSize',pageSize+'') 30 | .set('cateId',cateId+''); 31 | return this.http.get(Constants.HTTP_SERVER + "navigation-urls/list",{params}); 32 | } 33 | 34 | allCate(){ 35 | const params = new HttpParams() 36 | .set('keywords', "") 37 | .set('pageIndex', '0') 38 | .set('pageSize','100000') 39 | .set('parentId','-1'); 40 | return this.http.get(Constants.HTTP_SERVER + "navigation-cate/list",{params}); 41 | } 42 | 43 | /** 44 | * 添加和修改 45 | * @param nav 46 | */ 47 | addOrUpdate(nav: NavigationUrl){ 48 | const httpOptions = { 49 | headers: new HttpHeaders({ 'Content-Type': 'application/json' }) 50 | }; 51 | const params = { 52 | "pkId": nav.pkId, 53 | "shortName": nav.shortName, 54 | "longName": nav.longName, 55 | "url": nav.url, 56 | "icon": nav.icon, 57 | "cateId": nav.cateId, 58 | "orderValue": nav.orderValue?nav.orderValue:0 59 | } 60 | return this.http.post(Constants.HTTP_SERVER + "navigation-urls/addOrUpdate",params,httpOptions); 61 | } 62 | 63 | /** 64 | * 批量删除 65 | * @param ids 需要删除的id集合 66 | */ 67 | batDelete(ids: number[]){ 68 | const httpOptions = { 69 | headers: new HttpHeaders({ 'Content-Type': 'application/json' }) 70 | }; 71 | const params = ids; 72 | return this.http.post(Constants.HTTP_SERVER + "navigation-urls/delete",params,httpOptions); 73 | } 74 | 75 | /** 76 | * 单个删除 77 | * @param id 单个对象的id 78 | */ 79 | delete(id: number){ 80 | return this.batDelete([id]); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/navigation-url/navigation-url-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { NavigationUrlComponent } from './navigation-url.component'; 4 | 5 | const routes: Routes = [ 6 | { 7 | path: '', component: NavigationUrlComponent 8 | } 9 | ]; 10 | 11 | @NgModule({ 12 | imports: [RouterModule.forChild(routes)], 13 | exports: [RouterModule] 14 | }) 15 | export class NavigationUrlRoutingModule { } 16 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/navigation-url/navigation-url.component.less: -------------------------------------------------------------------------------- 1 | .content{ 2 | .tableHead{ 3 | .operate-button{ 4 | [nz-button] { 5 | margin-right: 8px; 6 | margin-bottom: 12px; 7 | } 8 | .filter-condition{ 9 | width: 30%; 10 | text-align: right; 11 | float:right; 12 | } 13 | } 14 | } 15 | .table-container{ 16 | position: relative; 17 | .tableImg{ 18 | width: 20px; 19 | height: 20px; 20 | } 21 | .sort-cell{ 22 | text-align: center; 23 | } 24 | } 25 | } 26 | .image 27 | { 28 | width: 100px !important; 29 | height: 100px !important; 30 | } 31 | .ant-cascader-picker { 32 | width: 300px; 33 | } -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/navigation-url/navigation-url.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { NavigationUrlComponent } from './navigation-url.component'; 4 | 5 | describe('NavigationUrlComponent', () => { 6 | let component: NavigationUrlComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ NavigationUrlComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(NavigationUrlComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/navigation-url/navigation-url.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { NavigationUrlRoutingModule } from './navigation-url-routing.module'; 5 | import { NavigationUrlComponent } from './navigation-url.component'; 6 | import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd'; 7 | import { FormsModule,ReactiveFormsModule } from '@angular/forms'; 8 | 9 | 10 | @NgModule({ 11 | declarations: [NavigationUrlComponent], 12 | imports: [ 13 | CommonModule, 14 | NavigationUrlRoutingModule, 15 | NgZorroAntdModule, 16 | FormsModule, 17 | ReactiveFormsModule 18 | ], 19 | exports: [NavigationUrlComponent] 20 | }) 21 | export class NavigationUrlModule { } 22 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/navigation-url/navigation-url.ts: -------------------------------------------------------------------------------- 1 | export class NavigationUrl{ 2 | pkId:number; 3 | icon:string; 4 | shortName:string; 5 | longName:string; 6 | url:string; 7 | cateId:number; 8 | orderValue:number; 9 | values:number[]; 10 | } -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/search-navigation/search-nav-http-service.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable} from '@angular/core'; 2 | import { HttpClient, HttpParams,HttpHeaders} from '@angular/common/http'; 3 | import {SearchNav} from './search-navigation'; 4 | import {Constants} from '../../constants'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class SearchNavHttpServiceService{ 10 | 11 | ngOnInit(): void { 12 | 13 | } 14 | 15 | constructor( 16 | private http: HttpClient 17 | ) { } 18 | 19 | /** 20 | * 请求列表 21 | * @param keyword 关键词 22 | * @param pageIndex 页面索引,从1开始 23 | * @param pageSize 每页显示的数量 24 | */ 25 | list(keyword:string,pageIndex: number,pageSize: number,leaderId:number){ 26 | const params = new HttpParams() 27 | .set('keywords', keyword) 28 | .set('pageIndex', pageIndex+'') 29 | .set('pageSize',pageSize+'') 30 | .set('leaderId',leaderId+''); 31 | return this.http.get(Constants.HTTP_SERVER + "search-nav/list",{params}); 32 | } 33 | 34 | /** 35 | * 添加和修改 36 | * @param nav 37 | */ 38 | addOrUpdate(nav: SearchNav){ 39 | const httpOptions = { 40 | headers: new HttpHeaders({ 'Content-Type': 'application/json' }) 41 | }; 42 | const params = { 43 | "pkId": nav.pkId, 44 | "name": nav.name, 45 | "url": nav.url, 46 | "icon": nav.icon, 47 | "leaderId": nav.leaderId, 48 | "orderValue": nav.orderValue?nav.orderValue:0 49 | } 50 | return this.http.post(Constants.HTTP_SERVER + "search-nav/addOrUpdate",params,httpOptions); 51 | } 52 | 53 | /** 54 | * 批量删除 55 | * @param ids 需要删除的id集合 56 | */ 57 | batDelete(ids: number[]){ 58 | const httpOptions = { 59 | headers: new HttpHeaders({ 'Content-Type': 'application/json' }) 60 | }; 61 | const params = ids; 62 | return this.http.post(Constants.HTTP_SERVER + "search-nav/delete",params,httpOptions); 63 | } 64 | 65 | /** 66 | * 单个删除 67 | * @param id 单个对象的id 68 | */ 69 | delete(id: number){ 70 | return this.batDelete([id]); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/search-navigation/search-navigation-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { SearchNavigationComponent } from './search-navigation.component'; 4 | 5 | const routes: Routes = [ 6 | { 7 | path: '', component: SearchNavigationComponent 8 | } 9 | ]; 10 | 11 | @NgModule({ 12 | imports: [RouterModule.forChild(routes)], 13 | exports: [RouterModule] 14 | }) 15 | export class SearchNavigationRoutingModule { } 16 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/search-navigation/search-navigation.component.less: -------------------------------------------------------------------------------- 1 | .content{ 2 | .tableHead{ 3 | .operate-button{ 4 | [nz-button] { 5 | margin-right: 8px; 6 | margin-bottom: 12px; 7 | } 8 | .filter-condition{ 9 | width: 30%; 10 | text-align: right; 11 | float:right; 12 | } 13 | } 14 | } 15 | .table-container{ 16 | position: relative; 17 | .tableImg{ 18 | width: 20px; 19 | height: 20px; 20 | } 21 | .sort-cell{ 22 | text-align: center; 23 | } 24 | } 25 | } 26 | .image 27 | { 28 | width: 100px !important; 29 | height: 100px !important; 30 | } 31 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/search-navigation/search-navigation.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SearchNavigationComponent } from './search-navigation.component'; 4 | 5 | describe('SearchNavigationComponent', () => { 6 | let component: SearchNavigationComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SearchNavigationComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SearchNavigationComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/search-navigation/search-navigation.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { SearchNavigationRoutingModule } from './search-navigation-routing.module'; 5 | import { SearchNavigationComponent } from './search-navigation.component'; 6 | import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd'; 7 | import { FormsModule,ReactiveFormsModule } from '@angular/forms'; 8 | 9 | @NgModule({ 10 | declarations: [ SearchNavigationComponent], 11 | imports: [ 12 | CommonModule, 13 | SearchNavigationRoutingModule, 14 | NgZorroAntdModule, 15 | FormsModule, 16 | ReactiveFormsModule 17 | ], 18 | exports : [SearchNavigationComponent] 19 | }) 20 | export class SearchNavigationModule { } 21 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/search-navigation/search-navigation.ts: -------------------------------------------------------------------------------- 1 | export class SearchNav{ 2 | pkId:number; 3 | icon:string; 4 | name:string; 5 | url:string; 6 | leaderId:number; 7 | orderValue:number; 8 | } -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/welcome/welcome-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { WelcomeComponent } from './welcome.component'; 4 | 5 | const routes: Routes = [ 6 | { path: '', component: WelcomeComponent }, 7 | ]; 8 | 9 | @NgModule({ 10 | imports: [RouterModule.forChild(routes)], 11 | exports: [RouterModule] 12 | }) 13 | export class WelcomeRoutingModule { } 14 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/welcome/welcome.component.css: -------------------------------------------------------------------------------- 1 | .welcome-content{ 2 | position: relative; 3 | width: 100%; 4 | height: 100%; 5 | display: flex; 6 | align-content: center; 7 | align-items: center; 8 | text-align: center; 9 | justify-content: center; 10 | flex-direction: column; 11 | padding: 100px 0; 12 | } 13 | img{ 14 | width: 50%; 15 | box-shadow: 10px 10px 5px #888888; 16 | border-radius: 5px; 17 | } 18 | a{ 19 | color: green; 20 | margin-top: 50px; 21 | border: 1px dashed green; 22 | border-radius: 5px; 23 | height: 40px; 24 | width: 160px; 25 | font-size: 16px; 26 | line-height: 40px; 27 | } -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/welcome/welcome.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | GO TO WEBSITE 4 |
-------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/welcome/welcome.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-welcome', 5 | templateUrl: './welcome.component.html', 6 | styleUrls: ['./welcome.component.css'] 7 | }) 8 | export class WelcomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /WebNav-Admin/src/app/pages/welcome/welcome.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { WelcomeRoutingModule } from './welcome-routing.module'; 4 | 5 | import { WelcomeComponent } from './welcome.component'; 6 | import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd'; 7 | 8 | 9 | @NgModule({ 10 | imports: [ 11 | WelcomeRoutingModule, 12 | NgZorroAntdModule], 13 | declarations: [WelcomeComponent], 14 | exports: [WelcomeComponent] 15 | }) 16 | export class WelcomeModule { } 17 | -------------------------------------------------------------------------------- /WebNav-Admin/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav-Admin/src/assets/.gitkeep -------------------------------------------------------------------------------- /WebNav-Admin/src/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav-Admin/src/assets/images/logo.png -------------------------------------------------------------------------------- /WebNav-Admin/src/assets/images/website_screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav-Admin/src/assets/images/website_screenshot.jpg -------------------------------------------------------------------------------- /WebNav-Admin/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /WebNav-Admin/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /WebNav-Admin/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav-Admin/src/favicon.ico -------------------------------------------------------------------------------- /WebNav-Admin/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 爱古瑞网址导航管理后台 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /WebNav-Admin/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /WebNav-Admin/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags.ts'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | /*************************************************************************************************** 56 | * Zone JS is required by default for Angular itself. 57 | */ 58 | import 'zone.js/dist/zone'; // Included with Angular CLI. 59 | 60 | 61 | /*************************************************************************************************** 62 | * APPLICATION IMPORTS 63 | */ 64 | -------------------------------------------------------------------------------- /WebNav-Admin/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /WebNav-Admin/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [] 6 | }, 7 | "files": [ 8 | "src/main.ts", 9 | "src/polyfills.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.ts" 13 | ], 14 | "exclude": [ 15 | "src/test.ts", 16 | "src/**/*.spec.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /WebNav-Admin/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "downlevelIteration": true, 9 | "experimentalDecorators": true, 10 | "module": "esnext", 11 | "moduleResolution": "node", 12 | "importHelpers": true, 13 | "target": "es2015", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | }, 22 | "angularCompilerOptions": { 23 | "fullTemplateTypeCheck": true, 24 | "strictInjectionParameters": true 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /WebNav-Admin/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /WebNav-Admin/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rules": { 4 | "array-type": false, 5 | "arrow-parens": false, 6 | "deprecation": { 7 | "severity": "warning" 8 | }, 9 | "component-class-suffix": true, 10 | "contextual-lifecycle": true, 11 | "directive-class-suffix": true, 12 | "directive-selector": [ 13 | true, 14 | "attribute", 15 | "app", 16 | "camelCase" 17 | ], 18 | "component-selector": [ 19 | true, 20 | "element", 21 | "app", 22 | "kebab-case" 23 | ], 24 | "import-blacklist": [ 25 | true, 26 | "rxjs/Rx" 27 | ], 28 | "interface-name": false, 29 | "max-classes-per-file": false, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-consecutive-blank-lines": false, 47 | "no-console": [ 48 | true, 49 | "debug", 50 | "info", 51 | "time", 52 | "timeEnd", 53 | "trace" 54 | ], 55 | "no-empty": false, 56 | "no-inferrable-types": [ 57 | true, 58 | "ignore-params" 59 | ], 60 | "no-non-null-assertion": true, 61 | "no-redundant-jsdoc": true, 62 | "no-switch-case-fall-through": true, 63 | "no-use-before-declare": true, 64 | "no-var-requires": false, 65 | "object-literal-key-quotes": [ 66 | true, 67 | "as-needed" 68 | ], 69 | "object-literal-sort-keys": false, 70 | "ordered-imports": false, 71 | "quotemark": [ 72 | true, 73 | "single" 74 | ], 75 | "trailing-comma": false, 76 | "no-conflicting-lifecycle": true, 77 | "no-host-metadata-property": true, 78 | "no-input-rename": true, 79 | "no-inputs-metadata-property": true, 80 | "no-output-native": true, 81 | "no-output-on-prefix": true, 82 | "no-output-rename": true, 83 | "no-outputs-metadata-property": true, 84 | "template-banana-in-box": true, 85 | "template-no-negated-async": true, 86 | "use-lifecycle-interface": true, 87 | "use-pipe-transform-interface": true 88 | }, 89 | "rulesDirectory": [ 90 | "codelyzer" 91 | ] 92 | } -------------------------------------------------------------------------------- /WebNav-Web-API/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /WebNav-Web-API/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav-Web-API/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /WebNav-Web-API/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /WebNav-Web-API/README.MD: -------------------------------------------------------------------------------- 1 | ## 一、代码层结构 2 | 根目录:`com.igreat.webnav` 3 | 4 | 1.启动类(WebnavApplication.java)推荐放在根目录com.igreat.webnav包下 5 | 6 | 2.实体类(domain) 7 | 8 |     A: com.igreat.webnav.domain(jpa项目) 9 | 10 |     B: com.igreat.webnav.pojo(mybatis项目) 11 | 12 | 3.数据接口访问层(Dao) 13 | 14 |     A: com.igreat.webnav.repository(jpa项目) 15 | 16 |     B: com.igreat.webnav.mapper(mybatis项目) 17 | 18 | 4.数据服务接口层(Service)推荐:com.igreat.webnav.service 19 | 20 | 5.数据服务实现层(Service Implements)推荐:com.igreat.webnav.service.impl 21 | 22 | ``` 23 | ——使用idea的同学推荐使用com.igreat.webnav.serviceImpl目录 24 | ``` 25 | 26 | 6.前端控制器层(Controller)推荐:com.igreat.webnav.controller 27 | 28 | 7.工具类库(utils)推荐:com.igreat.webnav.utils 29 | 30 | 8.配置类(config)推荐:com.igreat.webnav.config 31 | 32 | 9.数据传输对象(dto)推荐:com.igreat.webnav.dto 33 | 34 | ``` 35 | ——数据传输对象(Data Transfer Object)用于封装多个实体类(domain)之间的关系,不破坏原有的实体类结构 36 | ``` 37 | 38 | 10.视图包装对象(vo)推荐:com.igreat.webnav.vo 39 | 40 | ``` 41 | ——视图包装对象(View Object)用于封装客户端请求的数据,防止部分数据泄露(如:管理员ID),保证数据安全,不破坏   原有的实体类结构 42 | ``` 43 | 44 | ## 二、资源目录结构 45 | 46 | 根目录:`resources` 47 | 48 | 1.项目配置文件:resources/application.yml 49 | 50 | 2.静态资源目录:resources/static/ 51 | 52 | ——用于存放html、css、js、图片等资源 53 | 54 | 3.视图模板目录:resources/templates/ 55 | 56 | ——用于存放jsp、thymeleaf等模板文件 57 | 58 | 4.mybatis映射文件:resources/mapper/(mybatis项目) 59 | 60 | 5.mybatis配置文件:resources/mapper/config/(mybatis项目) -------------------------------------------------------------------------------- /WebNav-Web-API/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.7.RELEASE 9 | 10 | 11 | com.igreat 12 | webnav 13 | 1.0.0-SNAPSHOT 14 | WebNav-web-api 15 | 网址导航网站的API接口 16 | 17 | 18 | UTF-8 19 | UTF-8 20 | 1.8 21 | 22 | 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-data-jpa 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-devtools 36 | runtime 37 | true 38 | 39 | 40 | mysql 41 | mysql-connector-java 42 | 43 | 44 | 45 | org.springframework.boot 46 | spring-boot-starter-test 47 | test 48 | 49 | 50 | 51 | commons-lang 52 | commons-lang 53 | 2.6 54 | 55 | 56 | 57 | 58 | 59 | 60 | org.springframework.boot 61 | spring-boot-maven-plugin 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav-Web-API/src/main/.DS_Store -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav-Web-API/src/main/java/.DS_Store -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav-Web-API/src/main/java/com/.DS_Store -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav-Web-API/src/main/java/com/igreat/.DS_Store -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/WebnavApplication.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class WebnavApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(WebnavApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/aop/HttpAspect.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.aop; 2 | 3 | import org.apache.commons.lang.StringUtils; 4 | import org.aspectj.lang.JoinPoint; 5 | import org.aspectj.lang.annotation.Aspect; 6 | import org.aspectj.lang.annotation.Before; 7 | import org.aspectj.lang.annotation.Pointcut; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | import org.springframework.stereotype.Component; 11 | import org.springframework.web.context.request.RequestContextHolder; 12 | import org.springframework.web.context.request.ServletRequestAttributes; 13 | 14 | import javax.servlet.http.HttpServletRequest; 15 | import java.util.Map; 16 | 17 | /** 18 | * Created by D丶Cheng on 2018/7/4. 19 | */ 20 | @Aspect 21 | @Component 22 | public class HttpAspect { 23 | 24 | private final static Logger logger = LoggerFactory.getLogger(HttpAspect.class); 25 | 26 | //切入点 27 | @Pointcut("execution(public * com.igreat.webnav.controller.*.*(..))") 28 | private void auth() { 29 | 30 | } 31 | 32 | @Before("auth()") 33 | private void before(JoinPoint joinPoint) throws Exception { 34 | ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); 35 | HttpServletRequest request = attributes.getRequest(); 36 | logger.info("--------------------------------------------start----------------------------------------------"); 37 | //url 38 | logger.info("url={}", request.getRequestURL()); 39 | //method 40 | logger.info("method={}", request.getMethod()); 41 | //ip 42 | logger.info("ip={}", getIp(request)); 43 | //类名 、 类方法 44 | logger.info("method_class={}", joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName()); 45 | //参数 46 | logger.info("args={}", showParamter(request.getParameterMap())); 47 | 48 | 49 | logger.info("--------------------------------------------end----------------------------------------------"); 50 | } 51 | 52 | 53 | public String showParamter(Map map) { 54 | String result = ""; 55 | for (String key : map.keySet()) { 56 | result += key + ":" + String.valueOf(map.get(key)[0]) + " "; 57 | } 58 | return result; 59 | } 60 | 61 | public static String getIp(HttpServletRequest request) { 62 | String ip = request.getHeader("X-Forwarded-For"); 63 | if (StringUtils.isNotEmpty(ip) && !"unKnown".equalsIgnoreCase(ip)) { 64 | //多次反向代理后会有多个ip值,第一个ip才是真实ip 65 | int index = ip.indexOf(","); 66 | if (index != -1) { 67 | return ip.substring(0, index); 68 | } else { 69 | return ip; 70 | } 71 | } 72 | ip = request.getHeader("X-Real-IP"); 73 | if (StringUtils.isNotEmpty(ip) && !"unKnown".equalsIgnoreCase(ip)) { 74 | return ip; 75 | } 76 | return request.getRemoteAddr(); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/controller/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.controller; 2 | 3 | import com.igreat.webnav.result.ResultWrapper; 4 | import com.igreat.webnav.service.IndexService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.*; 7 | 8 | /** 9 | *
10 |  *     author : 陈伟
11 |  *     e-mail : chenwei@njbandou.com
12 |  *     time   : 2019/08/28
13 |  *     desc   : say something
14 |  *     version: 1.0
15 |  * 
16 | */ 17 | @CrossOrigin(origins = "*") //简单的处理跨域问题 18 | @RestController 19 | public class IndexController { 20 | 21 | @Autowired 22 | IndexService indexService; 23 | 24 | @GetMapping("/index/list") 25 | public ResultWrapper getIndexInfo(){ 26 | return indexService.getIndexInfo(); 27 | } 28 | 29 | @PostMapping("/urls/listByCate") 30 | public ResultWrapper getUrlsByCate(@RequestParam(name = "cateId",required = true) Integer cateId) 31 | { 32 | return indexService.getNavigationUrlByCate(cateId); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/domain/BaseModel.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.domain; 2 | 3 | import javax.persistence.GeneratedValue; 4 | import javax.persistence.GenerationType; 5 | import javax.persistence.Id; 6 | import javax.persistence.MappedSuperclass; 7 | import java.util.Date; 8 | 9 | /** 10 | *
11 |  *     author : 陈伟
12 |  *     e-mail : chenwei@njbandou.com
13 |  *     time   : 2019/08/28
14 |  *     desc   : say something
15 |  *     version: 1.0
16 |  * 
17 | */ 18 | @MappedSuperclass 19 | public class BaseModel { 20 | @Id 21 | @GeneratedValue(strategy = GenerationType.IDENTITY) 22 | private Integer pkId; 23 | /** 24 | * 创建时间 25 | */ 26 | private Date createdTime; 27 | /** 28 | * 创建人 29 | */ 30 | private Integer createdBy; 31 | /** 32 | * 更新时间 33 | */ 34 | private Date updatedTime; 35 | /** 36 | * 更新人 37 | */ 38 | private Integer updatedBy; 39 | 40 | /** 41 | * 排序值 42 | */ 43 | private Integer orderValue; 44 | 45 | public Integer getPkId() { 46 | return pkId; 47 | } 48 | 49 | public void setPkId(Integer pkId) { 50 | this.pkId = pkId; 51 | } 52 | 53 | public Integer getOrderValue() { 54 | return orderValue; 55 | } 56 | 57 | public void setOrderValue(Integer orderValue) { 58 | this.orderValue = orderValue; 59 | } 60 | 61 | public Date getCreatedTime() { 62 | return createdTime; 63 | } 64 | 65 | public void setCreatedTime(Date createdTime) { 66 | this.createdTime = createdTime; 67 | } 68 | 69 | public Integer getCreatedBy() { 70 | return createdBy; 71 | } 72 | 73 | public void setCreatedBy(Integer createdBy) { 74 | this.createdBy = createdBy; 75 | } 76 | 77 | public Date getUpdatedTime() { 78 | return updatedTime; 79 | } 80 | 81 | public void setUpdatedTime(Date updatedTime) { 82 | this.updatedTime = updatedTime; 83 | } 84 | 85 | public Integer getUpdatedBy() { 86 | return updatedBy; 87 | } 88 | 89 | public void setUpdatedBy(Integer updatedBy) { 90 | this.updatedBy = updatedBy; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/domain/NavigationCate.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | 6 | /** 7 | *
  8 |  *     author : 陈伟
  9 |  *     e-mail : chenwei@njbandou.com
 10 |  *     time   : 2019/08/28
 11 |  *     desc   : say something
 12 |  *     version: 1.0
 13 |  * 
14 | */ 15 | @Entity 16 | @Table(name = "navigation_cate") 17 | public class NavigationCate extends BaseModel { 18 | /** 19 | * 分类名称 20 | */ 21 | private String name; 22 | /** 23 | * 图标 24 | */ 25 | private String icon; 26 | /** 27 | * 主题颜色;以十六进制表示,以#号开头 28 | */ 29 | private String themeColor; 30 | /** 31 | * 简介;简短说明,不宜过长 32 | */ 33 | private String intro; 34 | /** 35 | * 父级标识;顶级为0 36 | */ 37 | private Integer parentId; 38 | /** 39 | * 级别;从0开始 40 | */ 41 | private Integer level; 42 | 43 | /** 44 | * 分类名称 45 | */ 46 | public String getName() { 47 | return this.name; 48 | } 49 | 50 | /** 51 | * 分类名称 52 | */ 53 | public void setName(String name) { 54 | this.name = name; 55 | } 56 | 57 | /** 58 | * 图标 59 | */ 60 | public String getIcon() { 61 | return this.icon; 62 | } 63 | 64 | /** 65 | * 图标 66 | */ 67 | public void setIcon(String icon) { 68 | this.icon = icon; 69 | } 70 | 71 | /** 72 | * 主题颜色;以十六进制表示,以#号开头 73 | */ 74 | public String getThemeColor() { 75 | return this.themeColor; 76 | } 77 | 78 | /** 79 | * 主题颜色;以十六进制表示,以#号开头 80 | */ 81 | public void setThemeColor(String themeColor) { 82 | this.themeColor = themeColor; 83 | } 84 | 85 | /** 86 | * 简介;简短说明,不宜过长 87 | */ 88 | public String getIntro() { 89 | return this.intro; 90 | } 91 | 92 | /** 93 | * 简介;简短说明,不宜过长 94 | */ 95 | public void setIntro(String intro) { 96 | this.intro = intro; 97 | } 98 | 99 | /** 100 | * 父级标识;顶级为0 101 | */ 102 | public Integer getParentId() { 103 | return this.parentId; 104 | } 105 | 106 | /** 107 | * 父级标识;顶级为0 108 | */ 109 | public void setParentId(Integer parentId) { 110 | this.parentId = parentId; 111 | } 112 | 113 | /** 114 | * 级别;从0开始 115 | */ 116 | public Integer getLevel() { 117 | return this.level; 118 | } 119 | 120 | /** 121 | * 级别;从0开始 122 | */ 123 | public void setLevel(Integer level) { 124 | this.level = level; 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/domain/NavigationCommon.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/08/28
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | @Entity 16 | @Table(name = "navigation_common") 17 | public class NavigationCommon extends BaseModel { 18 | /** 19 | * 图标 20 | */ 21 | private String icon; 22 | /** 23 | * 名称 24 | */ 25 | private String name; 26 | /** 27 | * 链接地址 28 | */ 29 | private String url; 30 | 31 | /** 32 | * 图标 33 | */ 34 | public String getIcon() { 35 | return this.icon; 36 | } 37 | 38 | /** 39 | * 图标 40 | */ 41 | public void setIcon(String icon) { 42 | this.icon = icon; 43 | } 44 | 45 | /** 46 | * 名称 47 | */ 48 | public String getName() { 49 | return this.name; 50 | } 51 | 52 | /** 53 | * 名称 54 | */ 55 | public void setName(String name) { 56 | this.name = name; 57 | } 58 | 59 | /** 60 | * 链接地址 61 | */ 62 | public String getUrl() { 63 | return this.url; 64 | } 65 | 66 | /** 67 | * 链接地址 68 | */ 69 | public void setUrl(String url) { 70 | this.url = url; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/domain/NavigationFloat.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/08/28
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | @Entity 16 | @Table(name = "navigation_float") 17 | public class NavigationFloat extends BaseModel { 18 | /** 19 | * 名称 20 | */ 21 | private String name; 22 | /** 23 | * 链接地址 24 | */ 25 | private String url; 26 | /** 27 | * 颜色;十六进制表示,以#号开头 28 | */ 29 | private String textColor; 30 | /** 31 | * 层;显示在上层还是下层,1表示上层,2表示下层 32 | */ 33 | private Integer level; 34 | 35 | /** 36 | * 名称 37 | */ 38 | public String getName() { 39 | return this.name; 40 | } 41 | 42 | /** 43 | * 名称 44 | */ 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | /** 50 | * 链接地址 51 | */ 52 | public String getUrl() { 53 | return this.url; 54 | } 55 | 56 | /** 57 | * 链接地址 58 | */ 59 | public void setUrl(String url) { 60 | this.url = url; 61 | } 62 | 63 | /** 64 | * 颜色;十六进制表示,以#号开头 65 | */ 66 | public String getTextColor() { 67 | return this.textColor; 68 | } 69 | 70 | /** 71 | * 颜色;十六进制表示,以#号开头 72 | */ 73 | public void setTextColor(String textColor) { 74 | this.textColor = textColor; 75 | } 76 | 77 | /** 78 | * 层;显示在上层还是下层,1表示上层,2表示下层 79 | */ 80 | public Integer getLevel() { 81 | return this.level; 82 | } 83 | 84 | /** 85 | * 层;显示在上层还是下层,1表示上层,2表示下层 86 | */ 87 | public void setLevel(Integer level) { 88 | this.level = level; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/domain/NavigationUrls.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | 6 | /** 7 | *
  8 |  *     author : 陈伟
  9 |  *     e-mail : chenwei@njbandou.com
 10 |  *     time   : 2019/08/28
 11 |  *     desc   : say something
 12 |  *     version: 1.0
 13 |  * 
14 | */ 15 | @Entity 16 | @Table(name = "navigation_urls") 17 | public class NavigationUrls extends BaseModel { 18 | /** 19 | * 图标 20 | */ 21 | private String icon; 22 | /** 23 | * 短名称 24 | */ 25 | private String shortName; 26 | /** 27 | * 长名称 28 | */ 29 | private String longName; 30 | /** 31 | * 链接地址 32 | */ 33 | private String url; 34 | 35 | /** 36 | * 所属分类编号 37 | */ 38 | private Integer cateId; 39 | 40 | /** 41 | * 图标 42 | */ 43 | public String getIcon() { 44 | return this.icon; 45 | } 46 | 47 | /** 48 | * 图标 49 | */ 50 | public void setIcon(String icon) { 51 | this.icon = icon; 52 | } 53 | 54 | /** 55 | * 短名称 56 | */ 57 | public String getShortName() { 58 | return this.shortName; 59 | } 60 | 61 | /** 62 | * 短名称 63 | */ 64 | public void setShortName(String shortName) { 65 | this.shortName = shortName; 66 | } 67 | 68 | /** 69 | * 长名称 70 | */ 71 | public String getLongName() { 72 | return this.longName; 73 | } 74 | 75 | /** 76 | * 长名称 77 | */ 78 | public void setLongName(String longName) { 79 | this.longName = longName; 80 | } 81 | 82 | /** 83 | * 链接地址 84 | */ 85 | public String getUrl() { 86 | return this.url; 87 | } 88 | 89 | /** 90 | * 链接地址 91 | */ 92 | public void setUrl(String url) { 93 | this.url = url; 94 | } 95 | 96 | /** 97 | * 所属分类编号 98 | */ 99 | public Integer getCateId() { 100 | return this.cateId; 101 | } 102 | 103 | /** 104 | * 所属分类编号 105 | */ 106 | public void setCateId(Integer cateId) { 107 | this.cateId = cateId; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/domain/SearchNavUrls.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/08/28
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | @Entity 16 | @Table(name = "search_nav_urls") 17 | public class SearchNavUrls extends BaseModel { 18 | /** 19 | * 图标 20 | */ 21 | private String icon; 22 | /** 23 | * 名称 24 | */ 25 | private String name; 26 | /** 27 | * 链接地址 28 | */ 29 | private String url; 30 | /** 31 | * 领导编号;上级领导编号,为0表示该链接为领导链接。即在页面上第一个显示的链接,其它只有在鼠标悬停后再显示 32 | */ 33 | private Integer leaderId; 34 | 35 | /** 36 | * 图标 37 | */ 38 | public String getIcon() { 39 | return this.icon; 40 | } 41 | 42 | /** 43 | * 图标 44 | */ 45 | public void setIcon(String icon) { 46 | this.icon = icon; 47 | } 48 | 49 | /** 50 | * 名称 51 | */ 52 | public String getName() { 53 | return this.name; 54 | } 55 | 56 | /** 57 | * 名称 58 | */ 59 | public void setName(String name) { 60 | this.name = name; 61 | } 62 | 63 | /** 64 | * 链接地址 65 | */ 66 | public String getUrl() { 67 | return this.url; 68 | } 69 | 70 | /** 71 | * 链接地址 72 | */ 73 | public void setUrl(String url) { 74 | this.url = url; 75 | } 76 | 77 | /** 78 | * 领导编号;上级领导编号,为0表示该链接为领导链接。即在页面上第一个显示的链接,其它只有在鼠标悬停后再显示 79 | */ 80 | public Integer getLeaderId() { 81 | return this.leaderId; 82 | } 83 | 84 | /** 85 | * 领导编号;上级领导编号,为0表示该链接为领导链接。即在页面上第一个显示的链接,其它只有在鼠标悬停后再显示 86 | */ 87 | public void setLeaderId(Integer leaderId) { 88 | this.leaderId = leaderId; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/domain/SiteBanner.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/08/28
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | @Entity 16 | @Table(name = "site_banner") 17 | public class SiteBanner extends BaseModel { 18 | /** 19 | * 广告标题;长度不超过8个中文字符 20 | */ 21 | private String title; 22 | /** 23 | * 图片;支持jpg/png/gif 24 | */ 25 | private String image; 26 | 27 | /** 28 | * 广告标题;长度不超过8个中文字符 29 | */ 30 | public String getTitle() { 31 | return this.title; 32 | } 33 | 34 | /** 35 | * 广告标题;长度不超过8个中文字符 36 | */ 37 | public void setTitle(String title) { 38 | this.title = title; 39 | } 40 | 41 | /** 42 | * 图片;支持jpg/png/gif 43 | */ 44 | public String getImage() { 45 | return this.image; 46 | } 47 | 48 | /** 49 | * 图片;支持jpg/png/gif 50 | */ 51 | public void setImage(String image) { 52 | this.image = image; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/repository/BannerDAO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.repository; 2 | 3 | import com.igreat.webnav.domain.SiteBanner; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | *
 9 |  *     author : 陈伟
10 |  *     e-mail : chenwei@njbandou.com
11 |  *     time   : 2019/08/28
12 |  *     desc   : say something
13 |  *     version: 1.0
14 |  * 
15 | */ 16 | @Repository 17 | public interface BannerDAO extends JpaRepository { 18 | } 19 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/repository/NavigationCateDAO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.repository; 2 | 3 | import com.igreat.webnav.domain.NavigationCate; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/08/28
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | public interface NavigationCateDAO extends JpaRepository { 16 | } 17 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/repository/NavigationCommonDAO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.repository; 2 | 3 | import com.igreat.webnav.domain.NavigationCommon; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/08/28
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | public interface NavigationCommonDAO extends JpaRepository { 16 | } 17 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/repository/NavigationFloatDAO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.repository; 2 | 3 | import com.igreat.webnav.domain.NavigationFloat; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/08/28
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | public interface NavigationFloatDAO extends JpaRepository { 16 | } 17 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/repository/NavigationUrlsDAO.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.repository; 2 | 3 | import com.igreat.webnav.domain.NavigationUrls; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.data.jpa.repository.Modifying; 6 | import org.springframework.data.jpa.repository.Query; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *
12 |  *     author : 陈伟
13 |  *     e-mail : chenwei@njbandou.com
14 |  *     time   : 2019/08/28
15 |  *     desc   : say something
16 |  *     version: 1.0
17 |  * 
18 | */ 19 | public interface NavigationUrlsDAO extends JpaRepository { 20 | @Modifying 21 | @Query("select nav from NavigationUrls nav where nav.cateId in (?1)") 22 | List findUrlsByCates(List ids); 23 | } 24 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/repository/SearchNavUrlsDao.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.repository; 2 | 3 | import com.igreat.webnav.domain.SearchNavUrls; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | /** 7 | *
 8 |  *     author : 陈伟
 9 |  *     e-mail : chenwei@njbandou.com
10 |  *     time   : 2019/08/28
11 |  *     desc   : say something
12 |  *     version: 1.0
13 |  * 
14 | */ 15 | public interface SearchNavUrlsDao extends JpaRepository { 16 | } 17 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/result/ResultWrapper.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.result; 2 | 3 | /** 4 | *
 5 |  *     author : 陈伟
 6 |  *     e-mail : chenwei@njbandou.com
 7 |  *     time   : 2019/08/28
 8 |  *     desc   : say something
 9 |  *     version: 1.0
10 |  * 
11 | */ 12 | public class ResultWrapper { 13 | /** 14 | * 返回码 15 | */ 16 | private int code; 17 | /** 18 | * 返回提示信息 19 | */ 20 | private String msg; 21 | /** 22 | * 返回的数据结构体 23 | */ 24 | private T data; 25 | 26 | public ResultWrapper(int code, String msg, T data) { 27 | this.code = code; 28 | this.msg = msg; 29 | this.data = data; 30 | } 31 | 32 | public int getCode() { 33 | return code; 34 | } 35 | 36 | public void setCode(int code) { 37 | this.code = code; 38 | } 39 | 40 | public String getMsg() { 41 | return msg; 42 | } 43 | 44 | public void setMsg(String msg) { 45 | this.msg = msg; 46 | } 47 | 48 | public T getData() { 49 | return data; 50 | } 51 | 52 | public void setData(T data) { 53 | this.data = data; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/service/IndexService.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.service; 2 | 3 | import com.igreat.webnav.result.ResultWrapper; 4 | 5 | /** 6 | *
 7 |  *     author : 陈伟
 8 |  *     e-mail : chenwei@njbandou.com
 9 |  *     time   : 2019/08/28
10 |  *     desc   : say something
11 |  *     version: 1.0
12 |  * 
13 | */ 14 | public interface IndexService { 15 | /** 16 | * 获取首页信息 17 | * @return 18 | */ 19 | public ResultWrapper getIndexInfo(); 20 | 21 | /** 22 | * 通过分类获取导航信息 23 | * @param cateId 24 | * @return 25 | */ 26 | public ResultWrapper getNavigationUrlByCate(Integer cateId); 27 | } 28 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/java/com/igreat/webnav/utils/ResultUtils.java: -------------------------------------------------------------------------------- 1 | package com.igreat.webnav.utils; 2 | 3 | import com.igreat.webnav.result.ResultWrapper; 4 | 5 | /** 6 | *
 7 |  *     author : 陈伟
 8 |  *     e-mail : chenwei@njbandou.com
 9 |  *     time   : 2019/08/28
10 |  *     desc   : say something
11 |  *     version: 1.0
12 |  * 
13 | */ 14 | public class ResultUtils { 15 | public static ResultWrapper returnResult(int code, String msg, T t){ 16 | return new ResultWrapper(code,msg,t); 17 | } 18 | 19 | /** 20 | * 请求成功 21 | * @param t 22 | * @param 23 | * @return 24 | */ 25 | public static ResultWrapper success(T t){ 26 | return returnResult(0,"请求成功",t); 27 | } 28 | 29 | /** 30 | * 请求失败 31 | * @param code 32 | * @param msg 33 | * @return 34 | */ 35 | public static ResultWrapper fail(int code, String msg){ 36 | return returnResult(code, msg, null); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | driver-class-name: com.mysql.jdbc.Driver 4 | url: jdbc:mysql://localhost:3306/WebNav?charset=utf8mb4&useSSL=false 5 | username: root 6 | password: cCNuQrQJ]nBuD>)4 7 | hikari: 8 | maximum-pool-size: 20 9 | minimum-idle: 5 10 | jpa: 11 | database-platform: org.hibernate.dialect.MySQL5InnoDBDialect 12 | show-sql: true 13 | jackson: 14 | #返回指定格式的时间 15 | date-format: yyyy-MM-dd HH:mm:ss 16 | time-zone: GMT+8 17 | serialization: 18 | # 返回格式化好的Json串 19 | indent-output: true 20 | #返回时间戳 21 | #write-dates-as-timestamps: true 22 | mvc: 23 | date-format: yyyy-MM-dd HH:mm:ss 24 | http: 25 | encoding: 26 | charset: UTF-8 27 | # 配置热部署 28 | devtools: 29 | restart: 30 | # 热部署生效 31 | enabled: true 32 | # 设置重启的目录 33 | additional-paths: src/main/java/ 34 | # classpath目录下的WEB-INF文件夹内容修改不重启 35 | exclude: WEB-INF/** 36 | 37 | server: 38 | port: 8888 39 | servlet: 40 | context-path: /web-api 41 | 42 | debug: true 43 | logging: 44 | config: classpath:logback/logback-spring.xml -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/resources/application-prod.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | driver-class-name: com.mysql.jdbc.Driver 4 | url: jdbc:mysql://localhost:3306/WebNav?charset=utf8mb4&useSSL=false 5 | username: root 6 | password: 4ri55vqMOp)s 7 | hikari: 8 | maximum-pool-size: 20 9 | minimum-idle: 5 10 | jpa: 11 | database-platform: org.hibernate.dialect.MySQL5InnoDBDialect 12 | show-sql: true 13 | jackson: 14 | #返回指定格式的时间 15 | date-format: yyyy-MM-dd HH:mm:ss 16 | time-zone: GMT+8 17 | serialization: 18 | # 返回格式化好的Json串 19 | indent-output: true 20 | #返回时间戳 21 | #write-dates-as-timestamps: true 22 | mvc: 23 | date-format: yyyy-MM-dd HH:mm:ss 24 | http: 25 | encoding: 26 | charset: UTF-8 27 | # 配置热部署 28 | devtools: 29 | restart: 30 | # 热部署生效 31 | enabled: true 32 | # 设置重启的目录 33 | additional-paths: src/main/java/ 34 | # classpath目录下的WEB-INF文件夹内容修改不重启 35 | exclude: WEB-INF/** 36 | 37 | server: 38 | port: 8888 39 | servlet: 40 | context-path: /web-api 41 | 42 | debug: false 43 | logging: 44 | config: classpath:logback/logback-spring.xml -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | driver-class-name: com.mysql.jdbc.Driver 4 | url: jdbc:mysql://localhost:3306/WebNav?charset=utf8mb4&useSSL=false 5 | username: root 6 | password: cCNuQrQJ]nBuD>)4 7 | hikari: 8 | maximum-pool-size: 20 9 | minimum-idle: 5 10 | jpa: 11 | database-platform: org.hibernate.dialect.MySQL5InnoDBDialect 12 | show-sql: true 13 | jackson: 14 | #返回指定格式的时间 15 | date-format: yyyy-MM-dd HH:mm:ss 16 | time-zone: GMT+8 17 | serialization: 18 | # 返回格式化好的Json串 19 | indent-output: true 20 | #返回时间戳 21 | #write-dates-as-timestamps: true 22 | mvc: 23 | date-format: yyyy-MM-dd HH:mm:ss 24 | http: 25 | encoding: 26 | charset: UTF-8 27 | # 配置热部署 28 | devtools: 29 | restart: 30 | # 热部署生效 31 | enabled: true 32 | # 设置重启的目录 33 | additional-paths: src/main/java/ 34 | # classpath目录下的WEB-INF文件夹内容修改不重启 35 | exclude: WEB-INF/** 36 | 37 | server: 38 | port: 8888 39 | servlet: 40 | context-path: /web-api 41 | 42 | debug: false 43 | logging: 44 | config: classpath:logback/logback-spring.xml -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | profiles: 3 | active: prod -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_RED} 2 | _________ _______ _______ _______ _______ _________ 3 | \__ __/( ____ \( ____ )( ____ \( ___ )\__ __/ 4 | ) ( | ( \/| ( )|| ( \/| ( ) | ) ( 5 | | | | | | (____)|| (__ | (___) | | | 6 | | | | | ____ | __)| __) | ___ | | | 7 | | | | | \_ )| (\ ( | ( | ( ) | | | 8 | ___) (___| (___) || ) \ \__| (____/\| ) ( | | | 9 | \_______/(_______)|/ \__/(_______/|/ \| )_( 10 | ${AnsiColor.BRIGHT_RED} 11 | Application Version: ${application.version}${application.formatted-version} 12 | Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version} 13 | ${AnsiColor.DEFAULT} 14 | -------------------------------------------------------------------------------- /WebNav-Web-API/src/main/resources/logback/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | ${PATTERN} 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | ${TEST_FILE_PATH}/debug.%d{yyyy-MM-dd}.log 31 | 32 | 30 33 | 34 | 35 | ${PATTERN} 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | INFO 48 | ACCEPT 49 | DENY 50 | 51 | 52 | ${PROD_FILE_PATH}/info.%d{yyyy-MM-dd}.log 53 | 30 54 | 55 | 56 | ${PATTERN} 57 | 58 | 59 | 60 | 61 | WARN 62 | ACCEPT 63 | DENY 64 | 65 | 66 | ${PROD_FILE_PATH}/warn.%d{yyyy-MM-dd}.log 67 | 30 68 | 69 | 70 | ${PATTERN} 71 | 72 | 73 | 74 | 75 | ERROR 76 | ACCEPT 77 | DENY 78 | 79 | 80 | ${PROD_FILE_PATH}/error.%d{yyyy-MM-dd}.log 81 | 30 82 | 83 | 84 | ${PATTERN} 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /WebNav/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /WebNav/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events*.json 15 | speed-measure-plugin*.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .classpath 21 | .c9/ 22 | *.launch 23 | .settings/ 24 | *.sublime-workspace 25 | 26 | # IDE - VSCode 27 | .vscode/* 28 | !.vscode/settings.json 29 | !.vscode/tasks.json 30 | !.vscode/launch.json 31 | !.vscode/extensions.json 32 | .history/* 33 | 34 | # misc 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | -------------------------------------------------------------------------------- /WebNav/README.md: -------------------------------------------------------------------------------- 1 | # WebNav 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.2. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /WebNav/browserslist: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /WebNav/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | 'browserName': 'chrome' 17 | }, 18 | directConnect: true, 19 | baseUrl: 'http://localhost:4200/', 20 | framework: 'jasmine', 21 | jasmineNodeOpts: { 22 | showColors: true, 23 | defaultTimeoutInterval: 30000, 24 | print: function() {} 25 | }, 26 | onPrepare() { 27 | require('ts-node').register({ 28 | project: require('path').join(__dirname, './tsconfig.json') 29 | }); 30 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 31 | } 32 | }; -------------------------------------------------------------------------------- /WebNav/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Welcome to WebNav!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /WebNav/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /WebNav/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /WebNav/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, './coverage/WebNav'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /WebNav/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web-nav", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build --base-href / --prod", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~8.2.0", 15 | "@angular/common": "~8.2.0", 16 | "@angular/compiler": "~8.2.0", 17 | "@angular/core": "~8.2.0", 18 | "@angular/forms": "~8.2.0", 19 | "@angular/platform-browser": "~8.2.0", 20 | "@angular/platform-browser-dynamic": "~8.2.0", 21 | "@angular/router": "~8.2.0", 22 | "angular-in-memory-web-api": "^0.9.0", 23 | "ng-zorro-antd": "^8.1.2", 24 | "rxjs": "~6.4.0", 25 | "tslib": "^1.10.0", 26 | "zone.js": "~0.9.1" 27 | }, 28 | "devDependencies": { 29 | "@angular-devkit/build-angular": "~0.802.2", 30 | "@angular/cli": "~8.2.2", 31 | "@angular/compiler-cli": "~8.2.0", 32 | "@angular/language-service": "~8.2.0", 33 | "@types/node": "~8.9.4", 34 | "@types/jasmine": "~3.3.8", 35 | "@types/jasminewd2": "~2.0.3", 36 | "codelyzer": "^5.0.0", 37 | "jasmine-core": "~3.4.0", 38 | "jasmine-spec-reporter": "~4.2.1", 39 | "karma": "~4.1.0", 40 | "karma-chrome-launcher": "~2.2.0", 41 | "karma-coverage-istanbul-reporter": "~2.0.1", 42 | "karma-jasmine": "~2.0.1", 43 | "karma-jasmine-html-reporter": "^1.4.0", 44 | "protractor": "~5.4.0", 45 | "ts-node": "~7.0.0", 46 | "tslint": "~5.15.0", 47 | "typescript": "~3.5.3" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /WebNav/proxy.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "/":{ 3 | "target":"http://localhost:8888/web-api" 4 | } 5 | } -------------------------------------------------------------------------------- /WebNav/src/app/apiservice.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { APIServiceService } from './apiservice.service'; 4 | 5 | describe('APIServiceService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: APIServiceService = TestBed.get(APIServiceService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /WebNav/src/app/apiservice.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient,HttpHeaders} from '@angular/common/http'; 3 | 4 | @Injectable({ 5 | providedIn: 'root' 6 | }) 7 | export class APIServiceService { 8 | 9 | // baseUrl = "http://47.96.98.193:80/WebNav" 10 | 11 | constructor( 12 | private http: HttpClient 13 | ) { } 14 | 15 | getIndex(){ 16 | return this.http.get("http://47.96.98.193:8888/web-api/index/list") 17 | } 18 | 19 | getUrls(id: number){ 20 | var params = new FormData(); 21 | params.set("cateId",id.toString()); 22 | return this.http.post("http://47.96.98.193:8888/web-api/urls/listByCate",params); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /WebNav/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | 4 | describe('AppComponent', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | }).compileComponents(); 11 | })); 12 | 13 | it('should create the app', () => { 14 | const fixture = TestBed.createComponent(AppComponent); 15 | const app = fixture.debugElement.componentInstance; 16 | expect(app).toBeTruthy(); 17 | }); 18 | 19 | it(`should have as title 'WebNav'`, () => { 20 | const fixture = TestBed.createComponent(AppComponent); 21 | const app = fixture.debugElement.componentInstance; 22 | expect(app.title).toEqual('WebNav'); 23 | }); 24 | 25 | it('should render title in a h1 tag', () => { 26 | const fixture = TestBed.createComponent(AppComponent); 27 | fixture.detectChanges(); 28 | const compiled = fixture.debugElement.nativeElement; 29 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to WebNav!'); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /WebNav/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd'; 6 | import { HttpClientModule } from '@angular/common/http'; 7 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 8 | import { registerLocaleData } from '@angular/common'; 9 | import zh from '@angular/common/locales/zh'; 10 | import { FloatUrlPipePipe } from './float-url-pipe.pipe'; 11 | import { FormsModule } from '@angular/forms'; 12 | 13 | registerLocaleData(zh); 14 | 15 | @NgModule({ 16 | declarations: [ 17 | AppComponent, 18 | FloatUrlPipePipe 19 | ], 20 | imports: [ 21 | BrowserModule, 22 | NgZorroAntdModule, 23 | HttpClientModule, 24 | BrowserAnimationsModule, 25 | FormsModule 26 | ], 27 | providers: [{ provide: NZ_I18N, useValue: zh_CN }], 28 | bootstrap: [AppComponent] 29 | }) 30 | export class AppModule { } 31 | -------------------------------------------------------------------------------- /WebNav/src/app/float-url-pipe.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | import { FloatUrlPipePipe } from './float-url-pipe.pipe'; 2 | 3 | describe('FloatUrlPipePipe', () => { 4 | it('create an instance', () => { 5 | const pipe = new FloatUrlPipePipe(); 6 | expect(pipe).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /WebNav/src/app/float-url-pipe.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | @Pipe({ 4 | name: 'floatUrlPipe' 5 | }) 6 | export class FloatUrlPipePipe implements PipeTransform { 7 | 8 | transform(value: any, ...args: any[]): any { 9 | var floatUrl = []; 10 | value.forEach(item => { 11 | if(item.level === args[0]){ 12 | floatUrl.push(item); 13 | } 14 | }); 15 | return floatUrl; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /WebNav/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav/src/assets/.gitkeep -------------------------------------------------------------------------------- /WebNav/src/assets/images/b1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav/src/assets/images/b1.png -------------------------------------------------------------------------------- /WebNav/src/assets/images/b4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav/src/assets/images/b4.png -------------------------------------------------------------------------------- /WebNav/src/assets/images/drop_search.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WebNav/src/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav/src/assets/images/logo.png -------------------------------------------------------------------------------- /WebNav/src/assets/images/music.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 12 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /WebNav/src/assets/images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav/src/assets/images/search.png -------------------------------------------------------------------------------- /WebNav/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /WebNav/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /WebNav/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhkai/iGreatNav/26785680bb5999b4a00627684ccfa48bdee9699f/WebNav/src/favicon.ico -------------------------------------------------------------------------------- /WebNav/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 爱古瑞导航 - 收录创意及美的网站 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /WebNav/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /WebNav/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags.ts'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | /*************************************************************************************************** 56 | * Zone JS is required by default for Angular itself. 57 | */ 58 | import 'zone.js/dist/zone'; // Included with Angular CLI. 59 | 60 | 61 | /*************************************************************************************************** 62 | * APPLICATION IMPORTS 63 | */ 64 | -------------------------------------------------------------------------------- /WebNav/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /WebNav/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [] 6 | }, 7 | "files": [ 8 | "src/main.ts", 9 | "src/polyfills.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.ts" 13 | ], 14 | "exclude": [ 15 | "src/test.ts", 16 | "src/**/*.spec.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /WebNav/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "downlevelIteration": true, 9 | "experimentalDecorators": true, 10 | "module": "esnext", 11 | "moduleResolution": "node", 12 | "importHelpers": true, 13 | "target": "es2015", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | }, 22 | "angularCompilerOptions": { 23 | "fullTemplateTypeCheck": true, 24 | "strictInjectionParameters": true 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /WebNav/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /WebNav/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rules": { 4 | "array-type": false, 5 | "arrow-parens": false, 6 | "deprecation": { 7 | "severity": "warning" 8 | }, 9 | "component-class-suffix": true, 10 | "contextual-lifecycle": true, 11 | "directive-class-suffix": true, 12 | "directive-selector": [ 13 | true, 14 | "attribute", 15 | "app", 16 | "camelCase" 17 | ], 18 | "component-selector": [ 19 | true, 20 | "element", 21 | "app", 22 | "kebab-case" 23 | ], 24 | "import-blacklist": [ 25 | true, 26 | "rxjs/Rx" 27 | ], 28 | "interface-name": false, 29 | "max-classes-per-file": false, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-consecutive-blank-lines": false, 47 | "no-console": [ 48 | true, 49 | "debug", 50 | "info", 51 | "time", 52 | "timeEnd", 53 | "trace" 54 | ], 55 | "no-empty": false, 56 | "no-inferrable-types": [ 57 | true, 58 | "ignore-params" 59 | ], 60 | "no-non-null-assertion": true, 61 | "no-redundant-jsdoc": true, 62 | "no-switch-case-fall-through": true, 63 | "no-use-before-declare": true, 64 | "no-var-requires": false, 65 | "object-literal-key-quotes": [ 66 | true, 67 | "as-needed" 68 | ], 69 | "object-literal-sort-keys": false, 70 | "ordered-imports": false, 71 | "quotemark": [ 72 | true, 73 | "single" 74 | ], 75 | "trailing-comma": false, 76 | "no-conflicting-lifecycle": true, 77 | "no-host-metadata-property": true, 78 | "no-input-rename": true, 79 | "no-inputs-metadata-property": true, 80 | "no-output-native": true, 81 | "no-output-on-prefix": true, 82 | "no-output-rename": true, 83 | "no-outputs-metadata-property": true, 84 | "template-banana-in-box": true, 85 | "template-no-negated-async": true, 86 | "use-lifecycle-interface": true, 87 | "use-pipe-transform-interface": true 88 | }, 89 | "rulesDirectory": [ 90 | "codelyzer" 91 | ] 92 | } --------------------------------------------------------------------------------