├── mvc-config
├── readme.md
└── src
│ └── main
│ ├── docker
│ └── Dockerfile
│ └── java
│ └── com
│ └── mvc
│ └── config
│ └── ConfigServerBootstrap.java
├── mvc-sms
├── README.md
└── src
│ └── main
│ ├── resources
│ └── logback.xml
│ ├── docker
│ └── Dockerfile
│ └── java
│ └── com
│ └── mvc
│ └── sms
│ ├── dto
│ ├── MobileDTO.java
│ └── MobileValiDTO.java
│ ├── config
│ ├── SmsConfiguration.java
│ └── RedisConfiguration.java
│ └── SmsBootstrap.java
├── mvc-admin
├── README.md
└── src
│ └── main
│ ├── resources
│ ├── logback.xml
│ └── mapper
│ │ └── GateLogMapper.xml
│ ├── docker
│ └── Dockerfile
│ └── java
│ └── com
│ └── mvc
│ └── user
│ ├── mapper
│ ├── GateLogMapper.java
│ ├── GroupTypeMapper.java
│ ├── ResourceAuthorityMapper.java
│ ├── UserMapper.java
│ ├── MenuMapper.java
│ ├── ElementMapper.java
│ └── GroupMapper.java
│ ├── rest
│ ├── GateLogController.java
│ └── GroupTypeController.java
│ ├── service
│ ├── GroupTypeBiz.java
│ ├── ResourceAuthorityBiz.java
│ └── GateLogBiz.java
│ ├── vo
│ ├── GroupTree.java
│ └── GroupUsers.java
│ ├── entity
│ └── JwtAuthenticationRequest.java
│ ├── rpc
│ ├── LogRest.java
│ ├── AuthService.java
│ └── UserRest.java
│ ├── config
│ ├── druid
│ │ ├── DruidStatViewServlet.java
│ │ └── DruidStatFilter.java
│ └── MapperConfiguration.java
│ ├── constant
│ └── AdminCommonConstant.java
│ └── AdminBootstrap.java
├── mvc-user
├── README.md
└── src
│ └── main
│ ├── resources
│ ├── logback.xml
│ └── mapper
│ │ └── GateLogMapper.xml
│ ├── docker
│ └── Dockerfile
│ └── java
│ └── com
│ └── mvc
│ └── user
│ ├── mapper
│ ├── CoinInfoMapper.java
│ ├── CapitalMapper.java
│ └── UserMapper.java
│ ├── dto
│ ├── ForgetDTO.java
│ ├── MobileValiDTO.java
│ ├── UpdateDTO.java
│ ├── UpdatePhoneDTO.java
│ ├── UserDTO.java
│ ├── PwdCheckDTO.java
│ └── TokenDTO.java
│ ├── vo
│ ├── JwtAuthenticationResponse.java
│ ├── GroupTree.java
│ ├── UserVO.java
│ ├── GroupUsers.java
│ └── CapitalVO.java
│ ├── config
│ ├── Jobs.java
│ ├── druid
│ │ ├── DruidStatViewServlet.java
│ │ └── DruidStatFilter.java
│ └── RedisConfiguration.java
│ ├── entity
│ ├── Capital.java
│ ├── CoinInfo.java
│ └── User.java
│ ├── rpc
│ └── service
│ │ ├── SmsService.java
│ │ ├── EthernumRest.java
│ │ └── AuthService.java
│ ├── constant
│ └── UserCommonConstant.java
│ └── UserBootstrap.java
├── README.md
├── mvc-console
├── target
│ └── classes
│ │ └── logback.xml
└── src
│ └── main
│ ├── resources
│ └── logback.xml
│ └── java
│ └── com
│ └── mvc
│ └── console
│ ├── mapper
│ ├── ConfigMapper.java
│ ├── CoinInfoMapper.java
│ ├── RefundApplicationMapper.java
│ ├── LockRecordMapper.java
│ └── TransactionMapper.java
│ ├── dto
│ ├── MobileValiDTO.java
│ ├── PwdCheckDTO.java
│ ├── DepositeDTO.java
│ ├── TransactionDTO.java
│ ├── LockRecordDTO.java
│ ├── SendTransactionDTO.java
│ ├── TokenDTO.java
│ └── WithdrawDTO.java
│ ├── entity
│ ├── LockConfig.java
│ ├── Config.java
│ ├── Capital.java
│ ├── CoinInfo.java
│ ├── LockRecord.java
│ ├── Transaction.java
│ ├── RefundApplication.java
│ └── WithdrawConfig.java
│ ├── util
│ └── ConfigUtil.java
│ ├── service
│ ├── CoinInfoService.java
│ ├── RefundApplicationService.java
│ └── CapitalService.java
│ ├── rest
│ ├── CapitalController.java
│ ├── CoinInfoController.java
│ ├── ConfigController.java
│ └── RefundApplicationController.java
│ ├── vo
│ ├── JwtAuthenticationResponse.java
│ ├── GroupTree.java
│ ├── LockRecordVO.java
│ ├── TransactionVO.java
│ └── CapitalVO.java
│ ├── config
│ ├── Jobs.java
│ ├── druid
│ │ ├── DruidStatViewServlet.java
│ │ └── DruidStatFilter.java
│ └── RedisConfiguration.java
│ ├── rpc
│ └── service
│ │ ├── SmsService.java
│ │ ├── EthernumService.java
│ │ └── UserService.java
│ ├── constant
│ └── UserCommonConstant.java
│ └── ConsoleBootstrap.java
├── mvc-admin-console
├── target
│ └── classes
│ │ └── logback.xml
└── src
│ └── main
│ ├── resources
│ └── logback.xml
│ └── java
│ └── com
│ └── mvc
│ └── console
│ ├── mapper
│ ├── ConfigMapper.java
│ ├── CoinInfoMapper.java
│ └── TransactionMapper.java
│ ├── entity
│ ├── Config.java
│ ├── CoinInfo.java
│ └── Transaction.java
│ ├── rest
│ ├── TransferController.java
│ └── ConfigController.java
│ ├── rpc
│ └── service
│ │ └── EthernumService.java
│ ├── service
│ └── ConfigService.java
│ ├── config
│ ├── druid
│ │ ├── DruidStatViewServlet.java
│ │ └── DruidStatFilter.java
│ └── MapperConfiguration.java
│ ├── constant
│ └── UserCommonConstant.java
│ ├── util
│ └── CoinUtil.java
│ └── AdminConsoleBootstrap.java
├── mvc-ethereum
└── src
│ └── main
│ ├── resources
│ └── logback.xml
│ └── java
│ └── com
│ └── mvc
│ └── ethereum
│ ├── model
│ ├── dto
│ │ ├── NewAccountDTO.java
│ │ ├── TransactionCountDTO.java
│ │ ├── TransactionByHashDTO.java
│ │ ├── PersonalByPrivateKeyDTO.java
│ │ ├── RawTransactionDTO.java
│ │ ├── ExportAccountDTO.java
│ │ ├── ImportRawKeyDTO.java
│ │ ├── BalanceDTO.java
│ │ └── SendTransactionDTO.java
│ ├── Block.java
│ ├── NodeConfiguration.java
│ ├── Account.java
│ ├── Filter.java
│ ├── EthTransaction.java
│ ├── JsonCredentials.java
│ ├── TransactionResponse.java
│ ├── TransferEventResponse.java
│ ├── ApprovalEventResponse.java
│ ├── Method.java
│ ├── Capital.java
│ ├── CoinInfo.java
│ ├── LockRecord.java
│ ├── vo
│ │ ├── LockRecordVO.java
│ │ ├── DepositeCount.java
│ │ ├── WithdrawCount.java
│ │ ├── AdminBalanceVO.java
│ │ ├── TransactionVO.java
│ │ └── LockCount.java
│ └── Transaction.java
│ ├── configuration
│ ├── FileConfig.java
│ ├── CorsConfig.java
│ └── RedisConfiguration.java
│ ├── mapper
│ ├── CoinInfoMapper.java
│ ├── LockRecordMapper.java
│ └── CapitalMapper.java
│ ├── exceptions
│ └── ExceededGasException.java
│ ├── service
│ └── EtherscanUrl.java
│ ├── utils
│ ├── FileUtil.java
│ └── EthereumUtil.java
│ ├── visitor
│ ├── AbstractBlockchainVisitor.java
│ └── VisitorFactory.java
│ └── EthereumApplication.java
├── mvc-center
└── src
│ └── main
│ ├── docker
│ └── Dockerfile
│ └── java
│ └── com
│ └── mvc
│ └── center
│ └── CenterBootstrap.java
├── mvc-auth
├── mvc-auth-server
│ └── src
│ │ └── main
│ │ ├── docker
│ │ └── Dockerfile
│ │ └── java
│ │ └── com
│ │ └── mvc
│ │ └── auth
│ │ ├── mapper
│ │ ├── ClientServiceMapper.java
│ │ └── ClientMapper.java
│ │ ├── biz
│ │ └── ClientServiceBiz.java
│ │ ├── configuration
│ │ ├── UserConfiguration.java
│ │ ├── AuthConfiguration.java
│ │ ├── FeignConfiguration.java
│ │ ├── KeyConfiguration.java
│ │ ├── ClientConfiguration.java
│ │ └── RedisConfiguration.java
│ │ ├── util
│ │ ├── user
│ │ │ ├── JwtAuthenticationResponse.java
│ │ │ ├── JwtUserAuthenticationRequest.java
│ │ │ ├── JwtAuthenticationRequest.java
│ │ │ └── JwtTokenUtil.java
│ │ └── client
│ │ │ └── ClientTokenUtil.java
│ │ ├── AuthBootstrap.java
│ │ ├── feign
│ │ └── IUserService.java
│ │ ├── service
│ │ ├── AuthClientService.java
│ │ └── AuthService.java
│ │ ├── interceptor
│ │ └── ClientTokenInterceptor.java
│ │ ├── controller
│ │ └── ServiceController.java
│ │ └── bean
│ │ └── ClientInfo.java
├── mvc-auth-common
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── mvc
│ │ └── auth
│ │ └── common
│ │ ├── util
│ │ ├── StringHelper.java
│ │ └── jwt
│ │ │ └── IJWTInfo.java
│ │ ├── event
│ │ └── AuthRemoteEvent.java
│ │ └── constatns
│ │ └── CommonConstants.java
├── mvc-auth-client
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── mvc
│ │ └── auth
│ │ └── client
│ │ ├── exception
│ │ ├── JwtSignatureException.java
│ │ ├── JwtTokenExpiredException.java
│ │ └── JwtIllegalArgumentException.java
│ │ ├── annotation
│ │ ├── IgnoreUserToken.java
│ │ └── IgnoreClientToken.java
│ │ ├── EnableAceAuthClient.java
│ │ ├── config
│ │ └── UserAuthConfig.java
│ │ └── configuration
│ │ └── AutoConfiguration.java
└── pom.xml
├── mvc-common
└── src
│ └── main
│ └── java
│ └── com
│ └── mvc
│ └── common
│ ├── constant
│ ├── RestMsgConstants.java
│ ├── UserConstant.java
│ ├── RestCodeConstants.java
│ └── CommonConstants.java
│ ├── util
│ ├── StringHelper.java
│ ├── ClientUtil.java
│ ├── UUIDUtils.java
│ └── Query.java
│ ├── dto
│ ├── LockRecordDTO.java
│ ├── TransactionDTO.java
│ ├── TransferDTO.java
│ └── BatchTransferDTO.java
│ ├── msg
│ ├── auth
│ │ ├── TokenErrorResponse.java
│ │ └── TokenForbiddenResponse.java
│ ├── ResultCode.java
│ ├── BaseResponse.java
│ ├── ObjectRestResponse.java
│ ├── Result.java
│ ├── ListRestResponse.java
│ └── ResultGenerator.java
│ ├── exception
│ ├── auth
│ │ ├── UserInvalidException.java
│ │ ├── ClientInvalidException.java
│ │ ├── TokenErrorException.java
│ │ └── ClientForbiddenException.java
│ └── BaseException.java
│ ├── annotation
│ ├── IgnoreUserToken.java
│ └── IgnoreClientToken.java
│ └── vo
│ └── TreeNode.java
├── mvc-api
├── src
│ └── main
│ │ └── java
│ │ └── com
│ │ └── mvc
│ │ └── api
│ │ └── vo
│ │ ├── user
│ │ └── NewAccountDTO.java
│ │ └── authority
│ │ └── PermissionInfo.java
└── pom.xml
├── mvc-gate
├── mvc-gate-server
│ └── src
│ │ └── main
│ │ ├── docker
│ │ └── Dockerfile
│ │ ├── java
│ │ └── com
│ │ │ └── mvc
│ │ │ └── gate
│ │ │ ├── feign
│ │ │ ├── ILogService.java
│ │ │ └── IUserService.java
│ │ │ ├── config
│ │ │ ├── CorsConfig.java
│ │ │ └── UserPrincipal.java
│ │ │ └── GateBootstrap.java
│ │ └── resources
│ │ └── bootstrap.yml
├── mvc-gate-ratelimit
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── mvc
│ │ └── gate
│ │ └── ratelimit
│ │ ├── config
│ │ ├── IUserPrincipal.java
│ │ ├── repository
│ │ │ ├── springdata
│ │ │ │ └── IRateLimiterRepository.java
│ │ │ └── InMemoryRateLimiter.java
│ │ ├── DefaultUserPrincipal.java
│ │ └── RateLimiter.java
│ │ └── EnableAceGateRateLimit.java
└── pom.xml
├── .gitignore
└── mysql-backup
└── backup.sh
/mvc-config/readme.md:
--------------------------------------------------------------------------------
1 | ## 配置服务
--------------------------------------------------------------------------------
/mvc-sms/README.md:
--------------------------------------------------------------------------------
1 | ## 短信服务
--------------------------------------------------------------------------------
/mvc-admin/README.md:
--------------------------------------------------------------------------------
1 | ## 后台用户服务
2 |
--------------------------------------------------------------------------------
/mvc-user/README.md:
--------------------------------------------------------------------------------
1 | ## 用户服务
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # lock-plat
2 | Lock MVC on platform
3 |
--------------------------------------------------------------------------------
/mvc-admin/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/mvc-console/target/classes/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/mvc-sms/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/mvc-user/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/mvc-admin-console/target/classes/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/mvc-console/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/mvc-admin-console/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/mvc-admin/src/main/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM livingobjects/jre8
2 | VOLUME /tmp
3 | ADD ace-admin.jar app.jar
4 | RUN bash -c 'touch /app.jar'
5 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
6 |
--------------------------------------------------------------------------------
/mvc-sms/src/main/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM livingobjects/jre8
2 | VOLUME /tmp
3 | ADD ace-admin.jar app.jar
4 | RUN bash -c 'touch /app.jar'
5 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
6 |
--------------------------------------------------------------------------------
/mvc-user/src/main/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM livingobjects/jre8
2 | VOLUME /tmp
3 | ADD ace-admin.jar app.jar
4 | RUN bash -c 'touch /app.jar'
5 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
6 |
--------------------------------------------------------------------------------
/mvc-center/src/main/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM livingobjects/jre8
2 | VOLUME /tmp
3 | ADD ace-center.jar app.jar
4 | RUN bash -c 'touch /app.jar'
5 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
6 |
--------------------------------------------------------------------------------
/mvc-config/src/main/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM livingobjects/jre8
2 | VOLUME /tmp
3 | ADD ace-config.jar app.jar
4 | RUN bash -c 'touch /app.jar'
5 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
6 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-server/src/main/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM livingobjects/jre8
2 | VOLUME /tmp
3 | ADD ace-auth.jar app.jar
4 | RUN bash -c 'touch /app.jar'
5 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
6 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/constant/RestMsgConstants.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.constant;
2 |
3 | /**
4 | * @author qyc
5 | */
6 | public class RestMsgConstants {
7 | public static final String VALI_IMG_ERR = "验证码输入错误";
8 | }
9 |
--------------------------------------------------------------------------------
/mvc-api/src/main/java/com/mvc/api/vo/user/NewAccountDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.api.vo.user;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * @author qyc
7 | */
8 | @Data
9 | public class NewAccountDTO {
10 |
11 | private String passphrase;
12 | }
13 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/dto/NewAccountDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model.dto;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * @author qyc
7 | */
8 | @Data
9 | public class NewAccountDTO {
10 |
11 | private String passphrase;
12 | }
13 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/configuration/FileConfig.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.configuration;
2 |
3 | import org.springframework.context.annotation.Configuration;
4 |
5 | /**
6 | * @author qyc
7 | */
8 | @Configuration
9 | public class FileConfig {
10 | }
11 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/dto/TransactionCountDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model.dto;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * @author qyc
7 | */
8 | @Data
9 | public class TransactionCountDTO {
10 |
11 | private String address;
12 | }
13 |
--------------------------------------------------------------------------------
/mvc-gate/mvc-gate-server/src/main/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | VOLUME /tmp
3 | ADD ace-gate.jar app.jar
4 | ADD wait-for-it.sh /wait-for-it.sh
5 | RUN sh -c 'touch /app.jar'
6 | RUN bash -c 'chmod 777 /wait-for-it.sh'
7 | CMD exec java -Djava.security.egd=file:/dev/./urandom -jar /app.jar
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/mapper/GateLogMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.mapper;
2 |
3 | import com.mvc.user.entity.GateLog;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | public interface GateLogMapper extends Mapper {
10 | }
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/dto/TransactionByHashDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model.dto;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * @author qyc
7 | */
8 | @Data
9 | public class TransactionByHashDTO {
10 | private String transactionHash;
11 | }
12 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/mapper/ConfigMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.mapper;
2 |
3 | import com.mvc.console.entity.Config;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | public interface ConfigMapper extends Mapper {
10 | }
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/dto/PersonalByPrivateKeyDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model.dto;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * @author qyc
7 | */
8 | @Data
9 | public class PersonalByPrivateKeyDTO {
10 |
11 | private String privateKey;
12 | }
13 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/dto/RawTransactionDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model.dto;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * @author qyc
7 | */
8 | @Data
9 | public class RawTransactionDTO {
10 |
11 | private String signedMessage;
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/mapper/GroupTypeMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.mapper;
2 |
3 | import com.mvc.user.entity.GroupType;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | public interface GroupTypeMapper extends Mapper {
10 | }
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/util/StringHelper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.util;
2 |
3 | /**
4 | * @author qyc
5 | */
6 | public class StringHelper {
7 | public static String getObjectValue(Object obj) {
8 | return obj == null ? "" : obj.toString();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/mapper/CoinInfoMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.mapper;
2 |
3 | import com.mvc.user.entity.CoinInfo;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | public interface CoinInfoMapper extends Mapper {
10 |
11 | }
--------------------------------------------------------------------------------
/mvc-admin-console/src/main/java/com/mvc/console/mapper/ConfigMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.mapper;
2 |
3 | import com.mvc.console.entity.Config;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | public interface ConfigMapper extends Mapper {
10 | }
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/constant/UserConstant.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.constant;
2 |
3 | /**
4 | * ${DESCRIPTION}
5 | *
6 | * @author wanghaobin
7 | * @create 2017-06-14 8:36
8 | */
9 | public class UserConstant {
10 | public static int PW_ENCORDER_SALT = 12;
11 | }
12 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/mapper/CoinInfoMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.mapper;
2 |
3 | import com.mvc.console.entity.CoinInfo;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | public interface CoinInfoMapper extends Mapper {
10 |
11 | }
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/dto/ExportAccountDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model.dto;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * @author qyc
7 | */
8 | @Data
9 | public class ExportAccountDTO {
10 | private String address;
11 | private String passphrase;
12 | }
13 |
--------------------------------------------------------------------------------
/mvc-admin-console/src/main/java/com/mvc/console/mapper/CoinInfoMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.mapper;
2 |
3 | import com.mvc.console.entity.CoinInfo;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | public interface CoinInfoMapper extends Mapper {
10 |
11 | }
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/constant/RestCodeConstants.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.constant;
2 |
3 | /**
4 | * @author qyc
5 | */
6 | public class RestCodeConstants {
7 | public static final int TOKEN_ERROR_CODE = 40101;
8 | public static final int TOKEN_FORBIDDEN_CODE = 40301;
9 | }
10 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/mapper/CoinInfoMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.mapper;
2 |
3 | import com.mvc.ethereum.model.CoinInfo;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | public interface CoinInfoMapper extends Mapper {
10 |
11 | }
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/exceptions/ExceededGasException.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.exceptions;
2 |
3 | /**
4 | * @author qyc
5 | */
6 | public class ExceededGasException extends Throwable {
7 | public ExceededGasException(String message) {
8 | super(message);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/dto/ImportRawKeyDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model.dto;
2 |
3 |
4 | import lombok.Data;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | @Data
10 | public class ImportRawKeyDTO {
11 |
12 | private String keydata;
13 | private String passphrase;
14 | }
15 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/dto/ForgetDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.dto;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * userDTO
7 | *
8 | * @author qiyichen
9 | * @create 2018/1/8 21:55
10 | */
11 | @Data
12 | public class ForgetDTO extends UserDTO{
13 |
14 | private String newPassword;
15 | }
16 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-common/src/main/java/com/mvc/auth/common/util/StringHelper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.common.util;
2 |
3 | /**
4 | * @author qyc
5 | */
6 | public class StringHelper {
7 | public static String getObjectValue(Object obj) {
8 | return obj == null ? "" : obj.toString();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/service/EtherscanUrl.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.service;
2 |
3 | /**
4 | * @author qyc
5 | */
6 | public interface EtherscanUrl {
7 |
8 | public final static String TXLIST = "?module=account&action=txlist&startblock=0&endblock=99999999&sort=asc&address=%s";
9 | }
10 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-client/src/main/java/com/mvc/auth/client/exception/JwtSignatureException.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.client.exception;
2 |
3 | /**
4 | * @author qyc
5 | */
6 | public class JwtSignatureException extends Exception {
7 | public JwtSignatureException(String s) {
8 | super(s);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-client/src/main/java/com/mvc/auth/client/exception/JwtTokenExpiredException.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.client.exception;
2 |
3 | /**
4 | * @author qyc
5 | */
6 | public class JwtTokenExpiredException extends Exception {
7 | public JwtTokenExpiredException(String s) {
8 | super(s);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-client/src/main/java/com/mvc/auth/client/exception/JwtIllegalArgumentException.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.client.exception;
2 |
3 | /**
4 | * @author qyc
5 | */
6 | public class JwtIllegalArgumentException extends Exception {
7 | public JwtIllegalArgumentException(String s) {
8 | super(s);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/mapper/RefundApplicationMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.mapper;
2 |
3 | import com.mvc.console.entity.RefundApplication;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | public interface RefundApplicationMapper extends Mapper {
10 |
11 | }
--------------------------------------------------------------------------------
/mvc-sms/src/main/java/com/mvc/sms/dto/MobileDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.sms.dto;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serializable;
6 |
7 | /**
8 | * smsCode
9 | *
10 | * @author qiyichen
11 | * @create 2018/1/8 16:04
12 | */
13 | @Data
14 | public class MobileDTO {
15 |
16 | private String mobile;
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/mvc-sms/src/main/java/com/mvc/sms/dto/MobileValiDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.sms.dto;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * smsCode
7 | *
8 | * @author qiyichen
9 | * @create 2018/1/8 16:04
10 | */
11 | @Data
12 | public class MobileValiDTO {
13 |
14 | private String mobile;
15 | private String valiCode;
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/dto/MobileValiDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.dto;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * smsCode
7 | *
8 | * @author qiyichen
9 | * @create 2018/1/8 16:04
10 | */
11 | @Data
12 | public class MobileValiDTO {
13 |
14 | private String mobile;
15 | private String valiCode;
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/dto/UpdateDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.dto;
2 |
3 | import com.mvc.user.entity.User;
4 | import lombok.Data;
5 |
6 | /**
7 | * userDTO
8 | *
9 | * @author qiyichen
10 | * @create 2018/1/8 21:55
11 | */
12 | @Data
13 | public class UpdateDTO extends User {
14 |
15 | private String newPassword;
16 | }
17 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/dto/MobileValiDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.dto;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * smsCode
7 | *
8 | * @author qiyichen
9 | * @create 2018/1/8 16:04
10 | */
11 | @Data
12 | public class MobileValiDTO {
13 |
14 | private String mobile;
15 | private String valiCode;
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/dto/BalanceDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model.dto;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serializable;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | @Data
11 | public class BalanceDTO implements Serializable {
12 | private String address;
13 | private String blockId;
14 | }
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 | .settings
3 | .classpath
4 | .project
5 |
6 | .idea/
7 | *.iml
8 | *.ipr
9 | *.iws
10 | .gradle/
11 | build/
12 | mods/
13 | .idea/libraries
14 | *.DS_Store
15 |
16 | *.class
17 |
18 | *_blockstore
19 |
20 | # Package Files
21 | # *.jar
22 | *.war
23 | *.ear
24 |
25 | # IDEA
26 | *.iml
27 | .idea/
28 | .DS_Store
29 | local.*
30 |
31 | application.yml
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/dto/UpdatePhoneDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.dto;
2 |
3 | import com.mvc.user.entity.User;
4 | import lombok.Data;
5 |
6 | /**
7 | * update phone dto
8 | *
9 | * @author qiyichen
10 | * @create 2018/1/9 14:10
11 | */
12 | @Data
13 | public class UpdatePhoneDTO extends UserDTO {
14 |
15 | private String newCellPhone;
16 | }
17 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/dto/PwdCheckDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.dto;
2 |
3 | import lombok.Data;
4 |
5 | import java.math.BigInteger;
6 |
7 | /**
8 | * userDTO
9 | *
10 | * @author qiyichen
11 | * @create 2018/1/8 21:55
12 | */
13 | @Data
14 | public class PwdCheckDTO {
15 |
16 | private String password;
17 | private BigInteger userId;
18 | }
19 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/dto/LockRecordDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.dto;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * TransactionDTO
7 | *
8 | * @author qiyichen
9 | * @create 2018/1/15 14:23
10 | */
11 | @Data
12 | public class LockRecordDTO {
13 |
14 | private Integer pageSize;
15 | private Integer pageNo;
16 | private String key;
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/dto/TransactionDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.dto;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * TransactionDTO
7 | *
8 | * @author qiyichen
9 | * @create 2018/1/15 14:23
10 | */
11 | @Data
12 | public class TransactionDTO {
13 |
14 | private Integer pageSize;
15 | private Integer pageNo;
16 | private Integer type;
17 | private String key;
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/dto/DepositeDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.dto;
2 |
3 | import lombok.Data;
4 |
5 | import java.math.BigDecimal;
6 |
7 | /**
8 | * deposite dto
9 | *
10 | * @author qiyichen
11 | * @create 2018/1/10 17:06
12 | */
13 | @Data
14 | public class DepositeDTO {
15 |
16 | private String type;
17 | private BigDecimal value;
18 | private String password;
19 | }
20 |
--------------------------------------------------------------------------------
/mvc-admin-console/src/main/java/com/mvc/console/mapper/TransactionMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.mapper;
2 |
3 | import com.mvc.console.entity.Transaction;
4 | import tk.mybatis.mapper.common.Mapper;
5 | import tk.mybatis.mapper.common.special.InsertListMapper;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | public interface TransactionMapper extends Mapper, InsertListMapper {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/mvc-gate/mvc-gate-ratelimit/src/main/java/com/mvc/gate/ratelimit/config/IUserPrincipal.java:
--------------------------------------------------------------------------------
1 | package com.mvc.gate.ratelimit.config;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 |
5 | /**
6 | * @author qyc
7 | */
8 | public interface IUserPrincipal {
9 | /**
10 | * getName
11 | *
12 | * @param request
13 | * @return
14 | */
15 | String getName(HttpServletRequest request);
16 | }
17 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/dto/UserDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.dto;
2 |
3 | import com.mvc.user.entity.User;
4 | import lombok.Data;
5 |
6 | import javax.validation.constraints.NotNull;
7 |
8 | /**
9 | * userDTO
10 | *
11 | * @author qiyichen
12 | * @create 2018/1/8 21:55
13 | */
14 | @Data
15 | public class UserDTO extends User{
16 |
17 | @NotNull(message = "验证码不能为空")
18 | private String valiCode;
19 | }
20 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/msg/auth/TokenErrorResponse.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.msg.auth;
2 |
3 | import com.mvc.common.constant.RestCodeConstants;
4 | import com.mvc.common.msg.BaseResponse;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | public class TokenErrorResponse extends BaseResponse {
10 | public TokenErrorResponse(String message) {
11 | super(RestCodeConstants.TOKEN_ERROR_CODE, message);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-server/src/main/java/com/mvc/auth/mapper/ClientServiceMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.mapper;
2 |
3 | import com.mvc.auth.entity.ClientService;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | public interface ClientServiceMapper extends Mapper {
10 |
11 | /**
12 | * deleteByServiceId
13 | *
14 | * @param id
15 | */
16 | void deleteByServiceId(int id);
17 | }
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/msg/auth/TokenForbiddenResponse.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.msg.auth;
2 |
3 | import com.mvc.common.constant.RestCodeConstants;
4 | import com.mvc.common.msg.BaseResponse;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | public class TokenForbiddenResponse extends BaseResponse {
10 | public TokenForbiddenResponse(String message) {
11 | super(RestCodeConstants.TOKEN_FORBIDDEN_CODE, message);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/dto/TransactionDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.dto;
2 |
3 | import lombok.Data;
4 |
5 | import java.math.BigInteger;
6 |
7 | /**
8 | * transaction dto
9 | *
10 | * @author qiyichen
11 | * @create 2018/1/10 12:51
12 | */
13 | @Data
14 | public class TransactionDTO {
15 |
16 | private Integer pageNo;
17 | private Integer pageSize;
18 | private String types;
19 | private BigInteger userId;
20 | }
21 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/dto/PwdCheckDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.dto;
2 |
3 | import com.mvc.user.entity.User;
4 | import lombok.Data;
5 |
6 | import javax.validation.constraints.NotNull;
7 | import java.math.BigInteger;
8 |
9 | /**
10 | * userDTO
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/8 21:55
14 | */
15 | @Data
16 | public class PwdCheckDTO {
17 |
18 | private String password;
19 | private BigInteger userId;
20 | }
21 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-server/src/main/java/com/mvc/auth/biz/ClientServiceBiz.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.biz;
2 |
3 | import com.mvc.auth.entity.ClientService;
4 | import com.mvc.auth.mapper.ClientServiceMapper;
5 | import com.mvc.common.biz.BaseBiz;
6 | import org.springframework.stereotype.Service;
7 |
8 | /**
9 | * @author ace
10 | * @create 2017/12/30.
11 | */
12 | @Service
13 | public class ClientServiceBiz extends BaseBiz {
14 | }
15 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/Block.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 | import lombok.*;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | @Builder(builderClassName = "Builder", toBuilder = true)
10 | @Setter
11 | @Getter
12 | @NoArgsConstructor
13 | @AllArgsConstructor
14 | @JsonIgnoreProperties(ignoreUnknown = true)
15 | public class Block {
16 | private String nonce;
17 | }
18 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/exception/auth/UserInvalidException.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.exception.auth;
2 |
3 |
4 | import com.mvc.common.constant.CommonConstants;
5 | import com.mvc.common.exception.BaseException;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | public class UserInvalidException extends BaseException {
11 | public UserInvalidException(String message) {
12 | super(message, CommonConstants.EX_USER_INVALID_CODE);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/exception/auth/ClientInvalidException.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.exception.auth;
2 |
3 |
4 | import com.mvc.common.constant.CommonConstants;
5 | import com.mvc.common.exception.BaseException;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | public class ClientInvalidException extends BaseException {
11 | public ClientInvalidException(String message) {
12 | super(message, CommonConstants.EX_CLIENT_INVALID_CODE);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/exception/auth/TokenErrorException.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.exception.auth;
2 |
3 |
4 | import com.mvc.common.constant.CommonConstants;
5 | import com.mvc.common.exception.BaseException;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | public class TokenErrorException extends BaseException {
11 | public TokenErrorException(String message, int status) {
12 | super(message, CommonConstants.EX_TOKEN_ERROR_CODE);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/NodeConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model;
2 |
3 | import lombok.Data;
4 | import org.springframework.boot.context.properties.ConfigurationProperties;
5 | import org.springframework.stereotype.Component;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | @Data
11 | @ConfigurationProperties
12 | @Component
13 | public class NodeConfiguration {
14 |
15 | private String nodeEndpoint;
16 | private String fromAddress;
17 | }
18 |
--------------------------------------------------------------------------------
/mvc-gate/mvc-gate-ratelimit/src/main/java/com/mvc/gate/ratelimit/EnableAceGateRateLimit.java:
--------------------------------------------------------------------------------
1 | package com.mvc.gate.ratelimit;
2 |
3 | import org.springframework.context.annotation.Import;
4 |
5 | import java.lang.annotation.*;
6 |
7 | /**
8 | * Created by ace on 2017/9/24.
9 | */
10 | @Target(ElementType.TYPE)
11 | @Retention(RetentionPolicy.RUNTIME)
12 | @Import(RateLimitAutoConfiguration.class)
13 | @Documented
14 | @Inherited
15 | public @interface EnableAceGateRateLimit {
16 | }
17 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/exception/auth/ClientForbiddenException.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.exception.auth;
2 |
3 |
4 | import com.mvc.common.constant.CommonConstants;
5 | import com.mvc.common.exception.BaseException;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | public class ClientForbiddenException extends BaseException {
11 | public ClientForbiddenException(String message) {
12 | super(message, CommonConstants.EX_CLIENT_FORBIDDEN_CODE);
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-server/src/main/java/com/mvc/auth/configuration/UserConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.configuration;
2 |
3 | import lombok.Data;
4 | import org.springframework.beans.factory.annotation.Value;
5 | import org.springframework.context.annotation.Configuration;
6 |
7 | /**
8 | * @author ace
9 | * @create 2017/12/26.
10 | */
11 | @Configuration
12 | @Data
13 | public class UserConfiguration {
14 | @Value("${jwt.token-header}")
15 | private String userTokenHeader;
16 | }
17 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/annotation/IgnoreUserToken.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.annotation;
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 | * 忽略用户鉴权
10 | * Created by ace on 2017/9/27.
11 | */
12 | @Retention(RetentionPolicy.RUNTIME)
13 | @Target(value={ElementType.METHOD,ElementType.TYPE})
14 | public @interface IgnoreUserToken {
15 | }
16 |
--------------------------------------------------------------------------------
/mvc-gate/mvc-gate-ratelimit/src/main/java/com/mvc/gate/ratelimit/config/repository/springdata/IRateLimiterRepository.java:
--------------------------------------------------------------------------------
1 | package com.mvc.gate.ratelimit.config.repository.springdata;
2 |
3 | import com.mvc.gate.ratelimit.config.Rate;
4 | import org.springframework.data.repository.CrudRepository;
5 | import org.springframework.stereotype.Repository;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | @Repository
11 | public interface IRateLimiterRepository extends CrudRepository {
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/annotation/IgnoreClientToken.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.annotation;
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 | * 忽略服务鉴权
10 | * Created by ace on 2017/9/27.
11 | */
12 | @Retention(RetentionPolicy.RUNTIME)
13 | @Target(value={ElementType.METHOD,ElementType.TYPE})
14 | public @interface IgnoreClientToken {
15 | }
16 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/dto/LockRecordDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.dto;
2 |
3 | import com.mvc.console.entity.LockRecord;
4 | import lombok.Data;
5 |
6 | import java.math.BigDecimal;
7 |
8 | /**
9 | * LockRecord
10 | *
11 | * @author qiyichen
12 | * @create 2018/1/11 19:44
13 | */
14 | @Data
15 | public class LockRecordDTO extends LockRecord{
16 |
17 | private String type;
18 | private BigDecimal value;
19 | private Integer pageNo;
20 | private Integer pageSize;
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/dto/SendTransactionDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.dto;
2 |
3 | import lombok.Data;
4 |
5 | import java.math.BigInteger;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | @Data
11 | public class SendTransactionDTO {
12 |
13 | private String pass;
14 | private String from;
15 | private String to;
16 | private BigInteger gas;
17 | private BigInteger gasPrice;
18 | private BigInteger value;
19 | private String data;
20 | private BigInteger nonce;
21 |
22 | }
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-client/src/main/java/com/mvc/auth/client/annotation/IgnoreUserToken.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.client.annotation;
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 | * 忽略用户鉴权
10 | * Created by ace on 2017/9/27.
11 | */
12 | @Retention(RetentionPolicy.RUNTIME)
13 | @Target(value={ElementType.METHOD,ElementType.TYPE})
14 | public @interface IgnoreUserToken {
15 | }
16 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/dto/TransferDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.dto;
2 |
3 |
4 | import lombok.Data;
5 | import lombok.NonNull;
6 |
7 | import java.math.BigInteger;
8 |
9 | /**
10 | * transfer dto
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/14 14:32
14 | */
15 | @Data
16 | public class TransferDTO {
17 |
18 | @NonNull
19 | private Float value;
20 | @NonNull
21 | private String address;
22 | @NonNull
23 | private String type;
24 |
25 | private String pass;
26 | }
27 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/dto/TokenDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.dto;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.math.BigInteger;
8 |
9 | /**
10 | * token dto
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/9 10:55
14 | */
15 | @Data
16 | @AllArgsConstructor
17 | @NoArgsConstructor
18 | public class TokenDTO {
19 | private String userName;
20 | private String clientId;
21 | private BigInteger userId;
22 | }
23 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-client/src/main/java/com/mvc/auth/client/EnableAceAuthClient.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.client;
2 |
3 | import com.mvc.auth.client.configuration.AutoConfiguration;
4 | import org.springframework.context.annotation.Import;
5 |
6 | import java.lang.annotation.*;
7 |
8 |
9 | /**
10 | * Created by ace on 2017/9/15.
11 | */
12 | @Target(ElementType.TYPE)
13 | @Retention(RetentionPolicy.RUNTIME)
14 | @Import(AutoConfiguration.class)
15 | @Documented
16 | @Inherited
17 | public @interface EnableAceAuthClient {
18 | }
19 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-client/src/main/java/com/mvc/auth/client/annotation/IgnoreClientToken.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.client.annotation;
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 | * 忽略服务鉴权
10 | * Created by ace on 2017/9/27.
11 | */
12 | @Retention(RetentionPolicy.RUNTIME)
13 | @Target(value={ElementType.METHOD,ElementType.TYPE})
14 | public @interface IgnoreClientToken {
15 | }
16 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/dto/BatchTransferDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.dto;
2 |
3 | import lombok.Data;
4 | import lombok.NonNull;
5 | import org.json.JSONArray;
6 |
7 | import java.util.List;
8 |
9 |
10 | /**
11 | * batchTransfer dto
12 | *
13 | * @author qiyichen
14 | * @create 2018/1/14 14:30
15 | */
16 | @Data
17 | public class BatchTransferDTO {
18 |
19 | @NonNull
20 | private String type;
21 | @NonNull
22 | private List transferDTOS;
23 |
24 | private String pass;
25 | }
26 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/entity/LockConfig.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.entity;
2 |
3 | import lombok.Data;
4 |
5 | import java.math.BigDecimal;
6 | import java.math.BigInteger;
7 |
8 | /**
9 | * LockConfig
10 | *
11 | * @author qiyichen
12 | * @create 2018/1/13 6:30
13 | */
14 | @Data
15 | public class LockConfig {
16 |
17 | private Integer switchKey;
18 | private String type;
19 | private BigDecimal min;
20 | private BigDecimal max;
21 | private Integer month;
22 | private Float interest;
23 | }
24 |
--------------------------------------------------------------------------------
/mvc-gate/mvc-gate-ratelimit/src/main/java/com/mvc/gate/ratelimit/config/DefaultUserPrincipal.java:
--------------------------------------------------------------------------------
1 | package com.mvc.gate.ratelimit.config;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 |
5 | /**
6 | * @author qyc
7 | */
8 | public class DefaultUserPrincipal implements IUserPrincipal {
9 | @Override
10 | public String getName(HttpServletRequest request) {
11 | if (request.getUserPrincipal() == null) {
12 | return null;
13 | }
14 | return request.getUserPrincipal().getName();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-server/src/main/java/com/mvc/auth/configuration/AuthConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.configuration;
2 |
3 | import com.mvc.common.handler.GlobalExceptionHandler;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | @Configuration
11 | public class AuthConfiguration {
12 | @Bean
13 | public GlobalExceptionHandler getGlobalExceptionHandler() {
14 | return new GlobalExceptionHandler();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-server/src/main/java/com/mvc/auth/configuration/FeignConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.configuration;
2 |
3 | import com.mvc.auth.interceptor.ClientTokenInterceptor;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | @Configuration
11 | public class FeignConfiguration {
12 | @Bean
13 | ClientTokenInterceptor getClientTokenInterceptor() {
14 | return new ClientTokenInterceptor();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/dto/TokenDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.dto;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.math.BigInteger;
8 |
9 | /**
10 | * token dto
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/9 10:55
14 | */
15 | @Data
16 | @AllArgsConstructor
17 | @NoArgsConstructor
18 | public class TokenDTO {
19 | private String userName;
20 | private String clientId;
21 | private BigInteger userId;
22 | private String address;
23 | }
24 |
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/rest/GateLogController.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.rest;
2 |
3 | import com.mvc.common.rest.BaseController;
4 | import com.mvc.user.entity.GateLog;
5 | import com.mvc.user.service.GateLogBiz;
6 | import org.springframework.stereotype.Controller;
7 | import org.springframework.web.bind.annotation.RequestMapping;
8 |
9 | /**
10 | * @author qyc
11 | * @create 2017-07-01 20:32
12 | */
13 | @Controller
14 | @RequestMapping("gateLog")
15 | public class GateLogController extends BaseController {
16 | }
17 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/Account.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 | import lombok.*;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | @Builder(builderClassName = "Builder", toBuilder = true)
10 | @Setter
11 | @Getter
12 | @NoArgsConstructor
13 | @AllArgsConstructor
14 | @JsonIgnoreProperties(ignoreUnknown = true)
15 | @ToString
16 | public class Account {
17 | private String passphrase;
18 | private String address;
19 | private long balance;
20 | }
21 |
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/service/GroupTypeBiz.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.service;
2 |
3 | import com.mvc.common.biz.BaseBiz;
4 | import com.mvc.user.entity.GroupType;
5 | import com.mvc.user.mapper.GroupTypeMapper;
6 | import org.springframework.stereotype.Service;
7 | import org.springframework.transaction.annotation.Transactional;
8 |
9 | /**
10 | * @author qyc
11 | * @create 2017-06-12 8:48
12 | */
13 | @Service
14 | @Transactional(rollbackFor = Exception.class)
15 | public class GroupTypeBiz extends BaseBiz {
16 | }
17 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/util/ConfigUtil.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.util;
2 |
3 | import com.mvc.console.entity.LockConfig;
4 | import com.mvc.console.entity.WithdrawConfig;
5 |
6 | import java.util.HashMap;
7 | import java.util.Map;
8 |
9 | /**
10 | * config util
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/13 6:27
14 | */
15 | public class ConfigUtil {
16 |
17 | public static Map lockConfigMap = new HashMap<>();
18 | public static Map withdrawConfigMap = new HashMap<>();
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/dto/SendTransactionDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model.dto;
2 |
3 | import lombok.Data;
4 |
5 | import java.math.BigDecimal;
6 | import java.math.BigInteger;
7 |
8 | /**
9 | * @author qyc
10 | */
11 | @Data
12 | public class SendTransactionDTO {
13 |
14 | private String pass;
15 | private String from;
16 | private String to;
17 | private BigInteger gas;
18 | private BigInteger gasPrice;
19 | private BigDecimal value;
20 | private String data;
21 | private BigInteger nonce;
22 |
23 | }
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/rest/GroupTypeController.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.rest;
2 |
3 | import com.mvc.common.rest.BaseController;
4 | import com.mvc.user.entity.GroupType;
5 | import com.mvc.user.service.GroupTypeBiz;
6 | import org.springframework.stereotype.Controller;
7 | import org.springframework.web.bind.annotation.RequestMapping;
8 |
9 | /**
10 | * @author qyc
11 | * @create 2017-06-08 11:51
12 | */
13 | @Controller
14 | @RequestMapping("groupType")
15 | public class GroupTypeController extends BaseController {
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-common/src/main/java/com/mvc/auth/common/util/jwt/IJWTInfo.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.common.util.jwt;
2 |
3 | /**
4 | * @author qyc
5 | */
6 | public interface IJWTInfo {
7 | /**
8 | * 获取用户名
9 | * @return
10 | */
11 | String getUniqueName();
12 |
13 | /**
14 | * 获取用户ID
15 | * @return
16 | */
17 | String getId();
18 |
19 | /**
20 | * 获取名称
21 | * @return
22 | */
23 | String getName();
24 |
25 | /**
26 | * 获取地址
27 | * @return
28 | */
29 | String getAddress();
30 | }
31 |
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/service/ResourceAuthorityBiz.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.service;
2 |
3 | import com.mvc.common.biz.BaseBiz;
4 | import com.mvc.user.entity.ResourceAuthority;
5 | import com.mvc.user.mapper.ResourceAuthorityMapper;
6 | import org.springframework.stereotype.Service;
7 | import org.springframework.transaction.annotation.Transactional;
8 |
9 | /**
10 | * @author qyc
11 | */
12 | @Service
13 | @Transactional(rollbackFor = Exception.class)
14 | public class ResourceAuthorityBiz extends BaseBiz {
15 | }
16 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-server/src/main/java/com/mvc/auth/util/user/JwtAuthenticationResponse.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.util.user;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * @author qyc
7 | */
8 | public class JwtAuthenticationResponse implements Serializable {
9 | private static final long serialVersionUID = 1250166508152483573L;
10 |
11 | private final String token;
12 |
13 | public JwtAuthenticationResponse(String token) {
14 | this.token = token;
15 | }
16 |
17 | public String getToken() {
18 | return this.token;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-server/src/main/java/com/mvc/auth/util/user/JwtUserAuthenticationRequest.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.util.user;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serializable;
6 | import java.math.BigInteger;
7 |
8 | /**
9 | * @author qyc
10 | */
11 | @Data
12 | public class JwtUserAuthenticationRequest implements Serializable {
13 |
14 | private static final long serialVersionUID = -8445943548965154778L;
15 |
16 | private String userName;
17 | private String clientId;
18 | private BigInteger userId;
19 | private String address;
20 | }
21 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/Filter.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 | import lombok.*;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | @Builder(builderClassName = "Builder", toBuilder = true)
10 | @Getter
11 | @Setter
12 | @NoArgsConstructor
13 | @AllArgsConstructor
14 | @JsonIgnoreProperties(ignoreUnknown = true)
15 | public class Filter {
16 | private String fromBlock = "0x0";
17 | private String toBlock = "lastest";
18 | private String address;
19 | private String topics;
20 | }
21 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/entity/Config.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.entity;
2 |
3 | import lombok.Data;
4 |
5 | import java.math.BigInteger;
6 | import java.util.Date;
7 |
8 | /**
9 | * config
10 | *
11 | * @author qiyichen
12 | * @create 2018/1/10 14:05
13 | */
14 | @Data
15 | public class Config {
16 |
17 | private BigInteger id;
18 | private String config;
19 | private Integer type;
20 | private Integer switchKey;
21 | private Integer status;
22 | private Date createdAt;
23 | private Date updatedAt;
24 | private Date deletedAt;
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/mvc-admin-console/src/main/java/com/mvc/console/entity/Config.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.entity;
2 |
3 | import lombok.Data;
4 |
5 | import java.math.BigInteger;
6 | import java.util.Date;
7 |
8 | /**
9 | * config
10 | *
11 | * @author qiyichen
12 | * @create 2018/1/10 14:05
13 | */
14 | @Data
15 | public class Config {
16 |
17 | private BigInteger id;
18 | private String config;
19 | private Integer type;
20 | private Integer switchKey;
21 | private Integer status;
22 | private Date createdAt;
23 | private Date updatedAt;
24 | private Date deletedAt;
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/mvc-center/src/main/java/com/mvc/center/CenterBootstrap.java:
--------------------------------------------------------------------------------
1 | package com.mvc.center;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
6 |
7 | /**
8 | * ${DESCRIPTION}
9 | *
10 | * @author wanghaobin
11 | * @create 2017-05-25 12:44
12 | */
13 | @EnableEurekaServer
14 | @SpringBootApplication
15 | public class CenterBootstrap {
16 | public static void main(String[] args) {
17 | SpringApplication.run(CenterBootstrap.class, args);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/service/CoinInfoService.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.service;
2 |
3 | import com.mvc.common.biz.BaseBiz;
4 | import com.mvc.console.entity.CoinInfo;
5 | import com.mvc.console.mapper.CoinInfoMapper;
6 | import org.springframework.stereotype.Service;
7 | import org.springframework.transaction.annotation.Transactional;
8 |
9 | /**
10 | * ${DESCRIPTION}
11 | *
12 | * @author wanghaobin
13 | * @create 2017-06-08 16:23
14 | */
15 | @Service
16 | @Transactional(rollbackFor = Exception.class)
17 | public class CoinInfoService extends BaseBiz {
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/mvc-admin-console/src/main/java/com/mvc/console/rest/TransferController.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.rest;
2 |
3 | import com.mvc.common.rest.BaseController;
4 | import com.mvc.console.service.ConfigService;
5 | import com.mvc.console.entity.CoinInfo;
6 | import org.springframework.stereotype.Controller;
7 | import org.springframework.web.bind.annotation.RequestMapping;
8 |
9 | /**
10 | * config controller
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/10 14:07
14 | */
15 | @Controller
16 | @RequestMapping("transfer")
17 | public class TransferController extends BaseController {
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/rest/CapitalController.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.rest;
2 |
3 | import com.mvc.common.rest.BaseController;
4 | import com.mvc.console.service.CapitalService;
5 | import com.mvc.console.entity.Capital;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RestController;
8 |
9 | /**
10 | * ${DESCRIPTION}
11 | *
12 | * @author wanghaobin
13 | * @create 2017-06-08 11:51
14 | */
15 | @RestController
16 | @RequestMapping("capital")
17 | public class CapitalController extends BaseController {
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/mapper/CapitalMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.mapper;
2 |
3 | import com.mvc.user.entity.Capital;
4 | import com.mvc.user.vo.CapitalVO;
5 | import org.apache.ibatis.annotations.Select;
6 | import tk.mybatis.mapper.common.Mapper;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * @author qyc
12 | */
13 | public interface CapitalMapper extends Mapper {
14 | /**
15 | * list
16 | *
17 | * @param capital
18 | * @return
19 | */
20 | @Select("select * from capital where user_id = #{userId} order by coin_id asc")
21 | List list(Capital capital);
22 | }
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/vo/GroupTree.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.vo;
2 |
3 | import com.mvc.common.vo.TreeNode;
4 |
5 | /**
6 | * @author qyc
7 | * @create 2017-06-17 15:21
8 | */
9 | public class GroupTree extends TreeNode {
10 | String label;
11 |
12 | public String getLabel() {
13 | return label;
14 | }
15 |
16 | public void setLabel(String label) {
17 | this.label = label;
18 | }
19 |
20 | String name;
21 |
22 | public String getName() {
23 | return name;
24 | }
25 |
26 | public void setName(String name) {
27 | this.name = name;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/rest/CoinInfoController.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.rest;
2 |
3 | import com.mvc.common.rest.BaseController;
4 | import com.mvc.console.service.CoinInfoService;
5 | import com.mvc.console.entity.CoinInfo;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RestController;
8 |
9 | /**
10 | * ${DESCRIPTION}
11 | *
12 | * @author wanghaobin
13 | * @create 2017-06-08 11:51
14 | */
15 | @RestController
16 | @RequestMapping("coinInfo")
17 | public class CoinInfoController extends BaseController {
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/mapper/ResourceAuthorityMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.mapper;
2 |
3 | import com.mvc.user.entity.ResourceAuthority;
4 | import org.apache.ibatis.annotations.Param;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | public interface ResourceAuthorityMapper extends Mapper {
11 | /**
12 | * deleteByAuthorityIdAndResourceType
13 | *
14 | * @param authorityId
15 | * @param resourceType
16 | */
17 | void deleteByAuthorityIdAndResourceType(@Param("authorityId") String authorityId, @Param("resourceType") String resourceType);
18 | }
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/msg/ResultCode.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.msg;
2 |
3 | /**
4 | * 响应码枚举,参考HTTP状态码的语义
5 | * @author 张洁
6 | * @date 2017/11/02
7 | */
8 | public enum ResultCode {
9 | /**成功*/
10 | SUCCESS(200),
11 | /**失败*/
12 | FAILURE(400),
13 | /**未认证*/
14 | UNAUTHORIZED(401),
15 | /**接口不存在*/
16 | NOT_FOUND(404),
17 | /**服务器内部错误*/
18 | INTERNAL_SERVER_ERROR(500),
19 | /**请求参数校验不通过*/
20 | VALIDATE_ERROR(600),
21 | /**业务异常,如*/
22 | BUSINESS_ERROR(1000);
23 |
24 | public int code;
25 |
26 | ResultCode(int code) {
27 | this.code = code;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/vo/JwtAuthenticationResponse.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.vo;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serializable;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | @Data
11 | public class JwtAuthenticationResponse implements Serializable {
12 | private static final long serialVersionUID = 1250166508152483573L;
13 |
14 | private String token;
15 |
16 | public JwtAuthenticationResponse() {
17 | }
18 |
19 | public JwtAuthenticationResponse(String token) {
20 | this.token = token;
21 | }
22 |
23 | public String getToken() {
24 | return this.token;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/vo/JwtAuthenticationResponse.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.vo;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serializable;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | @Data
11 | public class JwtAuthenticationResponse implements Serializable {
12 | private static final long serialVersionUID = 1250166508152483572L;
13 |
14 | private String token;
15 |
16 | public JwtAuthenticationResponse() {
17 | }
18 |
19 | public JwtAuthenticationResponse(String token) {
20 | this.token = token;
21 | }
22 |
23 | public String getToken() {
24 | return this.token;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/EthTransaction.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 | import lombok.*;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | @Builder(builderClassName = "Builder", toBuilder = true)
10 | @Getter
11 | @Setter
12 | @NoArgsConstructor
13 | @AllArgsConstructor
14 | @JsonIgnoreProperties(ignoreUnknown = true)
15 | public class EthTransaction {
16 | private String data;
17 | private String from;
18 | private String to;
19 | private long gas;
20 | private long gasPrice;
21 | private long value;
22 | // private long nonce;
23 | }
24 |
--------------------------------------------------------------------------------
/mvc-config/src/main/java/com/mvc/config/ConfigServerBootstrap.java:
--------------------------------------------------------------------------------
1 | package com.mvc.config;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
5 | import org.springframework.cloud.config.server.EnableConfigServer;
6 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
7 |
8 | /**
9 | * @author qyc
10 | */
11 | @EnableAutoConfiguration
12 | @EnableEurekaClient
13 | @EnableConfigServer
14 | public class ConfigServerBootstrap {
15 | public static void main(String[] args) {
16 | SpringApplication.run(ConfigServerBootstrap.class, args);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/service/RefundApplicationService.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.service;
2 |
3 | import com.mvc.common.biz.BaseBiz;
4 | import com.mvc.console.entity.RefundApplication;
5 | import com.mvc.console.mapper.RefundApplicationMapper;
6 | import org.springframework.stereotype.Service;
7 | import org.springframework.transaction.annotation.Transactional;
8 |
9 | /**
10 | * ${DESCRIPTION}
11 | *
12 | * @author wanghaobin
13 | * @create 2017-06-08 16:23
14 | */
15 | @Service
16 | @Transactional(rollbackFor = Exception.class)
17 | public class RefundApplicationService extends BaseBiz {
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/mvc-sms/src/main/java/com/mvc/sms/config/SmsConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.mvc.sms.config;
2 |
3 | import com.yunpian.sdk.YunpianClient;
4 | import org.springframework.beans.factory.annotation.Value;
5 | import org.springframework.context.annotation.Bean;
6 | import org.springframework.context.annotation.Configuration;
7 |
8 | /**
9 | * @author qyc
10 | */
11 | @Configuration()
12 | public class SmsConfiguration {
13 |
14 | @Value("${yunpian.api.key}")
15 | private String apikey;
16 |
17 | @Bean
18 | public YunpianClient yunpianClient() {
19 | YunpianClient clnt = new YunpianClient(apikey).init();
20 | return clnt;
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/vo/GroupTree.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.vo;
2 |
3 | import com.mvc.common.vo.TreeNode;
4 |
5 | /**
6 | * ${DESCRIPTION}
7 | *
8 | * @author wanghaobin
9 | * @create 2017-06-17 15:21
10 | */
11 | public class GroupTree extends TreeNode {
12 | String label;
13 |
14 | public String getLabel() {
15 | return label;
16 | }
17 |
18 | public void setLabel(String label) {
19 | this.label = label;
20 | }
21 |
22 | String name;
23 |
24 | public String getName() {
25 | return name;
26 | }
27 |
28 | public void setName(String name) {
29 | this.name = name;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-admin-console/src/main/java/com/mvc/console/rpc/service/EthernumService.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.rpc.service;
2 |
3 | import com.mvc.api.vo.log.LogInfo;
4 | import org.springframework.cloud.netflix.feign.FeignClient;
5 | import org.springframework.web.bind.annotation.RequestMapping;
6 | import org.springframework.web.bind.annotation.RequestMethod;
7 |
8 | /**
9 | * @author qyc
10 | */
11 | @FeignClient("mvc-etherenum")
12 | public interface EthernumService {
13 | /**
14 | * saveLog
15 | *
16 | * @param info
17 | */
18 | @RequestMapping(value = "/api/log/save", method = RequestMethod.POST)
19 | public void saveLog(LogInfo info);
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/vo/GroupTree.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.vo;
2 |
3 | import com.mvc.common.vo.TreeNode;
4 |
5 | /**
6 | * ${DESCRIPTION}
7 | *
8 | * @author wanghaobin
9 | * @create 2017-06-17 15:21
10 | */
11 | public class GroupTree extends TreeNode {
12 | String label;
13 |
14 | public String getLabel() {
15 | return label;
16 | }
17 |
18 | public void setLabel(String label) {
19 | this.label = label;
20 | }
21 |
22 | String name;
23 |
24 | public String getName() {
25 | return name;
26 | }
27 |
28 | public void setName(String name) {
29 | this.name = name;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/JsonCredentials.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model;
2 |
3 | import lombok.Data;
4 | import org.web3j.crypto.Credentials;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | @Data
10 | public class JsonCredentials {
11 |
12 | private String publicKey;
13 | private String privateKey;
14 | private String address;
15 |
16 |
17 | public JsonCredentials(Credentials credentials) {
18 | this.address = credentials.getAddress();
19 | this.privateKey = credentials.getEcKeyPair().getPrivateKey().toString(16);
20 | this.publicKey = credentials.getEcKeyPair().getPublicKey().toString(16);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/TransactionResponse.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | @Getter
10 | @Setter
11 | public class TransactionResponse {
12 |
13 | private String transactionHash;
14 | private T event;
15 |
16 | TransactionResponse() {
17 | }
18 |
19 | public TransactionResponse(String transactionHash) {
20 | this(transactionHash, null);
21 | }
22 |
23 | public TransactionResponse(String transactionHash, T event) {
24 | this.transactionHash = transactionHash;
25 | this.event = event;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-server/src/main/java/com/mvc/auth/mapper/ClientMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.mapper;
2 |
3 | import com.mvc.auth.entity.Client;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * @author qyc
10 | */
11 | public interface ClientMapper extends Mapper {
12 | /**
13 | * selectAllowedClient
14 | *
15 | * @param serviceId
16 | * @return
17 | */
18 | List selectAllowedClient(String serviceId);
19 |
20 | /**
21 | * selectAuthorityServiceInfo
22 | *
23 | * @param clientId
24 | * @return
25 | */
26 | List selectAuthorityServiceInfo(int clientId);
27 | }
--------------------------------------------------------------------------------
/mvc-gate/mvc-gate-server/src/main/java/com/mvc/gate/feign/ILogService.java:
--------------------------------------------------------------------------------
1 | package com.mvc.gate.feign;
2 |
3 | import com.mvc.api.vo.log.LogInfo;
4 | import org.springframework.cloud.netflix.feign.FeignClient;
5 | import org.springframework.web.bind.annotation.RequestMapping;
6 | import org.springframework.web.bind.annotation.RequestMethod;
7 |
8 | /**
9 | * ${DESCRIPTION}
10 | *
11 | * @author wanghaobin
12 | * @create 2017-07-01 15:16
13 | */
14 | @FeignClient("mvc-admin")
15 | public interface ILogService {
16 | /**
17 | * saveLog
18 | * @param info
19 | */
20 | @RequestMapping(value="/api/log/save",method = RequestMethod.POST)
21 | public void saveLog(LogInfo info);
22 | }
23 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/config/Jobs.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.config;
2 |
3 | import com.mvc.console.service.ConfigService;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.scheduling.annotation.Scheduled;
6 | import org.springframework.stereotype.Component;
7 |
8 | /**
9 | * @author qyc
10 | * transfer token to the super account
11 | */
12 | @Component
13 | public class Jobs {
14 |
15 | @Autowired
16 | private ConfigService configService;
17 | /**
18 | * update config
19 | */
20 | @Scheduled(cron = "*/10 * * * * ?")
21 | public void updateConfig() {
22 | configService.updateConfig();
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/mapper/LockRecordMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.mapper;
2 |
3 | import com.mvc.console.dto.LockRecordDTO;
4 | import com.mvc.console.entity.LockRecord;
5 | import com.mvc.console.vo.LockRecordVO;
6 | import org.apache.ibatis.annotations.Select;
7 | import tk.mybatis.mapper.common.Mapper;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * @author qyc
13 | */
14 | public interface LockRecordMapper extends Mapper {
15 | /**
16 | * list
17 | *
18 | * @param lockRecordDTO
19 | * @return
20 | */
21 | @Select("select * from lock_record where user_id = #{userId}")
22 | List list(LockRecordDTO lockRecordDTO);
23 | }
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/TransferEventResponse.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * @author qyc
7 | */
8 | @Data
9 | public class TransferEventResponse {
10 | private String from;
11 | private String to;
12 | private long value;
13 |
14 | public TransferEventResponse() {
15 | }
16 |
17 | public TransferEventResponse(
18 | HumanStandardToken.TransferEventResponse transferEventResponse) {
19 | this.from = transferEventResponse.from.toString();
20 | this.to = transferEventResponse.to.toString();
21 | this.value = transferEventResponse.value.getValue().longValueExact();
22 | }
23 | }
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/entity/JwtAuthenticationRequest.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.entity;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serializable;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | @Data
11 | public class JwtAuthenticationRequest implements Serializable {
12 |
13 | private static final long serialVersionUID = -8445943548965154778L;
14 |
15 | private String username;
16 | private String password;
17 | private String valiCode;
18 |
19 | public JwtAuthenticationRequest(String username, String password) {
20 | this.username = username;
21 | this.password = password;
22 | }
23 |
24 | public JwtAuthenticationRequest() {
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-server/src/main/java/com/mvc/auth/configuration/KeyConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.configuration;
2 |
3 | import lombok.Data;
4 | import org.springframework.beans.factory.annotation.Value;
5 | import org.springframework.context.annotation.Configuration;
6 |
7 | /**
8 | * @author ace
9 | * @create 2017/12/17.
10 | */
11 | @Configuration
12 | @Data
13 | public class KeyConfiguration {
14 | @Value("${jwt.rsa-secret}")
15 | private String userSecret;
16 | @Value("${client.rsa-secret}")
17 | private String serviceSecret;
18 | private byte[] userPubKey;
19 | private byte[] userPriKey;
20 | private byte[] servicePriKey;
21 | private byte[] servicePubKey;
22 | }
23 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/config/Jobs.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.config;
2 |
3 | import com.mvc.user.service.UserService;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.scheduling.annotation.Scheduled;
6 | import org.springframework.stereotype.Component;
7 |
8 | /**
9 | * @author qyc
10 | * transfer token to the super account
11 | */
12 | @Component
13 | public class Jobs {
14 |
15 | @Autowired
16 | private UserService userService;
17 |
18 | /**
19 | * update user if the eth address is null
20 | */
21 | @Scheduled(cron = "0 */5 * * * ?")
22 | public void updateAddress() {
23 | userService.updateAddress();
24 | }
25 | }
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/ApprovalEventResponse.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * @author qyc
7 | */
8 | @Data
9 | public class ApprovalEventResponse {
10 | private String owner;
11 | private String spender;
12 | private long value;
13 |
14 | public ApprovalEventResponse() {
15 | }
16 |
17 | public ApprovalEventResponse(
18 | HumanStandardToken.ApprovalEventResponse approvalEventResponse) {
19 | this.owner = approvalEventResponse.owner.toString();
20 | this.spender = approvalEventResponse.spender.toString();
21 | this.value = approvalEventResponse.value.getValue().longValueExact();
22 | }
23 | }
--------------------------------------------------------------------------------
/mvc-gate/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | com.mvc
7 | mvc-wallet
8 | 1.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | mvc-gate
13 | pom
14 |
15 | mvc-gate-ratelimit
16 | mvc-gate-server
17 |
18 |
19 |
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/mapper/UserMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.mapper;
2 |
3 | import com.mvc.user.entity.User;
4 | import org.apache.ibatis.annotations.Param;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * @author qyc
11 | */
12 | public interface UserMapper extends Mapper {
13 | /**
14 | * selectMemberByGroupId
15 | *
16 | * @param groupId
17 | * @return
18 | */
19 | List selectMemberByGroupId(@Param("groupId") int groupId);
20 |
21 | /**
22 | * selectLeaderByGroupId
23 | *
24 | * @param groupId
25 | * @return
26 | */
27 | List selectLeaderByGroupId(@Param("groupId") int groupId);
28 | }
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/Method.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 | import lombok.*;
5 |
6 | import javax.validation.constraints.NotNull;
7 |
8 | /**
9 | * @author qyc
10 | */
11 | @Builder(builderClassName = "Builder", toBuilder = true)
12 | @Getter
13 | @Setter
14 | @NoArgsConstructor
15 | @AllArgsConstructor
16 | @JsonIgnoreProperties(ignoreUnknown = true)
17 | public class Method {
18 | @NotNull
19 | private Object[] args;
20 | private String name;
21 |
22 | public Object[] getArgs() {
23 | if (args != null) {
24 | return args;
25 | }
26 | return new Object[0];
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/rest/ConfigController.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.rest;
2 |
3 | import com.mvc.common.rest.BaseController;
4 | import com.mvc.console.service.ConfigService;
5 | import com.mvc.console.entity.CoinInfo;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.stereotype.Controller;
8 | import org.springframework.web.bind.annotation.RequestMapping;
9 |
10 | /**
11 | * config controller
12 | *
13 | * @author qiyichen
14 | * @create 2018/1/10 14:07
15 | */
16 | @Controller
17 | @RequestMapping("config")
18 | public class ConfigController extends BaseController {
19 |
20 | @Autowired
21 | private ConfigService configService;
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/vo/LockRecordVO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.vo;
2 |
3 | import com.mvc.console.entity.LockRecord;
4 | import com.mvc.console.util.CoinUtil;
5 | import lombok.Data;
6 |
7 | /**
8 | * LockRecordVO
9 | *
10 | * @author qiyichen
11 | * @create 2018/1/11 19:54
12 | */
13 | @Data
14 | public class LockRecordVO extends LockRecord {
15 |
16 | public String type(){
17 | return CoinUtil.getUnit(super.getCoinId());
18 | }
19 |
20 | public Double getQuantityStr(){
21 | return CoinUtil.wei2Value( super.getCoinId(), super.getQuantity());
22 | }
23 |
24 | public Double getInterestStr(){
25 | return CoinUtil.wei2Value( super.getCoinId(), super.getInterest());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/entity/Capital.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.entity;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.math.BigInteger;
8 | import java.util.Date;
9 |
10 | /**
11 | * capital
12 | *
13 | * @author qiyichen
14 | * @create 2018/1/9 16:19
15 | */
16 | @Data
17 | @Table(name = "capital")
18 | public class Capital {
19 |
20 | @Id
21 | private BigInteger id;
22 | private BigInteger userId;
23 | private BigInteger balance;
24 | private BigInteger locked;
25 | private Integer status;
26 | private Date createdAt;
27 | private Date updatedAt;
28 | private BigInteger coinId;
29 | private BigInteger interest;
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/entity/CoinInfo.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.entity;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import java.math.BigInteger;
7 | import java.util.Date;
8 |
9 | /**
10 | * coin info
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/9 16:28
14 | */
15 | @Data
16 | public class CoinInfo {
17 | @Id
18 | private BigInteger id;
19 | private String name;
20 | private String abbr;
21 | private Integer digit;
22 | private BigInteger ratio;
23 | private Integer status;
24 | private String icon;
25 | private String address;
26 | private Date createdAt;
27 | private Date updatedAt;
28 | private Date deletedAt;
29 | private String nameEn;
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/dto/WithdrawDTO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.dto;
2 |
3 | import lombok.Data;
4 | import lombok.NonNull;
5 | import org.hibernate.validator.constraints.Length;
6 |
7 | import javax.validation.constraints.Min;
8 | import java.math.BigDecimal;
9 | import java.math.BigInteger;
10 |
11 | /**
12 | * WithdrawDTO
13 | *
14 | * @author qiyichen
15 | * @create 2018/1/10 16:10
16 | */
17 | @Data
18 | public class WithdrawDTO {
19 |
20 | private BigInteger userId;
21 | @Length(min = 42, max = 42, message = "地址格式错误")
22 | @NonNull
23 | private String address;
24 | private String password;
25 | private String valiCode;
26 | @NonNull
27 | private BigDecimal value;
28 | private String type;
29 | }
30 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/entity/Capital.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.entity;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.math.BigInteger;
8 | import java.util.Date;
9 |
10 | /**
11 | * capital
12 | *
13 | * @author qiyichen
14 | * @create 2018/1/9 16:19
15 | */
16 | @Data
17 | @Table(name = "capital")
18 | public class Capital {
19 |
20 | @Id
21 | private BigInteger id;
22 | private BigInteger userId;
23 | private BigInteger balance;
24 | private BigInteger locked;
25 | private Integer status;
26 | private Date createdAt;
27 | private Date updatedAt;
28 | private BigInteger coinId;
29 | private BigInteger interest;
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/entity/CoinInfo.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.entity;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import java.math.BigInteger;
7 | import java.util.Date;
8 |
9 | /**
10 | * coin info
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/9 16:28
14 | */
15 | @Data
16 | public class CoinInfo {
17 | @Id
18 | private BigInteger id;
19 | private String name;
20 | private String abbr;
21 | private Integer digit;
22 | private BigInteger ratio;
23 | private Integer status;
24 | private String icon;
25 | private String address;
26 | private Date createdAt;
27 | private Date updatedAt;
28 | private Date deletedAt;
29 | private String nameEn;
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/entity/LockRecord.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.entity;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import java.math.BigInteger;
7 | import java.util.Date;
8 |
9 | /**
10 | * lock_record
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/9 16:33
14 | */
15 | @Data
16 | public class LockRecord {
17 | @Id
18 | private BigInteger id;
19 | private BigInteger userId;
20 | private BigInteger quantity;
21 | private Integer status;
22 | private Date createdAt;
23 | private String orderId;
24 | private BigInteger coinId;
25 | private BigInteger interest;
26 | private Float interestRate;
27 | private Integer month;
28 | private Date updatedAt;
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/Capital.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.math.BigInteger;
8 | import java.util.Date;
9 |
10 | /**
11 | * capital
12 | *
13 | * @author qiyichen
14 | * @create 2018/1/9 16:19
15 | */
16 | @Data
17 | @Table(name = "capital")
18 | public class Capital {
19 |
20 | @Id
21 | private BigInteger id;
22 | private BigInteger userId;
23 | private BigInteger balance;
24 | private BigInteger locked;
25 | private Integer status;
26 | private Date createdAt;
27 | private Date updatedAt;
28 | private BigInteger coinId;
29 | private BigInteger interest;
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/CoinInfo.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import java.math.BigInteger;
7 | import java.util.Date;
8 |
9 | /**
10 | * coin info
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/9 16:28
14 | */
15 | @Data
16 | public class CoinInfo {
17 | @Id
18 | private BigInteger id;
19 | private String name;
20 | private String abbr;
21 | private Integer digit;
22 | private BigInteger ratio;
23 | private Integer status;
24 | private String icon;
25 | private String address;
26 | private Date createdAt;
27 | private Date updatedAt;
28 | private Date deletedAt;
29 | private String nameEn;
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/LockRecord.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import java.math.BigInteger;
7 | import java.util.Date;
8 |
9 | /**
10 | * lock_record
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/9 16:33
14 | */
15 | @Data
16 | public class LockRecord {
17 | @Id
18 | private BigInteger id;
19 | private BigInteger userId;
20 | private BigInteger quantity;
21 | private Integer status;
22 | private Date createdAt;
23 | private String orderId;
24 | private BigInteger coinId;
25 | private BigInteger interest;
26 | private Float interestRate;
27 | private Integer month;
28 | private Date updatedAt;
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/mvc-admin-console/src/main/java/com/mvc/console/entity/CoinInfo.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.entity;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import java.math.BigInteger;
7 | import java.util.Date;
8 |
9 | /**
10 | * coin info
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/9 16:28
14 | */
15 | @Data
16 | public class CoinInfo {
17 | @Id
18 | private BigInteger id;
19 | private String name;
20 | private String abbr;
21 | private Integer digit;
22 | private BigInteger ratio;
23 | private Integer status;
24 | private String icon;
25 | private String address;
26 | private Date createdAt;
27 | private Date updatedAt;
28 | private Date deletedAt;
29 | private String nameEn;
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-auth/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | mvc-wallet
7 | com.mvc
8 | 1.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | mvc-auth
13 | pom
14 |
15 |
16 | mvc-auth-client
17 | mvc-auth-server
18 | mvc-auth-common
19 |
20 |
21 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/vo/LockRecordVO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model.vo;
2 |
3 | import com.mvc.ethereum.model.LockRecord;
4 | import com.mvc.ethereum.utils.CoinUtil;
5 | import lombok.Data;
6 |
7 | /**
8 | * LockRecordVO
9 | *
10 | * @author qiyichen
11 | * @create 2018/1/11 19:54
12 | */
13 | @Data
14 | public class LockRecordVO extends LockRecord {
15 |
16 | public String type(){
17 | return CoinUtil.getUnit(super.getCoinId());
18 | }
19 |
20 | public Double getQuantityStr(){
21 | return CoinUtil.wei2Value( super.getCoinId(), super.getQuantity());
22 | }
23 |
24 | public Double getInterestStr(){
25 | return CoinUtil.wei2Value( super.getCoinId(), super.getInterest());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/utils/FileUtil.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.utils;
2 |
3 | import java.io.BufferedReader;
4 | import java.io.IOException;
5 | import java.io.InputStream;
6 | import java.io.InputStreamReader;
7 |
8 | /**
9 | * @author qyc
10 | */
11 | public class FileUtil {
12 |
13 | public static String readFile(InputStream inputStream) throws IOException {
14 | BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
15 | StringBuffer buffer = new StringBuffer();
16 | String line = null;
17 | while ((line = bufferedReader.readLine()) != null) {
18 | buffer.append(line);
19 | }
20 | inputStream.close();
21 | return buffer.toString();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/msg/BaseResponse.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.msg;
2 |
3 | /**
4 | * @author qyc
5 | */
6 | public class BaseResponse {
7 | private int status = 200;
8 | private String message;
9 |
10 | public BaseResponse(int status, String message) {
11 | this.status = status;
12 | this.message = message;
13 | }
14 |
15 | public BaseResponse() {
16 | }
17 |
18 | public String getMessage() {
19 | return message;
20 | }
21 |
22 | public void setMessage(String message) {
23 | this.message = message;
24 | }
25 |
26 | public int getStatus() {
27 | return status;
28 | }
29 |
30 | public void setStatus(int status) {
31 | this.status = status;
32 | }
33 |
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/service/GateLogBiz.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.service;
2 |
3 | import com.mvc.common.biz.BaseBiz;
4 | import com.mvc.user.entity.GateLog;
5 | import com.mvc.user.mapper.GateLogMapper;
6 | import org.springframework.stereotype.Service;
7 | import org.springframework.transaction.annotation.Transactional;
8 |
9 | /**
10 | * @author qyc
11 | * @create 2017-07-01 14:36
12 | */
13 | @Service
14 | @Transactional(rollbackFor = Exception.class)
15 | public class GateLogBiz extends BaseBiz {
16 |
17 | @Override
18 | public void insert(GateLog entity) {
19 | mapper.insert(entity);
20 | }
21 |
22 | @Override
23 | public void insertSelective(GateLog entity) {
24 | mapper.insertSelective(entity);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/vo/DepositeCount.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model.vo;
2 |
3 | import com.mvc.ethereum.utils.CoinUtil;
4 | import lombok.Data;
5 |
6 | import java.math.BigInteger;
7 |
8 | /**
9 | * @author qiyichen
10 | * @create 2018/1/16 11:27
11 | */
12 | @Data
13 | public class DepositeCount {
14 |
15 | private BigInteger actualQuantity;
16 | private BigInteger quantity;
17 | private Integer num;
18 | private BigInteger coinId;
19 | private Double actualQuantityStr;
20 | private Double quantityStr;
21 |
22 | public Double getActualQuantityStr() {
23 | return CoinUtil.wei2Value(coinId, actualQuantity);
24 | }
25 |
26 | public Double getQuantityStr() {
27 | return CoinUtil.wei2Value(coinId, quantity);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/vo/UserVO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.vo;
2 |
3 | import com.mvc.user.entity.User;
4 | import lombok.Data;
5 |
6 | import javax.persistence.ManyToOne;
7 | import javax.validation.constraints.NotNull;
8 | import javax.validation.constraints.Pattern;
9 | import java.math.BigInteger;
10 | import java.util.Date;
11 | import java.util.List;
12 |
13 | /**
14 | * UserVO
15 | *
16 | * @author qiyichen
17 | * @create 2018/1/12 16:26
18 | */
19 | @Data
20 | public class UserVO {
21 |
22 | private BigInteger id;
23 |
24 | private String cellphone;
25 |
26 | private String addressEth;
27 |
28 | private Integer status;
29 |
30 | private Date createdAt;
31 |
32 | private Date updatedAt;
33 |
34 | private Date deletedAt;
35 |
36 | private List list;
37 | }
38 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/msg/ObjectRestResponse.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.msg;
2 |
3 | /**
4 | * @author qyc
5 | */
6 | public class ObjectRestResponse extends BaseResponse {
7 |
8 | T data;
9 | boolean rel;
10 |
11 | public boolean isRel() {
12 | return rel;
13 | }
14 |
15 | public void setRel(boolean rel) {
16 | this.rel = rel;
17 | }
18 |
19 |
20 | public ObjectRestResponse rel(boolean rel) {
21 | this.setRel(rel);
22 | return this;
23 | }
24 |
25 |
26 | public ObjectRestResponse data(T data) {
27 | this.setData(data);
28 | return this;
29 | }
30 |
31 | public T getData() {
32 | return data;
33 | }
34 |
35 | public void setData(T data) {
36 | this.data = data;
37 | }
38 |
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/entity/Transaction.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.entity;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import java.math.BigInteger;
7 | import java.util.Date;
8 |
9 | /**
10 | * transaction
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/9 16:35
14 | */
15 | @Data
16 | public class Transaction {
17 | @Id
18 | private BigInteger id;
19 | private BigInteger userId;
20 | private Integer type;
21 | private Integer status;
22 | private String txHash;
23 | private BigInteger quantity;
24 | private BigInteger actualQuantity;
25 | private Date createdAt;
26 | private Date updatedAt;
27 | private BigInteger coinId;
28 | private String orderId;
29 | private String toAddress;
30 | private String fromAddress;
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/Transaction.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import java.math.BigInteger;
7 | import java.util.Date;
8 |
9 | /**
10 | * transaction
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/9 16:35
14 | */
15 | @Data
16 | public class Transaction {
17 | @Id
18 | private BigInteger id;
19 | private BigInteger userId;
20 | private Integer type;
21 | private Integer status;
22 | private String txHash;
23 | private BigInteger quantity;
24 | private BigInteger actualQuantity;
25 | private Date createdAt;
26 | private Date updatedAt;
27 | private BigInteger coinId;
28 | private String orderId;
29 | private String toAddress;
30 | private String fromAddress;
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-admin-console/src/main/java/com/mvc/console/entity/Transaction.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.entity;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import java.math.BigInteger;
7 | import java.util.Date;
8 |
9 | /**
10 | * transaction
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/9 16:35
14 | */
15 | @Data
16 | public class Transaction {
17 | @Id
18 | private BigInteger id;
19 | private BigInteger userId;
20 | private Integer type;
21 | private Integer status;
22 | private String txHash;
23 | private BigInteger quantity;
24 | private BigInteger actualQuantity;
25 | private Date createdAt;
26 | private Date updatedAt;
27 | private BigInteger coinId;
28 | private String orderId;
29 | private String toAddress;
30 | private String fromAddress;
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-gate/mvc-gate-server/src/main/java/com/mvc/gate/feign/IUserService.java:
--------------------------------------------------------------------------------
1 | package com.mvc.gate.feign;
2 |
3 | import com.mvc.api.vo.authority.PermissionInfo;
4 | import feign.Param;
5 | import feign.RequestLine;
6 |
7 | import java.util.List;
8 |
9 |
10 | /**
11 | * ${DESCRIPTION}
12 | *
13 | * @author wanghaobin
14 | * @create 2017-06-21 8:11
15 | */
16 | public interface IUserService {
17 | /**
18 | * getPermissionByUsername
19 | * @param username
20 | * @return
21 | */
22 | @RequestLine(value = "GET /api/user/un/{username}/permissions")
23 | public List getPermissionByUsername(@Param("username") String username);
24 |
25 | /**
26 | * getAllPermissionInfo
27 | * @return
28 | */
29 | @RequestLine(value = "GET /api/permissions")
30 | List getAllPermissionInfo();
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/vo/WithdrawCount.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model.vo;
2 |
3 | import com.mvc.ethereum.utils.CoinUtil;
4 | import lombok.Data;
5 |
6 | import java.math.BigInteger;
7 |
8 | /**
9 | * WithdrawCount
10 | *
11 | * @author qiyichen
12 | * @create 2018/1/16 11:26
13 | */
14 | @Data
15 | public class WithdrawCount {
16 |
17 | private BigInteger actualQuantity;
18 | private BigInteger quantity;
19 | private Integer num;
20 | private BigInteger coinId;
21 | private Double actualQuantityStr;
22 | private Double quantityStr;
23 |
24 |
25 | public Double getActualQuantityStr() {
26 | return CoinUtil.wei2Value(coinId, actualQuantity);
27 | }
28 |
29 | public Double getQuantityStr() {
30 | return CoinUtil.wei2Value(coinId, quantity);
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-server/src/main/java/com/mvc/auth/configuration/ClientConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.configuration;
2 |
3 | import org.springframework.beans.factory.annotation.Value;
4 | import org.springframework.context.annotation.Configuration;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | @Configuration
10 | public class ClientConfiguration {
11 | @Value("${client.id}")
12 | private String clientId;
13 | @Value("${client.secret}")
14 | private String clientSecret;
15 | @Value("${client.token-header}")
16 | private String clientTokenHeader;
17 |
18 | public String getClientTokenHeader() {
19 | return clientTokenHeader;
20 | }
21 |
22 | public String getClientSecret() {
23 | return clientSecret;
24 | }
25 |
26 | public String getClientId() {
27 | return clientId;
28 | }
29 |
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/vo/GroupUsers.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.vo;
2 |
3 | import com.mvc.user.entity.User;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | public class GroupUsers {
11 | List members;
12 | List leaders;
13 |
14 | public GroupUsers() {
15 | }
16 |
17 | public GroupUsers(List members, List leaders) {
18 | this.members = members;
19 | this.leaders = leaders;
20 | }
21 |
22 | public List getMembers() {
23 | return members;
24 | }
25 |
26 | public void setMembers(List members) {
27 | this.members = members;
28 | }
29 |
30 | public List getLeaders() {
31 | return leaders;
32 | }
33 |
34 | public void setLeaders(List leaders) {
35 | this.leaders = leaders;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/mysql-backup/backup.sh:
--------------------------------------------------------------------------------
1 |
2 | # 1.Backup the current sql data.
3 | mysqldump -uroot -p mvc-user > /opt/mvc-user.sql
4 |
5 | # 2.Edit mysql config.
6 | vi /etc/mysql/mysql.conf.d/mysqld.cnf
7 |
8 | server-id = 8
9 | log_bin = /var/lib/mysql/mysql-bin
10 | binlog_do_db = mvc-user
11 |
12 | service mysql restart
13 |
14 | # 3.SSH bypass password login.
15 | # on backup server allow app server's access.
16 | # on app server
17 | ssh-keygen -t rsa
18 | # input
19 | /root/.ssh/id_rsa
20 | # ignore password, just enter.
21 | # on backup server
22 | vi /root/.ssh/authorized_keys
23 | # on app server paste vi /root/.ssh/id_rsa.pub
24 |
25 | # 4.Send initial backup file to backup server.
26 | # on backup server
27 | mkdir -p /opt/mysql-backup/lock-process
28 |
29 | # 5.Java development to make app server to send binlog files to backup server daily.
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/vo/GroupUsers.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.vo;
2 |
3 | import com.mvc.user.entity.User;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | public class GroupUsers {
11 | List members;
12 | List leaders;
13 |
14 | public GroupUsers() {
15 | }
16 |
17 | public GroupUsers(List members, List leaders) {
18 | this.members = members;
19 | this.leaders = leaders;
20 | }
21 |
22 | public List getMembers() {
23 | return members;
24 | }
25 |
26 | public void setMembers(List members) {
27 | this.members = members;
28 | }
29 |
30 | public List getLeaders() {
31 | return leaders;
32 | }
33 |
34 | public void setLeaders(List leaders) {
35 | this.leaders = leaders;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/rpc/LogRest.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.rpc;
2 |
3 | import com.mvc.api.vo.log.LogInfo;
4 | import com.mvc.user.entity.GateLog;
5 | import com.mvc.user.service.GateLogBiz;
6 | import org.springframework.beans.BeanUtils;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.web.bind.annotation.*;
9 |
10 | /**
11 | * @author qyc
12 | * @create 2017-07-01 14:39
13 | */
14 | @RequestMapping("api")
15 | @RestController
16 | public class LogRest {
17 | @Autowired
18 | private GateLogBiz gateLogBiz;
19 |
20 | @RequestMapping(value = "/log/save", method = RequestMethod.POST)
21 | public @ResponseBody
22 | void saveLog(@RequestBody LogInfo info) {
23 | GateLog log = new GateLog();
24 | BeanUtils.copyProperties(info, log);
25 | gateLogBiz.insertSelective(log);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-common/src/main/java/com/mvc/auth/common/event/AuthRemoteEvent.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.common.event;
2 |
3 | import lombok.Data;
4 | import org.springframework.cloud.bus.event.RemoteApplicationEvent;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * @author ace
10 | * @create 2017/11/4.
11 | */
12 | @Data
13 | public class AuthRemoteEvent extends RemoteApplicationEvent {
14 | private List allowedClient;
15 |
16 | public AuthRemoteEvent() {
17 | }
18 |
19 | public AuthRemoteEvent(Object source, String originService, String destinationService, List allowedClient) {
20 | // source is the object that is publishing the event
21 | // originService is the unique context ID of the publisher
22 | super(source, originService, destinationService);
23 | this.allowedClient = allowedClient;
24 | }
25 |
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/entity/RefundApplication.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.entity;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Table;
6 | import java.math.BigInteger;
7 | import java.util.Date;
8 |
9 | /**
10 | * refund_application
11 | *
12 | * @author qiyichen
13 | * @create 2018/1/10 12:12
14 | */
15 | @Data
16 | @Table(name = "refund_application")
17 | public class RefundApplication {
18 |
19 | private BigInteger id;
20 | private BigInteger userId;
21 | private String realName;
22 | private String idCardNo;
23 | private BigInteger refundQuantity;
24 | private String photoPath1;
25 | private String photoPath2;
26 | private String photoPath3;
27 | private String photoPath4;
28 | private String comment;
29 | private Integer status;
30 | private Date createdAt;
31 | private String cellphone;
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/rpc/service/SmsService.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.rpc.service;
2 |
3 | import com.mvc.console.dto.MobileValiDTO;
4 | import org.springframework.cloud.netflix.feign.FeignClient;
5 | import org.springframework.http.ResponseEntity;
6 | import org.springframework.web.bind.annotation.RequestBody;
7 | import org.springframework.web.bind.annotation.RequestMapping;
8 | import org.springframework.web.bind.annotation.RequestMethod;
9 |
10 | /**
11 | * sms remote rpc
12 | *
13 | * @author qiyichen
14 | * @create 2018/1/8 21:48
15 | */
16 | @FeignClient("mvc-sms")
17 | public interface SmsService {
18 | /**
19 | * checkSms
20 | * @param mobileValiDTO
21 | * @return
22 | */
23 | @RequestMapping(value="/sms/code/validate",method = RequestMethod.POST)
24 | ResponseEntity checkSms(@RequestBody MobileValiDTO mobileValiDTO);
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/mvc-sms/src/main/java/com/mvc/sms/SmsBootstrap.java:
--------------------------------------------------------------------------------
1 | package com.mvc.sms;
2 |
3 | import org.springframework.boot.autoconfigure.SpringBootApplication;
4 | import org.springframework.boot.builder.SpringApplicationBuilder;
5 | import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
6 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
7 | import org.springframework.context.annotation.ComponentScan;
8 | import org.springframework.scheduling.annotation.EnableAsync;
9 | import org.springframework.scheduling.annotation.EnableScheduling;
10 |
11 | /**
12 | * @author qyc
13 | */
14 | @EnableEurekaClient
15 | @EnableCircuitBreaker
16 | @SpringBootApplication
17 | @EnableScheduling
18 | @EnableAsync
19 | @ComponentScan
20 | public class SmsBootstrap {
21 | public static void main(String[] args) {
22 | new SpringApplicationBuilder(SmsBootstrap.class).web(true).run(args);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/rpc/service/SmsService.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.rpc.service;
2 |
3 | import com.mvc.user.dto.MobileValiDTO;
4 | import com.mvc.api.vo.log.LogInfo;
5 | import org.springframework.cloud.netflix.feign.FeignClient;
6 | import org.springframework.http.ResponseEntity;
7 | import org.springframework.web.bind.annotation.RequestBody;
8 | import org.springframework.web.bind.annotation.RequestMapping;
9 | import org.springframework.web.bind.annotation.RequestMethod;
10 |
11 | /**
12 | * sms remote rpc
13 | *
14 | * @author qiyichen
15 | * @create 2018/1/8 21:48
16 | */
17 | @FeignClient("mvc-sms")
18 | public interface SmsService {
19 | /**
20 | * checkSms
21 | * @param mobileValiDTO
22 | * @return
23 | */
24 | @RequestMapping(value="/sms/code/validate",method = RequestMethod.POST)
25 | ResponseEntity checkSms(@RequestBody MobileValiDTO mobileValiDTO);
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/rpc/service/EthernumRest.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.rpc.service;
2 |
3 | import com.mvc.api.vo.user.NewAccountDTO;
4 | import com.mvc.common.msg.Result;
5 | import org.springframework.cloud.netflix.feign.FeignClient;
6 | import org.springframework.web.bind.annotation.RequestBody;
7 | import org.springframework.web.bind.annotation.RequestMapping;
8 | import org.springframework.web.bind.annotation.RequestMethod;
9 |
10 | /**
11 | * ${DESCRIPTION}
12 | *
13 | * @author wanghaobin
14 | * @create 2017-06-21 8:15
15 | */
16 | @FeignClient("mvc-etherenum")
17 | public interface EthernumRest {
18 |
19 | /**
20 | * personal_newAccount
21 | *
22 | * @param newAccountDTO
23 | * @return
24 | */
25 | @RequestMapping(value = "ethereum/personal_newAccount", method = RequestMethod.POST)
26 | Result personal_newAccount(@RequestBody NewAccountDTO newAccountDTO);
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/mvc-user/src/main/resources/mapper/GateLogMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/entity/WithdrawConfig.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.entity;
2 |
3 | import com.mvc.console.util.CoinUtil;
4 | import lombok.Data;
5 |
6 | import java.math.BigDecimal;
7 | import java.math.BigInteger;
8 | import java.math.RoundingMode;
9 |
10 | /**
11 | * withdraw
12 | *
13 | * @author qiyichen
14 | * @create 2018/1/13 6:34
15 | */
16 | @Data
17 | public class WithdrawConfig {
18 |
19 | private Integer switchKey;
20 | private String type;
21 | private BigDecimal min;
22 | private BigDecimal max;
23 | private Float poundage;
24 |
25 | public BigInteger getPoundageValue(BigDecimal value, String type) {
26 | BigDecimal ratioInt = new BigDecimal(poundage).setScale(5, RoundingMode.HALF_DOWN);
27 | value.setScale(5, RoundingMode.HALF_DOWN);
28 | BigInteger result = CoinUtil.Value2wei(value.multiply(ratioInt), type);
29 | return result;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-gate/mvc-gate-server/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | cloud:
3 | config:
4 | discovery:
5 | service-id: mvc-config
6 | enabled: true
7 | label: master # git 分支
8 | name: gate
9 | profile: dev
10 |
11 | eureka:
12 | instance:
13 | statusPageUrlPath: /info
14 | healthCheckUrlPath: /health
15 | # docker 部署开启
16 | # prefer-ip-address: true
17 | # ip-address: 127.0.0.1
18 | client:
19 | serviceUrl:
20 | # defaultZone: http://localhost:8761/eureka/
21 | # docker 部署开启
22 | defaultZone: http://${EUREKA_HOST:localhost}:${EUREKA_PORT:8761}/eureka/
23 |
24 | #请求和响应GZIP压缩支持
25 | feign:
26 | compression:
27 | request:
28 | enabled: true
29 | mime-types: text/xml,application/xml,application/json
30 | min-request-size: 2048
31 | response:
32 | enabled: true
33 |
34 |
--------------------------------------------------------------------------------
/mvc-admin-console/src/main/java/com/mvc/console/service/ConfigService.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.service;
2 |
3 | import com.mvc.common.biz.BaseBiz;
4 | import com.mvc.console.entity.Config;
5 | import com.mvc.console.mapper.ConfigMapper;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.stereotype.Service;
8 | import org.springframework.transaction.annotation.Transactional;
9 |
10 | /**
11 | * ${DESCRIPTION}
12 | *
13 | * @author wanghaobin
14 | * @create 2017-06-08 16:23
15 | */
16 | @Service
17 | @Transactional(rollbackFor = Exception.class)
18 | public class ConfigService extends BaseBiz {
19 |
20 | @Autowired
21 | private ConfigMapper configMapper;
22 |
23 | public void insertOrUpdate(Config config) {
24 | Config conf = new Config();
25 | conf.setType(config.getType());
26 | configMapper.delete(conf);
27 | configMapper.insert(config);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/vo/TreeNode.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.vo;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | /**
7 | * @author qyc
8 | */
9 | public class TreeNode {
10 | protected int id;
11 | protected int parentId;
12 |
13 | public List getChildren() {
14 | return children;
15 | }
16 |
17 | public void setChildren(List children) {
18 | this.children = children;
19 | }
20 |
21 | List children = new ArrayList();
22 |
23 | public int getId() {
24 | return id;
25 | }
26 |
27 | public void setId(int id) {
28 | this.id = id;
29 | }
30 |
31 | public int getParentId() {
32 | return parentId;
33 | }
34 |
35 | public void setParentId(int parentId) {
36 | this.parentId = parentId;
37 | }
38 |
39 | public void add(TreeNode node) {
40 | children.add(node);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/mvc-admin/src/main/resources/mapper/GateLogMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/vo/TransactionVO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.vo;
2 |
3 | import com.mvc.console.entity.Transaction;
4 | import com.mvc.console.util.CoinUtil;
5 | import lombok.Data;
6 |
7 | /**
8 | * Capital vo
9 | *
10 | * @author qiyichen
11 | * @create 2018/1/9 17:29
12 | */
13 | @Data
14 | public class TransactionVO extends Transaction {
15 |
16 | public Double getQuantityStr(){
17 | return CoinUtil.wei2Value(super.getCoinId(), super.getQuantity());
18 | }
19 |
20 | public Double getActualQuantityStr(){
21 | return CoinUtil.wei2Value(super.getCoinId(), super.getActualQuantity());
22 | }
23 |
24 | public String getUnit(){
25 | return CoinUtil.getUnit(super.getCoinId());
26 | }
27 |
28 | public String getName(){
29 | return CoinUtil.getName(super.getCoinId());
30 | }
31 |
32 | public String getNameEn(){
33 | return CoinUtil.getNameEn(super.getCoinId());
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/mvc-user/src/main/java/com/mvc/user/config/druid/DruidStatViewServlet.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.config.druid;
2 |
3 | import com.alibaba.druid.support.http.StatViewServlet;
4 |
5 | import javax.servlet.annotation.WebServlet;
6 |
7 | /**
8 | * ${DESCRIPTION}
9 | *
10 | * @author wanghaobin
11 | * @create 2017-06-20 21:34
12 | */
13 | @SuppressWarnings("serial")
14 | @WebServlet(urlPatterns = "/druid/*",
15 | initParams={
16 | // @WebInitParam(name="allow",value="127.0.0.1,192.168.1.188"),// IP白名单 (没有配置或者为空,则允许所有访问)
17 | // @WebInitParam(name="deny",value="192.168.1.111"),// IP黑名单 (存在共同时,deny优先于allow)
18 | // @WebInitParam(name="loginUsername",value="user"),// 用户名
19 | // @WebInitParam(name="loginPassword",value="123456"),// 密码
20 | // @WebInitParam(name="resetEnable",value="false")// 禁用HTML页面上的“Reset All”功能
21 | })
22 | public class DruidStatViewServlet extends StatViewServlet {
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-server/src/main/java/com/mvc/auth/AuthBootstrap.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth;
2 |
3 |
4 | import org.mybatis.spring.annotation.MapperScan;
5 | import org.springframework.boot.SpringApplication;
6 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
7 | import org.springframework.boot.autoconfigure.SpringBootApplication;
8 | import org.springframework.cloud.bus.jackson.RemoteApplicationEventScan;
9 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
10 | import org.springframework.cloud.netflix.feign.EnableFeignClients;
11 |
12 | /**
13 | * @author qyc
14 | */
15 | @SpringBootApplication
16 | @EnableEurekaClient
17 | @EnableFeignClients
18 | @MapperScan("com.mvc.auth.mapper")
19 | @RemoteApplicationEventScan(basePackages = "com.mvc.auth.common.event")
20 | @EnableAutoConfiguration
21 | public class AuthBootstrap {
22 | public static void main(String[] args) {
23 | SpringApplication.run(AuthBootstrap.class, args);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/rpc/AuthService.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.rpc;
2 |
3 | import com.alibaba.fastjson.JSONObject;
4 | import com.mvc.user.entity.JwtAuthenticationRequest;
5 | import org.springframework.cloud.netflix.feign.FeignClient;
6 | import org.springframework.http.ResponseEntity;
7 | import org.springframework.web.bind.annotation.RequestBody;
8 | import org.springframework.web.bind.annotation.RequestMapping;
9 | import org.springframework.web.bind.annotation.RequestMethod;
10 |
11 |
12 | /**
13 | * @author qyc
14 | * @create 2017-06-21 8:11
15 | */
16 | @FeignClient("mvc-auth")
17 | public interface AuthService {
18 | /**
19 | * createAuthenticationToken
20 | *
21 | * @param authenticationRequest
22 | * @return
23 | */
24 | @RequestMapping(value = "jwt/token", method = RequestMethod.POST)
25 | public ResponseEntity createAuthenticationToken(
26 | @RequestBody JwtAuthenticationRequest authenticationRequest);
27 | }
28 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-client/src/main/java/com/mvc/auth/client/config/UserAuthConfig.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.client.config;
2 |
3 | import org.springframework.beans.factory.annotation.Value;
4 |
5 | import javax.servlet.http.HttpServletRequest;
6 |
7 | /**
8 | * @author qyc
9 | */
10 | public class UserAuthConfig {
11 |
12 | @Value("${auth.user.token-header}")
13 | private String tokenHeader;
14 |
15 | private byte[] pubKeyByte;
16 |
17 | public String getTokenHeader() {
18 | return tokenHeader;
19 | }
20 |
21 | public void setTokenHeader(String tokenHeader) {
22 | this.tokenHeader = tokenHeader;
23 | }
24 |
25 | public String getToken(HttpServletRequest request) {
26 | return request.getHeader(this.getTokenHeader());
27 | }
28 |
29 | public byte[] getPubKeyByte() {
30 | return pubKeyByte;
31 | }
32 |
33 | public void setPubKeyByte(byte[] pubKeyByte) {
34 | this.pubKeyByte = pubKeyByte;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-client/src/main/java/com/mvc/auth/client/configuration/AutoConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.client.configuration;
2 |
3 | import com.mvc.auth.client.config.ServiceAuthConfig;
4 | import com.mvc.auth.client.config.UserAuthConfig;
5 | import org.springframework.cloud.bus.jackson.RemoteApplicationEventScan;
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.context.annotation.ComponentScan;
8 | import org.springframework.context.annotation.Configuration;
9 |
10 | /**
11 | * @author qyc
12 | */
13 | @Configuration
14 | @ComponentScan({"com.mvc.auth.client", "com.mvc.auth.common.event"})
15 | @RemoteApplicationEventScan(basePackages = "com.mvc.auth.common.event")
16 | public class AutoConfiguration {
17 | @Bean
18 | ServiceAuthConfig getServiceAuthConfig() {
19 | return new ServiceAuthConfig();
20 | }
21 |
22 | @Bean
23 | UserAuthConfig getUserAuthConfig() {
24 | return new UserAuthConfig();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/mvc-console/src/main/java/com/mvc/console/config/druid/DruidStatViewServlet.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.config.druid;
2 |
3 | import com.alibaba.druid.support.http.StatViewServlet;
4 |
5 | import javax.servlet.annotation.WebServlet;
6 |
7 | /**
8 | * ${DESCRIPTION}
9 | *
10 | * @author wanghaobin
11 | * @create 2017-06-20 21:34
12 | */
13 | @SuppressWarnings("serial")
14 | @WebServlet(urlPatterns = "/druid/*",
15 | initParams={
16 | // @WebInitParam(name="allow",value="127.0.0.1,192.168.1.188"),// IP白名单 (没有配置或者为空,则允许所有访问)
17 | // @WebInitParam(name="deny",value="192.168.1.111"),// IP黑名单 (存在共同时,deny优先于allow)
18 | // @WebInitParam(name="loginUsername",value="user"),// 用户名
19 | // @WebInitParam(name="loginPassword",value="123456"),// 密码
20 | // @WebInitParam(name="resetEnable",value="false")// 禁用HTML页面上的“Reset All”功能
21 | })
22 | public class DruidStatViewServlet extends StatViewServlet {
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/mvc-admin-console/src/main/java/com/mvc/console/config/druid/DruidStatViewServlet.java:
--------------------------------------------------------------------------------
1 | package com.mvc.console.config.druid;
2 |
3 | import com.alibaba.druid.support.http.StatViewServlet;
4 |
5 | import javax.servlet.annotation.WebServlet;
6 |
7 | /**
8 | * ${DESCRIPTION}
9 | *
10 | * @author wanghaobin
11 | * @create 2017-06-20 21:34
12 | */
13 | @SuppressWarnings("serial")
14 | @WebServlet(urlPatterns = "/druid/*",
15 | initParams={
16 | // @WebInitParam(name="allow",value="127.0.0.1,192.168.1.188"),// IP白名单 (没有配置或者为空,则允许所有访问)
17 | // @WebInitParam(name="deny",value="192.168.1.111"),// IP黑名单 (存在共同时,deny优先于allow)
18 | // @WebInitParam(name="loginUsername",value="user"),// 用户名
19 | // @WebInitParam(name="loginPassword",value="123456"),// 密码
20 | // @WebInitParam(name="resetEnable",value="false")// 禁用HTML页面上的“Reset All”功能
21 | })
22 | public class DruidStatViewServlet extends StatViewServlet {
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/vo/AdminBalanceVO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model.vo;
2 |
3 | import com.alibaba.fastjson.JSONObject;
4 | import com.mvc.ethereum.utils.CoinUtil;
5 | import lombok.AllArgsConstructor;
6 | import lombok.Data;
7 | import lombok.NoArgsConstructor;
8 |
9 | import java.math.BigInteger;
10 |
11 | /**
12 | * AdminBalanceVO
13 | *
14 | * @author qiyichen
15 | * @create 2018/1/15 17:20
16 | */
17 | @Data
18 | @NoArgsConstructor
19 | @AllArgsConstructor
20 | public class AdminBalanceVO {
21 |
22 | private BigInteger balance;
23 | private WithdrawCount withdraw;
24 | private DepositeCount deposite;
25 | private LockCount lock;
26 | private BigInteger coinId;
27 | private BigInteger otherBalance;
28 |
29 | public Double getBalanceStr() {
30 | return CoinUtil.wei2Value(coinId, balance);
31 | }
32 |
33 | public Double getOtherBalanceStr() {
34 | return CoinUtil.wei2Value(coinId, otherBalance);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/mvc-ethereum/src/main/java/com/mvc/ethereum/model/vo/TransactionVO.java:
--------------------------------------------------------------------------------
1 | package com.mvc.ethereum.model.vo;
2 |
3 | import com.mvc.ethereum.model.Transaction;
4 | import com.mvc.ethereum.utils.CoinUtil;
5 | import lombok.Data;
6 |
7 | /**
8 | * TransactionVO
9 | *
10 | * @author qiyichen
11 | * @create 2018/1/15 14:33
12 | */
13 | @Data
14 | public class TransactionVO extends Transaction {
15 |
16 | public Double getQuantityStr(){
17 | return CoinUtil.wei2Value(super.getCoinId(), super.getQuantity());
18 | }
19 |
20 | public Double getActualQuantityStr(){
21 | return CoinUtil.wei2Value(super.getCoinId(), super.getActualQuantity());
22 | }
23 |
24 | public String getUnit(){
25 | return CoinUtil.getUnit(super.getCoinId());
26 | }
27 |
28 | public String getName(){
29 | return CoinUtil.getName(super.getCoinId());
30 | }
31 |
32 | public String getNameEn(){
33 | return CoinUtil.getNameEn(super.getCoinId());
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/mvc-common/src/main/java/com/mvc/common/util/ClientUtil.java:
--------------------------------------------------------------------------------
1 | package com.mvc.common.util;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 |
5 | /**
6 | * @author qyc
7 | */
8 | public class ClientUtil {
9 |
10 | private final static String UNKNOWN = "unknown";
11 |
12 | /**
13 | * 获取客户端真实ip
14 | *
15 | * @param request
16 | * @return
17 | */
18 | public static String getClientIp(HttpServletRequest request) {
19 | String ip = request.getHeader("x-forwarded-for");
20 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
21 | ip = request.getHeader("Proxy-Client-IP");
22 | }
23 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
24 | ip = request.getHeader("WL-Proxy-Client-IP");
25 | }
26 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
27 | ip = request.getRemoteAddr();
28 | }
29 | return ip;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-server/src/main/java/com/mvc/auth/feign/IUserService.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.feign;
2 |
3 | import com.mvc.api.vo.user.UserInfo;
4 | import com.mvc.auth.configuration.FeignConfiguration;
5 | import org.springframework.cloud.netflix.feign.FeignClient;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RequestMethod;
8 | import org.springframework.web.bind.annotation.RequestParam;
9 |
10 |
11 | /**
12 | * ${DESCRIPTION}
13 | *
14 | * @author wanghaobin
15 | * @create 2017-06-21 8:11
16 | */
17 | @FeignClient(value = "mvc-admin", configuration = FeignConfiguration.class)
18 | public interface IUserService {
19 | /**
20 | * validate
21 | *
22 | * @param username
23 | * @param password
24 | * @return
25 | */
26 | @RequestMapping(value = "/api/user/validate", method = RequestMethod.POST)
27 | public UserInfo validate(@RequestParam("username") String username, @RequestParam("password") String password);
28 | }
29 |
--------------------------------------------------------------------------------
/mvc-auth/mvc-auth-server/src/main/java/com/mvc/auth/util/user/JwtAuthenticationRequest.java:
--------------------------------------------------------------------------------
1 | package com.mvc.auth.util.user;
2 |
3 | import java.io.Serializable;
4 | /**
5 | * @author qyc
6 | */
7 | public class JwtAuthenticationRequest implements Serializable {
8 |
9 | private static final long serialVersionUID = -8445943548965154778L;
10 |
11 | private String username;
12 | private String password;
13 |
14 |
15 | public JwtAuthenticationRequest(String username, String password) {
16 | this.username = username;
17 | this.password = password;
18 | }
19 |
20 | public JwtAuthenticationRequest() {
21 | }
22 |
23 | public String getPassword() {
24 | return password;
25 | }
26 |
27 | public void setPassword(String password) {
28 | this.password = password;
29 | }
30 |
31 | public String getUsername() {
32 | return username;
33 | }
34 |
35 | public void setUsername(String username) {
36 | this.username = username;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/config/druid/DruidStatViewServlet.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.config.druid;
2 |
3 | import com.alibaba.druid.support.http.StatViewServlet;
4 |
5 | import javax.servlet.annotation.WebInitParam;
6 | import javax.servlet.annotation.WebServlet;
7 |
8 | /**
9 | * ${DESCRIPTION}
10 | *
11 | * @author wanghaobin
12 | * @create 2017-06-20 21:34
13 | */
14 | @SuppressWarnings("serial")
15 | @WebServlet(urlPatterns = "/druid/*",
16 | initParams={
17 | // @WebInitParam(name="allow",value="127.0.0.1,192.168.1.188"),// IP白名单 (没有配置或者为空,则允许所有访问)
18 | // @WebInitParam(name="deny",value="192.168.1.111"),// IP黑名单 (存在共同时,deny优先于allow)
19 | // @WebInitParam(name="loginUsername",value="user"),// 用户名
20 | // @WebInitParam(name="loginPassword",value="123456"),// 密码
21 | // @WebInitParam(name="resetEnable",value="false")// 禁用HTML页面上的“Reset All”功能
22 | })
23 | public class DruidStatViewServlet extends StatViewServlet {
24 |
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/mvc-admin/src/main/java/com/mvc/user/mapper/MenuMapper.java:
--------------------------------------------------------------------------------
1 | package com.mvc.user.mapper;
2 |
3 | import com.mvc.user.entity.Menu;
4 | import org.apache.ibatis.annotations.Param;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * @author qyc
11 | */
12 | public interface MenuMapper extends Mapper