├── README.md
├── .gitignore
├── .idea
├── dataSources
│ ├── 1131dc9c-8e55-43dc-92de-dd9d063ceb74
│ │ └── storage_v2
│ │ │ └── _src_
│ │ │ └── schema
│ │ │ ├── orange.Libeww.meta
│ │ │ └── orange.Libeww.zip
│ └── 95f31c06-3c2e-4312-8005-2c585b6e147e
│ │ └── storage_v2
│ │ └── _src_
│ │ └── schema
│ │ ├── orange.Libeww.meta
│ │ └── orange.Libeww.zip
├── vcs.xml
├── encodings.xml
├── inspectionProfiles
│ └── Project_Default.xml
├── dataSources.local.xml
├── dataSources.xml
├── misc.xml
└── compiler.xml
├── .txlcn
├── application-5555.mv.db
├── application-9999.mv.db
├── order-service-9999.mv.db
└── seller-service-5555.mv.db
├── txlcn-tm
└── src
│ ├── main
│ ├── resources
│ │ ├── static
│ │ │ └── admin
│ │ │ │ ├── favicon.png
│ │ │ │ ├── assets
│ │ │ │ └── 8c382430f673ad2237bbf19e5c8a4b00.png
│ │ │ │ └── index.html
│ │ ├── application.properties
│ │ └── tx-manager.sql
│ └── java
│ │ └── com
│ │ └── codingapi
│ │ └── txlcn
│ │ └── tm
│ │ ├── config
│ │ └── EnableTransactionManagerServer.java
│ │ ├── cluster
│ │ └── TMProperties.java
│ │ ├── support
│ │ ├── restapi
│ │ │ ├── auth
│ │ │ │ ├── sauth
│ │ │ │ │ ├── SAuthHandleException.java
│ │ │ │ │ ├── DefaultSAuthLogic.java
│ │ │ │ │ ├── token
│ │ │ │ │ │ └── TokenStorage.java
│ │ │ │ │ └── SAuthLogic.java
│ │ │ │ └── TxManagerAdminAuthLogic.java
│ │ │ ├── vo
│ │ │ │ ├── Token.java
│ │ │ │ ├── DeleteExceptions.java
│ │ │ │ ├── ExceptionList.java
│ │ │ │ ├── TxLogList.java
│ │ │ │ ├── DeleteLogsReq.java
│ │ │ │ ├── ListAppMods.java
│ │ │ │ ├── ErrorResponse.java
│ │ │ │ ├── DTXInfo.java
│ │ │ │ └── TxManagerLog.java
│ │ │ ├── RedirectController.java
│ │ │ └── ao
│ │ │ │ └── WriteTxExceptionDTO.java
│ │ ├── txex
│ │ │ └── TxExceptionListener.java
│ │ └── db
│ │ │ └── jpa
│ │ │ └── TxExceptionRepository.java
│ │ ├── core
│ │ └── storage
│ │ │ ├── FastStorageProvider.java
│ │ │ ├── LockValue.java
│ │ │ └── GroupProps.java
│ │ ├── txmsg
│ │ ├── RpcExecuteService.java
│ │ ├── RpcExceptionHandler.java
│ │ └── TransactionCmd.java
│ │ └── TMApplication.java
│ └── test
│ └── java
│ └── com
│ └── codingapi
│ └── txlcn
│ └── tm
│ └── TestFastStorage.java
├── yitao-sms-service
└── src
│ └── main
│ ├── resources
│ ├── lib
│ │ ├── dom4j-1.6.1.jar
│ │ ├── commons-codec-1.3.jar
│ │ ├── commons-logging-1.0.4.jar
│ │ └── commons-httpclient-3.0-rc4.jar
│ └── application.yml
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── yitaosmsservice
│ ├── YitaoSmsServiceApplication.java
│ └── config
│ └── SmsProperties.java
├── yitao-upload-service
└── src
│ ├── main
│ ├── resources
│ │ ├── fdfs
│ │ │ └── fdfs_client.conf
│ │ └── application.yml
│ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaouploadservice
│ │ ├── config
│ │ ├── UploadProperties.java
│ │ ├── FastdfsClientConfig.java
│ │ └── FastClientImporter.java
│ │ └── YitaoUploadServiceApplication.java
│ └── test
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── yitaouploadservice
│ ├── YitaoSellerServiceApplicationTests.java
│ └── Testts.java
├── yitao-mapper
├── src
│ └── main
│ │ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── mapper
│ │ ├── SpecGroupMapper.java
│ │ ├── SpecParamMapper.java
│ │ ├── PayLogMapper.java
│ │ ├── OrderMapper.java
│ │ ├── SpuDetailMapper.java
│ │ ├── SeckillMapper.java
│ │ ├── SpuMapper.java
│ │ ├── UserMapper.java
│ │ ├── SeckillOrderMapper.java
│ │ ├── OrderStatusMapper.java
│ │ ├── SkuMapper.java
│ │ ├── CategoryMapper.java
│ │ ├── OrderDetailMapper.java
│ │ ├── StockMapper.java
│ │ └── BrandMapper.java
└── pom.xml
├── yitao-user-webapi
└── src
│ ├── main
│ ├── resources
│ │ └── application.yml
│ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaouserservicewebapi
│ │ └── YitaoUserWebApplication.java
│ └── test
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── yitaouserservice
│ └── YitaoUserServiceApplicationTests.java
├── yitao-seller-webapi
└── src
│ ├── main
│ ├── resources
│ │ └── application.yml
│ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaosellerservice
│ │ └── YitaoSellerWebApiApplication.java
│ └── test
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── yitaosellerservice
│ └── YitaoSellerServiceApplicationTests.java
├── yitao-cart-webapi
├── src
│ ├── main
│ │ ├── resources
│ │ │ └── application.yml
│ │ └── java
│ │ │ └── com
│ │ │ └── gerry
│ │ │ └── yitao
│ │ │ └── yitaocartservicewebapi
│ │ │ ├── YitaoCartWebApplication.java
│ │ │ └── config
│ │ │ ├── JwtProperties.java
│ │ │ └── MvcConfig.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaocartweb
│ │ └── YitaoCartWebApplicationTests.java
└── pom.xml
├── yitao-detail-webapi
└── src
│ ├── main
│ ├── resources
│ │ └── application.yml
│ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaodetailservicewebapi
│ │ ├── YitaoDetailWebApplication.java
│ │ └── controller
│ │ └── PageDetailController.java
│ └── test
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── yitaosearchservice
│ ├── YitaoDetailServiceApplicationTests.java
│ └── PageDetailTests.java
├── yitao-search-webapi
└── src
│ ├── main
│ ├── resources
│ │ └── application.yml
│ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaosearchservicewebapi
│ │ ├── YitaoSearchWebApiApplication.java
│ │ └── controller
│ │ └── GoodsSearchController.java
│ └── test
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── yitaosearchservice
│ └── YitaoSellerServiceApplicationTests.java
├── yitao-common
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── gerry
│ │ └── yitao
│ │ ├── common
│ │ ├── base
│ │ │ ├── mapper
│ │ │ │ └── BaseMapper.java
│ │ │ └── interceptor
│ │ │ │ └── properties
│ │ │ │ ├── FilterProperties.java
│ │ │ │ └── AuthProperties.java
│ │ ├── entity
│ │ │ ├── JwtConstants.java
│ │ │ └── UserInfo.java
│ │ ├── util
│ │ │ ├── ObjectUtils.java
│ │ │ └── DateUtil.java
│ │ └── exception
│ │ │ ├── VersionValidationException.java
│ │ │ ├── ParamValidationException.java
│ │ │ ├── PermissionDeniedException.java
│ │ │ ├── SystemException.java
│ │ │ └── ResourceNotFoundException.java
│ │ └── response
│ │ ├── Result.java
│ │ └── CodeMsg.java
│ └── resources
│ └── application-common.yml
├── yitao-seckill-webapi
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── gerry
│ │ │ │ └── yitao
│ │ │ │ └── yitaoseckillwebapi
│ │ │ │ ├── entity
│ │ │ │ ├── StockParam.java
│ │ │ │ └── SecKillParam.java
│ │ │ │ ├── ex
│ │ │ │ └── StockException.java
│ │ │ │ ├── YitaoSeckillWebApplication.java
│ │ │ │ ├── limiting
│ │ │ │ └── AccessLimiter.java
│ │ │ │ └── config
│ │ │ │ ├── JwtProperties.java
│ │ │ │ └── MvcConfig.java
│ │ └── resources
│ │ │ └── application.yml
│ └── test
│ │ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaouserservice
│ │ └── YitaoUserServiceApplicationTests.java
└── pom.xml
├── yitao-order-webapi
├── src
│ └── main
│ │ ├── resources
│ │ └── application.yml
│ │ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaoorderwebapi
│ │ ├── YitaoOrderWebApplication.java
│ │ ├── config
│ │ ├── JwtProperties.java
│ │ └── MvcConfig.java
│ │ └── controller
│ │ └── PayNotifyController.java
└── pom.xml
├── yitao-upload-webapi
└── src
│ ├── main
│ ├── resources
│ │ └── application.yml
│ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaouploadwebapi
│ │ ├── YitaoUploadWebApiApplication.java
│ │ └── controller
│ │ └── UploadController.java
│ └── test
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── yitaouploadservice
│ └── YitaoSellerServiceApplicationTests.java
├── yitao-seller-interface
├── src
│ └── main
│ │ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── seller
│ │ ├── service
│ │ ├── CategoryService.java
│ │ ├── SpecService.java
│ │ ├── BrandService.java
│ │ └── GoodsService.java
│ │ ├── dto
│ │ └── CartDto.java
│ │ └── bo
│ │ ├── BrandBo.java
│ │ └── SeckillParameter.java
└── pom.xml
├── yitao-order-service
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── gerry
│ │ │ └── yitao
│ │ │ └── yitaoorderservice
│ │ │ ├── config
│ │ │ ├── IdWorkerProperties.java
│ │ │ ├── IdWorkerConfig.java
│ │ │ ├── PayConfiguration.java
│ │ │ └── WxPayConfig.java
│ │ │ └── YitaoOrderServiceApplication.java
│ └── resources
│ │ └── application.yml
│ └── test
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── yitaocartservice
│ └── YitaoCartServiceApplicationTests.java
├── yitao-upload-interface
├── src
│ └── main
│ │ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── upload
│ │ ├── service
│ │ └── UploadService.java
│ │ └── bo
│ │ └── UploadBo.java
└── pom.xml
├── yitao-user-service
└── src
│ ├── test
│ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaouserservice
│ │ └── YitaoUserApplicationTests.java
│ └── main
│ ├── java
│ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaouserservice
│ │ ├── YitaoUserServiceApplication.java
│ │ └── utils
│ │ └── CodecUtils.java
│ └── resources
│ └── application.yml
├── yitao-auth-interface
├── src
│ └── main
│ │ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── auth
│ │ └── service
│ │ └── AuthService.java
└── pom.xml
├── yitao-cart-service
└── src
│ ├── test
│ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaocartservice
│ │ └── YitaoCartServiceApplicationTests.java
│ └── main
│ ├── resources
│ └── application.yml
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── yitaocartservice
│ ├── YitaoCartServiceApplication.java
│ └── listener
│ └── CartListener.java
├── yitao-detail-interface
├── src
│ └── main
│ │ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── detail
│ │ └── service
│ │ └── PageDetailService.java
└── pom.xml
├── yitao-detail-service
└── src
│ ├── main
│ ├── resources
│ │ └── application.yml
│ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaosearchservice
│ │ ├── utils
│ │ └── ThreadUtil.java
│ │ ├── YitaoDetailServiceApplication.java
│ │ └── client
│ │ ├── CategoryClient.java
│ │ └── BrandClient.java
│ └── test
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── yitaodetailservice
│ ├── YitaoPageDetailApplicationTests.java
│ └── PageDetailTests.java
├── yitao-search-service
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── gerry
│ │ │ └── yitao
│ │ │ └── yitaosearchservice
│ │ │ ├── respository
│ │ │ └── GoodsRepository.java
│ │ │ ├── YitaoSearchServiceApplication.java
│ │ │ └── client
│ │ │ ├── CategoryClient.java
│ │ │ └── BrandClient.java
│ └── resources
│ │ └── application.yml
│ └── test
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── yitaosearchservice
│ └── YitaoSearchApplicationTests.java
├── yitao-order-interface
├── src
│ └── main
│ │ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── order
│ │ ├── status
│ │ ├── PayStateEnum.java
│ │ └── OrderStatusEnum.java
│ │ ├── service
│ │ ├── PayLogService.java
│ │ └── OrderService.java
│ │ └── dto
│ │ ├── AddressDTO.java
│ │ └── OrderDto.java
└── pom.xml
├── yitao-seller-service
└── src
│ ├── test
│ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaosellerservice
│ │ └── YitaoSellerServiceApplicationTests.java
│ └── main
│ ├── java
│ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── yitaosellerservice
│ │ └── YitaoSellerServiceApplication.java
│ └── resources
│ └── application.yml
├── yitao-auth-webapi
└── src
│ └── main
│ ├── resources
│ └── application.yml
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── yitaoauthservicewebapi
│ └── YitaoAuthWebApplication.java
├── yitao-domain
├── src
│ └── main
│ │ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ ├── domain
│ │ ├── Stock.java
│ │ ├── Brand.java
│ │ ├── Category.java
│ │ ├── SeckillOrder.java
│ │ ├── SpecGroup.java
│ │ ├── SpuDetail.java
│ │ ├── PayLog.java
│ │ ├── OrderDetail.java
│ │ ├── OrderStatus.java
│ │ ├── SpecParam.java
│ │ ├── Sku.java
│ │ ├── User.java
│ │ ├── Spu.java
│ │ └── SeckillGoods.java
│ │ └── entity
│ │ └── PageResult.java
└── pom.xml
├── yitao-cart-interface
├── src
│ └── main
│ │ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── cart
│ │ ├── entity
│ │ └── Cart.java
│ │ └── service
│ │ └── CartService.java
└── pom.xml
├── yitao-auth-service
└── src
│ └── main
│ ├── resources
│ └── application.yml
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── yitaoauthservice
│ ├── YitaoAuthServiceApplication.java
│ ├── client
│ └── UserClient.java
│ └── service
│ └── AuthServiceImpl.java
├── yitao-seckill-service
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── gerry
│ │ │ └── yitao
│ │ │ └── yitaoseckillservice
│ │ │ ├── YitaoSeckillServiceApplication.java
│ │ │ └── utils
│ │ │ └── CodecUtils.java
│ └── resources
│ │ └── application.yml
│ └── test
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── yitaouserservice
│ └── YitaoSecKillApplicationTests.java
├── yitao-seckill-interface
├── src
│ └── main
│ │ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── seckill
│ │ ├── dto
│ │ └── SeckillDTO.java
│ │ └── utils
│ │ └── ImageUtil.java
└── pom.xml
├── yitao-search-interface
├── src
│ └── main
│ │ └── java
│ │ └── com
│ │ └── gerry
│ │ └── yitao
│ │ └── search
│ │ ├── service
│ │ └── SearchService.java
│ │ └── entity
│ │ ├── SearchRequest.java
│ │ ├── SearchResult.java
│ │ └── Goods.java
└── pom.xml
└── yitao-user-interface
├── src
└── main
│ └── java
│ └── com
│ └── gerry
│ └── yitao
│ └── user
│ └── service
│ └── UserService.java
└── pom.xml
/README.md:
--------------------------------------------------------------------------------
1 | # yitao-parent
2 | yitao电商项目
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | target/
--------------------------------------------------------------------------------
/.idea/dataSources/1131dc9c-8e55-43dc-92de-dd9d063ceb74/storage_v2/_src_/schema/orange.Libeww.meta:
--------------------------------------------------------------------------------
1 | #n:orange
--------------------------------------------------------------------------------
/.idea/dataSources/95f31c06-3c2e-4312-8005-2c585b6e147e/storage_v2/_src_/schema/orange.Libeww.meta:
--------------------------------------------------------------------------------
1 | #n:orange
--------------------------------------------------------------------------------
/.txlcn/application-5555.mv.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ygs12/yitao-parent/HEAD/.txlcn/application-5555.mv.db
--------------------------------------------------------------------------------
/.txlcn/application-9999.mv.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ygs12/yitao-parent/HEAD/.txlcn/application-9999.mv.db
--------------------------------------------------------------------------------
/.txlcn/order-service-9999.mv.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ygs12/yitao-parent/HEAD/.txlcn/order-service-9999.mv.db
--------------------------------------------------------------------------------
/.txlcn/seller-service-5555.mv.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ygs12/yitao-parent/HEAD/.txlcn/seller-service-5555.mv.db
--------------------------------------------------------------------------------
/txlcn-tm/src/main/resources/static/admin/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ygs12/yitao-parent/HEAD/txlcn-tm/src/main/resources/static/admin/favicon.png
--------------------------------------------------------------------------------
/yitao-sms-service/src/main/resources/lib/dom4j-1.6.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ygs12/yitao-parent/HEAD/yitao-sms-service/src/main/resources/lib/dom4j-1.6.1.jar
--------------------------------------------------------------------------------
/yitao-sms-service/src/main/resources/lib/commons-codec-1.3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ygs12/yitao-parent/HEAD/yitao-sms-service/src/main/resources/lib/commons-codec-1.3.jar
--------------------------------------------------------------------------------
/yitao-sms-service/src/main/resources/lib/commons-logging-1.0.4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ygs12/yitao-parent/HEAD/yitao-sms-service/src/main/resources/lib/commons-logging-1.0.4.jar
--------------------------------------------------------------------------------
/yitao-sms-service/src/main/resources/lib/commons-httpclient-3.0-rc4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ygs12/yitao-parent/HEAD/yitao-sms-service/src/main/resources/lib/commons-httpclient-3.0-rc4.jar
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/txlcn-tm/src/main/resources/static/admin/assets/8c382430f673ad2237bbf19e5c8a4b00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ygs12/yitao-parent/HEAD/txlcn-tm/src/main/resources/static/admin/assets/8c382430f673ad2237bbf19e5c8a4b00.png
--------------------------------------------------------------------------------
/yitao-upload-service/src/main/resources/fdfs/fdfs_client.conf:
--------------------------------------------------------------------------------
1 | connect_timeout = 30
2 | network_timeout = 30
3 | charset = UTF-8
4 | http.tracker_http_port = 8888
5 | http.anti_steal_token = no
6 | tracker_server = 192.168.3.201:22122
--------------------------------------------------------------------------------
/.idea/dataSources/1131dc9c-8e55-43dc-92de-dd9d063ceb74/storage_v2/_src_/schema/orange.Libeww.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ygs12/yitao-parent/HEAD/.idea/dataSources/1131dc9c-8e55-43dc-92de-dd9d063ceb74/storage_v2/_src_/schema/orange.Libeww.zip
--------------------------------------------------------------------------------
/.idea/dataSources/95f31c06-3c2e-4312-8005-2c585b6e147e/storage_v2/_src_/schema/orange.Libeww.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ygs12/yitao-parent/HEAD/.idea/dataSources/95f31c06-3c2e-4312-8005-2c585b6e147e/storage_v2/_src_/schema/orange.Libeww.zip
--------------------------------------------------------------------------------
/yitao-sms-service/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | rabbitmq:
3 | virtual-host: /
4 | username: test
5 | password: test
6 | host: 192.168.3.201
7 | server:
8 | port: 7783
9 |
10 | yt:
11 | sms:
12 | accessKeyId: C13907872
13 | accessKeySecret: 3b38c5611c052c7de17d36f840fb4052
--------------------------------------------------------------------------------
/yitao-mapper/src/main/java/com/gerry/yitao/mapper/SpecGroupMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.mapper;
2 |
3 | import com.gerry.yitao.domain.SpecGroup;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @author bystander
8 | * @date 2018/9/18
9 | */
10 | public interface SpecGroupMapper extends Mapper {
11 | }
12 |
--------------------------------------------------------------------------------
/yitao-mapper/src/main/java/com/gerry/yitao/mapper/SpecParamMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.mapper;
2 |
3 | import com.gerry.yitao.domain.SpecParam;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @author bystander
8 | * @date 2018/9/18
9 | */
10 | public interface SpecParamMapper extends Mapper {
11 | }
12 |
--------------------------------------------------------------------------------
/yitao-user-webapi/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 10050
3 | dubbo:
4 | application:
5 | name: yitao-user-web
6 | qos-enable: false
7 | registry:
8 | address: zookeeper://192.168.3.201:2181
9 | spring:
10 | jackson:
11 | default-property-inclusion: non_null
12 | profiles:
13 | active: common
--------------------------------------------------------------------------------
/yitao-seller-webapi/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | dubbo:
2 | application:
3 | name: yitao-seller-webapi
4 | registry:
5 | address: zookeeper://192.168.3.201:2181
6 | # address: zookeeper://192.168.3.220:2181?backup=192.168.3.221:2181,192.168.3.222:2181
7 | server:
8 | port: 10010
9 | spring:
10 | profiles:
11 | active: common
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/yitao-cart-webapi/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 10070
3 | dubbo:
4 | application:
5 | name: yitao-cart-web
6 | qos-enable: false
7 | registry:
8 | address: zookeeper://192.168.3.220:2181?backup=192.168.3.221:2181,192.168.3.222:2181
9 | spring:
10 | jackson:
11 | default-property-inclusion: non_null
12 | profiles:
13 | active: common
--------------------------------------------------------------------------------
/yitao-mapper/src/main/java/com/gerry/yitao/mapper/PayLogMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.mapper;
2 |
3 | import com.gerry.yitao.domain.PayLog;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @ProjectName: yitao-parent
8 | * @Auther: GERRY
9 | * @Date: 2019/5/15 15:05
10 | * @Description:
11 | */
12 | public interface PayLogMapper extends Mapper {
13 | }
--------------------------------------------------------------------------------
/yitao-detail-webapi/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 10040
3 | dubbo:
4 | application:
5 | name: yitao-detail-web
6 | qos-enable: false
7 | registry:
8 | address: zookeeper://192.168.3.220:2181?backup=192.168.3.221:2181,192.168.3.222:2181
9 | spring:
10 | jackson:
11 | default-property-inclusion: non_null
12 | profiles:
13 | active: common
--------------------------------------------------------------------------------
/yitao-mapper/src/main/java/com/gerry/yitao/mapper/OrderMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.mapper;
2 |
3 | import com.gerry.yitao.domain.Order;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @ProjectName: yitao-parent
8 | * @Auther: GERRY
9 | * @Date: 2019/4/14 15:21
10 | * @Description:
11 | */
12 |
13 | public interface OrderMapper extends Mapper {
14 | }
15 |
--------------------------------------------------------------------------------
/yitao-search-webapi/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 10030
3 | dubbo:
4 | application:
5 | name: yitao-search-webapi
6 | qos-enable: false
7 | registry:
8 | address: zookeeper://192.168.3.220:2181?backup=192.168.3.221:2181,192.168.3.222:2181
9 | spring:
10 | jackson:
11 | default-property-inclusion: non_null
12 | profiles:
13 | active: common
--------------------------------------------------------------------------------
/yitao-common/src/main/java/com/gerry/yitao/common/base/mapper/BaseMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.common.base.mapper;
2 |
3 | import tk.mybatis.mapper.common.Mapper;
4 |
5 | /**
6 | * @ProjectName: yitao-parent
7 | * @Auther: GERRY
8 | * @Date: 2019/4/14 14:59
9 | * @Description: 所有Mapper类的基类(只针对单表)
10 | */
11 | public interface BaseMapper extends Mapper {
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/yitao-mapper/src/main/java/com/gerry/yitao/mapper/SpuDetailMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.mapper;
2 |
3 | import com.gerry.yitao.domain.SpuDetail;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @ProjectName: yitao-parent
8 | * @Auther: GERRY
9 | * @Date: 2019/4/14 15:26
10 | * @Description:
11 | */
12 | public interface SpuDetailMapper extends Mapper {
13 | }
14 |
--------------------------------------------------------------------------------
/yitao-common/src/main/java/com/gerry/yitao/common/entity/JwtConstants.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.common.entity;
2 |
3 | /**
4 | * @ProjectName: yitao-parent
5 | * @Auther: GERRY
6 | * @Date: 2019/5/6 19:00
7 | * @Description:
8 | */
9 | public class JwtConstants {
10 | public static final String JWT_KEY_ID = "id";
11 | public static final String JWT_KEY_USER_NAME = "username";
12 | }
13 |
--------------------------------------------------------------------------------
/yitao-mapper/src/main/java/com/gerry/yitao/mapper/SeckillMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.mapper;
2 |
3 | import com.gerry.yitao.domain.SeckillGoods;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @ProjectName: yitao-parent
8 | * @Auther: GERRY
9 | * @Date: 2019/5/15 15:05
10 | * @Description: 秒杀的商品
11 | */
12 | public interface SeckillMapper extends Mapper {
13 | }
14 |
--------------------------------------------------------------------------------
/yitao-mapper/src/main/java/com/gerry/yitao/mapper/SpuMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.mapper;
2 |
3 | import com.gerry.yitao.common.base.mapper.BaseMapper;
4 | import com.gerry.yitao.domain.Spu;
5 |
6 | /**
7 | * @ProjectName: yitao-parent
8 | * @Auther: GERRY
9 | * @Date: 2019/4/14 15:25
10 | * @Description:
11 | */
12 |
13 | public interface SpuMapper extends BaseMapper {
14 | }
15 |
--------------------------------------------------------------------------------
/yitao-mapper/src/main/java/com/gerry/yitao/mapper/UserMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.mapper;
2 |
3 | import com.gerry.yitao.common.base.mapper.BaseMapper;
4 | import com.gerry.yitao.domain.User;
5 |
6 | /**
7 | * @ProjectName: yitao-parent
8 | * @Auther: GERRY
9 | * @Date: 2019/4/14 15:28
10 | * @Description:
11 | */
12 |
13 | public interface UserMapper extends BaseMapper {
14 | }
15 |
--------------------------------------------------------------------------------
/yitao-seckill-webapi/src/main/java/com/gerry/yitao/yitaoseckillwebapi/entity/StockParam.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoseckillwebapi.entity;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * @ProjectName: yitao-parent
7 | * @Auther: GERRY
8 | * @Date: 2019/5/28 21:19
9 | * @Description:
10 | */
11 | @Data
12 | public class StockParam {
13 | private Long goodsId;
14 | private Long stock;
15 | }
16 |
--------------------------------------------------------------------------------
/yitao-seckill-webapi/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 10090
3 | dubbo:
4 | application:
5 | name: yitao-seckill-web
6 | qos-enable: false
7 | registry:
8 | address: zookeeper://192.168.3.201:2181
9 | spring:
10 | jackson:
11 | default-property-inclusion: non_null
12 | profiles:
13 | active: common
14 | redis:
15 | host: 192.168.3.201
16 | password: redis-01
--------------------------------------------------------------------------------
/yitao-mapper/src/main/java/com/gerry/yitao/mapper/SeckillOrderMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.mapper;
2 |
3 | import com.gerry.yitao.domain.SeckillOrder;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @ProjectName: yitao-parent
8 | * @Auther: GERRY
9 | * @Date: 2019/5/15 15:05
10 | * @Description: 秒杀订单Mapper
11 | */
12 | public interface SeckillOrderMapper extends Mapper {
13 | }
14 |
--------------------------------------------------------------------------------
/yitao-seckill-webapi/src/main/java/com/gerry/yitao/yitaoseckillwebapi/entity/SecKillParam.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoseckillwebapi.entity;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * @ProjectName: yitao-parent
7 | * @Auther: GERRY
8 | * @Date: 2019/5/27 14:54
9 | * @Description:
10 | */
11 | @Data
12 | public class SecKillParam {
13 | private Long goodsId;
14 | private Integer verifyCode = 0;
15 | }
16 |
--------------------------------------------------------------------------------
/yitao-order-webapi/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 10080
3 | dubbo:
4 | application:
5 | name: yitao-order-web
6 | qos-enable: false
7 | registry:
8 | address: zookeeper://192.168.3.201:2181
9 | # address: zookeeper://192.168.3.220:2181?backup=192.168.3.221:2181,192.168.3.222:2181
10 | spring:
11 | jackson:
12 | default-property-inclusion: non_null
13 | profiles:
14 | active: common
--------------------------------------------------------------------------------
/yitao-mapper/src/main/java/com/gerry/yitao/mapper/OrderStatusMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.mapper;
2 |
3 | import com.gerry.yitao.common.base.mapper.BaseMapper;
4 | import com.gerry.yitao.domain.OrderStatus;
5 |
6 | /**
7 | * @ProjectName: yitao-parent
8 | * @Auther: GERRY
9 | * @Date: 2019/4/14 15:22
10 | * @Description:
11 | */
12 |
13 | public interface OrderStatusMapper extends BaseMapper {
14 | }
15 |
--------------------------------------------------------------------------------
/yitao-upload-webapi/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 10020
3 | dubbo:
4 | protocol:
5 | name: hessian
6 | application:
7 | name: yitao-upload-webapi
8 | registry:
9 | address: zookeeper://192.168.3.220:2181?backup=192.168.3.221:2181,192.168.3.222:2181
10 | spring:
11 | servlet:
12 | multipart:
13 | max-request-size: 100MB
14 | max-file-size: 100MB
15 | profiles:
16 | active: common
--------------------------------------------------------------------------------
/yitao-seller-interface/src/main/java/com/gerry/yitao/seller/service/CategoryService.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.seller.service;
2 |
3 | import com.gerry.yitao.domain.Category;
4 |
5 | import java.util.List;
6 |
7 |
8 | public interface CategoryService {
9 |
10 |
11 | List queryCategoryByPid(Long pid);
12 |
13 | List queryCategoryByIds(List ids);
14 |
15 | List queryAllByCid3(Long id);
16 | }
17 |
--------------------------------------------------------------------------------
/yitao-order-service/src/main/java/com/gerry/yitao/yitaoorderservice/config/IdWorkerProperties.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoorderservice.config;
2 |
3 | import lombok.Data;
4 | import org.springframework.boot.context.properties.ConfigurationProperties;
5 |
6 | @Data
7 | @ConfigurationProperties(prefix = "yt.worker")
8 | public class IdWorkerProperties {
9 |
10 | private long workerId;// 当前机器id
11 |
12 | private long dataCenterId;// 序列号
13 | }
--------------------------------------------------------------------------------
/yitao-upload-interface/src/main/java/com/gerry/yitao/upload/service/UploadService.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.upload.service;
2 |
3 | import com.gerry.yitao.upload.bo.UploadBo;
4 |
5 | /**
6 | * @ProjectName: yitao-parent
7 | * @Auther: GERRY
8 | * @Date: 2019/4/17 18:12
9 | * @Description: 上传图片的服务接口
10 | */
11 | public interface UploadService {
12 | String uploadImage(UploadBo uploadBo);
13 | Integer deleteImage(String imagePath);
14 | }
15 |
--------------------------------------------------------------------------------
/yitao-mapper/src/main/java/com/gerry/yitao/mapper/SkuMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.mapper;
2 |
3 | import com.gerry.yitao.domain.Sku;
4 | import tk.mybatis.mapper.additional.idlist.IdListMapper;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | /**
8 | * @ProjectName: yitao-parent
9 | * @Auther: GERRY
10 | * @Date: 2019/4/14 15:24
11 | * @Description:
12 | */
13 |
14 | public interface SkuMapper extends Mapper, IdListMapper {
15 | }
16 |
--------------------------------------------------------------------------------
/yitao-user-service/src/test/java/com/gerry/yitao/yitaouserservice/YitaoUserApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaouserservice;
2 |
3 | import org.junit.runner.RunWith;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 | import org.springframework.test.context.junit4.SpringRunner;
6 |
7 | @RunWith(SpringRunner.class)
8 | @SpringBootTest(classes = YitaoUserServiceApplication.class)
9 | public class YitaoUserApplicationTests {
10 | }
11 |
--------------------------------------------------------------------------------
/yitao-auth-interface/src/main/java/com/gerry/yitao/auth/service/AuthService.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.auth.service;
2 |
3 | /**
4 | * @ProjectName: yitao-parent
5 | * @Auther: GERRY
6 | * @Date: 2019/5/6 19:02
7 | * @Description:
8 | */
9 | public interface AuthService {
10 | /**
11 | * 用户登录的方法
12 | * @param username
13 | * @param password
14 | * @return
15 | */
16 | String login(String username, String password);
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/yitao-cart-service/src/test/java/com/gerry/yitao/yitaocartservice/YitaoCartServiceApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaocartservice;
2 |
3 | import org.junit.runner.RunWith;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 | import org.springframework.test.context.junit4.SpringRunner;
6 |
7 | @RunWith(SpringRunner.class)
8 | @SpringBootTest(classes = YitaoCartServiceApplication.class)
9 | public class YitaoCartServiceApplicationTests {
10 | }
11 |
--------------------------------------------------------------------------------
/yitao-cart-service/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | redis:
3 | host: 192.168.3.172
4 | password: redis-01
5 | rabbitmq:
6 | virtual-host: /
7 | username: test
8 | password: test
9 | host: 192.168.3.201
10 | dubbo:
11 | application:
12 | name: yitao-cart-service
13 | protocol:
14 | port: 20887
15 | registry:
16 | address: zookeeper://192.168.3.220:2181?backup=192.168.3.221:2181,192.168.3.222:2181
17 | server:
18 | port: 7782
--------------------------------------------------------------------------------
/yitao-mapper/src/main/java/com/gerry/yitao/mapper/CategoryMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.mapper;
2 |
3 | import com.gerry.yitao.domain.Category;
4 | import tk.mybatis.mapper.additional.idlist.IdListMapper;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | /**
8 | * @ProjectName: yitao-parent
9 | * @Auther: GERRY
10 | * @Date: 2019/4/14 15:19
11 | * @Description:
12 | */
13 |
14 | public interface CategoryMapper extends Mapper, IdListMapper {
15 | }
16 |
--------------------------------------------------------------------------------
/yitao-mapper/src/main/java/com/gerry/yitao/mapper/OrderDetailMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.mapper;
2 |
3 | import com.gerry.yitao.domain.OrderDetail;
4 | import tk.mybatis.mapper.additional.insert.InsertListMapper;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | /**
8 | * @ProjectName: yitao-parent
9 | * @Auther: GERRY
10 | * @Date: 2019/4/14 15:21
11 | * @Description:
12 | */
13 | public interface OrderDetailMapper extends Mapper, InsertListMapper {
14 | }
15 |
--------------------------------------------------------------------------------
/yitao-sms-service/src/main/java/com/gerry/yitao/yitaosmsservice/YitaoSmsServiceApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosmsservice;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class YitaoSmsServiceApplication {
8 |
9 |
10 | public static void main(String[] args) {
11 | SpringApplication.run(YitaoSmsServiceApplication.class);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/yitao-upload-service/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | dubbo:
2 | application:
3 | name: yitao-upload-service
4 | protocol:
5 | port: 20881
6 | payload: 104857600
7 | name: hessian
8 | registry:
9 | address: zookeeper://192.168.3.220:2181?backup=192.168.3.221:2181,192.168.3.222:2181
10 |
11 | yitao:
12 | upload:
13 | allowTypes:
14 | - image/jpeg
15 | - image/png
16 | - image/bmp
17 | baseUrl: http://yitao.image.com/
18 | server:
19 | port: 7777
20 |
--------------------------------------------------------------------------------
/yitao-common/src/main/resources/application-common.yml:
--------------------------------------------------------------------------------
1 | yt:
2 | jwt:
3 | pubKeyPath: D:/vip/keys/gerry/id_rsa.pub # 公钥地址
4 | cookieName: YT_TOKEN # cookie的名称
5 | filter:
6 | allowPaths:
7 | - /api/auth # 授权中心
8 | - /api/search # 商品搜索
9 | - /api/user/register #注册
10 | - /api/user/check # 检验数据类型
11 | - /api/user/send # 发送验证码
12 | - /api/user/query # 用户查询
13 | - /api/item # 商品页
14 | - /item # 商品详情
15 | - /api/upload # 图片服务器
16 | - /api/order
17 | - /error
--------------------------------------------------------------------------------
/yitao-detail-interface/src/main/java/com/gerry/yitao/detail/service/PageDetailService.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.detail.service;
2 |
3 | import java.util.Map;
4 |
5 | /**
6 | * @ProjectName: yitao-parent
7 | * @Auther: GERRY
8 | * @Date: 2019/4/29 18:11
9 | * @Description:
10 | */
11 | public interface PageDetailService {
12 | Map loadModel(Long spuId);
13 | void createHtml(Long spuId);
14 | void asyncExecute(Long spuId);
15 | void deleteHtml(Long id);
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/yitao-detail-service/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | rabbitmq:
3 | virtual-host: /
4 | username: test
5 | password: test
6 | host: 192.168.3.201
7 | dubbo:
8 | application:
9 | name: yitao-detail-service
10 | protocol:
11 | port: 20884
12 | registry:
13 | address: zookeeper://192.168.3.220:2181?backup=192.168.3.221:2181,192.168.3.222:2181
14 | server:
15 | port: 7780
16 | # 调用外部服务接口的前缀
17 | client.url: http://api.yitao.com/
18 | yt.page.path: D:/vip/yitao/pages
--------------------------------------------------------------------------------
/yitao-search-service/src/main/java/com/gerry/yitao/yitaosearchservice/respository/GoodsRepository.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosearchservice.respository;
2 |
3 | import com.gerry.yitao.search.entity.Goods;
4 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
5 |
6 | /**
7 | * @ProjectName: yitao-parent
8 | * @Auther: GERRY
9 | * @Date: 2019/4/23 18:23
10 | * @Description:
11 | */
12 | public interface GoodsRepository extends ElasticsearchRepository {
13 | }
14 |
--------------------------------------------------------------------------------
/yitao-order-interface/src/main/java/com/gerry/yitao/order/status/PayStateEnum.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.order.status;
2 |
3 | /**
4 | * @ProjectName: yitao-parent
5 | * @Auther: GERRY
6 | * @Date: 2019/5/14 19:38
7 | * @Description: 支付状态枚举
8 | */
9 | public enum PayStateEnum {
10 |
11 | NOT_PAY(0), SUCCESS(1), FAIL(2);
12 |
13 | int value;
14 |
15 | PayStateEnum(int value) {
16 | this.value = value;
17 | }
18 |
19 | public int getValue() {
20 | return value;
21 | }
22 | }
--------------------------------------------------------------------------------
/yitao-order-interface/src/main/java/com/gerry/yitao/order/service/PayLogService.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.order.service;
2 |
3 | import com.gerry.yitao.common.entity.UserInfo;
4 |
5 | /**
6 | * @ProjectName: yitao-parent
7 | * @Auther: GERRY
8 | * @Date: 2019/5/14 19:42
9 | * @Description: 支付日志接口
10 | */
11 | public interface PayLogService {
12 | /**
13 | * 添加支付日志
14 | * @param orderId
15 | * @param actualPay
16 | */
17 | void createPayLog(Long orderId, Double actualPay, UserInfo user);
18 | }
19 |
--------------------------------------------------------------------------------
/yitao-upload-interface/src/main/java/com/gerry/yitao/upload/bo/UploadBo.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.upload.bo;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serializable;
6 |
7 | /**
8 | * @ProjectName: yitao-parent
9 | * @Auther: GERRY
10 | * @Date: 2019/4/18 21:15
11 | * @Description:
12 | */
13 | @Data
14 | public class UploadBo implements Serializable {
15 | private static final long serialVersionUID = 1L;
16 | private byte[] bytes;
17 | private String contentType;
18 | private String fileName;
19 | }
20 |
--------------------------------------------------------------------------------
/yitao-search-webapi/src/test/java/com/gerry/yitao/yitaosearchservice/YitaoSellerServiceApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosearchservice;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | @RunWith(SpringRunner.class)
9 | @SpringBootTest
10 | public class YitaoSellerServiceApplicationTests {
11 |
12 | @Test
13 | public void contextLoads() {
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/yitao-seller-service/src/test/java/com/gerry/yitao/yitaosellerservice/YitaoSellerServiceApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosellerservice;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | @RunWith(SpringRunner.class)
9 | @SpringBootTest
10 | public class YitaoSellerServiceApplicationTests {
11 |
12 | @Test
13 | public void contextLoads() {
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/yitao-seller-webapi/src/test/java/com/gerry/yitao/yitaosellerservice/YitaoSellerServiceApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosellerservice;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | @RunWith(SpringRunner.class)
9 | @SpringBootTest
10 | public class YitaoSellerServiceApplicationTests {
11 |
12 | @Test
13 | public void contextLoads() {
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/yitao-upload-webapi/src/test/java/com/gerry/yitao/yitaouploadservice/YitaoSellerServiceApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaouploadservice;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | @RunWith(SpringRunner.class)
9 | @SpringBootTest
10 | public class YitaoSellerServiceApplicationTests {
11 |
12 | @Test
13 | public void contextLoads() {
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/yitao-order-service/src/test/java/com/gerry/yitao/yitaocartservice/YitaoCartServiceApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaocartservice;
2 |
3 | import com.gerry.yitao.yitaoorderservice.YitaoOrderServiceApplication;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | @RunWith(SpringRunner.class)
9 | @SpringBootTest(classes = YitaoOrderServiceApplication.class)
10 | public class YitaoCartServiceApplicationTests {
11 | }
12 |
--------------------------------------------------------------------------------
/yitao-search-service/src/test/java/com/gerry/yitao/yitaosearchservice/YitaoSearchApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosearchservice;
2 |
3 | import com.gerry.yitao.yitaosearchservice.YitaoSearchServiceApplication;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | @RunWith(SpringRunner.class)
9 | @SpringBootTest(classes = YitaoSearchServiceApplication.class)
10 | public class YitaoSearchApplicationTests {
11 | }
12 |
--------------------------------------------------------------------------------
/yitao-detail-service/src/test/java/com/gerry/yitao/yitaodetailservice/YitaoPageDetailApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaodetailservice;
2 |
3 | import com.gerry.yitao.yitaosearchservice.YitaoDetailServiceApplication;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | @RunWith(SpringRunner.class)
9 | @SpringBootTest(classes = YitaoDetailServiceApplication.class)
10 | public class YitaoPageDetailApplicationTests {
11 | }
12 |
--------------------------------------------------------------------------------
/yitao-sms-service/src/main/java/com/gerry/yitao/yitaosmsservice/config/SmsProperties.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosmsservice.config;
2 |
3 | /**
4 | * @ProjectName: yitao-parent
5 | * @Auther: GERRY
6 | * @Date: 2019/5/6 18:21
7 | * @Description:
8 | */
9 |
10 | import lombok.Data;
11 | import org.springframework.boot.context.properties.ConfigurationProperties;
12 | @ConfigurationProperties(prefix = "yt.sms")
13 | @Data
14 | public class SmsProperties {
15 | private String accessKeyId;
16 | private String accessKeySecret;
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/yitao-common/src/main/java/com/gerry/yitao/common/entity/UserInfo.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.common.entity;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.io.Serializable;
8 |
9 | /**
10 | * @ProjectName: yitao-parent
11 | * @Auther: GERRY
12 | * @Date: 2019/5/6 19:00
13 | * @Description:
14 | */
15 | @Data
16 | @NoArgsConstructor
17 | @AllArgsConstructor
18 | public class UserInfo implements Serializable {
19 | private Long id;
20 | private String username;
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/yitao-common/src/main/java/com/gerry/yitao/common/base/interceptor/properties/FilterProperties.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.common.base.interceptor.properties;
2 |
3 | import lombok.Data;
4 | import org.springframework.boot.context.properties.ConfigurationProperties;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * @ProjectName: yitao-parent
10 | * @Auther: GERRY
11 | * @Date: 2019/5/8 11:55
12 | * @Description:
13 | */
14 | @Data
15 | @ConfigurationProperties(prefix = "yt.filter")
16 | public class FilterProperties {
17 | private List allowPaths;
18 | }
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/yitao-seller-interface/src/main/java/com/gerry/yitao/seller/dto/CartDto.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.seller.dto;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.io.Serializable;
8 |
9 | /**
10 | * @ProjectName: yitao-parent
11 | * @Auther: GERRY
12 | * @Date: 2019/4/16 19:30
13 | * @Description:
14 | */
15 | @Data
16 | @NoArgsConstructor
17 | @AllArgsConstructor
18 | public class CartDto implements Serializable {
19 | private Long skuId; //商品skuId
20 | private Integer num; //购买数量
21 | }
22 |
--------------------------------------------------------------------------------
/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/config/EnableTransactionManagerServer.java:
--------------------------------------------------------------------------------
1 | package com.codingapi.txlcn.tm.config;
2 |
3 | import com.codingapi.txlcn.tm.TMAutoConfiguration;
4 | import org.springframework.context.annotation.Import;
5 |
6 | import java.lang.annotation.*;
7 |
8 | /**
9 | * Description:
10 | * Date: 19-2-15 下午5:25
11 | *
12 | * @author ujued
13 | */
14 | @Retention(RetentionPolicy.RUNTIME)
15 | @Target(ElementType.TYPE)
16 | @Documented
17 | @Import(value = {TMAutoConfiguration.class})
18 | public @interface EnableTransactionManagerServer {
19 | }
20 |
--------------------------------------------------------------------------------
/yitao-upload-service/src/test/java/com/gerry/yitao/yitaouploadservice/YitaoSellerServiceApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaouploadservice;
2 |
3 | import com.gerry.yitao.upload.service.UploadService;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.boot.test.context.SpringBootTest;
7 | import org.springframework.test.context.junit4.SpringRunner;
8 |
9 | @RunWith(SpringRunner.class)
10 | @SpringBootTest
11 | public class YitaoSellerServiceApplicationTests {
12 |
13 |
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/txlcn-tm/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=TransactionManager
2 | server.port=7970
3 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver
4 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/tx-manager?characterEncoding=UTF-8&useSSL=false
5 | spring.datasource.username=root
6 | spring.datasource.password=123
7 | spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
8 | spring.jpa.hibernate.ddl-auto=update
9 | spring.redis.host=192.168.3.201
10 | spring.redis.password=redis-01
11 | spring.redis.port=6379
12 | tx-lcn.logger.enabled=true
--------------------------------------------------------------------------------
/yitao-search-service/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | data:
3 | elasticsearch:
4 | cluster-name: elasticsearch
5 | cluster-nodes: 192.168.3.201:9300
6 | rabbitmq:
7 | virtual-host: /
8 | username: test
9 | password: test
10 | host: 192.168.3.201
11 | dubbo:
12 | application:
13 | name: yitao-search-service
14 | protocol:
15 | port: 20882
16 | registry:
17 | address: zookeeper://192.168.3.220:2181?backup=192.168.3.221:2181,192.168.3.222:2181
18 | server:
19 | port: 7778
20 | # 调用外部服务接口的前缀
21 | client.url: http://api.yitao.com/
--------------------------------------------------------------------------------
/yitao-auth-webapi/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 10060
3 | dubbo:
4 | application:
5 | name: yitao-auth-web
6 | qos-enable: false
7 | registry:
8 | address: zookeeper://192.168.3.201:2181
9 | spring:
10 | jackson:
11 | default-property-inclusion: non_null
12 | profiles:
13 | active: common
14 | yt:
15 | jwt:
16 | secret: yt@Login(Auth}*^778)&gerry%f35YUE2 # 登录校验的密钥
17 | pubKeyPath: D:/vip/keys/gerry/id_rsa.pub # 公钥地址
18 | priKeyPath: D:/vip/keys/gerry/id_rsa # 私钥地址
19 | expire: 30 # 过期时间,单位分钟
20 | cookieName: YT_TOKEN
21 | cookieMaxAge: 1800
--------------------------------------------------------------------------------
/yitao-detail-service/src/main/java/com/gerry/yitao/yitaosearchservice/utils/ThreadUtil.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosearchservice.utils;
2 |
3 | import java.util.concurrent.ExecutorService;
4 | import java.util.concurrent.Executors;
5 |
6 | /**
7 | * @ProjectName: yitao-parent
8 | * @Auther: GERRY
9 | * @Date: 2019/4/29 23:42
10 | * @Description:
11 | */
12 | public class ThreadUtil {
13 | private static final ExecutorService executorService = Executors.newFixedThreadPool(10);
14 |
15 | public static void execute(Runnable runnable) {
16 | executorService.submit(runnable);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/yitao-seller-webapi/src/main/java/com/gerry/yitao/yitaosellerservice/YitaoSellerWebApiApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosellerservice;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 |
7 | @SpringBootApplication(scanBasePackages = "com.gerry.yitao")
8 | @EnableDubbo
9 | public class YitaoSellerWebApiApplication {
10 |
11 |
12 | public static void main(String[] args) {
13 | SpringApplication.run(YitaoSellerWebApiApplication.class);
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/yitao-cart-webapi/src/test/java/com/gerry/yitao/yitaocartweb/YitaoCartWebApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaocartweb;
2 |
3 | import com.gerry.yitao.yitaocartservicewebapi.YitaoCartWebApplication;
4 | import org.junit.Test;
5 | import org.junit.runner.RunWith;
6 | import org.springframework.boot.test.context.SpringBootTest;
7 | import org.springframework.test.context.junit4.SpringRunner;
8 |
9 | @RunWith(SpringRunner.class)
10 | @SpringBootTest(classes = {YitaoCartWebApplication.class})
11 | public class YitaoCartWebApplicationTests {
12 |
13 |
14 |
15 | @Test
16 | public void contextLoads() {
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/yitao-domain/src/main/java/com/gerry/yitao/domain/Stock.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.domain;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.io.Serializable;
8 |
9 | /**
10 | * @ProjectName: yitao-parent
11 | * @Auther: GERRY
12 | * @Date: 2019/4/15 21:41
13 | * @Description:
14 | */
15 | @Table(name = "tb_stock")
16 | @Data
17 | public class Stock implements Serializable {
18 |
19 | @Id
20 | private Long skuId;
21 |
22 | private Integer seckillStock;// 秒杀可用库存
23 |
24 | private Integer seckillTotal;// 已秒杀数量
25 |
26 | private Integer stock;// 正常库存
27 | }
--------------------------------------------------------------------------------
/yitao-user-webapi/src/test/java/com/gerry/yitao/yitaouserservice/YitaoUserServiceApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaouserservice;
2 |
3 | import com.gerry.yitao.yitaouserservicewebapi.YitaoUserWebApplication;
4 | import org.junit.Test;
5 | import org.junit.runner.RunWith;
6 | import org.springframework.boot.test.context.SpringBootTest;
7 | import org.springframework.test.context.junit4.SpringRunner;
8 |
9 | @RunWith(SpringRunner.class)
10 | @SpringBootTest(classes = {YitaoUserWebApplication.class})
11 | public class YitaoUserServiceApplicationTests {
12 |
13 |
14 |
15 | @Test
16 | public void contextLoads() {
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/yitao-seckill-webapi/src/test/java/com/gerry/yitao/yitaouserservice/YitaoUserServiceApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaouserservice;
2 |
3 | import com.gerry.yitao.yitaoseckillwebapi.YitaoSeckillWebApplication;
4 | import org.junit.Test;
5 | import org.junit.runner.RunWith;
6 | import org.springframework.boot.test.context.SpringBootTest;
7 | import org.springframework.test.context.junit4.SpringRunner;
8 |
9 | @RunWith(SpringRunner.class)
10 | @SpringBootTest(classes = {YitaoSeckillWebApplication.class})
11 | public class YitaoUserServiceApplicationTests {
12 |
13 |
14 |
15 | @Test
16 | public void contextLoads() {
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/yitao-upload-service/src/main/java/com/gerry/yitao/yitaouploadservice/config/UploadProperties.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaouploadservice.config;
2 |
3 | import lombok.Data;
4 | import org.springframework.boot.context.properties.ConfigurationProperties;
5 | import org.springframework.stereotype.Component;
6 |
7 | import java.util.List;
8 | /**
9 | * @ProjectName: yitao-parent
10 | * @Auther: GERRY
11 | * @Date: 2019/4/17 18:19
12 | * @Description:
13 | */
14 | @Data
15 | @Component
16 | @ConfigurationProperties(prefix = "yitao.upload")
17 | public class UploadProperties {
18 |
19 | private String baseUrl;
20 | private List allowTypes;
21 | }
22 |
--------------------------------------------------------------------------------
/yitao-detail-webapi/src/test/java/com/gerry/yitao/yitaosearchservice/YitaoDetailServiceApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosearchservice;
2 |
3 | import com.gerry.yitao.yitaodetailservicewebapi.YitaoDetailWebApplication;
4 | import org.junit.Test;
5 | import org.junit.runner.RunWith;
6 | import org.springframework.boot.test.context.SpringBootTest;
7 | import org.springframework.test.context.junit4.SpringRunner;
8 |
9 | @RunWith(SpringRunner.class)
10 | @SpringBootTest(classes = {YitaoDetailWebApplication.class})
11 | public class YitaoDetailServiceApplicationTests {
12 |
13 |
14 |
15 | @Test
16 | public void contextLoads() {
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/txlcn-tm/src/main/resources/static/admin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | TxManager系统后台
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/yitao-upload-service/src/main/java/com/gerry/yitao/yitaouploadservice/config/FastdfsClientConfig.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaouploadservice.config;
2 |
3 | import com.gerry.yitao.common.upload.FastdfsClient;
4 | import org.springframework.boot.SpringBootConfiguration;
5 | import org.springframework.context.annotation.Bean;
6 |
7 | /**
8 | * @ProjectName: yitao-parent
9 | * @Auther: GERRY
10 | * @Date: 2019/4/20 02:04
11 | * @Description:
12 | */
13 | @SpringBootConfiguration
14 | public class FastdfsClientConfig {
15 | @Bean
16 | public FastdfsClient fastdfsClient() {
17 | return new FastdfsClient("classpath:fdfs/fdfs_client.conf");
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/yitao-domain/src/main/java/com/gerry/yitao/domain/Brand.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.domain;
2 |
3 | import lombok.Data;
4 | import tk.mybatis.mapper.annotation.KeySql;
5 |
6 | import javax.persistence.Id;
7 | import javax.persistence.Table;
8 | import java.io.Serializable;
9 |
10 | /**
11 | * @ProjectName: yitao-parent
12 | * @Auther: GERRY
13 | * @Date: 2019/4/15 21:41
14 | * @Description:
15 | */
16 | @Table(name = "tb_brand")
17 | @Data
18 | public class Brand implements Serializable {
19 |
20 | @Id
21 | @KeySql(useGeneratedKeys = true)
22 | private Long id;
23 | private String name;
24 | private String image;
25 | private Character letter;
26 | }
27 |
--------------------------------------------------------------------------------
/yitao-cart-interface/src/main/java/com/gerry/yitao/cart/entity/Cart.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.cart.entity;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serializable;
6 |
7 | /**
8 | * @ProjectName: yitao-parent
9 | * @Auther: GERRY
10 | * @Date: 2019/5/3 19:12
11 | * @Description:
12 | */
13 | @Data
14 | public class Cart implements Serializable {
15 |
16 | //商品id
17 | private Long skuId;
18 |
19 | //商品标题
20 | private String title;
21 |
22 | //购买数量
23 | private Integer num;
24 |
25 | //商品图片
26 | private String image;
27 |
28 | //加入购物车时商品的价格
29 | private Long price;
30 |
31 | //商品的规格参数
32 | private String ownSpec;
33 | }
34 |
--------------------------------------------------------------------------------
/yitao-seckill-webapi/src/main/java/com/gerry/yitao/yitaoseckillwebapi/ex/StockException.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoseckillwebapi.ex;
2 |
3 | import com.gerry.yitao.yitaoseckillwebapi.entity.StockParam;
4 | import lombok.Data;
5 |
6 | /**
7 | * @ProjectName: yitao-parent
8 | * @Auther: GERRY
9 | * @Date: 2019/5/28 21:17
10 | * @Description: 自定义异常处理类
11 | */
12 | @Data
13 | public class StockException extends RuntimeException {
14 | private StockParam param;
15 |
16 | public StockException() {
17 |
18 | }
19 |
20 | public StockException(StockParam param, String message) {
21 | super(message);
22 | this.param = param;
23 |
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/yitao-auth-service/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | rabbitmq:
3 | virtual-host: /
4 | username: test
5 | password: test
6 | host: 192.168.3.201
7 | dubbo:
8 | application:
9 | name: yitao-auth-service
10 | protocol:
11 | port: 20885
12 | registry:
13 | address: zookeeper://192.168.3.201:2181
14 | server:
15 | port: 7781
16 | yt:
17 | jwt:
18 | secret: yt@Login(Auth}*^778)&gerry%f35YUE2 # 登录校验的密钥
19 | pubKeyPath: D:/vip/keys/gerry/id_rsa.pub # 公钥地址
20 | priKeyPath: D:/vip/keys/gerry/id_rsa # 私钥地址
21 | expire: 30 # 过期时间,单位分钟
22 | cookieName: YT_TOKEN
23 | cookieMaxAge: 1800
24 | # 调用外部服务接口的前缀
25 | client.url: http://api.yitao.com/
--------------------------------------------------------------------------------
/yitao-order-interface/src/main/java/com/gerry/yitao/order/dto/AddressDTO.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.order.dto;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serializable;
6 |
7 | /**
8 | * @ProjectName: yitao-parent
9 | * @Auther: GERRY
10 | * @Date: 2019/5/14 19:33
11 | * @Description:
12 | */
13 | @Data
14 | public class AddressDTO implements Serializable {
15 | private Long id;
16 | private String name;// 收件人姓名
17 | private String phone;// 电话
18 | private String state;// 省份
19 | private String city;// 城市
20 | private String district;// 区
21 | private String address;// 街道地址
22 | private String zipCode;// 邮编
23 | private Boolean isDefault;
24 | }
25 |
--------------------------------------------------------------------------------
/yitao-order-interface/src/main/java/com/gerry/yitao/order/dto/OrderDto.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.order.dto;
2 |
3 | import com.gerry.yitao.seller.dto.CartDto;
4 | import lombok.AllArgsConstructor;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 | import java.util.List;
10 |
11 | /**
12 | * @ProjectName: yitao-parent
13 | * @Auther: GERRY
14 | * @Date: 2019/5/14 19:33
15 | * @Description:
16 | */
17 | @Data
18 | @AllArgsConstructor
19 | @NoArgsConstructor
20 | public class OrderDto implements Serializable {
21 | private Long addressId; // 收获人地址id
22 | private Integer paymentType;// 付款类型
23 | private List carts;// 订单详情
24 | }
--------------------------------------------------------------------------------
/yitao-user-service/src/main/java/com/gerry/yitao/yitaouserservice/YitaoUserServiceApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaouserservice;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import tk.mybatis.spring.annotation.MapperScan;
7 |
8 | @SpringBootApplication
9 | @EnableDubbo
10 | @MapperScan(basePackages = "com.gerry.yitao.mapper")
11 | public class YitaoUserServiceApplication {
12 |
13 |
14 | public static void main(String[] args) {
15 | SpringApplication.run(YitaoUserServiceApplication.class);
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/yitao-cart-service/src/main/java/com/gerry/yitao/yitaocartservice/YitaoCartServiceApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaocartservice;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
7 |
8 | @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
9 | @EnableDubbo
10 | public class YitaoCartServiceApplication {
11 |
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(YitaoCartServiceApplication.class);
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/yitao-domain/src/main/java/com/gerry/yitao/domain/Category.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.domain;
2 |
3 | import lombok.Data;
4 | import tk.mybatis.mapper.annotation.KeySql;
5 |
6 | import javax.persistence.Id;
7 | import javax.persistence.Table;
8 | import java.io.Serializable;
9 |
10 | /**
11 | * @ProjectName: yitao-parent
12 | * @Auther: GERRY
13 | * @Date: 2019/4/15 21:41
14 | * @Description:
15 | */
16 | @Data
17 | @Table(name = "tb_category")
18 | public class Category implements Serializable {
19 |
20 | @Id
21 | @KeySql(useGeneratedKeys = true)
22 | private Long id;
23 | private String name;
24 | private Long parentId;
25 | private Boolean isParent;
26 | private Integer sort;
27 | }
28 |
--------------------------------------------------------------------------------
/yitao-seckill-service/src/main/java/com/gerry/yitao/yitaoseckillservice/YitaoSeckillServiceApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoseckillservice;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import tk.mybatis.spring.annotation.MapperScan;
7 |
8 | @SpringBootApplication
9 | @EnableDubbo
10 | @MapperScan(basePackages = "com.gerry.yitao.mapper")
11 | public class YitaoSeckillServiceApplication {
12 |
13 |
14 | public static void main(String[] args) {
15 | SpringApplication.run(YitaoSeckillServiceApplication.class);
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/yitao-detail-service/src/main/java/com/gerry/yitao/yitaosearchservice/YitaoDetailServiceApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosearchservice;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
7 |
8 | @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
9 | @EnableDubbo
10 | public class YitaoDetailServiceApplication {
11 |
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(YitaoDetailServiceApplication.class);
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/yitao-search-service/src/main/java/com/gerry/yitao/yitaosearchservice/YitaoSearchServiceApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosearchservice;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
7 |
8 | @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
9 | @EnableDubbo
10 | public class YitaoSearchServiceApplication {
11 |
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(YitaoSearchServiceApplication.class);
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/yitao-upload-service/src/main/java/com/gerry/yitao/yitaouploadservice/YitaoUploadServiceApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaouploadservice;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
7 |
8 | @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
9 | @EnableDubbo
10 | public class YitaoUploadServiceApplication {
11 |
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(YitaoUploadServiceApplication.class);
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/yitao-upload-service/src/main/java/com/gerry/yitao/yitaouploadservice/config/FastClientImporter.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaouploadservice.config;
2 |
3 | import org.springframework.context.annotation.Configuration;
4 | import org.springframework.context.annotation.EnableMBeanExport;
5 | import org.springframework.context.annotation.Import;
6 | import org.springframework.jmx.support.RegistrationPolicy;
7 |
8 | /**
9 | * @ProjectName: yitao-parent
10 | * @Auther: GERRY
11 | * @Date: 2019/4/17 18:19
12 | * @Description:
13 | */
14 | @Configuration
15 | @Import(FastdfsClientConfig.class)
16 | // 解决jmx重复注册bean的问题
17 | @EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING)
18 | public class FastClientImporter {
19 | }
--------------------------------------------------------------------------------
/yitao-order-service/src/main/java/com/gerry/yitao/yitaoorderservice/YitaoOrderServiceApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoorderservice;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import tk.mybatis.spring.annotation.MapperScan;
7 |
8 | @SpringBootApplication
9 | @EnableDubbo
10 | @MapperScan(basePackages = "com.gerry.yitao.mapper")
11 | //@EnableDistributedTransaction
12 | public class YitaoOrderServiceApplication {
13 |
14 | public static void main(String[] args) {
15 | SpringApplication.run(YitaoOrderServiceApplication.class);
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/yitao-order-webapi/src/main/java/com/gerry/yitao/yitaoorderwebapi/YitaoOrderWebApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoorderwebapi;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
7 |
8 | @SpringBootApplication(exclude = DataSourceAutoConfiguration.class,scanBasePackages = {"com.gerry.yitao"})
9 | @EnableDubbo
10 | public class YitaoOrderWebApplication {
11 |
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(YitaoOrderWebApplication.class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/yitao-cart-webapi/src/main/java/com/gerry/yitao/yitaocartservicewebapi/YitaoCartWebApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaocartservicewebapi;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
7 |
8 | @SpringBootApplication(exclude = DataSourceAutoConfiguration.class,scanBasePackages = {"com.gerry.yitao"})
9 | @EnableDubbo
10 | public class YitaoCartWebApplication {
11 |
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(YitaoCartWebApplication.class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/yitao-seller-service/src/main/java/com/gerry/yitao/yitaosellerservice/YitaoSellerServiceApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosellerservice;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import tk.mybatis.spring.annotation.MapperScan;
7 |
8 | @SpringBootApplication
9 | @EnableDubbo
10 | @MapperScan(basePackages = "com.gerry.yitao.mapper")
11 | // @EnableDistributedTransaction
12 | public class YitaoSellerServiceApplication {
13 |
14 |
15 | public static void main(String[] args) {
16 | SpringApplication.run(YitaoSellerServiceApplication.class);
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/yitao-upload-webapi/src/main/java/com/gerry/yitao/yitaouploadwebapi/YitaoUploadWebApiApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaouploadwebapi;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
7 |
8 | @SpringBootApplication(exclude = DataSourceAutoConfiguration.class,scanBasePackages = {"com.gerry.yitao"})
9 | @EnableDubbo
10 | public class YitaoUploadWebApiApplication {
11 |
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(YitaoUploadWebApiApplication.class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/yitao-detail-webapi/src/main/java/com/gerry/yitao/yitaodetailservicewebapi/YitaoDetailWebApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaodetailservicewebapi;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
7 |
8 | @SpringBootApplication(exclude = DataSourceAutoConfiguration.class,scanBasePackages = {"com.gerry.yitao"})
9 | @EnableDubbo
10 | public class YitaoDetailWebApplication {
11 |
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(YitaoDetailWebApplication.class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/yitao-search-webapi/src/main/java/com/gerry/yitao/yitaosearchservicewebapi/YitaoSearchWebApiApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosearchservicewebapi;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
7 |
8 | @SpringBootApplication(exclude = DataSourceAutoConfiguration.class,scanBasePackages = {"com.gerry.yitao"})
9 | @EnableDubbo
10 | public class YitaoSearchWebApiApplication {
11 |
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(YitaoSearchWebApiApplication.class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/yitao-domain/src/main/java/com/gerry/yitao/domain/SeckillOrder.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.domain;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.GeneratedValue;
6 | import javax.persistence.GenerationType;
7 | import javax.persistence.Id;
8 | import javax.persistence.Table;
9 | import java.io.Serializable;
10 |
11 | /**
12 | * @ProjectName: yitao-parent
13 | * @Auther: GERRY
14 | * @Date: 2019/4/15 21:41
15 | * @Description: 秒杀订单
16 | */
17 | @Table(name = "tb_seckill_order")
18 | @Data
19 | public class SeckillOrder implements Serializable {
20 |
21 | @Id
22 | @GeneratedValue(strategy = GenerationType.IDENTITY)
23 | private Long id;
24 |
25 | private Long userId;
26 |
27 | private Long skuId;
28 |
29 | private Long orderId;
30 | }
31 |
--------------------------------------------------------------------------------
/yitao-user-webapi/src/main/java/com/gerry/yitao/yitaouserservicewebapi/YitaoUserWebApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaouserservicewebapi;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
7 |
8 | @SpringBootApplication(
9 | exclude = DataSourceAutoConfiguration.class,
10 | scanBasePackages = {"com.gerry.yitao"})
11 | @EnableDubbo
12 | public class YitaoUserWebApplication {
13 |
14 |
15 | public static void main(String[] args) {
16 | SpringApplication.run(YitaoUserWebApplication.class);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/yitao-seckill-interface/src/main/java/com/gerry/yitao/seckill/dto/SeckillDTO.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.seckill.dto;
2 |
3 | import com.gerry.yitao.common.entity.UserInfo;
4 | import com.gerry.yitao.domain.SeckillGoods;
5 | import lombok.AllArgsConstructor;
6 | import lombok.Data;
7 | import lombok.NoArgsConstructor;
8 |
9 | import java.io.Serializable;
10 |
11 | /**
12 | * @ProjectName: yitao-parent
13 | * @Auther: GERRY
14 | * @Date: 2019/5/23 18:38
15 | * @Description: 秒杀信息传输类
16 | */
17 | @Data
18 | @AllArgsConstructor
19 | @NoArgsConstructor
20 | public class SeckillDTO implements Serializable {
21 | /**
22 | * 用户信息
23 | */
24 | private UserInfo userInfo;
25 |
26 | /**
27 | * 秒杀商品
28 | */
29 | private SeckillGoods seckillGoods;
30 | }
31 |
--------------------------------------------------------------------------------
/yitao-seckill-webapi/src/main/java/com/gerry/yitao/yitaoseckillwebapi/YitaoSeckillWebApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoseckillwebapi;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
7 |
8 | @SpringBootApplication(
9 | exclude = DataSourceAutoConfiguration.class,
10 | scanBasePackages = {"com.gerry.yitao"})
11 | @EnableDubbo
12 | public class YitaoSeckillWebApplication {
13 |
14 |
15 | public static void main(String[] args) {
16 | SpringApplication.run(YitaoSeckillWebApplication.class);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/yitao-seller-interface/src/main/java/com/gerry/yitao/seller/bo/BrandBo.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.seller.bo;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.io.Serializable;
8 | import java.util.List;
9 |
10 | /**
11 | * @ProjectName: yitao-parent
12 | * @Auther: GERRY
13 | * @Date: 2019/4/16 19:29
14 | * @Description:
15 | */
16 | @Data
17 | @NoArgsConstructor
18 | @AllArgsConstructor
19 | // BO 业务对象=> 把请求的数据封装为BO从传入业务层(输入)
20 | // DTO (输入=参数,输出=返回结果)
21 | // VO (封装页面渲染的数据(来源不同实体情况可以选择定义))
22 | public class BrandBo implements Serializable {
23 | private Long id;
24 | private String name;
25 | private String image;
26 | private List cids;
27 | private Character letter;
28 | }
29 |
--------------------------------------------------------------------------------
/yitao-domain/src/main/java/com/gerry/yitao/domain/SpecGroup.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.domain;
2 |
3 | import lombok.Data;
4 | import tk.mybatis.mapper.annotation.KeySql;
5 |
6 | import javax.persistence.Id;
7 | import javax.persistence.Table;
8 | import javax.persistence.Transient;
9 | import java.io.Serializable;
10 | import java.util.List;
11 |
12 | /**
13 | * @ProjectName: yitao-parent
14 | * @Auther: GERRY
15 | * @Date: 2019/4/15 21:41
16 | * @Description:
17 | */
18 | @Data
19 | @Table(name = "tb_spec_group")
20 | public class SpecGroup implements Serializable {
21 |
22 | @Id
23 | @KeySql(useGeneratedKeys = true)
24 | private Long id;
25 | private Long cid;
26 | private String name;
27 |
28 | @Transient
29 | private List params;
30 | }
31 |
--------------------------------------------------------------------------------
/yitao-domain/src/main/java/com/gerry/yitao/domain/SpuDetail.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.domain;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.io.Serializable;
8 |
9 | /**
10 | * @ProjectName: yitao-parent
11 | * @Auther: GERRY
12 | * @Date: 2019/4/15 21:41
13 | * @Description:
14 | */
15 | @Table(name = "tb_spu_detail")
16 | @Data
17 | public class SpuDetail implements Serializable {
18 |
19 | @Id
20 | private Long spuId;
21 |
22 | //商品描述
23 | private String description;
24 |
25 | //通用规格参数数据
26 | private String genericSpec;
27 |
28 | //特殊规格参数数据
29 | private String specialSpec;
30 |
31 | //包装清单
32 | private String packingList;
33 |
34 | //售后服务
35 | private String afterService;
36 | }
37 |
--------------------------------------------------------------------------------
/yitao-detail-webapi/src/test/java/com/gerry/yitao/yitaosearchservice/PageDetailTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaosearchservice;
2 |
3 | import com.alibaba.fastjson.JSON;
4 | import com.gerry.yitao.detail.service.PageDetailService;
5 | import org.junit.Test;
6 |
7 | import javax.annotation.Resource;
8 | import java.util.Map;
9 |
10 | /**
11 | * @ProjectName: yitao-parent
12 | * @Auther: GERRY
13 | * @Date: 2019/4/29 20:46
14 | * @Description:
15 | */
16 | public class PageDetailTests extends YitaoDetailServiceApplicationTests {
17 |
18 | @Resource
19 | private PageDetailService pageDetailService;
20 |
21 | @Test
22 | public void test1() {
23 | Map map = pageDetailService.loadModel(51L);
24 | System.out.println(JSON.toJSONString(map,true));
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/yitao-seller-interface/src/main/java/com/gerry/yitao/seller/bo/SeckillParameter.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.seller.bo;
2 |
3 |
4 | import lombok.Data;
5 |
6 | import java.io.Serializable;
7 |
8 | /**
9 | * @ProjectName: yitao-parent
10 | * @Auther: GERRY
11 | * @Date: 2019/4/16 19:29
12 | * @Description: 秒杀的参数类
13 | */
14 | @Data
15 |
16 | public class SeckillParameter implements Serializable {
17 |
18 | /**
19 | * 要秒杀的sku id
20 | */
21 | private Long id;
22 |
23 | /**
24 | * 秒杀开始时间
25 | */
26 | private String startTime;
27 |
28 | /**
29 | * 秒杀结束时间
30 | */
31 | private String endTime;
32 |
33 | /**
34 | * 参与秒杀的商品数量
35 | */
36 | private Integer count;
37 |
38 | /**
39 | * 折扣
40 | */
41 | private double discount;
42 | }
43 |
--------------------------------------------------------------------------------
/yitao-order-interface/src/main/java/com/gerry/yitao/order/status/OrderStatusEnum.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.order.status;
2 |
3 | /**
4 | * @ProjectName: yitao-parent
5 | * @Auther: GERRY
6 | * @Date: 2019/5/14 19:37
7 | * @Description: 定义状态枚举
8 | */
9 | public enum OrderStatusEnum {
10 |
11 | INIT(1, "初始化,未付款"),
12 | PAY_UP(2, "已付款,未发货"),
13 | DELIVERED(3, "已发货,未确认"),
14 | CONFIRMED(4, "已确认,未评价"),
15 | CLOSED(5, "已关闭"),
16 | RATED(6, "已评价,交易结束");
17 |
18 | private Integer code;
19 | private String msg;
20 |
21 | OrderStatusEnum(Integer code, String msg) {
22 | this.code = code;
23 | this.msg = msg;
24 | }
25 |
26 | public Integer value(){
27 | return this.code;
28 | }
29 |
30 | public String msg(){
31 | return msg;
32 | }
33 | }
--------------------------------------------------------------------------------
/yitao-order-service/src/main/java/com/gerry/yitao/yitaoorderservice/config/IdWorkerConfig.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoorderservice.config;
2 |
3 | import com.gerry.yitao.common.util.IdWorker;
4 | import org.springframework.boot.context.properties.EnableConfigurationProperties;
5 | import org.springframework.context.annotation.Bean;
6 | import org.springframework.context.annotation.Configuration;
7 |
8 | /**
9 | * @ProjectName: yitao-parent
10 | * @Auther: GERRY
11 | * @Date: 2019/5/15 15:29
12 | * @Description: IdWorker配置类
13 | */
14 | @Configuration
15 | @EnableConfigurationProperties(IdWorkerProperties.class)
16 | public class IdWorkerConfig {
17 |
18 | @Bean
19 | public IdWorker idWorker(IdWorkerProperties prop) {
20 | return new IdWorker(prop.getWorkerId(), prop.getDataCenterId());
21 | }
22 | }
--------------------------------------------------------------------------------
/yitao-seller-interface/src/main/java/com/gerry/yitao/seller/service/SpecService.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.seller.service;
2 |
3 | import com.gerry.yitao.domain.SpecGroup;
4 | import com.gerry.yitao.domain.SpecParam;
5 |
6 | import java.util.List;
7 |
8 | public interface SpecService {
9 |
10 | List querySpecGroupByCid(Long cid);
11 |
12 | void saveSpecGroup(SpecGroup specGroup);
13 |
14 | void deleteSpecGroup(Long id);
15 |
16 | void updateSpecGroup(SpecGroup specGroup);
17 |
18 | List querySpecParams(Long gid, Long cid, Boolean searching, Boolean generic);
19 |
20 | void saveSpecParam(SpecParam specParam);
21 |
22 | void updateSpecParam(SpecParam specParam);
23 |
24 | void deleteSpecParam(Long id);
25 |
26 | List querySpecsByCid(Long cid);
27 | }
28 |
--------------------------------------------------------------------------------
/yitao-domain/src/main/java/com/gerry/yitao/entity/PageResult.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.entity;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.io.Serializable;
8 | import java.util.List;
9 |
10 | /**
11 | * @ProjectName: yitao-parent
12 | * @Auther: GERRY
13 | * @Date: 2019/4/14 17:32
14 | * @Description:
15 | */
16 | @Data
17 | @NoArgsConstructor
18 | @AllArgsConstructor
19 | public class PageResult implements Serializable {
20 | private static final long serialVersionUID = 4612105649493688532L;
21 | private long total; // 总记录数
22 | private Integer totalPages; //总页数
23 | private List rows; // 每页显示的数据集合
24 |
25 | public PageResult(long total, List rows) {
26 | this.total = total;
27 | this.rows = rows;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/yitao-mapper/src/main/java/com/gerry/yitao/mapper/StockMapper.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.mapper;
2 |
3 | import com.gerry.yitao.domain.Stock;
4 | import org.apache.ibatis.annotations.Param;
5 | import org.apache.ibatis.annotations.Update;
6 | import tk.mybatis.mapper.additional.idlist.IdListMapper;
7 | import tk.mybatis.mapper.additional.insert.InsertListMapper;
8 | import tk.mybatis.mapper.common.Mapper;
9 |
10 | /**
11 | * @ProjectName: yitao-parent
12 | * @Auther: GERRY
13 | * @Date: 2019/4/14 15:27
14 | * @Description:
15 | */
16 |
17 | public interface StockMapper extends Mapper, IdListMapper,InsertListMapper {
18 |
19 | @Update("update tb_stock set stock = stock - #{num} where sku_id = #{skuId} and stock >= #{num}")
20 | int decreaseStock(@Param("skuId") Long skuId, @Param("num") Integer num);
21 | }
22 |
--------------------------------------------------------------------------------
/yitao-domain/src/main/java/com/gerry/yitao/domain/PayLog.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.domain;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.io.Serializable;
8 | import java.util.Date;
9 |
10 | /**
11 | * @ProjectName: yitao-parent
12 | * @Auther: GERRY
13 | * @Date: 2019/4/15 21:41
14 | * @Description:
15 | */
16 | @Data
17 | @Table(name = "tb_pay_log")
18 | public class PayLog implements Serializable {
19 | @Id
20 | private Long orderId;
21 | private Double totalFee;
22 | private Long userId;
23 | private String transactionId;
24 | private Integer status;
25 | private Integer payType;
26 | private String bankType;
27 | private Date createTime;
28 | private Date payTime;
29 | private Date refundTime;
30 | private Date closedTime;
31 | }
32 |
--------------------------------------------------------------------------------
/yitao-seckill-webapi/src/main/java/com/gerry/yitao/yitaoseckillwebapi/limiting/AccessLimiter.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoseckillwebapi.limiting;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * @ProjectName: yitao-parent
10 | * @Auther: GERRY
11 | * @Date: 2019/5/27 00:52
12 | * @Description: 接口限流注解
13 | */
14 | @Retention(RetentionPolicy.RUNTIME)
15 | @Target(ElementType.METHOD)
16 | public @interface AccessLimiter {
17 | /**
18 | * 限流时间
19 | * @return
20 | */
21 | int seconds();
22 |
23 | /**
24 | * 最大请求次数
25 | * @return
26 | */
27 | int maxCount();
28 |
29 | /**
30 | * 是否需要登录
31 | * @return
32 | */
33 | boolean needLogin() default true;
34 | }
35 |
--------------------------------------------------------------------------------
/yitao-search-interface/src/main/java/com/gerry/yitao/search/service/SearchService.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.search.service;
2 |
3 | import com.gerry.yitao.domain.Category;
4 | import com.gerry.yitao.domain.Spu;
5 | import com.gerry.yitao.search.entity.Goods;
6 | import com.gerry.yitao.search.entity.SearchRequest;
7 | import com.gerry.yitao.search.entity.SearchResult;
8 | import org.elasticsearch.search.aggregations.bucket.terms.LongTerms;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * @ProjectName: yitao-parent
14 | * @Auther: GERRY
15 | * @Date: 2019/4/23 18:21
16 | * @Description:
17 | */
18 | public interface SearchService {
19 | Goods buildGoods(Spu spu);
20 | SearchResult search(SearchRequest searchRequest);
21 | List handleCategoryAgg(LongTerms terms);
22 | void insertOrUpdate(Long id);
23 | void delete(Long id);
24 | }
25 |
--------------------------------------------------------------------------------
/yitao-order-service/src/main/java/com/gerry/yitao/yitaoorderservice/config/PayConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoorderservice.config;
2 |
3 | import org.springframework.boot.SpringBootConfiguration;
4 | import org.springframework.boot.context.properties.ConfigurationProperties;
5 | import org.springframework.context.annotation.Bean;
6 | import org.springframework.web.client.RestTemplate;
7 |
8 | /**
9 | * @ProjectName: yitao-parent
10 | * @Auther: GERRY
11 | * @Date: 2019/5/15 15:29
12 | * @Description: 支付配置类
13 | */
14 | @SpringBootConfiguration
15 | public class PayConfiguration {
16 | @Bean
17 | public RestTemplate restTemplate() {
18 | return new RestTemplate();
19 | }
20 |
21 | @Bean
22 | @ConfigurationProperties(prefix = "yt.wxpay")
23 | public WxPayConfig payConfig() {
24 | return new WxPayConfig();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/yitao-seller-interface/src/main/java/com/gerry/yitao/seller/service/BrandService.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.seller.service;
2 |
3 | import com.gerry.yitao.seller.bo.BrandBo;
4 | import com.gerry.yitao.domain.Brand;
5 | import com.gerry.yitao.domain.Category;
6 | import com.gerry.yitao.entity.PageResult;
7 |
8 | import java.util.List;
9 |
10 |
11 | public interface BrandService {
12 |
13 | PageResult queryBrandByPageAndSort(Integer page, Integer rows, String sortBy, Boolean desc, String key);
14 |
15 | void saveBrand(Brand brand, List cids);
16 |
17 | List queryCategoryByBid(Long bid);
18 |
19 | void updateBrand(BrandBo brandbo);
20 |
21 | void deleteBrand(Long bid);
22 |
23 | List queryBrandByCid(Long cid);
24 |
25 | Brand queryBrandByBid(Long id);
26 |
27 | List queryBrandByIds(List ids);
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/yitao-domain/src/main/java/com/gerry/yitao/domain/OrderDetail.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.domain;
2 |
3 | import lombok.Data;
4 | import tk.mybatis.mapper.annotation.KeySql;
5 |
6 | import javax.persistence.Id;
7 | import javax.persistence.Table;
8 | import java.io.Serializable;
9 |
10 | /**
11 | * @ProjectName: yitao-parent
12 | * @Auther: GERRY
13 | * @Date: 2019/4/15 21:41
14 | * @Description:
15 | */
16 | @Data
17 | @Table(name = "tb_order_detail")
18 | public class OrderDetail implements Serializable {
19 |
20 | @Id
21 | @KeySql(useGeneratedKeys = true)
22 | private Long id;
23 |
24 | private Long orderId;// 订单id
25 |
26 | private Long skuId;// 商品id
27 |
28 | private Integer num;// 商品购买数量
29 |
30 | private String title;// 商品标题
31 |
32 | private Double price;// 商品单价
33 |
34 | private String ownSpec;// 商品规格数据
35 |
36 | private String image;// 图片
37 | }
38 |
--------------------------------------------------------------------------------
/.idea/dataSources.local.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | #@
7 | `
8 |
9 |
10 | master_key
11 | root
12 | *:@
13 |
14 |
15 |
--------------------------------------------------------------------------------
/yitao-domain/src/main/java/com/gerry/yitao/domain/OrderStatus.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.domain;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.io.Serializable;
8 | import java.util.Date;
9 |
10 | /**
11 | * @ProjectName: yitao-parent
12 | * @Auther: GERRY
13 | * @Date: 2019/4/15 21:41
14 | * @Description:
15 | */
16 | @Data
17 | @Table(name = "tb_order_status")
18 | public class OrderStatus implements Serializable {
19 |
20 | @Id
21 | private Long orderId;
22 |
23 | private Integer status; //1、未付款 2、已付款,未发货 3、已发货,未确认 4、交易成功 5、交易关闭 6、已评价'
24 |
25 | private Date createTime;// 创建时间
26 |
27 | private Date paymentTime;// 付款时间
28 |
29 | private Date consignTime;// 发货时间
30 |
31 | private Date endTime;// 交易结束时间
32 |
33 | private Date closeTime;// 交易关闭时间
34 |
35 | private Date commentTime;// 评价时间
36 | }
37 |
--------------------------------------------------------------------------------
/yitao-auth-service/src/main/java/com/gerry/yitao/yitaoauthservice/YitaoAuthServiceApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoauthservice;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import com.gerry.yitao.auth.entity.JwtProperties;
5 | import org.springframework.boot.SpringApplication;
6 | import org.springframework.boot.autoconfigure.SpringBootApplication;
7 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
8 | import org.springframework.boot.context.properties.EnableConfigurationProperties;
9 |
10 | @SpringBootApplication(
11 | exclude = DataSourceAutoConfiguration.class)
12 | @EnableDubbo
13 | @EnableConfigurationProperties(JwtProperties.class)
14 | public class YitaoAuthServiceApplication {
15 |
16 |
17 | public static void main(String[] args) {
18 | SpringApplication.run(YitaoAuthServiceApplication.class);
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/yitao-domain/src/main/java/com/gerry/yitao/domain/SpecParam.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.domain;
2 |
3 | import lombok.Data;
4 | import tk.mybatis.mapper.annotation.KeySql;
5 |
6 | import javax.persistence.Column;
7 | import javax.persistence.Id;
8 | import javax.persistence.Table;
9 | import java.io.Serializable;
10 |
11 | /**
12 | * @ProjectName: yitao-parent
13 | * @Auther: GERRY
14 | * @Date: 2019/4/15 21:41
15 | * @Description:
16 | */
17 | @Data
18 | @Table(name = "tb_spec_param")
19 | public class SpecParam implements Serializable {
20 |
21 | @Id
22 | @KeySql(useGeneratedKeys = true)
23 | private Long id;
24 | private Long cid;
25 | private Long groupId;
26 | private String name;
27 | @Column(name = "`numeric`")
28 | private Boolean numeric;
29 | private String unit;
30 | private Boolean generic;
31 | private Boolean searching;
32 | private String segments;
33 | }
34 |
--------------------------------------------------------------------------------
/yitao-mapper/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | yitao-parent
7 | com.gerry.yitao
8 | 1.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | yitao-mapper
13 |
14 |
15 |
16 | com.gerry.yitao
17 | yitao-domain
18 |
19 |
20 |
21 | com.gerry.yitao
22 | yitao-common
23 |
24 |
25 |
--------------------------------------------------------------------------------
/yitao-auth-webapi/src/main/java/com/gerry/yitao/yitaoauthservicewebapi/YitaoAuthWebApplication.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoauthservicewebapi;
2 |
3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
4 | import com.gerry.yitao.auth.entity.JwtProperties;
5 | import org.springframework.boot.SpringApplication;
6 | import org.springframework.boot.autoconfigure.SpringBootApplication;
7 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
8 | import org.springframework.boot.context.properties.EnableConfigurationProperties;
9 |
10 | @SpringBootApplication(exclude = DataSourceAutoConfiguration.class,scanBasePackages = {"com.gerry.yitao"})
11 | @EnableDubbo
12 | @EnableConfigurationProperties(JwtProperties.class)
13 | public class YitaoAuthWebApplication {
14 |
15 |
16 | public static void main(String[] args) {
17 | SpringApplication.run(YitaoAuthWebApplication.class);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/yitao-user-interface/src/main/java/com/gerry/yitao/user/service/UserService.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.user.service;
2 |
3 | import com.gerry.yitao.domain.User;
4 |
5 | /**
6 | * @ProjectName: yitao-parent
7 | * @Auther: GERRY
8 | * @Date: 2019/5/3 19:12
9 | * @Description: 用户操作接口
10 | */
11 | public interface UserService {
12 | /**
13 | * 校验用户对象数据类型
14 | * @param data
15 | * @param type
16 | * @return
17 | */
18 | Boolean checkData(String data, Integer type);
19 |
20 | /**
21 | * 发送验证码
22 | * @param phone
23 | */
24 | void sendVerifyCode(String phone);
25 |
26 | /**
27 | * 用户注册
28 | * @param user
29 | * @param code
30 | */
31 | void register(User user, String code);
32 |
33 | /**
34 | * 根据账号和密码查询用户信息
35 | * @param username
36 | * @param password
37 | * @return
38 | */
39 | User queryUser(String username, String password);
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/.idea/dataSources.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | mysql
6 | true
7 | com.mysql.jdbc.Driver
8 | jdbc:mysql://localhost:3306/orange
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/yitao-seller-interface/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 | yitao-parent
7 | com.gerry.yitao
8 | 1.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | yitao-seller-interface
13 |
14 | yitao-seller-interface
15 |
16 |
17 |
18 | com.gerry.yitao
19 | yitao-domain
20 |
21 |
22 |
23 | com.gerry.yitao
24 | yitao-common
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/yitao-domain/src/main/java/com/gerry/yitao/domain/Sku.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.domain;
2 |
3 | import lombok.Data;
4 | import tk.mybatis.mapper.annotation.KeySql;
5 |
6 | import javax.persistence.Id;
7 | import javax.persistence.Table;
8 | import javax.persistence.Transient;
9 | import java.io.Serializable;
10 | import java.util.Date;
11 |
12 | /**
13 | * @ProjectName: yitao-parent
14 | * @Auther: GERRY
15 | * @Date: 2019/4/15 21:41
16 | * @Description:
17 | */
18 | @Table(name = "tb_sku")
19 | @Data
20 | public class Sku implements Serializable {
21 | @Id
22 | @KeySql(useGeneratedKeys = true)
23 | private Long id;
24 | private Long spuId;
25 | private String title;
26 | private String images;
27 | private Double price;
28 | private String ownSpec;// 商品特殊规格的键值对
29 | private String indexes;// 商品特殊规格的下标
30 | private Boolean enable;// 是否有效,逻辑删除用
31 | private Date createTime;// 创建时间
32 | private Date lastUpdateTime;// 最后修改时间
33 | @Transient
34 | private Integer stock;// 库存
35 | }
36 |
--------------------------------------------------------------------------------
/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/cluster/TMProperties.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2019 CodingApi .
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.codingapi.txlcn.tm.cluster;
17 |
18 | import lombok.Data;
19 |
20 | /**
21 | * Description:
22 | * Date: 19-1-25 上午10:31
23 | *
24 | * @author ujued
25 | */
26 | @Data
27 | public class TMProperties {
28 | private String host;
29 | private Integer httpPort;
30 | private Integer transactionPort;
31 | }
32 |
--------------------------------------------------------------------------------
/yitao-search-interface/src/main/java/com/gerry/yitao/search/entity/SearchRequest.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.search.entity;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serializable;
6 | import java.util.Map;
7 |
8 | /**
9 | * @ProjectName: yitao-parent
10 | * @Auther: GERRY
11 | * @Date: 2019/4/23 18:21
12 | * @Description:
13 | */
14 | @Data
15 | public class SearchRequest implements Serializable {
16 |
17 | private static final Integer DEFAULT_PAGE = 1;
18 | private static final Integer DEFAULT_SIZE = 20;
19 | private String key;
20 | private Integer page;
21 | //排序字段
22 | private String sortBy;
23 | //是否降序
24 | private Boolean descending;
25 | //过滤字段
26 | private Map filter;
27 |
28 | public Integer getPage() {
29 | if (page == null) {
30 | return DEFAULT_PAGE;
31 | }
32 | // 获取页码时做一些校验,不能小于1
33 | return Math.max(DEFAULT_PAGE, page);
34 | }
35 |
36 | public Integer getSize() {
37 | return DEFAULT_SIZE;
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/auth/sauth/SAuthHandleException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2019 CodingApi .
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.codingapi.txlcn.tm.support.restapi.auth.sauth;
17 |
18 | /**
19 | * Description:
20 | * Date: 2018/11/23
21 | *
22 | * @author ujued
23 | */
24 | public class SAuthHandleException extends Exception {
25 |
26 | public SAuthHandleException(String message) {
27 | super(message);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/yitao-order-webapi/src/main/java/com/gerry/yitao/yitaoorderwebapi/config/JwtProperties.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoorderwebapi.config;
2 |
3 | import com.gerry.yitao.common.util.RsaUtils;
4 | import lombok.Data;
5 | import lombok.extern.slf4j.Slf4j;
6 | import org.springframework.boot.context.properties.ConfigurationProperties;
7 |
8 | import javax.annotation.PostConstruct;
9 | import java.security.PublicKey;
10 |
11 | /**
12 | * @ProjectName: yitao-parent
13 | * @Auther: GERRY
14 | * @Date: 2019/5/9 19:17
15 | * @Description:
16 | */
17 | @Data
18 | @Slf4j
19 | @ConfigurationProperties(prefix = "yt.jwt")
20 | public class JwtProperties {
21 |
22 | private String pubKeyPath;
23 |
24 | private String cookieName;
25 |
26 | private PublicKey publicKey;
27 |
28 | @PostConstruct
29 | public void init() {
30 | try {
31 | publicKey = RsaUtils.getPublicKey(pubKeyPath);
32 | } catch (Exception e) {
33 | log.error("初始化公钥失败", e);
34 | throw new RuntimeException();
35 |
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/yitao-seckill-webapi/src/main/java/com/gerry/yitao/yitaoseckillwebapi/config/JwtProperties.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoseckillwebapi.config;
2 |
3 | import com.gerry.yitao.common.util.RsaUtils;
4 | import lombok.Data;
5 | import lombok.extern.slf4j.Slf4j;
6 | import org.springframework.boot.context.properties.ConfigurationProperties;
7 |
8 | import javax.annotation.PostConstruct;
9 | import java.security.PublicKey;
10 |
11 | /**
12 | * @ProjectName: yitao-parent
13 | * @Auther: GERRY
14 | * @Date: 2019/5/9 19:17
15 | * @Description:
16 | */
17 | @Data
18 | @Slf4j
19 | @ConfigurationProperties(prefix = "yt.jwt")
20 | public class JwtProperties {
21 |
22 | private String pubKeyPath;
23 |
24 | private String cookieName;
25 |
26 | private PublicKey publicKey;
27 |
28 | @PostConstruct
29 | public void init() {
30 | try {
31 | publicKey = RsaUtils.getPublicKey(pubKeyPath);
32 | } catch (Exception e) {
33 | log.error("初始化公钥失败", e);
34 | throw new RuntimeException();
35 |
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/yitao-cart-webapi/src/main/java/com/gerry/yitao/yitaocartservicewebapi/config/JwtProperties.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaocartservicewebapi.config;
2 |
3 | import com.gerry.yitao.common.util.RsaUtils;
4 | import lombok.Data;
5 | import lombok.extern.slf4j.Slf4j;
6 | import org.springframework.boot.context.properties.ConfigurationProperties;
7 |
8 | import javax.annotation.PostConstruct;
9 | import java.security.PublicKey;
10 |
11 | /**
12 | * @ProjectName: yitao-parent
13 | * @Auther: GERRY
14 | * @Date: 2019/5/9 19:17
15 | * @Description:
16 | */
17 | @Data
18 | @Slf4j
19 | @ConfigurationProperties(prefix = "yt.jwt")
20 | public class JwtProperties {
21 |
22 | private String pubKeyPath;
23 |
24 | private String cookieName;
25 |
26 | private PublicKey publicKey;
27 |
28 | @PostConstruct
29 | public void init() {
30 | try {
31 | publicKey = RsaUtils.getPublicKey(pubKeyPath);
32 | } catch (Exception e) {
33 | log.error("初始化公钥失败", e);
34 | throw new RuntimeException();
35 |
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/yitao-user-service/src/main/java/com/gerry/yitao/yitaouserservice/utils/CodecUtils.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaouserservice.utils;
2 |
3 | import org.apache.commons.codec.digest.DigestUtils;
4 | import org.apache.commons.lang3.StringUtils;
5 |
6 | import java.util.UUID;
7 |
8 | /**
9 | * @ProjectName: yitao-parent
10 | * @Auther: GERRY
11 | * @Date: 2019/5/6 11:56
12 | * @Description:
13 | */
14 | public class CodecUtils {
15 | public static String md5Hex(String data,String salt) {
16 | if (StringUtils.isBlank(salt)) {
17 | salt = data.hashCode() + "";
18 | }
19 |
20 | return DigestUtils.md5Hex(salt + DigestUtils.md5Hex(data));
21 | }
22 |
23 | public static String shaHex(String data, String salt) {
24 | if (StringUtils.isBlank(salt)) {
25 | salt = data.hashCode() + "";
26 | }
27 | return DigestUtils.sha512Hex(salt + DigestUtils.sha512Hex(data));
28 | }
29 |
30 | public static String generateSalt(){
31 | return StringUtils.replace(UUID.randomUUID().toString(), "-", "");
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/storage/FastStorageProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2019 CodingApi .
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.codingapi.txlcn.tm.core.storage;
17 |
18 | /**
19 | * Description:
20 | * Date: 19-1-22 下午2:18
21 | *
22 | * @author ujued
23 | */
24 | public interface FastStorageProvider {
25 |
26 | /**
27 | * TM FastStorage's implementation.
28 | *
29 | * @return fast storage's implementation
30 | */
31 | FastStorage provide();
32 | }
33 |
--------------------------------------------------------------------------------
/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/vo/Token.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2019 CodingApi .
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.codingapi.txlcn.tm.support.restapi.vo;
17 |
18 | import lombok.AllArgsConstructor;
19 | import lombok.Data;
20 | import lombok.NoArgsConstructor;
21 |
22 | /**
23 | * Description:
24 | * Date: 2018/12/29
25 | *
26 | * @author ujued
27 | */
28 | @AllArgsConstructor
29 | @NoArgsConstructor
30 | @Data
31 | public class Token {
32 | private String token;
33 | }
34 |
--------------------------------------------------------------------------------
/yitao-seckill-service/src/main/java/com/gerry/yitao/yitaoseckillservice/utils/CodecUtils.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoseckillservice.utils;
2 |
3 | import org.apache.commons.codec.digest.DigestUtils;
4 | import org.apache.commons.lang3.StringUtils;
5 |
6 | import java.util.UUID;
7 |
8 | /**
9 | * @ProjectName: yitao-parent
10 | * @Auther: GERRY
11 | * @Date: 2019/5/6 11:56
12 | * @Description:
13 | */
14 | public class CodecUtils {
15 | public static String md5Hex(String data,String salt) {
16 | if (StringUtils.isBlank(salt)) {
17 | salt = data.hashCode() + "";
18 | }
19 |
20 | return DigestUtils.md5Hex(salt + DigestUtils.md5Hex(data));
21 | }
22 |
23 | public static String shaHex(String data, String salt) {
24 | if (StringUtils.isBlank(salt)) {
25 | salt = data.hashCode() + "";
26 | }
27 | return DigestUtils.sha512Hex(salt + DigestUtils.sha512Hex(data));
28 | }
29 |
30 | public static String generateSalt(){
31 | return StringUtils.replace(UUID.randomUUID().toString(), "-", "");
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/yitao-common/src/main/java/com/gerry/yitao/common/base/interceptor/properties/AuthProperties.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.common.base.interceptor.properties;
2 |
3 | import com.gerry.yitao.common.util.RsaUtils;
4 | import lombok.Data;
5 | import lombok.extern.slf4j.Slf4j;
6 | import org.springframework.boot.context.properties.ConfigurationProperties;
7 |
8 | import javax.annotation.PostConstruct;
9 | import java.security.PublicKey;
10 |
11 | /**
12 | * @ProjectName: yitao-parent
13 | * @Auther: GERRY
14 | * @Date: 2019/5/8 11:56
15 | * @Description:
16 | */
17 |
18 | @Data
19 | @Slf4j
20 | @ConfigurationProperties(prefix = "yt.jwt")
21 | public class AuthProperties {
22 |
23 | private String pubKeyPath;
24 | private PublicKey publicKey;
25 | private String cookieName;
26 |
27 | @PostConstruct
28 | public void init() {
29 | try {
30 | //获取公钥
31 | this.publicKey = RsaUtils.getPublicKey(pubKeyPath);
32 | } catch (Exception e) {
33 | log.error("初始化公钥失败", e);
34 | throw new RuntimeException();
35 | }
36 |
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/yitao-seckill-service/src/test/java/com/gerry/yitao/yitaouserservice/YitaoSecKillApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaouserservice;
2 |
3 | import com.gerry.yitao.domain.SeckillGoods;
4 | import com.gerry.yitao.seckill.service.SeckillService;
5 | import com.gerry.yitao.yitaoseckillservice.YitaoSeckillServiceApplication;
6 | import org.junit.Test;
7 | import org.junit.runner.RunWith;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.boot.test.context.SpringBootTest;
10 | import org.springframework.test.context.junit4.SpringRunner;
11 |
12 | import java.util.List;
13 |
14 | @RunWith(SpringRunner.class)
15 | @SpringBootTest(classes = YitaoSeckillServiceApplication.class)
16 | public class YitaoSecKillApplicationTests {
17 | @Autowired
18 | private SeckillService seckillService;
19 |
20 | @Test
21 | public void testFindSeckillList() {
22 | List seckillGoods = seckillService.querySecKillList();
23 | for (SeckillGoods seckillGood : seckillGoods) {
24 | System.out.println(seckillGood);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/yitao-order-webapi/src/main/java/com/gerry/yitao/yitaoorderwebapi/config/MvcConfig.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoorderwebapi.config;
2 |
3 | import com.gerry.yitao.yitaoorderwebapi.filter.LoginInterceptor;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.boot.context.properties.EnableConfigurationProperties;
6 | import org.springframework.context.annotation.Configuration;
7 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
9 |
10 | /**
11 | * @ProjectName: yitao-parent
12 | * @Auther: GERRY
13 | * @Date: 2019/5/9 19:09
14 | * @Description:
15 | */
16 | @Configuration
17 | @EnableConfigurationProperties(JwtProperties.class)
18 | public class MvcConfig implements WebMvcConfigurer {
19 |
20 | @Autowired(required = false)
21 | private JwtProperties props;
22 |
23 | @Override
24 | public void addInterceptors(InterceptorRegistry registry) {
25 | //配置登录拦截器
26 | registry.addInterceptor(new LoginInterceptor(props)).addPathPatterns("/**");
27 | }
28 | }
--------------------------------------------------------------------------------
/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/txex/TxExceptionListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2019 CodingApi .
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.codingapi.txlcn.tm.support.txex;
17 |
18 | import com.codingapi.txlcn.tm.support.db.domain.TxException;
19 |
20 | /**
21 | * Description:
22 | * Date: 19-1-3 上午9:40
23 | *
24 | * @author ujued
25 | */
26 | public interface TxExceptionListener {
27 |
28 | /**
29 | * 实务异常时
30 | *
31 | * @param txException txException
32 | */
33 | void onException(TxException txException);
34 | }
35 |
--------------------------------------------------------------------------------
/yitao-cart-webapi/src/main/java/com/gerry/yitao/yitaocartservicewebapi/config/MvcConfig.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaocartservicewebapi.config;
2 |
3 | import com.gerry.yitao.yitaocartservicewebapi.filter.LoginInterceptor;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.boot.context.properties.EnableConfigurationProperties;
6 | import org.springframework.context.annotation.Configuration;
7 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
9 |
10 | /**
11 | * @ProjectName: yitao-parent
12 | * @Auther: GERRY
13 | * @Date: 2019/5/9 19:09
14 | * @Description:
15 | */
16 | @Configuration
17 | @EnableConfigurationProperties(JwtProperties.class)
18 | public class MvcConfig implements WebMvcConfigurer {
19 |
20 | @Autowired(required = false)
21 | private JwtProperties props;
22 |
23 | @Override
24 | public void addInterceptors(InterceptorRegistry registry) {
25 | //配置登录拦截器
26 | registry.addInterceptor(new LoginInterceptor(props)).addPathPatterns("/**");
27 | }
28 | }
--------------------------------------------------------------------------------
/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/vo/DeleteExceptions.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2019 CodingApi .
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.codingapi.txlcn.tm.support.restapi.vo;
17 |
18 | import lombok.AllArgsConstructor;
19 | import lombok.Data;
20 | import lombok.NoArgsConstructor;
21 |
22 | import java.util.List;
23 |
24 | /**
25 | * Description:
26 | * Date: 19-1-18 上午11:48
27 | *
28 | * @author ujued
29 | */
30 | @AllArgsConstructor
31 | @NoArgsConstructor
32 | @Data
33 | public class DeleteExceptions {
34 | private List id;
35 | }
--------------------------------------------------------------------------------
/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/storage/LockValue.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2019 CodingApi .
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.codingapi.txlcn.tm.core.storage;
17 |
18 | import lombok.Data;
19 |
20 | import java.io.Serializable;
21 |
22 | /**
23 | * Description:
24 | * Date: 19-1-23 下午5:41
25 | *
26 | * @author ujued
27 | */
28 | @Data
29 | public class LockValue implements Serializable {
30 | /**
31 | * 事务组ID
32 | */
33 | private String groupId;
34 |
35 | /**
36 | * 锁类型
37 | */
38 | private int lockType;
39 | }
40 |
--------------------------------------------------------------------------------
/yitao-auth-service/src/main/java/com/gerry/yitao/yitaoauthservice/client/UserClient.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaoauthservice.client;
2 |
3 | import com.gerry.yitao.common.util.RestTemplateUtils;
4 | import com.gerry.yitao.domain.User;
5 | import org.springframework.beans.factory.annotation.Value;
6 | import org.springframework.http.ResponseEntity;
7 | import org.springframework.stereotype.Component;
8 |
9 | import java.util.HashMap;
10 | import java.util.Map;
11 |
12 | /**
13 | * @ProjectName: yitao-parent
14 | * @Auther: GERRY
15 | * @Date: 2019/5/6 19:07
16 | * @Description:
17 | */
18 | @Component
19 | public class UserClient {
20 | @Value("${client.url:}")
21 | private String url;
22 |
23 | public User queryUser(String username, String password) {
24 | String requestUrl = url+"api/user/query?username={username}&password={password}";
25 | Map params = new HashMap<>();
26 | params.put("username", username);
27 | params.put("password", password);
28 | ResponseEntity entity = RestTemplateUtils.get(requestUrl,User.class,params);
29 |
30 | return entity.getBody();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/yitao-domain/src/main/java/com/gerry/yitao/domain/User.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.domain;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnore;
4 | import lombok.Data;
5 | import org.hibernate.validator.constraints.Length;
6 | import tk.mybatis.mapper.annotation.KeySql;
7 |
8 | import javax.persistence.Id;
9 | import javax.persistence.Table;
10 | import javax.validation.constraints.Pattern;
11 | import java.io.Serializable;
12 | import java.util.Date;
13 |
14 | /**
15 | * @ProjectName: yitao-parent
16 | * @Auther: GERRY
17 | * @Date: 2019/4/15 21:41
18 | * @Description:
19 | */
20 | @Data
21 | @Table(name = "tb_user")
22 | public class User implements Serializable {
23 | @Id
24 | @KeySql(useGeneratedKeys = true)
25 | private Long id;
26 | @Length(max = 30, min = 4, message = "用户名长度只能在4-30之间")
27 | private String username;// 用户名
28 | @JsonIgnore
29 | @Length(max = 30, min = 4, message = "密码长度只能在4-30之间")
30 | private String password;// 密码
31 | @Pattern(regexp = "^1[35678]\\d{9}$",message = "手机号格式不正确")
32 | private String phone;// 电话
33 | private Date created;
34 | @JsonIgnore
35 | private String salt;
36 | }
37 |
--------------------------------------------------------------------------------
/yitao-upload-interface/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 | yitao-parent
7 | com.gerry.yitao
8 | 1.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | yitao-upload-interface
13 |
14 | yitao-upload-interface
15 |
16 |
17 |
18 | org.projectlombok
19 | lombok
20 |
21 |
22 |
23 | org.springframework.boot
24 | spring-boot-starter-web
25 |
26 |
27 |
28 | com.caucho
29 | hessian
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/yitao-common/src/main/java/com/gerry/yitao/common/util/ObjectUtils.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.common.util;
2 |
3 | import org.apache.commons.lang3.StringUtils;
4 |
5 | /**
6 | * @ProjectName: yitao-parent
7 | * @Auther: GERRY
8 | * @Date: 2019/5/6 19:05
9 | * @Description:
10 | */
11 | public class ObjectUtils {
12 | public static String toString(Object obj) {
13 | if (obj == null) {
14 | return null;
15 | }
16 | return obj.toString();
17 | }
18 |
19 | public static Long toLong(Object obj) {
20 | if (obj == null) {
21 | return 0L;
22 | }
23 | if (obj instanceof Double || obj instanceof Float) {
24 | return Long.valueOf(StringUtils.substringBefore(obj.toString(), "."));
25 | }
26 | if (obj instanceof Number) {
27 | return Long.valueOf(obj.toString());
28 | }
29 | if (obj instanceof String) {
30 | return Long.valueOf(obj.toString());
31 | } else {
32 | return 0L;
33 | }
34 | }
35 |
36 | public static Integer toInt(Object obj) {
37 | return toLong(obj).intValue();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/storage/GroupProps.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2019 CodingApi .
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.codingapi.txlcn.tm.core.storage;
17 |
18 | import lombok.Data;
19 |
20 | import java.io.Serializable;
21 |
22 | /**
23 | * Description:
24 | * Date: 19-1-30 下午4:38
25 | *
26 | * @author ujued
27 | */
28 | @Data
29 | public class GroupProps implements Serializable {
30 |
31 | /**
32 | * 事务组ID
33 | */
34 | private String groupId;
35 |
36 | /**
37 | * 创建时间
38 | */
39 | private long createTimeMillis;
40 | }
41 |
--------------------------------------------------------------------------------
/yitao-common/src/main/java/com/gerry/yitao/common/util/DateUtil.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.common.util;
2 |
3 | import java.util.Date;
4 | import java.util.GregorianCalendar;
5 |
6 | /**
7 | * 类描述:时间操作工具栏
8 | * @auther Gerry
9 | * @create 2018/03/31
10 | */
11 | public class DateUtil {
12 |
13 | /**
14 | * 功能描述:根据时间和传过来的格式 格式化显示时间
15 | * @param date
16 | * @param pattern
17 | * @return
18 | */
19 | public static String format(Date date, String pattern) {
20 | if (date == null) {
21 | return "null";
22 | }
23 | if (pattern == null || pattern.equals("") || pattern.equals("null")) {
24 | pattern = "yyyy-MM-dd HH:mm:ss";
25 | }
26 | return new java.text.SimpleDateFormat(pattern).format(date);
27 | }
28 |
29 | /**
30 | * 功能描述:实现日期的加减
31 | * @param date
32 | * @param day
33 | * @return
34 | */
35 | public static Date addDay(Date date,int day){
36 | GregorianCalendar calendar=new GregorianCalendar();
37 | calendar.setTime(date);
38 | calendar.add(GregorianCalendar.DATE, day);
39 | return calendar.getTime();
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/yitao-detail-interface/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 | yitao-parent
7 | com.gerry.yitao
8 | 1.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | yitao-detail-interface
13 |
14 | yitao-detail-interface
15 |
16 |
17 |
18 | com.gerry.yitao
19 | yitao-domain
20 |
21 |
22 |
23 | org.springframework.boot
24 | spring-boot-starter-thymeleaf
25 |
26 |
27 |
28 | org.projectlombok
29 | lombok
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/RedirectController.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2019 CodingApi .
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.codingapi.txlcn.tm.support.restapi;
17 |
18 | import org.springframework.stereotype.Controller;
19 | import org.springframework.web.bind.annotation.RequestMapping;
20 |
21 | /**
22 | * Description:
23 | * Date: 1/11/19
24 | *
25 | * @author ujued
26 | */
27 | @Controller
28 | public class RedirectController {
29 |
30 | @RequestMapping("/")
31 | public String index() {
32 | return "redirect:/admin/index.html";
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/vo/ExceptionList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2019 CodingApi .
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.codingapi.txlcn.tm.support.restapi.vo;
17 |
18 | import lombok.AllArgsConstructor;
19 | import lombok.Data;
20 | import lombok.NoArgsConstructor;
21 |
22 | import java.util.List;
23 |
24 | /**
25 | * Description:
26 | * Date: 2018/12/20
27 | *
28 | * @author ujued
29 | */
30 | @AllArgsConstructor
31 | @NoArgsConstructor
32 | @Data
33 | public class ExceptionList {
34 | private long total;
35 | private List exceptions;
36 | }
37 |
--------------------------------------------------------------------------------
/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/vo/TxLogList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2019 CodingApi .
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.codingapi.txlcn.tm.support.restapi.vo;
17 |
18 | import lombok.AllArgsConstructor;
19 | import lombok.Data;
20 | import lombok.NoArgsConstructor;
21 |
22 | import java.util.List;
23 |
24 | /**
25 | * Description:
26 | * Date: 2018/12/24
27 | *
28 | * @author ujued
29 | */
30 | @AllArgsConstructor
31 | @NoArgsConstructor
32 | @Data
33 | public class TxLogList {
34 |
35 | private long total;
36 |
37 | private List logs;
38 | }
39 |
--------------------------------------------------------------------------------
/yitao-detail-service/src/test/java/com/gerry/yitao/yitaodetailservice/PageDetailTests.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.yitaodetailservice;
2 |
3 | import com.alibaba.fastjson.JSON;
4 | import com.gerry.yitao.detail.service.PageDetailService;
5 | import org.junit.Test;
6 |
7 | import javax.annotation.Resource;
8 | import java.util.Map;
9 |
10 | /**
11 | * @ProjectName: yitao-parent
12 | * @Auther: GERRY
13 | * @Date: 2019/4/29 20:46
14 | * @Description:
15 | */
16 | public class PageDetailTests extends YitaoPageDetailApplicationTests {
17 |
18 | @Resource
19 | private PageDetailService pageDetailService;
20 |
21 | @Test
22 | public void test1() {
23 | Map map = pageDetailService.loadModel(51L);
24 | System.out.println(JSON.toJSONString(map,true));
25 | }
26 |
27 | @Test
28 | public void createHtml() {
29 | // 当你首次访问的商品详情页时。
30 | // 1、动态渲染
31 | // 2、判断指定目录下面是否存在了静态页面,如果存在直接访问,如果不存在通过,重新访问生成对应静态页面
32 | // if (!f -name $) {
33 | // root html;
34 | //}
35 | // proxy_pass = "192.168.3.101:10040";
36 |
37 | pageDetailService.createHtml(57L);
38 | }
39 |
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/yitao-search-interface/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 | yitao-parent
7 | com.gerry.yitao
8 | 1.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | yitao-search-interface
13 |
14 | yitao-search-interface
15 |
16 |
17 |
18 | com.gerry.yitao
19 | yitao-domain
20 |
21 |
22 |
23 | org.projectlombok
24 | lombok
25 |
26 |
27 |
28 | org.springframework.boot
29 | spring-boot-starter-data-elasticsearch
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/vo/DeleteLogsReq.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2019 CodingApi .
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.codingapi.txlcn.tm.support.restapi.vo;
17 |
18 | import lombok.AllArgsConstructor;
19 | import lombok.Data;
20 | import lombok.NoArgsConstructor;
21 |
22 | /**
23 | * Description:
24 | * Date: 19-1-17 下午6:39
25 | *
26 | * @author ujued
27 | */
28 | @AllArgsConstructor
29 | @NoArgsConstructor
30 | @Data
31 | public class DeleteLogsReq {
32 | private String groupId;
33 | private String tag;
34 | private String lTime;
35 | private String rTime;
36 | }
--------------------------------------------------------------------------------
/yitao-common/src/main/java/com/gerry/yitao/response/Result.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.response;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * @ProjectName: yitao-parent
7 | * @Auther: GERRY
8 | * @Date: 2019/5/24 14:00
9 | * @Description: 结果类
10 | */
11 | @Data
12 | public class Result {
13 |
14 | private int code;
15 | private String msg;
16 | private T data;
17 |
18 | /**
19 | * 成功时候的调用
20 | * */
21 | public static Result success(T data){
22 | Result result = new Result(data);
23 | result.code = CodeMsg.SUCCESS.getCode();
24 | return new Result(data);
25 | }
26 |
27 | /**
28 | * 失败时候的调用
29 | * */
30 | public static Result error(CodeMsg codeMsg){
31 | return new Result(codeMsg);
32 | }
33 |
34 | private Result(T data) {
35 | this.data = data;
36 | }
37 |
38 | private Result(int code, String msg) {
39 | this.code = code;
40 | this.msg = msg;
41 | }
42 |
43 | private Result(CodeMsg codeMsg) {
44 | if(codeMsg != null) {
45 | this.code = codeMsg.getCode();
46 | this.msg = codeMsg.getMsg();
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/yitao-search-interface/src/main/java/com/gerry/yitao/search/entity/SearchResult.java:
--------------------------------------------------------------------------------
1 | package com.gerry.yitao.search.entity;
2 |
3 |
4 | import com.gerry.yitao.domain.Brand;
5 | import com.gerry.yitao.domain.Category;
6 | import com.gerry.yitao.entity.PageResult;
7 | import lombok.Data;
8 | import lombok.NoArgsConstructor;
9 |
10 | import java.util.List;
11 | import java.util.Map;
12 |
13 | /**
14 | * @ProjectName: yitao-parent
15 | * @Auther: GERRY
16 | * @Date: 2019/4/23 18:21
17 | * @Description:
18 | */
19 | @Data
20 | @NoArgsConstructor
21 | public class SearchResult extends PageResult {
22 |
23 | private List brands;
24 | private List categories;
25 | //规格参数过滤条件
26 | private List