├── ikeeping_common ├── src │ └── main │ │ ├── resources │ │ └── application.yml │ │ └── java │ │ └── com │ │ └── zz │ │ └── ikeeping │ │ └── common │ │ ├── model │ │ ├── ActiveCode.java │ │ ├── LoginToken.java │ │ └── EmailMsg.java │ │ ├── config │ │ ├── SnsConfig.java │ │ └── KodoConfig.java │ │ ├── exception │ │ └── UserException.java │ │ ├── vo │ │ ├── PageBean.java │ │ └── R.java │ │ └── util │ │ ├── Base64Util.java │ │ ├── CodeUtil.java │ │ └── FileUtil.java └── pom.xml ├── ikeeping_entity ├── src │ └── main │ │ ├── resources │ │ └── application.yml │ │ └── java │ │ └── com │ │ └── zz │ │ └── ikeeping │ │ └── entity │ │ ├── GoodsType.java │ │ ├── BMI.java │ │ ├── UserCoupon.java │ │ ├── UserPoint.java │ │ ├── StepCount.java │ │ ├── Community.java │ │ ├── NewsC.java │ │ ├── News.java │ │ ├── Comment.java │ │ ├── User.java │ │ ├── Address.java │ │ ├── OrderDetail.java │ │ ├── NewsDetail.java │ │ ├── Sign.java │ │ ├── Goods.java │ │ ├── Points.java │ │ ├── Transportation.java │ │ ├── Order.java │ │ ├── CommunityDetail.java │ │ └── Coupon.java └── pom.xml ├── ikeeping_payApi ├── src │ ├── main │ │ ├── resources │ │ │ └── application.yml │ │ └── java │ │ │ └── com │ │ │ └── zz │ │ │ └── ikeeping │ │ │ └── pay │ │ │ ├── config │ │ │ ├── SystemConfig.java │ │ │ ├── WechatPayConfig.java │ │ │ ├── SwaggerConfig.java │ │ │ └── AliPayConfig.java │ │ │ ├── entity │ │ │ ├── AliPay.java │ │ │ └── WechatPay.java │ │ │ ├── service │ │ │ ├── AliPayService.java │ │ │ ├── WechatPayService.java │ │ │ └── impl │ │ │ │ └── AliPayServiceImpl.java │ │ │ ├── PayApplication.java │ │ │ ├── controller │ │ │ ├── AliPayController.java │ │ │ ├── WechatPayController.java │ │ │ └── QrCodeController.java │ │ │ └── util │ │ │ └── MD5Util.java │ └── test │ │ └── java │ │ └── com │ │ └── zz │ │ └── ikeeping │ │ └── pay │ │ └── test │ │ └── PayTest.java └── pom.xml ├── .gitignore ├── ikeeping_resourceApi ├── src │ └── main │ │ ├── resources │ │ └── application.yml │ │ └── java │ │ └── com │ │ └── zz │ │ └── ikeeping │ │ └── api │ │ └── resource │ │ ├── config │ │ ├── KodoUtilConfig.java │ │ └── SwaggerConfig.java │ │ ├── ResourceApplication.java │ │ └── controller │ │ └── UploadController.java └── pom.xml ├── ikeeping_serverUser ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── zz │ │ │ └── ikeeping │ │ │ └── server │ │ │ └── user │ │ │ ├── dao │ │ │ ├── PointsMapper.java │ │ │ ├── CouponMapper.java │ │ │ ├── UserPointsMapper.java │ │ │ ├── UserMapper.java │ │ │ ├── UserSignDao.java │ │ │ └── AddressMapper.java │ │ │ ├── service │ │ │ ├── CouponService.java │ │ │ ├── UserSignService.java │ │ │ ├── UserService.java │ │ │ ├── AddressService.java │ │ │ └── impl │ │ │ │ ├── CouponServiceimpl.java │ │ │ │ └── AddressServiceImpl.java │ │ │ ├── util │ │ │ ├── RandomUtil.java │ │ │ └── UserTokenUtil.java │ │ │ ├── config │ │ │ └── RedisConfig.java │ │ │ ├── controller │ │ │ ├── CouponController.java │ │ │ ├── UserController.java │ │ │ ├── UserSignController.java │ │ │ └── AddressController.java │ │ │ └── IkeepingUserApplication.java │ │ └── resources │ │ ├── application.yml │ │ └── mapper │ │ ├── CouponMapper.xml │ │ ├── UserSignMapper.xml │ │ ├── UserPointsMapper.xml │ │ └── PointsMapper.xml └── pom.xml ├── ikeeping_serverShop └── src │ └── main │ ├── java │ └── com │ │ └── zz │ │ └── ikeeping │ │ └── server │ │ └── shop │ │ ├── service │ │ ├── GoodsTypeService.java │ │ ├── T.java │ │ ├── GoodsService.java │ │ └── impl │ │ │ └── GoodsTypeServiceImpl.java │ │ ├── dto │ │ └── GoodsDTO.java │ │ ├── dao │ │ ├── UserMapper.java │ │ ├── OrderMapper.java │ │ ├── CouponMapper.java │ │ ├── UserCouponMapper.java │ │ ├── OrderDetailMapper.java │ │ ├── GoodsTypeMapper.java │ │ └── GoodsMapper.java │ │ ├── controller │ │ ├── GoodsTypeController.java │ │ └── GoodsController.java │ │ └── ServerShopApplication.java │ └── resources │ └── application.yml ├── ikeeping_serverLogin ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── zz │ │ │ └── ikeeping │ │ │ └── service │ │ │ └── login │ │ │ ├── common │ │ │ └── ProjectConfig.java │ │ │ ├── model │ │ │ └── LoginToken.java │ │ │ ├── dao │ │ │ ├── UserInfoDao.java │ │ │ ├── UserDao.java │ │ │ ├── OrdersStatusDao.java │ │ │ ├── UserLogDao.java │ │ │ └── CartDao.java │ │ │ ├── vo │ │ │ └── CartVo.java │ │ │ ├── service │ │ │ ├── LoginService.java │ │ │ ├── OrdersStstusService.java │ │ │ ├── UserUpdateService.java │ │ │ ├── CartVoService.java │ │ │ └── impl │ │ │ │ ├── OrdersStstusServiceImpl.java │ │ │ │ ├── CartVoServiceImpl.java │ │ │ │ └── UserUpdateServiceImpl.java │ │ │ ├── config │ │ │ ├── RedisConfig.java │ │ │ └── IdGeneratorConfig.java │ │ │ ├── LoginApplication.java │ │ │ ├── utils │ │ │ └── UserTokenUtil.java │ │ │ └── controller │ │ │ └── LoginController.java │ │ └── resources │ │ ├── mapper │ │ ├── OrdersStatus.xml │ │ ├── Cart.xml │ │ └── UserInfoUpdate.xml │ │ └── application.yml └── pom.xml ├── ikeeping_sns ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── zz │ │ │ └── ikeeping │ │ │ └── sns │ │ │ ├── dao │ │ │ ├── CommunityMapper.java │ │ │ ├── CommunityDetailMapper.java │ │ │ └── CommentMapper.java │ │ │ ├── vo │ │ │ └── VCommunityDetail.java │ │ │ ├── config │ │ │ └── RedisConfig.java │ │ │ ├── SnsApplication.java │ │ │ └── service │ │ │ └── SnsService.java │ │ └── resources │ │ ├── mapper │ │ ├── CommunityMapper.xml │ │ ├── CommentMapper.xml │ │ └── CommunityDetailMapper.xml │ │ └── application.yml └── pom.xml ├── ikeeping_sports ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── zz │ │ │ └── ikeeping │ │ │ └── sports │ │ │ ├── dao │ │ │ ├── BMIMapper.java │ │ │ └── StepCountMapper.java │ │ │ ├── service │ │ │ ├── PhysiqueService.java │ │ │ ├── StepCountService.java │ │ │ ├── SportsService.java │ │ │ └── impl │ │ │ │ ├── StepCountServiceImpl.java │ │ │ │ ├── SportsServiceImpl.java │ │ │ │ └── PhysiqueServiceImpl.java │ │ │ ├── config │ │ │ └── BMIType.java │ │ │ ├── controller │ │ │ ├── SportsController.java │ │ │ ├── PhysiqueController.java │ │ │ └── StepCountController.java │ │ │ └── SportsApplication.java │ │ └── resources │ │ ├── application.yml │ │ └── mapper │ │ ├── BMIMapper.xml │ │ └── StepCountMapper.xml └── pom.xml ├── ikeeping_api ├── src │ └── main │ │ ├── resources │ │ ├── application.yml │ │ └── static │ │ │ └── index.html │ │ └── java │ │ └── com │ │ └── zz │ │ └── ikeeping │ │ └── ikeeping_api │ │ ├── service │ │ ├── GoodsTypeService.java │ │ ├── SportsService.java │ │ ├── CouponService.java │ │ ├── UserSignService.java │ │ ├── PhysiqueService.java │ │ ├── StepCountService.java │ │ ├── AddressService.java │ │ ├── UserService.java │ │ ├── GoodsService.java │ │ └── SnsService.java │ │ ├── controller │ │ ├── GoodsTypeController.java │ │ ├── SportsController.java │ │ ├── CouponController.java │ │ ├── PhysiqueController.java │ │ ├── StepCountController.java │ │ ├── UserController.java │ │ ├── UserSignController.java │ │ ├── GoodsController.java │ │ └── AddressController.java │ │ ├── IkeepingApiApplication.java │ │ └── config │ │ └── SwaggerConfig.java └── pom.xml ├── ikeeping_loginApi ├── src │ └── main │ │ ├── resources │ │ └── application.yml │ │ └── java │ │ └── com │ │ └── zz │ │ └── ikeeping │ │ └── api │ │ └── login │ │ ├── LoginApiApplication.java │ │ ├── config │ │ └── SwaggerConfig.java │ │ ├── service │ │ └── LoginService.java │ │ └── controller │ │ └── LoginController.java └── pom.xml ├── ikeeping_news ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── zz │ │ │ └── ikeeping │ │ │ └── news │ │ │ ├── service │ │ │ ├── NewsCService.java │ │ │ ├── NewsService.java │ │ │ ├── NewsDetailService.java │ │ │ └── impl │ │ │ │ └── NewsServiceImpl.java │ │ │ ├── dao │ │ │ ├── NewsCMapper.java │ │ │ ├── NewsMapper.java │ │ │ └── NewsDetailMapper.java │ │ │ ├── config │ │ │ ├── RedisConfig.java │ │ │ └── SwaggerConfig.java │ │ │ ├── vo │ │ │ └── VNewDetail.java │ │ │ ├── NewsApplication.java │ │ │ ├── test │ │ │ └── random.java │ │ │ └── controller │ │ │ ├── NewCController.java │ │ │ ├── NewsController.java │ │ │ └── NewsDetailController.java │ │ └── resources │ │ ├── application.yml │ │ └── mapper │ │ ├── NewsMapper.xml │ │ └── NewsCMapper.xml └── pom.xml ├── ikeeping_message └── src │ └── main │ ├── java │ └── com │ │ └── zz │ │ └── ikeeping │ │ └── message │ │ ├── core │ │ ├── dao │ │ │ ├── MessageMapper.java │ │ │ ├── MsgReceiveMapper.java │ │ │ └── MessageLogMapper.java │ │ ├── entity │ │ │ ├── MsgReceive.java │ │ │ ├── MessageLog.java │ │ │ └── Message.java │ │ ├── service │ │ │ └── MessageService.java │ │ └── controller │ │ │ └── MessageController.java │ │ ├── config │ │ ├── RedisConfig.java │ │ └── SwaggerConfig.java │ │ └── MessageApplication.java │ └── resources │ ├── application.yml │ └── mapper │ ├── MsgReceiveMapper.xml │ ├── MessageLogMapper.xml │ └── MessageMapper.xml ├── ikeeping_eureka ├── src │ └── main │ │ ├── resources │ │ └── application.yml │ │ └── java │ │ └── com │ │ └── zz │ │ └── ikeeping │ │ └── eureka │ │ └── EurekaApplication.java └── pom.xml ├── ikeeping_esApi └── pom.xml ├── ikeeping_transportation └── pom.xml └── readme.md /ikeeping_common/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ikeeping_entity/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9308 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Example user template template 3 | ### Example user template 4 | 5 | # IntelliJ project files 6 | .idea 7 | *.iml 8 | out 9 | gen 10 | -------------------------------------------------------------------------------- /ikeeping_resourceApi/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9804 3 | spring: 4 | servlet: 5 | multipart: 6 | max-file-size: 10MB #单个文件最大限制 7 | max-request-size: 100MB #单个请求最大限制 -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/dao/PointsMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.dao; 2 | 3 | import com.zz.ikeeping.entity.Points; 4 | 5 | public interface PointsMapper { 6 | int insert(Points record); 7 | 8 | } -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/service/GoodsTypeService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | 5 | public interface GoodsTypeService { 6 | R selectAll(); 7 | } 8 | -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/service/T.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop.service; 2 | 3 | /** 4 | * @author DJL 5 | * @create 2019-06-25 21:42 6 | * @desc ${DESCRIPTION} 7 | **/ 8 | public class T { 9 | } 10 | -------------------------------------------------------------------------------- /ikeeping_common/src/main/java/com/zz/ikeeping/common/model/ActiveCode.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.common.model; 2 | 3 | import lombok.Data; 4 | 5 | 6 | @Data 7 | public class ActiveCode { 8 | private String email; 9 | private int code; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /ikeeping_common/src/main/java/com/zz/ikeeping/common/config/SnsConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.common.config; 2 | 3 | public class SnsConfig { 4 | public static final String PAGEVIEWUSER = "pageViewUser:"; 5 | public static final String PAGEVIEWCOUNT = "pageViewCount:"; 6 | } 7 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/common/ProjectConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.common; 2 | 3 | public class ProjectConfig { 4 | //登录日志 5 | public static final String LOGINLOG="log:";//log:uid+flag+createtime+content 6 | 7 | } 8 | -------------------------------------------------------------------------------- /ikeeping_common/src/main/java/com/zz/ikeeping/common/model/LoginToken.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.common.model; 2 | 3 | 4 | import lombok.Data; 5 | 6 | @Data 7 | public class LoginToken { 8 | private String id; 9 | private String phone; 10 | private int uid; 11 | } 12 | -------------------------------------------------------------------------------- /ikeeping_sns/src/main/java/com/zz/ikeeping/sns/dao/CommunityMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sns.dao; 2 | 3 | 4 | import com.zz.ikeeping.entity.Community; 5 | 6 | import java.util.List; 7 | 8 | public interface CommunityMapper { 9 | List showTopicType(); 10 | 11 | } -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/GoodsType.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class GoodsType { 7 | private Integer id; 8 | 9 | private String typename; 10 | 11 | private Integer typelevel; 12 | 13 | } -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/model/LoginToken.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.model; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoginToken { 7 | private String id; 8 | private String phone; 9 | private int uid; 10 | } 11 | -------------------------------------------------------------------------------- /ikeeping_sports/src/main/java/com/zz/ikeeping/sports/dao/BMIMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sports.dao; 2 | 3 | import com.zz.ikeeping.entity.BMI; 4 | 5 | import java.util.List; 6 | 7 | public interface BMIMapper { 8 | int insert (BMI bmi); 9 | List findByUid(int uid); 10 | } 11 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | serviceUrl: 4 | defaultZone: http://localhost:8761/eureka/ 5 | spring: 6 | application: 7 | name: ApiDataConsumer 8 | main: 9 | allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册 10 | server: 11 | port: 9801 12 | -------------------------------------------------------------------------------- /ikeeping_loginApi/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | serviceUrl: 4 | defaultZone: http://localhost:8761/eureka/ 5 | spring: 6 | application: 7 | name: ApiLoginConsumer 8 | server: 9 | port: 9803 10 | feign: 11 | httpclient: 12 | enabled: true 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/service/NewsCService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.NewsC; 5 | 6 | public interface NewsCService { 7 | 8 | R update(NewsC c); 9 | 10 | R insert(NewsC c); 11 | } 12 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/dao/CouponMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.dao; 2 | import com.zz.ikeeping.entity.Coupon; 3 | 4 | import java.util.List; 5 | 6 | public interface CouponMapper { 7 | int insert(Coupon record); 8 | List findAll(); 9 | } 10 | -------------------------------------------------------------------------------- /ikeeping_common/src/main/java/com/zz/ikeeping/common/exception/UserException.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.common.exception; 2 | 3 | 4 | public class UserException extends Exception { 5 | public UserException(){ 6 | 7 | } 8 | public UserException(String msg){ 9 | super(msg); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/BMI.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class BMI { 7 | private Integer id; 8 | private Integer uid; 9 | private Float weight; 10 | private Float hight; 11 | private Integer status; 12 | } 13 | -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/UserCoupon.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class UserCoupon { 7 | private Integer id; 8 | 9 | private Integer uid; 10 | 11 | private Integer cpid; 12 | 13 | private Integer flag; 14 | 15 | } -------------------------------------------------------------------------------- /ikeeping_sports/src/main/java/com/zz/ikeeping/sports/service/PhysiqueService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sports.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.BMI; 5 | 6 | public interface PhysiqueService { 7 | String calBMI(BMI bmi); 8 | R findByUid(int uid); 9 | } 10 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/service/CouponService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.Coupon; 5 | 6 | public interface CouponService { 7 | R save(Coupon coupon); 8 | R findAll(); 9 | } 10 | -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/UserPoint.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class UserPoint { 7 | private Integer id; 8 | 9 | private Integer uid; 10 | 11 | private Integer totalscore; 12 | 13 | private Integer currscore; 14 | 15 | } -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/StepCount.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | import java.util.Date; 5 | 6 | @Data 7 | public class StepCount { 8 | private Integer id; 9 | private Integer uid; 10 | private Integer stepcount; 11 | private Date daydate; 12 | } 13 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/dao/NewsCMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news.dao; 2 | 3 | import com.zz.ikeeping.entity.NewsC; 4 | 5 | public interface NewsCMapper { 6 | 7 | 8 | int insert(NewsC record); 9 | 10 | int update(NewsC record); 11 | 12 | NewsC selectOne(Integer nid); 13 | 14 | 15 | } -------------------------------------------------------------------------------- /ikeeping_sports/src/main/java/com/zz/ikeeping/sports/dao/StepCountMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sports.dao; 2 | 3 | import com.zz.ikeeping.entity.StepCount; 4 | 5 | import java.util.List; 6 | 7 | public interface StepCountMapper { 8 | int insert (StepCount stepCount); 9 | List findByUid(int uid); 10 | } 11 | -------------------------------------------------------------------------------- /ikeeping_sports/src/main/java/com/zz/ikeeping/sports/service/StepCountService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sports.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.StepCount; 5 | 6 | public interface StepCountService { 7 | R insert(StepCount stepCount); 8 | R findByUid(int uid); 9 | } 10 | -------------------------------------------------------------------------------- /ikeeping_sports/src/main/java/com/zz/ikeeping/sports/service/SportsService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sports.service; 2 | 3 | public interface SportsService { 4 | /** 5 | * 计算BMI指数 6 | * @param weight 7 | * @param height 8 | * @return 9 | */ 10 | public String calBMI(float weight,float height); 11 | } 12 | -------------------------------------------------------------------------------- /ikeeping_message/src/main/java/com/zz/ikeeping/message/core/dao/MessageMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.message.core.dao; 2 | 3 | import com.zz.ikeeping.message.core.entity.Message; 4 | 5 | import java.util.List; 6 | 7 | public interface MessageMapper { 8 | 9 | int insert(Message record); 10 | 11 | List selectAll(); 12 | } -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/dao/UserInfoDao.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.dao; 2 | 3 | import com.zz.ikeeping.entity.User; 4 | import org.springframework.web.bind.annotation.RequestParam; 5 | 6 | public interface UserInfoDao { 7 | //更新用户的信息 8 | int userInfoupdate(User user); 9 | } 10 | -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/java/com/zz/ikeeping/pay/config/SystemConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay.config; 2 | 3 | /** 4 | * @author DJL 5 | * @create 2019-06-27 22:12 6 | * @desc 支付系统配置 7 | **/ 8 | public class SystemConfig { 9 | 10 | // 支付系统的URL地址或域名 11 | public static final String PAYURL = "http://localhost:9308/"; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/Community.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class Community { 9 | private Integer cmid; 10 | 11 | private String cmtitle; 12 | 13 | private String cmimgurl; 14 | 15 | private Date cmtime; 16 | 17 | } -------------------------------------------------------------------------------- /ikeeping_message/src/main/java/com/zz/ikeeping/message/core/dao/MsgReceiveMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.message.core.dao; 2 | 3 | import com.zz.ikeeping.message.core.entity.MsgReceive; 4 | 5 | import java.util.List; 6 | 7 | public interface MsgReceiveMapper { 8 | 9 | int insert(MsgReceive record); 10 | 11 | List selectAll(); 12 | } -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/dao/NewsMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news.dao; 2 | 3 | import com.zz.ikeeping.entity.News; 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | public interface NewsMapper { 9 | 10 | void insert(News record); 11 | 12 | List selectAll(Map map); 13 | 14 | 15 | } -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/NewsC.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class NewsC { 7 | private Integer id; 8 | 9 | private Integer nid; 10 | 11 | private String comment; 12 | private Integer pcount;//点赞数 13 | 14 | private Integer ccount;//评论数 15 | 16 | 17 | } -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/util/RandomUtil.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.util; 2 | 3 | import java.util.Random; 4 | 5 | 6 | public class RandomUtil { 7 | public static int createNum(int start,int end){ 8 | Random random=new Random(); 9 | return random.nextInt(end-start)+start; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ikeeping_message/src/main/java/com/zz/ikeeping/message/core/entity/MsgReceive.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.message.core.entity; 2 | 3 | import lombok.Data; 4 | import java.util.Date; 5 | 6 | @Data 7 | public class MsgReceive { 8 | private Long id; 9 | 10 | private String no; 11 | 12 | private Date createtime; 13 | 14 | private Integer flag; 15 | 16 | } -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/dao/UserPointsMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.dao; 2 | 3 | import com.zz.ikeeping.entity.Points; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | public interface UserPointsMapper { 7 | int insert(Points record); 8 | int update(@Param("uid") int uid, @Param("score") int score); 9 | 10 | } -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/News.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class News { 9 | private Integer id; 10 | 11 | private String newstype; 12 | 13 | private String imgurl; 14 | 15 | private String content; 16 | 17 | private Date pubtime; 18 | 19 | } -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/Comment.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Comment { 7 | private Integer id; 8 | 9 | private Integer ruid; 10 | 11 | private Integer uid; 12 | 13 | private Integer cmid; 14 | 15 | private String content; 16 | 17 | private String imgurl; 18 | 19 | } -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | private Integer uid; 8 | 9 | private String uname; 10 | 11 | private String phone; 12 | 13 | private String password; 14 | 15 | private String imgurl; 16 | 17 | private Integer flag; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/Address.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Address { 7 | private Integer addid; 8 | 9 | private Integer uid; 10 | 11 | private String addname; 12 | 13 | private String addtel; 14 | 15 | private String address; 16 | 17 | private Integer flag; 18 | 19 | 20 | } -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/OrderDetail.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class OrderDetail { 7 | private Integer id; 8 | 9 | private Integer oid; 10 | 11 | private Integer gid; 12 | 13 | private String odid; 14 | 15 | private Integer goodscount; 16 | 17 | private Double price; 18 | 19 | } -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/vo/CartVo.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.vo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CartVo { 7 | /** 8 | * @author : nick 9 | * @date : 2019-06-29 20:10 10 | **/ 11 | private String name; 12 | private String imgurl; 13 | private int price; 14 | private int goodscount; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ikeeping_eureka/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | #服务器端口号 Eureka默认的端口号 8761 2 | server: 3 | port: 8761 4 | eureka: 5 | instance: 6 | hostname: localhost #服务器地址 7 | client: 8 | register-with-eureka: false #是否注册 注册中心不需要注册 默认开启需关闭 9 | fetch-registry: false #检查注册中心 默认开启需关闭 10 | service-url: 11 | defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ #提供者和消费者要使用的地址 -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/service/UserSignService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.service; 2 | 3 | 4 | import com.zz.ikeeping.common.vo.R; 5 | 6 | 7 | public interface UserSignService { 8 | R saveSign(String token); 9 | R queryByDays(String token, int days); 10 | R queryByUid(String token); 11 | R querySingle(String token); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ikeeping_message/src/main/java/com/zz/ikeeping/message/core/entity/MessageLog.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.message.core.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class MessageLog { 9 | private Long id; 10 | 11 | private Long mid; 12 | 13 | private Date createtime; 14 | 15 | private String ip; 16 | 17 | private String info; 18 | 19 | } -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.dao; 2 | 3 | import com.zz.ikeeping.entity.User; 4 | import org.apache.ibatis.annotations.Select; 5 | 6 | public interface UserDao { 7 | //根据手机查询用户 8 | @Select("select * from t_user where flag=1 and phone=#{phone}") 9 | User selectByPhone(String phone); 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/service/LoginService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.service; 2 | 3 | 4 | import com.zz.ikeeping.common.vo.R; 5 | 6 | 7 | public interface LoginService { 8 | //实现登录 9 | R login(String phone, String pass); 10 | //校验登录有效性 11 | R checkLogin(String token); 12 | //注销 13 | R exitLogin(String token); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/NewsDetail.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class NewsDetail { 7 | private Integer id; 8 | 9 | private Integer rewardcount; 10 | 11 | private Integer readcount; 12 | 13 | private Integer cid; 14 | 15 | private Integer gid; 16 | 17 | private String detailcontent; 18 | 19 | 20 | } -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/Sign.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class Sign { 9 | private Integer id; 10 | 11 | private Integer uid; 12 | 13 | private Integer score; 14 | 15 | private Integer extrascore; 16 | 17 | private Date createtime; 18 | 19 | private Integer days; 20 | 21 | } -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/service/OrdersStstusService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | 6 | public interface OrdersStstusService { 7 | //根据状态查询订单 8 | @GetMapping("/order/selectByStatus.do") 9 | R selectByStatus(int status, int uid); 10 | } 11 | -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/dto/GoodsDTO.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class GoodsDTO { 7 | private Integer id; 8 | 9 | private String name; 10 | 11 | private Integer price; 12 | 13 | private String imgurl; 14 | 15 | private Integer goodstype; 16 | 17 | private Integer sellcount; 18 | } 19 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | iKeeping-爱健身 小程序App API接口地址导航 6 | 7 | 8 | 9 |

10 |
    11 |
  1. 统一API数据接口文档
  2. 12 |
  3. 源码地址
  4. 13 |
14 |

15 | 16 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/dao/OrdersStatusDao.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.dao; 2 | 3 | import com.zz.ikeeping.entity.Order; 4 | 5 | import java.util.List; 6 | 7 | public interface OrdersStatusDao { 8 | /** 9 | * @author : nick 10 | * @date : 2019-07-01 20:47 11 | **/ 12 | 13 | //根据状态查询相应的订单 14 | List selectByStatus(int status ,int uid); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.dao; 2 | 3 | 4 | import com.zz.ikeeping.entity.User; 5 | 6 | public interface UserMapper { 7 | 8 | // 注册手机号 9 | int insert(User record); 10 | // 根据手机号查找用户有没有注册过 11 | User selectByPhone(String phone); 12 | /* // 根据手机号完善用户信息 13 | User updeteByPhone(String phone);*/ 14 | 15 | 16 | 17 | } -------------------------------------------------------------------------------- /ikeeping_sns/src/main/java/com/zz/ikeeping/sns/vo/VCommunityDetail.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sns.vo; 2 | 3 | import com.zz.ikeeping.entity.CommunityDetail; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class VCommunityDetail extends CommunityDetail { 8 | //用户信息 9 | private Integer uid; 10 | private String imgurl; 11 | private String uname; 12 | 13 | //评论内容 14 | private String content; 15 | } 16 | -------------------------------------------------------------------------------- /ikeeping_sports/src/main/java/com/zz/ikeeping/sports/config/BMIType.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sports.config; 2 | 3 | public enum BMIType { 4 | slim("偏瘦"),normal("正常"),obesity("肥胖"),overweight("偏重"),health("健康"),hubHeath("亚健康"); 5 | private String value; 6 | private BMIType(String value){ 7 | this.value = value; 8 | } 9 | public String getValue(){ 10 | return value; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/Goods.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Goods { 7 | private Integer id; 8 | 9 | private String name; 10 | 11 | private Integer price; 12 | 13 | private Integer flag; 14 | 15 | private String imgurl; 16 | 17 | private Integer goodstype; 18 | 19 | private Integer goodscount; 20 | 21 | } -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/java/com/zz/ikeeping/pay/entity/AliPay.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay.entity; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @author DJL 7 | * @create 2019-06-28 19:51 8 | * @desc ${DESCRIPTION} 9 | **/ 10 | @Data 11 | public class AliPay { 12 | //订单编号 13 | private String out_trade_no; 14 | //价格 15 | private double total_amount; 16 | //商品信息 17 | private String subject; 18 | } 19 | -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/java/com/zz/ikeeping/pay/entity/WechatPay.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay.entity; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @author DJL 7 | * @create 2019-06-27 22:03 8 | * @desc ${DESCRIPTION} 9 | **/ 10 | @Data 11 | public class WechatPay { 12 | // 订单号 13 | private String orderNo; 14 | // 订单信息 15 | private String orderInfo; 16 | // 订单交易金额 17 | private int price; 18 | } 19 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news.config; 2 | 3 | import com.zz.ikeeping.common.util.JedisUtil; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | @Configuration 8 | public class RedisConfig { 9 | @Bean 10 | public JedisUtil createJu(){ 11 | return JedisUtil.getInstance(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/service/NewsService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.News; 5 | import org.springframework.web.multipart.MultipartFile; 6 | 7 | import java.util.Map; 8 | 9 | public interface NewsService { 10 | R insert(News record); 11 | 12 | 13 | 14 | R queryPage(Map map); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/service/GoodsTypeService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import org.springframework.cloud.openfeign.FeignClient; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | 7 | @FeignClient(name = "ShopProvider") 8 | public interface GoodsTypeService { 9 | @GetMapping("/goodstype/all") 10 | R all(); 11 | } 12 | -------------------------------------------------------------------------------- /ikeeping_message/src/main/java/com/zz/ikeeping/message/core/entity/Message.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.message.core.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Message { 7 | private Long id; 8 | 9 | private Integer pcode; 10 | 11 | private Integer type; 12 | 13 | private String title; 14 | 15 | private String content; 16 | 17 | private String receive; 18 | 19 | private Integer flag; 20 | 21 | } -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/dao/UserLogDao.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.dao; 2 | 3 | import org.apache.ibatis.annotations.Insert; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | public interface UserLogDao { 7 | @Insert("insert into userlog(uid,flag,content,createtime) values(#{uid},2,#{content},now())") 8 | int save(@Param("uid") int uid, @Param("content") String content); 9 | } 10 | -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/Points.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class Points { 9 | private Integer id; 10 | 11 | private Integer uid; 12 | 13 | private Integer score; 14 | 15 | private String info; 16 | 17 | private Date startdate; 18 | 19 | private Date enddate; 20 | 21 | private Integer flag; 22 | 23 | } -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/service/UserUpdateService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.User; 5 | import org.springframework.web.bind.annotation.RequestParam; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | 9 | public interface UserUpdateService { 10 | //更改用户信息 11 | R UserInfoUpdate(User user); 12 | } 13 | -------------------------------------------------------------------------------- /ikeeping_sns/src/main/java/com/zz/ikeeping/sns/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sns.config; 2 | 3 | import com.zz.ikeeping.common.util.JedisUtil; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | 8 | @Configuration 9 | public class RedisConfig { 10 | @Bean 11 | public JedisUtil createJU(){ 12 | return JedisUtil.getInstance(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/vo/VNewDetail.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news.vo; 2 | 3 | import com.zz.ikeeping.entity.NewsDetail; 4 | import lombok.Data; 5 | 6 | import java.util.Date; 7 | 8 | @Data 9 | public class VNewDetail extends NewsDetail { 10 | private String imgurl; 11 | private Date pubtime; 12 | private String newstype; 13 | private String comment; 14 | private Integer ccount; 15 | private Integer pcount; 16 | } 17 | -------------------------------------------------------------------------------- /ikeeping_common/src/main/java/com/zz/ikeeping/common/vo/PageBean.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.common.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | *@Author feri 9 | *@Date Created in 2019/6/19 15:58 10 | */ 11 | @Data 12 | public class PageBean { 13 | private int currPage;//当前页 14 | private int totalCount;//总条数 15 | private int count;//每页显示多少条 16 | private int totalPage;//总页数 17 | private List data;//数据 18 | } 19 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/service/NewsDetailService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.NewsDetail; 5 | 6 | public interface NewsDetailService { 7 | //咨询绑定id 8 | R selectAll(Integer id); 9 | 10 | R update(NewsDetail detail); 11 | 12 | R push(String newstype); 13 | 14 | R pushgood(String name); 15 | //咨询id 16 | R sale(int id); 17 | } 18 | -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/Transportation.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class Transportation { 9 | private Integer id; 10 | 11 | private Integer uid; 12 | 13 | private Integer oid; 14 | 15 | private String fromaddress; 16 | 17 | private String curraddress; 18 | 19 | private Date datetime; 20 | 21 | private Integer aid; 22 | 23 | } -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/resources/mapper/OrdersStatus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /ikeeping_message/src/main/java/com/zz/ikeeping/message/core/dao/MessageLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.message.core.dao; 2 | 3 | import com.zz.ikeeping.message.core.entity.MessageLog; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | public interface MessageLogMapper { 9 | 10 | int insert(MessageLog record); 11 | List selectByPage(@Param("index") int index, @Param("count") int count); 12 | long selectCount(); 13 | } -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.config; 2 | 3 | import com.zz.ikeeping.common.util.JedisUtil; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | 8 | @Configuration 9 | public class RedisConfig { 10 | @Bean 11 | public JedisUtil createJU(){ 12 | return JedisUtil.getInstance(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.config; 2 | 3 | 4 | import com.zz.ikeeping.common.util.JedisUtil; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | 9 | @Configuration 10 | public class RedisConfig { 11 | @Bean 12 | public JedisUtil createJU(){ 13 | return JedisUtil.getInstance(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/config/IdGeneratorConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.config; 2 | 3 | import com.zz.ikeeping.common.util.IdGenerator; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | 8 | @Configuration 9 | public class IdGeneratorConfig { 10 | @Bean 11 | public IdGenerator createIG(){ 12 | return new IdGenerator(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/dao/CartDao.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.dao; 2 | 3 | import com.zz.ikeeping.service.login.vo.CartVo; 4 | import org.springframework.web.bind.annotation.RequestParam; 5 | 6 | import java.util.List; 7 | 8 | public interface CartDao { 9 | //查询购物车里的所有订单 10 | List selectAll(); 11 | //用户购买后 根据id删除购物车的订单 12 | int deleteById(@RequestParam(value="id",required=true) List id); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/Order.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class Order { 9 | private Integer id; 10 | 11 | private Integer uid; 12 | 13 | private Integer status; 14 | 15 | private Date datetime; 16 | 17 | private Double totalprice; 18 | 19 | private Date modtime; 20 | 21 | private Double goodsprice; 22 | 23 | private Integer aid; 24 | 25 | } -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop.dao; 2 | 3 | import com.zz.ikeeping.entity.User; 4 | 5 | public interface UserMapper { 6 | int deleteByPrimaryKey(Integer uid); 7 | 8 | int insert(User record); 9 | 10 | int insertSelective(User record); 11 | 12 | User selectByPrimaryKey(Integer uid); 13 | 14 | int updateByPrimaryKeySelective(User record); 15 | 16 | int updateByPrimaryKey(User record); 17 | } -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/CommunityDetail.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class CommunityDetail { 9 | private Integer id; 10 | 11 | private Integer cmid; 12 | 13 | private Integer uid; 14 | 15 | private Date pubtime; 16 | 17 | private String location; 18 | 19 | private String content; 20 | 21 | private String imgurl; 22 | 23 | private Integer count; 24 | } -------------------------------------------------------------------------------- /ikeeping_entity/src/main/java/com/zz/ikeeping/entity/Coupon.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class Coupon { 9 | private Integer id; 10 | 11 | private String type; 12 | 13 | private Integer money; 14 | 15 | private Integer totalcount; 16 | 17 | private Date startdate; 18 | 19 | private Integer days; 20 | 21 | private Integer sendcount; 22 | 23 | private Integer usedcount; 24 | 25 | } -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/dao/OrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop.dao; 2 | 3 | import com.zz.ikeeping.entity.Order; 4 | 5 | public interface OrderMapper { 6 | int deleteByPrimaryKey(Integer id); 7 | 8 | int insert(Order record); 9 | 10 | int insertSelective(Order record); 11 | 12 | Order selectByPrimaryKey(Integer id); 13 | 14 | int updateByPrimaryKeySelective(Order record); 15 | 16 | int updateByPrimaryKey(Order record); 17 | } -------------------------------------------------------------------------------- /ikeeping_sns/src/main/resources/mapper/CommunityMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | cmid, cmname, cmimgurl, cmtime 7 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/dao/CouponMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop.dao; 2 | 3 | import com.zz.ikeeping.entity.Coupon; 4 | 5 | public interface CouponMapper { 6 | int deleteByPrimaryKey(Integer id); 7 | 8 | int insert(Coupon record); 9 | 10 | int insertSelective(Coupon record); 11 | 12 | Coupon selectByPrimaryKey(Integer id); 13 | 14 | int updateByPrimaryKeySelective(Coupon record); 15 | 16 | int updateByPrimaryKey(Coupon record); 17 | } -------------------------------------------------------------------------------- /ikeeping_common/src/main/java/com/zz/ikeeping/common/config/KodoConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.common.config; 2 | 3 | /** 4 | * @author DJL 5 | * @create 2019-06-26 21:13 6 | * @desc 七牛云存储配置信息 7 | **/ 8 | public class KodoConfig { 9 | 10 | // 七牛KODO 11 | public static final String KODO_ACCESSKEY = "M99LJ7JghYv9eEYhSqu0CVYEZvft24Wj838PBexk"; 12 | public static final String KODO_SECRETKEY = "1Ncq8DFnSxT-kPckxC9s4Tz9_QJ09K7EZeQpuyMG"; 13 | public static final String KODO_BUCKET = "djlshop"; 14 | } 15 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/dao/UserSignDao.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.dao; 2 | 3 | 4 | import com.zz.ikeeping.entity.Sign; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | 9 | public interface UserSignDao { 10 | int insert(Sign sign); 11 | List selectByUid(int uid); 12 | Sign selectByUidLast(int uid); 13 | //近 5天的签到数据 近30天的签到数据 14 | List selectByUidDays(@Param("uid") int uid, @Param("days") int days); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ikeeping_message/src/main/java/com/zz/ikeeping/message/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.message.config; 2 | 3 | 4 | import com.zz.ikeeping.common.util.JedisUtil; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | *@Author feri 10 | *@Date Created in 2019/6/13 11:35 11 | */ 12 | @Configuration 13 | public class RedisConfig { 14 | @Bean 15 | public JedisUtil createJU(){ 16 | return JedisUtil.getInstance(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/java/com/zz/ikeeping/pay/service/AliPayService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay.service; 2 | 3 | 4 | import com.zz.ikeeping.common.vo.R; 5 | import com.zz.ikeeping.pay.entity.AliPay; 6 | 7 | /** 8 | * @author DJL 9 | * @create 2019-06-28 19:55 10 | * @desc ${DESCRIPTION} 11 | **/ 12 | public interface AliPayService { 13 | 14 | // 生成订单支付信息 15 | R orderPay(AliPay pay); 16 | 17 | // 查询订单支付状态 18 | R queryOrderPay(String orderNo); 19 | 20 | // 关闭支付订单 21 | R closeOrderPay(String orderNo); 22 | } 23 | -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/dao/UserCouponMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop.dao; 2 | 3 | import com.zz.ikeeping.entity.UserCoupon; 4 | 5 | public interface UserCouponMapper { 6 | int deleteByPrimaryKey(Integer id); 7 | 8 | int insert(UserCoupon record); 9 | 10 | int insertSelective(UserCoupon record); 11 | 12 | UserCoupon selectByPrimaryKey(Integer id); 13 | 14 | int updateByPrimaryKeySelective(UserCoupon record); 15 | 16 | int updateByPrimaryKey(UserCoupon record); 17 | } -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/dao/OrderDetailMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop.dao; 2 | 3 | import com.zz.ikeeping.entity.OrderDetail; 4 | 5 | public interface OrderDetailMapper { 6 | int deleteByPrimaryKey(Integer id); 7 | 8 | int insert(OrderDetail record); 9 | 10 | int insertSelective(OrderDetail record); 11 | 12 | OrderDetail selectByPrimaryKey(Integer id); 13 | 14 | int updateByPrimaryKeySelective(OrderDetail record); 15 | 16 | int updateByPrimaryKey(OrderDetail record); 17 | } -------------------------------------------------------------------------------- /ikeeping_message/src/main/java/com/zz/ikeeping/message/core/service/MessageService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.message.core.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.message.core.entity.Message; 5 | 6 | /** 7 | *@Author feri 8 | *@Date Created in 2019/6/13 10:47 9 | */ 10 | public interface MessageService { 11 | R sendMsg(Message message, String ip); 12 | /*R page(int page, int count); 13 | */ 14 | R checkCode(String phone, int code); 15 | R sendMessage(Message message, String ip); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.service; 2 | 3 | import com.zz.ikeeping.common.exception.UserException; 4 | import com.zz.ikeeping.common.vo.R; 5 | import com.zz.ikeeping.entity.User; 6 | 7 | public interface UserService { 8 | 9 | // 根据手机号查找用户有没有注册过 10 | R checkPhone(String phone); 11 | 12 | // 根据手机号注册 13 | R insert(User user) throws UserException; 14 | 15 | // 根据手机验证码注册 16 | R verifyCode(String phone, int code) throws UserException; 17 | } 18 | -------------------------------------------------------------------------------- /ikeeping_common/src/main/java/com/zz/ikeeping/common/util/Base64Util.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.common.util; 2 | 3 | import java.util.Base64; 4 | 5 | /** 6 | * @author DJL 7 | * @create 2019-06-26 22:30 8 | * @desc ${DESCRIPTION} 9 | **/ 10 | public class Base64Util { 11 | //转换为Base64 12 | public static String base64Enc(byte[] msg) { 13 | return Base64.getEncoder().encodeToString(msg); 14 | } 15 | //解码 16 | public static byte[] base64Dec(String msg) { 17 | return Base64.getDecoder().decode(msg); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/java/com/zz/ikeeping/pay/service/WechatPayService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay.service; 2 | 3 | 4 | import com.zz.ikeeping.common.vo.R; 5 | import com.zz.ikeeping.pay.entity.WechatPay; 6 | 7 | /** 8 | * @author DJL 9 | * @create 2019-06-27 22:05 10 | * @desc ${DESCRIPTION} 11 | **/ 12 | public interface WechatPayService { 13 | 14 | // 生成订单支付信息 15 | R orderPay(WechatPay pay); 16 | 17 | // 查询订单支付状态 18 | R queryOrderPay(String orderNo); 19 | 20 | // 关闭支付订单 21 | R closeOrderPay(String orderNo); 22 | } 23 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | serviceUrl: 4 | defaultZone: http://localhost:8761/eureka/ 5 | spring: 6 | application: 7 | name: UserProvider 8 | datasource: 9 | driver-class-name: com.mysql.cj.jdbc.Driver 10 | username: anhaoyang 11 | password: AnHaoYang142464! 12 | url: jdbc:mysql://47.107.128.52:3306/ikeeping?serverTimezone=UTC&characterEncoding=UTF8 13 | type: com.alibaba.druid.pool.DruidDataSource 14 | server: 15 | port: 9402 16 | mybatis: 17 | mapper-locations: classpath*:/mapper/*.xml -------------------------------------------------------------------------------- /ikeeping_esApi/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ikeeping_parent 7 | com.zz.ikeeping 8 | 0.1 9 | 10 | 4.0.0 11 | 12 | ikeeping_esApi 13 | 14 | 15 | -------------------------------------------------------------------------------- /ikeeping_resourceApi/src/main/java/com/zz/ikeeping/api/resource/config/KodoUtilConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.api.resource.config; 2 | 3 | import com.zz.ikeeping.api.resource.util.KodoUtil; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | /** 8 | * @author DJL 9 | * @create 2019-06-26 21:15 10 | * @desc 配置KodoUtil工具类对象 11 | **/ 12 | @Configuration 13 | public class KodoUtilConfig { 14 | @Bean 15 | public KodoUtil createKodoUtil() { 16 | return new KodoUtil(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | driver-class-name: com.mysql.cj.jdbc.Driver 4 | username: anhaoyang 5 | password: AnHaoYang142464! 6 | url: jdbc:mysql://47.107.128.52:3306/ikeeping?serverTimezone=UTC&characterEncoding=UTF8 7 | type: com.alibaba.druid.pool.DruidDataSource 8 | server: 9 | port: 9600 10 | mybatis: 11 | mapper-locations: classpath*:/mapper/*.xml 12 | pagehelper: 13 | helper-dialect: mysql 14 | reasonable: true 15 | support-methods-arguments: true 16 | params: count=countSql 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ikeeping_message/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | serviceUrl: 4 | defaultZone: http://localhost:8761/eureka/ 5 | spring: 6 | application: 7 | name: UserProvider 8 | datasource: 9 | driver-class-name: com.mysql.cj.jdbc.Driver 10 | username: anhaoyang 11 | password: AnHaoYang142464! 12 | url: jdbc:mysql://47.107.128.52:3306/ikeeping?serverTimezone=UTC&characterEncoding=UTF8 13 | type: com.alibaba.druid.pool.DruidDataSource 14 | server: 15 | port: 9420 16 | mybatis: 17 | mapper-locations: classpath*:/mapper/*.xml 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | service-url: 4 | defaultZone: http://localhost:8761/eureka/ 5 | 6 | spring: 7 | application: 8 | name: ShopProvider 9 | datasource: 10 | driver-class-name: com.mysql.cj.jdbc.Driver 11 | username: anhaoyang 12 | password: AnHaoYang142464! 13 | url: jdbc:mysql://47.107.128.52:3306/ikeeping?serverTimezone=UTC&characterEncoding=UTF8 14 | type: com.alibaba.druid.pool.DruidDataSource 15 | 16 | server: 17 | port: 9901 18 | 19 | mybatis: 20 | mapper-locations: classpath*:/mapper/*.xml -------------------------------------------------------------------------------- /ikeeping_sns/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | serviceUrl: 4 | defaultZone: http://localhost:8761/eureka/ 5 | spring: 6 | application: 7 | name: CommentProvider 8 | datasource: 9 | driver-class-name: com.mysql.cj.jdbc.Driver 10 | username: anhaoyang 11 | password: AnHaoYang142464! 12 | url: jdbc:mysql://47.107.128.52:3306/ikeeping?serverTimezone=UTC&characterEncoding=UTF8 13 | type: com.alibaba.druid.pool.DruidDataSource 14 | server: 15 | port: 9701 16 | mybatis: 17 | mapper-locations: classpath*:/mapper/*.xml 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ikeeping_sports/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | serviceUrl: 4 | defaultZone: http://localhost:8761/eureka/ 5 | spring: 6 | application: 7 | name: SportsProvider 8 | datasource: 9 | driver-class-name: com.mysql.cj.jdbc.Driver 10 | username: anhaoyang 11 | password: AnHaoYang142464! 12 | url: jdbc:mysql://47.107.128.52:3306/ikeeping?serverTimezone=UTC&characterEncoding=UTF8 13 | type: com.alibaba.druid.pool.DruidDataSource 14 | server: 15 | port: 9401 16 | mybatis: 17 | mapper-locations: classpath*:/mapper/*.xml 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | serviceUrl: 4 | defaultZone: http://localhost:8761/eureka/ 5 | spring: 6 | application: 7 | name: LoginProvider 8 | datasource: 9 | driver-class-name: com.mysql.cj.jdbc.Driver 10 | username: anhaoyang 11 | password: AnHaoYang142464! 12 | url: jdbc:mysql://47.107.128.52:3306/ikeeping?serverTimezone=UTC&characterEncoding=UTF8 13 | type: com.alibaba.druid.pool.DruidDataSource 14 | server: 15 | port: 9802 16 | mybatis: 17 | mapper-locations: classpath*:/mapper/*.xml 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ikeeping_transportation/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ikeeping_parent 7 | com.zz.ikeeping 8 | 0.1 9 | 10 | 4.0.0 11 | 12 | ikeeping_transportation 13 | 14 | 15 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/NewsApplication.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news; 2 | import org.mybatis.spring.annotation.MapperScan; 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 6 | 7 | @SpringBootApplication 8 | @MapperScan("com.zz.ikeeping.news.dao") 9 | @EnableSwagger2 10 | public class NewsApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(NewsApplication.class,args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ikeeping_sports/src/main/resources/mapper/BMIMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | insert into t_bmi (uid, weight,hight,status) values (#{uid}, #{weight},#{hight},#{status}) 6 | 7 | 10 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/service/CartVoService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestParam; 6 | 7 | import java.util.List; 8 | 9 | public interface CartVoService { 10 | //查询购物车的所有商品的信息,包括图片地址、商品名、价格、数量 11 | @GetMapping("/cart/all.do") 12 | R all(); 13 | 14 | //根据id删除购物车的商品 15 | @GetMapping("/cart/delete.do") 16 | R delete(@RequestParam(value="id",required=true) List id); 17 | } 18 | -------------------------------------------------------------------------------- /ikeeping_eureka/src/main/java/com/zz/ikeeping/eureka/EurekaApplication.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.eureka; 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 | * @author DJl 9 | * @create 2019-06-24 21:07 10 | * @desc Eureka注册中心启动开关 11 | **/ 12 | @SpringBootApplication 13 | @EnableEurekaServer 14 | public class EurekaApplication { 15 | public static void main(String[] args) { 16 | SpringApplication.run(EurekaApplication.class, args); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ikeeping_sports/src/main/resources/mapper/StepCountMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | insert into t_stepcount(uid,stepcount,daydate) values (#{uid},#{stepcount},now()) 6 | 7 | 10 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/LoginApplication.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 7 | 8 | @SpringBootApplication 9 | @EnableEurekaClient 10 | @MapperScan("com.zz.ikeeping.service.login.dao") 11 | public class LoginApplication { 12 | public static void main(String[] args) { 13 | SpringApplication.run(LoginApplication.class,args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/service/SportsService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.service; 2 | 3 | import org.springframework.cloud.openfeign.FeignClient; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestParam; 6 | @FeignClient(name = "SportsProvider") 7 | public interface SportsService { 8 | /** 9 | * 计算BMI指数 10 | * @param weight 11 | * @param height 12 | * @return 13 | */ 14 | @GetMapping("sports/calculate.do") 15 | public String calBMI(@RequestParam("weight") float weight, @RequestParam("height") float height); 16 | } 17 | -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/dao/GoodsTypeMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop.dao; 2 | 3 | import com.zz.ikeeping.entity.GoodsType; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import java.util.List; 7 | 8 | @Repository 9 | public interface GoodsTypeMapper { 10 | int deleteByPrimaryKey(Integer id); 11 | 12 | int insert(GoodsType record); 13 | 14 | int insertSelective(GoodsType record); 15 | 16 | GoodsType selectByPrimaryKey(Integer id); 17 | 18 | int updateByPrimaryKeySelective(GoodsType record); 19 | 20 | int updateByPrimaryKey(GoodsType record); 21 | 22 | List selectAll(); 23 | } -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/service/GoodsService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | 5 | public interface GoodsService { 6 | R getGoodsPageByType(Integer typeid, Integer page, Integer count); 7 | 8 | R getById(Integer gid); 9 | 10 | R getGoodsPageByTypePriceAsc(Integer typeid, Integer page, Integer count); 11 | 12 | R getGoodsPageByTypePriceDesc(Integer typeid, Integer page, Integer count); 13 | 14 | R getGoodsPageByTypeSellAsc(Integer typeid, Integer page, Integer count); 15 | 16 | R getGoodsPageByTypeSellDesc(Integer typeid, Integer page, Integer count); 17 | } 18 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/resources/mapper/CouponMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | insert into t_coupon(type, money, totalcount, startdate, days, sendcount, usedcount) values (#{type}, #{money}, #{totalcount}, #{startdate}, #{days}, #{sendcount}, #{usedcount}) 9 | 10 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/test/random.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news.test; 2 | 3 | import com.zz.ikeeping.entity.News; 4 | import io.swagger.models.auth.In; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import java.util.Random; 9 | 10 | public class random { 11 | 12 | public static void main(String[] args) { 13 | /*List list = new ArrayList(); 14 | 15 | for(int i=0;i<20;i++){ 16 | 17 | list.add(i); 18 | } 19 | // Random random = new Random(); 20 | Integer a = list.get((int) (Math.random() * list.size())); 21 | System.out.println("随机数"+a); 22 | */ 23 | 24 | int a =5; 25 | 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/service/impl/GoodsTypeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop.service.impl; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.server.shop.dao.GoodsTypeMapper; 5 | import com.zz.ikeeping.server.shop.service.GoodsTypeService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class GoodsTypeServiceImpl implements GoodsTypeService { 11 | 12 | @Autowired 13 | private GoodsTypeMapper goodsTypeDao; 14 | 15 | @Override 16 | public R selectAll() { 17 | return R.setOK("ok",goodsTypeDao.selectAll()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/controller/GoodsTypeController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.ikeeping_api.service.GoodsTypeService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class GoodsTypeController { 11 | 12 | @Autowired 13 | private GoodsTypeService goodsTypeService; 14 | 15 | @GetMapping("/api/goodstype/all.do") 16 | public R all(){ 17 | return goodsTypeService.all(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/controller/GoodsTypeController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.server.shop.service.GoodsTypeService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class GoodsTypeController { 11 | 12 | @Autowired 13 | private GoodsTypeService goodsTypeService; 14 | 15 | @GetMapping("/goodstype/all") 16 | public R all(){ 17 | return goodsTypeService.selectAll(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ikeeping_sns/src/main/java/com/zz/ikeeping/sns/dao/CommunityDetailMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sns.dao; 2 | 3 | import com.zz.ikeeping.entity.CommunityDetail; 4 | import com.zz.ikeeping.sns.vo.VCommunityDetail; 5 | import org.springframework.web.bind.annotation.RequestParam; 6 | 7 | import java.util.List; 8 | 9 | public interface CommunityDetailMapper { 10 | 11 | List selectDetail(); 12 | 13 | //话题点赞数量 14 | int topicPraise(@RequestParam("id") int id, @RequestParam("count") int count); 15 | 16 | //新增发表 17 | int add(CommunityDetail detail); 18 | 19 | List newPublishTopicDetail(int cmid); 20 | 21 | List showTopicAtMostComment(int cmid); 22 | } -------------------------------------------------------------------------------- /ikeeping_loginApi/src/main/java/com/zz/ikeeping/api/login/LoginApiApplication.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.api.login; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.openfeign.EnableFeignClients; 7 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 8 | 9 | @SpringBootApplication 10 | @EnableDiscoveryClient 11 | @EnableFeignClients 12 | @EnableSwagger2 13 | public class LoginApiApplication { 14 | public static void main(String[] args) { 15 | SpringApplication.run(LoginApiApplication.class,args); 16 | } 17 | } -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/service/CouponService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.Coupon; 5 | import org.springframework.cloud.openfeign.FeignClient; 6 | import org.springframework.web.bind.annotation.DeleteMapping; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestBody; 10 | 11 | @FeignClient(name = "UserProvider") 12 | public interface CouponService { 13 | @PostMapping("user/coupon/save.do") 14 | R save(@RequestBody Coupon coupon); 15 | @GetMapping("user/coupon/all.do") 16 | R findAll(); 17 | } 18 | -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/ServerShopApplication.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 7 | 8 | /** 9 | * @author DJL 10 | * @create 2019-06-25 21:39 11 | * @desc ${DESCRIPTION} 12 | **/ 13 | @SpringBootApplication 14 | @EnableEurekaClient 15 | @MapperScan("com.zz.ikeeping.server.shop.dao") //扫描Dao 16 | public class ServerShopApplication { 17 | public static void main(String[] args) { 18 | SpringApplication.run(ServerShopApplication.class, args); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ikeeping_sports/src/main/java/com/zz/ikeeping/sports/controller/SportsController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sports.controller; 2 | 3 | import com.zz.ikeeping.sports.service.SportsService; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestParam; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class SportsController { 11 | @Autowired 12 | private SportsService service; 13 | 14 | @GetMapping("sports/calculate.do") 15 | public String calBMI(@RequestParam("weight") float weight, @RequestParam("height") float height){ 16 | return service.calBMI(height, weight); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/dao/NewsDetailMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news.dao; 2 | 3 | import com.zz.ikeeping.entity.Goods; 4 | import com.zz.ikeeping.entity.News; 5 | import com.zz.ikeeping.entity.NewsDetail; 6 | import com.zz.ikeeping.entity.UserCoupon; 7 | import com.zz.ikeeping.news.vo.VNewDetail; 8 | 9 | import java.util.List; 10 | 11 | public interface NewsDetailMapper { 12 | 13 | int insert(NewsDetail record); 14 | 15 | int insertSelective(NewsDetail record); 16 | 17 | List selectAll(Integer cid); 18 | 19 | void update(NewsDetail detail); 20 | 21 | List push(String newstype); 22 | 23 | List pushgood(String name); 24 | //咨询id 25 | UserCoupon sale(int id); 26 | 27 | NewsDetail selectByK(Integer cid); 28 | } -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/resources/mapper/Cart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | delete from t_cart where id 12 | 13 | 14 | #{id} 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/dao/AddressMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.dao; 2 | 3 | import com.zz.ikeeping.entity.Address; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | public interface AddressMapper { 9 | 10 | // 添加收货地址 11 | int insert(Address address); 12 | 13 | // 根据用户id 查找所有用户地址 14 | List
selectByUid(Integer uid); 15 | 16 | // 查询指定用户非默认收货地址 17 | Address selectByDefault(Integer uid); 18 | // 查询某一收货地址 19 | Address selectByAddid(Integer addid); 20 | 21 | // 修改默认收货地址 22 | void updateDefault(@Param("addid") Address addid); 23 | 24 | // 修改收货地址信息 25 | void update( Address address); 26 | // 删除指定的收货地址 27 | void deleteById(Integer addid); 28 | 29 | 30 | 31 | } -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/service/AddressService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.Address; 5 | import com.zz.ikeeping.entity.Coupon; 6 | 7 | public interface AddressService { 8 | // 查询指定用户的所有非默认的收货地址 9 | R selectById(String token); 10 | // 查询指定用户的默认收货地址 11 | R selectByDefult(String token); 12 | // 删除指定的收货地址 13 | R deleteById(Integer addid); 14 | // 将非默认的收货地址改为默认收货地址 15 | // R updateDefult(Integer addid); 16 | 17 | // 新增收货地址 18 | R insert(Address address); 19 | 20 | // 修改收货地址 21 | R updateByAddid(Address address); 22 | 23 | interface CouponService { 24 | R save(Coupon coupon); 25 | R findAll(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ikeeping_entity/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ikeeping_parent 7 | com.zz.ikeeping 8 | 0.1 9 | 10 | 4.0.0 11 | 12 | ikeeping_entity 13 | 14 | 15 | 16 | org.projectlombok 17 | lombok 18 | ${lombok.version} 19 | 20 | 21 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/service/impl/CouponServiceimpl.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.service.impl; 2 | import com.zz.ikeeping.common.vo.R; 3 | import com.zz.ikeeping.entity.Coupon; 4 | import com.zz.ikeeping.server.user.dao.CouponMapper; 5 | import com.zz.ikeeping.server.user.service.CouponService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class CouponServiceimpl implements CouponService { 11 | @Autowired 12 | private CouponMapper couponMapper; 13 | 14 | @Override 15 | public R save(Coupon coupon) { 16 | return R.setOK("OK",couponMapper.insert(coupon)); 17 | } 18 | 19 | @Override 20 | public R findAll() { 21 | return R.setOK("OK",couponMapper.findAll()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ikeeping_sports/src/main/java/com/zz/ikeeping/sports/service/impl/StepCountServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sports.service.impl; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.StepCount; 5 | import com.zz.ikeeping.sports.dao.StepCountMapper; 6 | import com.zz.ikeeping.sports.service.StepCountService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service 11 | public class StepCountServiceImpl implements StepCountService { 12 | @Autowired 13 | private StepCountMapper mapper; 14 | @Override 15 | public R insert(StepCount stepCount) { 16 | 17 | return R.setOK("OK",mapper.insert(stepCount)); 18 | } 19 | 20 | @Override 21 | public R findByUid(int uid) { 22 | return R.setOK("OK",mapper.findByUid(uid)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ikeeping_sns/src/main/java/com/zz/ikeeping/sns/dao/CommentMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sns.dao; 2 | 3 | import com.zz.ikeeping.common.config.ProjectConfig; 4 | import com.zz.ikeeping.entity.Comment; 5 | import com.zz.ikeeping.entity.Community; 6 | import com.zz.ikeeping.sns.vo.VCommunityDetail; 7 | import org.springframework.web.bind.annotation.RequestBody; 8 | import org.springframework.web.bind.annotation.RequestParam; 9 | 10 | import java.util.List; 11 | 12 | public interface CommentMapper { 13 | 14 | int insert(Community community); 15 | 16 | List selectComment(@RequestParam("id") int id); 17 | 18 | //展示所有评论 19 | List all(); 20 | 21 | //新增评论 22 | int addCommont(Comment comment); 23 | 24 | //回复评论 25 | int replyCommont(Comment comment); 26 | 27 | //评论点赞数量 28 | int commont(@RequestParam("id") int id,@RequestParam("count") int count); 29 | } -------------------------------------------------------------------------------- /ikeeping_message/src/main/java/com/zz/ikeeping/message/MessageApplication.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.message; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 7 | import org.springframework.transaction.annotation.EnableTransactionManagement; 8 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 9 | 10 | /** 11 | *@Author feri 12 | *@Date Created in 2019/6/13 10:05 13 | */ 14 | @SpringBootApplication 15 | @MapperScan("com.zz.ikepping.message.core.dao") 16 | @EnableTransactionManagement 17 | @EnableEurekaClient //服务提供者 18 | @EnableSwagger2 19 | public class MessageApplication { 20 | public static void main(String[] args) { 21 | SpringApplication.run(MessageApplication.class,args); 22 | } 23 | } -------------------------------------------------------------------------------- /ikeeping_sports/src/main/java/com/zz/ikeeping/sports/controller/PhysiqueController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sports.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.BMI; 5 | import com.zz.ikeeping.sports.service.PhysiqueService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.*; 8 | 9 | @RestController 10 | public class PhysiqueController { 11 | @Autowired 12 | private PhysiqueService service; 13 | /** 14 | * 通过给出体重和身高计算身体质量指数,返回结果 15 | */ 16 | @PostMapping("sports/physique.do") 17 | public String calBMI(@RequestBody BMI bmi){ 18 | return service.calBMI(bmi); 19 | } 20 | 21 | /** 22 | * 根据用户uid查询健康指数 23 | */ 24 | @GetMapping("sports/list.do") 25 | public R findByUid(@RequestParam("uid") int uid) { 26 | return service.findByUid(uid); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/service/UserSignService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.service; 2 | 3 | 4 | import com.zz.ikeeping.common.vo.R; 5 | import org.springframework.cloud.openfeign.FeignClient; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestParam; 9 | 10 | @FeignClient(name = "UserProvider") 11 | public interface UserSignService { 12 | @GetMapping("usersign/all.do") 13 | R all(@RequestParam("token") String token); 14 | @GetMapping("/usersign/single.do") 15 | R single(@RequestParam("token") String token); 16 | @GetMapping("/usersign/day.do") 17 | R signDays(@RequestParam("token") String token, @RequestParam("days") int days); 18 | @PostMapping("/usersign/signsave.do") 19 | R save(@RequestParam("token") String token); 20 | } 21 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/service/PhysiqueService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.BMI; 5 | import org.springframework.cloud.openfeign.FeignClient; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | @FeignClient(name = "SportsProvider") 11 | public interface PhysiqueService { 12 | /** 13 | * 通过给出体重和身高计算身体质量指数,返回结果 14 | */ 15 | @PostMapping("sports/physique.do") 16 | public String calBMI(@RequestBody BMI bmi); 17 | /** 18 | * 根据用户uid查询健康指数 19 | * @param uid 20 | * @return 21 | */ 22 | @GetMapping("sports/list.do") 23 | public R findByUid(@RequestParam("uid") int uid); 24 | } 25 | -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/java/com/zz/ikeeping/pay/PayApplication.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.builder.SpringApplicationBuilder; 6 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 7 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 8 | 9 | /** 10 | * @author DJL 11 | * @create 2019-06-27 22:39 12 | * @desc ${DESCRIPTION} 13 | **/ 14 | @SpringBootApplication 15 | @EnableSwagger2 16 | public class PayApplication extends SpringBootServletInitializer { 17 | public static void main(String[] args) { 18 | SpringApplication.run(PayApplication.class, args); 19 | } 20 | 21 | @Override 22 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 23 | return builder.sources(PayApplication.class); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ikeeping_sns/src/main/java/com/zz/ikeeping/sns/SnsApplication.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sns; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.builder.SpringApplicationBuilder; 7 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 8 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 9 | 10 | @SpringBootApplication 11 | @EnableEurekaClient 12 | @MapperScan("com.zz.ikeeping.sns.dao") 13 | public class SnsApplication extends SpringBootServletInitializer { 14 | public static void main(String[] args) { 15 | SpringApplication.run(SnsApplication.class, args); 16 | } 17 | 18 | @Override 19 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 20 | return builder.sources(SnsApplication.class); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/service/impl/OrdersStstusServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.service.impl; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.Order; 5 | import com.zz.ikeeping.service.login.dao.OrdersStatusDao; 6 | import com.zz.ikeeping.service.login.service.OrdersStstusService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * @author : nick 14 | * @date : 2019-07-01 21:01 15 | **/ 16 | @Service 17 | public class OrdersStstusServiceImpl implements OrdersStstusService { 18 | 19 | @Autowired 20 | private OrdersStatusDao ordersStatusDao; 21 | 22 | @Override 23 | public R selectByStatus(int status, int uid) { 24 | List orders = ordersStatusDao.selectByStatus(status, uid); 25 | return R.setOK("OK",orders); 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/controller/CouponController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.Coupon; 5 | import com.zz.ikeeping.server.user.service.CouponService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.*; 8 | 9 | @RestController 10 | public class CouponController { 11 | @Autowired 12 | private CouponService userService; 13 | 14 | /** 15 | * 增加优惠券 16 | * @param coupon 实体类对象 17 | * @return 18 | */ 19 | @PostMapping("user/coupon/save.do") 20 | public R save(@RequestBody Coupon coupon){ 21 | return userService.save(coupon); 22 | } 23 | 24 | /** 25 | * 查询所有的优惠券 26 | * @return 27 | */ 28 | @GetMapping("user/coupon/all.do") 29 | public R findAll(){ 30 | return userService.findAll(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/dao/GoodsMapper.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop.dao; 2 | 3 | import com.zz.ikeeping.entity.Goods; 4 | import com.zz.ikeeping.server.shop.dto.GoodsDTO; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | @Repository 10 | public interface GoodsMapper { 11 | int deleteByPrimaryKey(Integer id); 12 | 13 | int insert(Goods record); 14 | 15 | int insertSelective(Goods record); 16 | 17 | Goods selectByPrimaryKey(Integer id); 18 | 19 | int updateByPrimaryKeySelective(Goods record); 20 | 21 | int updateByPrimaryKey(Goods record); 22 | 23 | List selectByTypeid(Integer typeid); 24 | 25 | List selectByTypeidPriceAsc(Integer typeid); 26 | 27 | List selectByTypeidPriceDesc(Integer typeid); 28 | 29 | List selectByTypeidSellAsc(Integer typeid); 30 | 31 | List selectByTypeidSellDesc(Integer typeid); 32 | } -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/controller/SportsController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.controller; 2 | 3 | import com.zz.ikeeping.ikeeping_api.service.SportsService; 4 | import io.swagger.annotations.Api; 5 | import io.swagger.annotations.ApiOperation; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RequestParam; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | @RestController 12 | @Api(value = "身体素质接口",tags = "身体素质接口") 13 | public class SportsController { 14 | @Autowired 15 | private SportsService service; 16 | //根据用户输入的身高和体重计算用户的身体素质 17 | @ApiOperation(value = "计算用户的身体素质") 18 | @GetMapping("api/sports/calculate.do") 19 | public String calBMI(@RequestParam("weight") float weight, @RequestParam("height") float height){ 20 | return service.calBMI(height, weight); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ikeeping_sports/src/main/java/com/zz/ikeeping/sports/SportsApplication.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sports; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.builder.SpringApplicationBuilder; 7 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 8 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 9 | 10 | @SpringBootApplication 11 | @EnableEurekaClient 12 | @MapperScan("com.zz.ikeeping.sports.dao") 13 | public class SportsApplication extends SpringBootServletInitializer { 14 | public static void main(String[] args) { 15 | SpringApplication.run(SportsApplication.class, args); 16 | } 17 | 18 | @Override 19 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 20 | return builder.sources(SportsApplication.class); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/service/StepCountService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.StepCount; 5 | import org.springframework.cloud.openfeign.FeignClient; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | 11 | @FeignClient(name = "SportsProvider") 12 | public interface StepCountService { 13 | /** 14 | * 添加用户的步数 15 | * @param stepCount 16 | * @return 17 | */ 18 | @PostMapping("step/insert.do") 19 | public R insert(@RequestBody StepCount stepCount); 20 | 21 | /** 22 | * 根据用户uid查询用户的步数 23 | * @param uid 24 | * @return 25 | */ 26 | @GetMapping("step/find.do") 27 | public R findByUid(@RequestParam("uid") int uid); 28 | } 29 | -------------------------------------------------------------------------------- /ikeeping_common/src/main/java/com/zz/ikeeping/common/model/EmailMsg.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.common.model; 2 | 3 | 4 | public class EmailMsg { 5 | public String getTitle() { 6 | return title; 7 | } 8 | 9 | public void setTitle(String title) { 10 | this.title = title; 11 | } 12 | 13 | public String getContent() { 14 | return content; 15 | } 16 | 17 | public void setContent(String content) { 18 | this.content = content; 19 | } 20 | 21 | public String getEmail() { 22 | return email; 23 | } 24 | 25 | public void setEmail(String email) { 26 | this.email = email; 27 | } 28 | 29 | private String company;//公司名称 30 | private String title;//邮箱标题 31 | private String content;//邮箱内容 32 | private String email;//接收人 33 | 34 | public String getCompany() { 35 | return company; 36 | } 37 | 38 | public void setCompany(String company) { 39 | this.company = company; 40 | } 41 | 42 | 43 | } -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/service/AddressService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.Address; 5 | import org.springframework.cloud.openfeign.FeignClient; 6 | import org.springframework.web.bind.annotation.*; 7 | 8 | @FeignClient(name = "UserProvider") 9 | public interface AddressService { 10 | @GetMapping("address/selectByUid.do") 11 | R selectAddByUid(@RequestParam("token") String token); 12 | 13 | // 添加指定用户的收货地址 14 | @PostMapping("address/insert.do") 15 | R insert(@RequestBody Address address); 16 | // 查询用户的默认收货地址 17 | @GetMapping("address/selectByDefult") 18 | R selectByDefult(@RequestParam("token") String token); 19 | // 修改收货地址信息 20 | @PostMapping("address/updateadd") 21 | R updateadd(@RequestBody Address address); 22 | // 删除指定id的地址信息 23 | @DeleteMapping("address/deleteById") 24 | R deleteById(@RequestParam("addid") Integer addid); 25 | 26 | 27 | } -------------------------------------------------------------------------------- /ikeeping_resourceApi/src/main/java/com/zz/ikeeping/api/resource/ResourceApplication.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.api.resource; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.builder.SpringApplicationBuilder; 6 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 7 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 8 | 9 | /** 10 | * @author DJL 11 | * @create 2019-06-26 20:34 12 | * @desc ${DESCRIPTION} 13 | **/ 14 | @SpringBootApplication 15 | @EnableSwagger2 16 | public class ResourceApplication extends SpringBootServletInitializer { 17 | public static void main(String[] args) { 18 | SpringApplication.run(ResourceApplication.class, args); 19 | } 20 | 21 | @Override 22 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 23 | return builder.sources(ResourceApplication.class); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/controller/CouponController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.controller; 2 | import com.zz.ikeeping.common.vo.R; 3 | import com.zz.ikeeping.entity.Coupon; 4 | import com.zz.ikeeping.ikeeping_api.service.CouponService; 5 | import io.swagger.annotations.Api; 6 | import io.swagger.annotations.ApiOperation; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | @RestController 11 | @Api(value = "优惠券接口",tags = "优惠券接口") 12 | public class CouponController { 13 | @Autowired 14 | private CouponService userService; 15 | 16 | //增加优惠券 17 | @ApiOperation("添加优惠券接口") 18 | @PostMapping("api/user/coupon/save.do") 19 | public R save(@RequestBody Coupon coupon){ 20 | return userService.save(coupon); 21 | } 22 | 23 | //查询所有的优惠券 24 | @ApiOperation("查询所有的优惠券接口") 25 | @GetMapping("api/user/coupon/all.do") 26 | public R findAll(){ 27 | return userService.findAll(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.User; 5 | 6 | import org.springframework.cloud.openfeign.FeignClient; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestBody; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | 12 | @FeignClient(name = "UserProvider") 13 | public interface UserService { 14 | //新增 15 | @PostMapping("user/save.do") 16 | R save(@RequestBody User user); 17 | //校验手机号是否存在 18 | @GetMapping("user/checkphone.do") 19 | R check(@RequestParam("phone") String phone); 20 | @GetMapping("user/verifyCode.do") 21 | R verifyCode(@RequestParam("phone") String phone, @RequestParam("code") int code); 22 | @GetMapping("user/sendcode.do") 23 | R sendCode(@RequestParam("phone") String phone); 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/resources/mapper/UserSignMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | insert into t_sign (uid, score,extrascore,createtime,days) 7 | values (#{uid}, #{score},#{extrascore},now(),#{days}) 8 | 9 | 12 | 15 | 18 | -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/java/com/zz/ikeeping/pay/config/WechatPayConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay.config; 2 | 3 | /** 4 | * @author DJL 5 | * @create 2019-06-27 17:37 6 | * @desc 微信支付配置类 7 | **/ 8 | public class WechatPayConfig { 9 | 10 | // 微信支付应用ID 11 | public static final String APP_ID = "wx632c8f211f8122c6"; 12 | // 微信支付商家ID 13 | public static final String MCH_ID = "1497984412"; 14 | // 微信支付秘钥 15 | public static final String API_KEY = "sbNCm1JnevqI36LrEaxFwcaT0hkGxFnC"; 16 | // 下单接口地址 17 | public static final String UFDOOER_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder"; 18 | // 支付查询接口 19 | public static final String QUERY_URL = "https://api.mch.weixin.qq.com/pay/orderquery"; 20 | // 支付订单取消地址 21 | public static final String CLOSE_URL = "https://api.mch.weixin.qq.com/pay/closeorder"; 22 | // 支付退款地址 23 | public static final String REFUND_URL = "https://api.mch.weixin.qq.com/pay/refundquery"; 24 | // 支付回调通知地址 25 | public static final String NOTIFY_URL = "http://114.242.26.51/pay/result/notice.do"; 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/resources/mapper/UserPointsMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | insert into t_userpoint (uid, totalscore, currscore) 12 | values ( #{uid,jdbcType=INTEGER}, #{totalscore,jdbcType=INTEGER}, 13 | #{currscore,jdbcType=INTEGER}) 14 | 15 | 16 | 17 | update t_userpoint set totalscore=totalscore+#{score},currscore=currscore+#{score} where uid=#{uid} 18 | 19 | -------------------------------------------------------------------------------- /ikeeping_sports/src/main/java/com/zz/ikeeping/sports/service/impl/SportsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sports.service.impl; 2 | 3 | import com.zz.ikeeping.sports.config.BMIType; 4 | import com.zz.ikeeping.sports.dao.BMIMapper; 5 | import com.zz.ikeeping.sports.service.SportsService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class SportsServiceImpl implements SportsService { 11 | @Autowired 12 | private BMIMapper mapper; 13 | 14 | @Override 15 | public String calBMI(float weight, float height) { 16 | height = height / 100; 17 | float bmi = weight / (height * height); 18 | 19 | if (bmi < 18.5){ 20 | return (BMIType.slim.getValue()); 21 | } else if(bmi >= 18.5 && bmi < 24) { 22 | return (BMIType.normal.getValue()); 23 | }else if(bmi >= 24 && bmi < 28) { 24 | return (BMIType.overweight.getValue()); 25 | } else { 26 | return (BMIType.obesity.getValue()); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/controller/PhysiqueController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.BMI; 5 | import com.zz.ikeeping.ikeeping_api.service.PhysiqueService; 6 | import io.swagger.annotations.Api; 7 | import io.swagger.annotations.ApiOperation; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | @RestController 12 | @Api(value = "健康指数接口",tags = "健康指数接口") 13 | public class PhysiqueController { 14 | @Autowired 15 | private PhysiqueService service; 16 | 17 | //通过给出体重和身高计算身体质量指数,返回结果 18 | @ApiOperation(value = "计算健康指数接口") 19 | @PostMapping("api/sports/physique.do") 20 | public String calBMI(@RequestBody BMI bmi){ 21 | return service.calBMI(bmi); 22 | } 23 | //根据用户uid查询健康指数 24 | @ApiOperation(value = "查询健康指数接口") 25 | @GetMapping("api/sports/list.do") 26 | public R findByUid(@RequestParam("uid") int uid) { 27 | return service.findByUid(uid); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/controller/StepCountController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.StepCount; 5 | import com.zz.ikeeping.ikeeping_api.service.StepCountService; 6 | import io.swagger.annotations.Api; 7 | import io.swagger.annotations.ApiOperation; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | @RestController 12 | @Api(value = "运动计步接口",tags = "运动计步接口") 13 | public class StepCountController { 14 | @Autowired 15 | private StepCountService service; 16 | //添加用户的步数 17 | @ApiOperation(value ="添加用户的步数" ) 18 | @PostMapping("api/step/insert.do") 19 | public R insertStep(@RequestBody StepCount stepCount){ 20 | return service.insert(stepCount); 21 | } 22 | //根据用户uid查询用户的步数 23 | @ApiOperation(value = "根据用户uid查询用户的步数") 24 | @GetMapping("api/step/find.do") 25 | public R findStep(@RequestParam("uid") int uid){ 26 | return service.findByUid(uid); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/resources/mapper/UserInfoUpdate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | update t_user 6 | 7 | 8 | 9 | uname = #{uname,jdbcType=VARCHAR}, 10 | 11 | 12 | phone = #{phone,jdbcType=VARCHAR}, 13 | 14 | 15 | 16 | password = #{password,jdbcType=VARCHAR}, 17 | 18 | 19 | imgurl = #{imgurl,jdbcType=VARCHAR}, 20 | 21 | 22 | flag = #{flag} 23 | 24 | 25 | where uid = #{uid,jdbcType=INTEGER} 26 | 27 | -------------------------------------------------------------------------------- /ikeeping_message/src/main/resources/mapper/MsgReceiveMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | id, no, createtime, flag 13 | 14 | 19 | 20 | 21 | insert into msgreceive (no,createtime,flag) 22 | values ( #{no,jdbcType=VARCHAR}, now(), #{flag,jdbcType=INTEGER}) 23 | 24 | 25 | -------------------------------------------------------------------------------- /ikeeping_common/src/main/java/com/zz/ikeeping/common/util/CodeUtil.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.common.util; 2 | 3 | import java.util.Random; 4 | 5 | /** 6 | *@Author 亓慧珍 7 | *@Date Created in 2019/6/10 15:08 8 | */ 9 | public class CodeUtil { 10 | //生成指定位数的随机数 len=4 生成4位数字 11 | public static int createCode(int len){ 12 | StringBuffer buffer=new StringBuffer(); 13 | Random random=new Random(); 14 | for(int i=1;i<=len;i++){ 15 | buffer.append(random.nextInt(10)); 16 | } 17 | return Integer.parseInt(buffer.toString()); 18 | } 19 | public static int createNum(int len){ 20 | Random random=new Random(); 21 | // len=4 10 ^4-10^3=9000 0-8999 +1000=1000-9999 22 | return (int)(random.nextInt((int)(Math.pow(10,len)-Math.pow(10,len-1)))+Math.pow(10,len-1)); 23 | } 24 | 25 | public static void main(String[] args) { 26 | //System.out.println(createCode(4)); 27 | for(int i=1;i<10001;i++){ 28 | int n=createNum(4); 29 | if(n<1000 || n>=10000) { 30 | System.out.println(n); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/IkeepingUserApplication.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.builder.SpringApplicationBuilder; 7 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 8 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 9 | import org.springframework.transaction.annotation.EnableTransactionManagement; 10 | 11 | @SpringBootApplication 12 | @EnableTransactionManagement //开启事务管理 13 | @EnableEurekaClient //服务提供者 14 | @MapperScan("com.zz.ikeeping.server.user.dao") //扫描Dao 15 | public class IkeepingUserApplication extends SpringBootServletInitializer{ 16 | public static void main(String[] args) { 17 | SpringApplication.run(IkeepingUserApplication.class,args); 18 | } 19 | 20 | @Override 21 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 22 | return builder.sources(IkeepingUserApplication.class); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ikeeping_payApi/src/test/java/com/zz/ikeeping/pay/test/PayTest.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay.test; 2 | 3 | import com.zz.ikeeping.pay.util.CommonPayUtil; 4 | import com.zz.ikeeping.pay.util.QrCodeUtil; 5 | import org.junit.Test; 6 | 7 | import java.io.File; 8 | 9 | /** 10 | * @author DJL 11 | * @create 2019-06-27 19:58 12 | * @desc 支付接口测试类 13 | **/ 14 | public class PayTest { 15 | 16 | @Test 17 | public void qrCodeTest() { 18 | File file = new File("hello.png"); 19 | System.out.println(QrCodeUtil.writeToFile("DJL 你好!", 300, file)); 20 | } 21 | 22 | @Test 23 | public void wechatPayTest() { 24 | String url= null; 25 | try { 26 | url = CommonPayUtil.wechatPay("1","测试微信支付","198908080001"); 27 | System.out.println("支付链接:"+url); 28 | File file = new File("pay.png"); 29 | System.out.println(QrCodeUtil.writeToFile(url, 300, file)); 30 | 31 | } catch (Exception e) { 32 | e.printStackTrace(); 33 | } 34 | } 35 | 36 | @Test 37 | public void wechatPayQueryTest() { 38 | System.out.println(CommonPayUtil.wechatPayQuery("198908080001")); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/resources/mapper/PointsMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | insert into t_points (uid, score,info, startdate, enddate, flag) 15 | values ( #{uid,jdbcType=INTEGER}, #{score,jdbcType=INTEGER}, 16 | #{info,jdbcType=VARCHAR}, #{startdate,jdbcType=DATE}, #{enddate,jdbcType=DATE},1) 17 | 18 | 19 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/util/UserTokenUtil.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.util; 2 | 3 | 4 | import com.alibaba.fastjson.JSON; 5 | import com.zz.ikeeping.common.model.LoginToken; 6 | import com.zz.ikeeping.entity.User; 7 | 8 | public class UserTokenUtil { 9 | public static LoginToken parseToken(String json){ 10 | if(json!=null){ 11 | return JSON.parseObject(json,LoginToken.class); 12 | }else { 13 | return null; 14 | } 15 | } 16 | public static int parseTokenId(String json){ 17 | if(json!=null){ 18 | LoginToken user= JSON.parseObject(json,LoginToken.class); 19 | return user.getUid(); 20 | }else { 21 | return 0; 22 | } 23 | } 24 | public static User parseUserToken(String json){ 25 | if(json!=null){ 26 | return JSON.parseObject(json,User.class); 27 | }else { 28 | return null; 29 | } 30 | } 31 | public static int parseUid(String json){ 32 | if(json!=null){ 33 | User user= JSON.parseObject(json,User.class); 34 | return user.getUid(); 35 | }else { 36 | return 0; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/utils/UserTokenUtil.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.utils; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.zz.ikeeping.entity.User; 5 | import com.zz.ikeeping.service.login.model.LoginToken; 6 | 7 | 8 | public class UserTokenUtil { 9 | public static LoginToken parseToken(String json){ 10 | if(json!=null){ 11 | return JSON.parseObject(json,LoginToken.class); 12 | }else { 13 | return null; 14 | } 15 | } 16 | public static int parseTokenId(String json){ 17 | if(json!=null){ 18 | LoginToken user= JSON.parseObject(json,LoginToken.class); 19 | return user.getUid(); 20 | }else { 21 | return 0; 22 | } 23 | } 24 | public static User parseUserToken(String json){ 25 | if(json!=null){ 26 | return JSON.parseObject(json,User.class); 27 | }else { 28 | return null; 29 | } 30 | } 31 | public static int parseUid(String json){ 32 | if(json!=null){ 33 | User user= JSON.parseObject(json,User.class); 34 | return user.getUid(); 35 | }else { 36 | return 0; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/resources/mapper/NewsMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | id, newstype, imgurl, content, pubtime 13 | 14 | 19 | 20 | 21 | insert into t_news (newstype, imgurl, 22 | content, pubtime) 23 | values (#{newstype,jdbcType=VARCHAR}, #{imgurl,jdbcType=VARCHAR}, 24 | #{content,jdbcType=VARCHAR}, #{pubtime,jdbcType=DATE}) 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /ikeeping_common/src/main/java/com/zz/ikeeping/common/vo/R.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.common.vo; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @author DJL 7 | * @create 2019-06-26 22:26 8 | * @desc 返回对象 9 | **/ 10 | @Data 11 | public class R { 12 | private int code; 13 | private String msg; 14 | private Object data; 15 | 16 | public static R setOK(){ 17 | R r=new R(); 18 | r.setCode(1); 19 | r.setMsg("OK"); 20 | r.setData(null); 21 | return r; 22 | } 23 | 24 | public static R setOK(String msg){ 25 | R r=new R(); 26 | r.setCode(1); 27 | r.setMsg(msg); 28 | r.setData(null); 29 | return r; 30 | } 31 | 32 | public static R setOK(String msg,Object data){ 33 | R r=new R(); 34 | r.setCode(1); 35 | r.setMsg(msg); 36 | r.setData(data); 37 | return r; 38 | } 39 | public static R setERROR(){ 40 | R r=new R(); 41 | r.setCode(0); 42 | r.setMsg("ERROR"); 43 | r.setData(null); 44 | return r; 45 | } 46 | public static R setERROR(String msg){ 47 | R r=new R(); 48 | r.setCode(0); 49 | r.setMsg(msg); 50 | r.setData(null); 51 | return r; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /ikeeping_sports/src/main/java/com/zz/ikeeping/sports/controller/StepCountController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sports.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.StepCount; 5 | import com.zz.ikeeping.sports.service.StepCountService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestBody; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | @RestController 13 | public class StepCountController { 14 | @Autowired 15 | private StepCountService service; 16 | 17 | /** 18 | * 添加用户的步数 19 | * @param stepCount 20 | * @return 21 | */ 22 | @PostMapping("step/insert.do") 23 | public R insetStep(@RequestBody StepCount stepCount){ 24 | System.out.println(stepCount.getStepcount()); 25 | System.out.println(stepCount.getUid()); 26 | return service.insert(stepCount); 27 | } 28 | 29 | /** 30 | * 根据用户uid查询用户的步数 31 | * @param uid 32 | * @return 33 | */ 34 | @GetMapping("step/find.do") 35 | public R findStep(int uid){ 36 | return service.findByUid(uid); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ikeeping_resourceApi/src/main/java/com/zz/ikeeping/api/resource/controller/UploadController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.api.resource.controller; 2 | 3 | import com.zz.ikeeping.api.resource.util.KodoUtil; 4 | import com.zz.ikeeping.common.vo.R; 5 | import io.swagger.annotations.Api; 6 | import io.swagger.annotations.ApiOperation; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | import org.springframework.web.multipart.MultipartFile; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | 14 | /** 15 | * @author DJL 16 | * @create 2019-06-26 21:18 17 | * @desc 文件上传控制器 18 | **/ 19 | @RestController 20 | @Api(value = "文件上传的API接口", tags = "文件上传至七牛云的数据接口") 21 | public class UploadController { 22 | 23 | @Autowired(required = false) 24 | private KodoUtil KodoUtil; 25 | 26 | @ApiOperation("单个文件上传接口") 27 | @PostMapping("/api/resource/qiniuUpload.do") 28 | public R upload(MultipartFile file, HttpServletRequest request){ 29 | if (!file.isEmpty()) { 30 | String fileUrl = KodoUtil.uploadMultipartFile(file); 31 | return R.setOK("OK", fileUrl); 32 | } else { 33 | return R.setERROR("请选择上传的文件"); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.controller; 2 | 3 | 4 | import com.zz.ikeeping.common.vo.R; 5 | import com.zz.ikeeping.entity.User; 6 | import com.zz.ikeeping.ikeeping_api.service.UserService; 7 | 8 | import io.swagger.annotations.Api; 9 | import io.swagger.annotations.ApiOperation; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.web.bind.annotation.*; 12 | @Api(value = "用户注册接口", tags = "用户注册接口") 13 | @RestController 14 | public class UserController { 15 | @Autowired 16 | private UserService userService; 17 | 18 | //普通新增用户 19 | @ApiOperation("普通新增用户") 20 | @PostMapping("/api/user/save.do") 21 | public R save(@RequestBody User user){ 22 | return userService.save(user); 23 | } 24 | // 查询用户有没有注册过 25 | @ApiOperation("查询用户有没有注册过") 26 | @GetMapping("api/user/checkphone.do") 27 | public R check(@RequestParam("phone") String phone){ 28 | return userService.check(phone); 29 | } 30 | // 根据手机验证码注册 31 | @ApiOperation("根据手机验证码注册") 32 | @GetMapping("api/user/verifyCode.do") 33 | public R verifyCode(@RequestParam("phone") String phone, @RequestParam("code") int code) { 34 | return userService.verifyCode(phone, code); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/controller/NewCController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.NewsC; 5 | import com.zz.ikeeping.news.service.NewsCService; 6 | import io.swagger.annotations.Api; 7 | import io.swagger.annotations.ApiOperation; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.PostMapping; 12 | import org.springframework.web.bind.annotation.PutMapping; 13 | import org.springframework.web.bind.annotation.RequestBody; 14 | import org.springframework.web.bind.annotation.ResponseBody; 15 | @Api(value = "评论操作",tags = "评论操作") 16 | @Controller 17 | @ResponseBody 18 | public class NewCController { 19 | @Autowired 20 | private NewsCService cService; 21 | 22 | @ApiOperation(value = "更新动态",notes = "更新数据") 23 | @PutMapping("/newsc/update.do") 24 | public R update(@RequestBody NewsC c){ 25 | cService.update(c); 26 | return R.setOK(); 27 | } 28 | @ApiOperation(value = "添加评论",notes = "插入数据") 29 | @PostMapping("/newsc/add.do") 30 | public R add(@RequestBody NewsC c){ 31 | cService.insert(c); 32 | 33 | return R.setOK(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ikeeping_sns/src/main/java/com/zz/ikeeping/sns/service/SnsService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sns.service; 2 | 3 | import com.zz.ikeeping.common.config.ProjectConfig; 4 | import com.zz.ikeeping.entity.Comment; 5 | import com.zz.ikeeping.entity.Community; 6 | import com.zz.ikeeping.entity.CommunityDetail; 7 | import com.zz.ikeeping.sns.dao.CommunityDetailMapper; 8 | import com.zz.ikeeping.sns.vo.VCommunityDetail; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | public interface SnsService { 15 | 16 | List showTopicType(); 17 | 18 | List selectDetail(); 19 | 20 | List showTopicComment(int id); 21 | 22 | int commentCount(int id); 23 | 24 | List newPublishTopicDetail(int cmid); 25 | 26 | List showTopicAtMostComment(int cmid); 27 | 28 | int pageView(int id, String IP); 29 | 30 | List allCommont(); 31 | 32 | int add(CommunityDetail detail); 33 | 34 | int addCommont(Comment comment); 35 | 36 | void replyCommont(Comment comment); 37 | 38 | //话题点赞数量 39 | int topicPraise(@RequestParam("id") int id, @RequestParam("count") int count); 40 | 41 | //评论点赞数量 42 | int commont(@RequestParam("id") int id, @RequestParam("count") int count); 43 | } 44 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.controller; 2 | 3 | import com.zz.ikeeping.common.exception.UserException; 4 | import com.zz.ikeeping.common.vo.R; 5 | import com.zz.ikeeping.entity.User; 6 | 7 | import com.zz.ikeeping.server.user.service.UserService; 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | @RestController 13 | public class UserController { 14 | @Autowired 15 | private UserService userService; 16 | 17 | // 新增 18 | @PostMapping("user/save.do") 19 | public R save(@RequestBody User user) throws UserException { 20 | return userService.insert(user); 21 | } 22 | 23 | // 查询手机号是否被注册 24 | @GetMapping("user/checkphone.do") 25 | public R check(@RequestParam("phone") String phone){ 26 | return userService.checkPhone(phone); 27 | } 28 | // 验证码注册 29 | @GetMapping("user/verifyCode.do") 30 | public R verifyCode(@RequestParam("phone") String phone, @RequestParam("code") int code) { 31 | try { 32 | return userService.verifyCode(phone, code); 33 | } catch (UserException e) { 34 | e.printStackTrace(); 35 | return R.setERROR(); 36 | } 37 | } 38 | 39 | 40 | 41 | 42 | } 43 | 44 | -------------------------------------------------------------------------------- /ikeeping_sports/src/main/java/com/zz/ikeeping/sports/service/impl/PhysiqueServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.sports.service.impl; 2 | 3 | import com.alibaba.druid.sql.dialect.h2.visitor.H2ASTVisitor; 4 | import com.zz.ikeeping.common.vo.R; 5 | import com.zz.ikeeping.entity.BMI; 6 | import com.zz.ikeeping.sports.config.BMIType; 7 | import com.zz.ikeeping.sports.dao.BMIMapper; 8 | import com.zz.ikeeping.sports.service.PhysiqueService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | @Service 13 | public class PhysiqueServiceImpl implements PhysiqueService { 14 | @Autowired 15 | private BMIMapper mapper; 16 | @Override 17 | public String calBMI(BMI bmi) { 18 | Float weight = bmi.getWeight(); 19 | float height = bmi.getHight(); 20 | height = height / 100; 21 | float b = weight / (height * height); 22 | String t = null; 23 | if (b < 24) { 24 | bmi.setStatus(1); 25 | t = BMIType.health.getValue(); 26 | } else { 27 | bmi.setStatus(2); 28 | t = BMIType.hubHeath.getValue(); 29 | } 30 | mapper.insert(bmi); 31 | return t; 32 | } 33 | 34 | @Override 35 | public R findByUid(int uid) { 36 | return R.setOK("OK",mapper.findByUid(uid)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ikeeping_resourceApi/src/main/java/com/zz/ikeeping/api/resource/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.api.resource.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.RequestHandlerSelectors; 7 | import springfox.documentation.service.ApiInfo; 8 | import springfox.documentation.service.Contact; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | 12 | /** 13 | * @author DJL 14 | * @create 2019-06-26 20:47 15 | * @desc swagger配置类 16 | **/ 17 | @Configuration 18 | public class SwaggerConfig { 19 | 20 | public ApiInfo createA(){ 21 | ApiInfo info=new ApiInfoBuilder().title("统一资源管理平台"). 22 | contact( new Contact("DJL","https://github.com/yuuyoo/ikeeping_parent","yuuyoo@163.com")). 23 | description("实现文件上传功能").build(); 24 | return info; 25 | } 26 | 27 | @Bean 28 | public Docket createDocket(){ 29 | Docket docket=new Docket(DocumentationType.SWAGGER_2).apiInfo(createA()).select(). 30 | apis(RequestHandlerSelectors.basePackage("com.zz.ikeeping.api.resource.controller")). 31 | build(); 32 | return docket; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/IkeepingApiApplication.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.builder.SpringApplicationBuilder; 6 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 7 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 8 | import org.springframework.cloud.openfeign.EnableFeignClients; 9 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 10 | 11 | /** 12 | * @author DJL 13 | * @create 2019-06-24 21:50 14 | * @desc api开关 15 | **/ 16 | @SpringBootApplication 17 | @EnableDiscoveryClient // 开启注册发现 18 | @EnableSwagger2 // 开启swagger在线api文档功能 19 | @EnableFeignClients // 此注解的作用是扫描标记了@FeignClient的接口并创建实例bean 20 | public class IkeepingApiApplication extends SpringBootServletInitializer { 21 | public static void main(String[] args) { 22 | SpringApplication.run(IkeepingApiApplication.class, args); 23 | } 24 | 25 | /** 26 | * 重写configure方法实现项目war运行 27 | * 28 | * @param builder 29 | * @return 30 | */ 31 | @Override 32 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 33 | return builder.sources(IkeepingApiApplication.class); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ikeeping_message/src/main/resources/mapper/MessageLogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | id, mid, createtime, ip, info 14 | 15 | 22 | 23 | 26 | 27 | insert into messagelog ( mid, createtime, ip, info) 28 | values (#{mid,jdbcType=INTEGER},now(), #{ip,jdbcType=VARCHAR},#{info,jdbcType=VARCHAR}) 29 | 30 | 31 | -------------------------------------------------------------------------------- /ikeeping_eureka/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ikeeping_parent 7 | com.zz.ikeeping 8 | 0.1 9 | 10 | 4.0.0 11 | ikeeping_eureka 12 | war 13 | 14 | 15 | 16 | org.springframework.boot 17 | spring-boot-starter-web 18 | 19 | 20 | 21 | org.springframework.cloud 22 | spring-cloud-starter-netflix-eureka-server 23 | 24 | 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-maven-plugin 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/controller/NewsController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news.controller; 2 | 3 | 4 | import com.zz.ikeeping.common.vo.R; 5 | import com.zz.ikeeping.entity.News; 6 | import com.zz.ikeeping.news.service.NewsService; 7 | import io.swagger.annotations.Api; 8 | import io.swagger.annotations.ApiOperation; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.GetMapping; 12 | import org.springframework.web.bind.annotation.PostMapping; 13 | import org.springframework.web.bind.annotation.RequestBody; 14 | import org.springframework.web.bind.annotation.ResponseBody; 15 | import org.springframework.web.multipart.MultipartFile; 16 | 17 | import java.util.Map; 18 | 19 | @Api(value = "咨讯操作",tags = "咨讯操作") 20 | @Controller 21 | @ResponseBody 22 | public class NewsController { 23 | @Autowired 24 | private NewsService newsService; 25 | 26 | @ApiOperation(value = "添加",notes = "添加") 27 | @PostMapping("/news/add.do") 28 | public R add(@RequestBody News news){ 29 | 30 | return newsService.insert(news); 31 | 32 | } 33 | 34 | @ApiOperation(value = "查询全部分页",notes = "查询全部") 35 | @PostMapping("/news/find.do") 36 | public R find( @RequestBody Map map){ 37 | 38 | return newsService.queryPage(map); 39 | 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /ikeeping_message/src/main/java/com/zz/ikeeping/message/core/controller/MessageController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.message.core.controller; 2 | 3 | 4 | import com.zz.ikeeping.common.vo.R; 5 | import com.zz.ikeeping.message.core.entity.Message; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestBody; 10 | import org.springframework.web.bind.annotation.RestController; 11 | import com.zz.ikeeping.message.core.service.MessageService; 12 | 13 | import javax.servlet.http.HttpServletRequest; 14 | 15 | /** 16 | *@Author feri 17 | *@Date Created in 2019/6/13 13:10 18 | */ 19 | @RestController 20 | public class MessageController { 21 | @Autowired 22 | private MessageService messageService; 23 | // @GetMapping("/message/page.do") 24 | /* public R all(int page, int count){ 25 | return messageService.page(page, count); 26 | }*/ 27 | // 发送手机验证码 28 | @PostMapping("/message/sendmsg.do") 29 | public R sendMsg(@RequestBody Message message, HttpServletRequest request){ 30 | return messageService.sendMessage(message,request.getRemoteAddr()); 31 | } 32 | // 验证手机验证码是否正确 33 | @GetMapping("/message/checkcode.do") 34 | public R check(String phone,int code){ 35 | return messageService.checkCode(phone, code); 36 | } 37 | } -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/service/GoodsService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import org.springframework.cloud.openfeign.FeignClient; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestParam; 7 | 8 | @FeignClient(name = "ShopProvider") 9 | public interface GoodsService { 10 | 11 | @GetMapping("/goods/list/level") 12 | R levelList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count); 13 | 14 | @GetMapping("/goods/list/price/asc") 15 | R priceAscList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count); 16 | @GetMapping("/goods/list/price/desc") 17 | R priceDescList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count); 18 | 19 | @GetMapping("/goods/list/sellcount/asc") 20 | R sellAscList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count); 21 | @GetMapping("/goods/list/sellcount/desc") 22 | R sellDescList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count); 23 | 24 | @GetMapping("/goods/detail") 25 | R detail(@RequestParam("gid") Integer gid); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/controller/UserSignController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.server.user.service.UserSignService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestParam; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | 12 | @RestController 13 | public class UserSignController { 14 | @Autowired 15 | private UserSignService signService; 16 | 17 | //查询所有签到记录 18 | @GetMapping("usersign/all.do") 19 | public R all(@RequestParam("token") String token){ 20 | return signService.queryByUid(token); 21 | } 22 | //查询最近的签到信息 23 | @GetMapping("/usersign/single.do") 24 | public R single(@RequestParam("token") String token){ 25 | return signService.querySingle(token); 26 | } 27 | //查询5/30天内签到 28 | @GetMapping("/usersign/day.do") 29 | public R signDays(@RequestParam("token") String token,@RequestParam("days") int days){ 30 | return signService.queryByDays(token, days); 31 | } 32 | //签到 33 | @PostMapping("/usersign/signsave.do") 34 | public R save(@RequestParam("token") String token){ 35 | return signService.saveSign(token); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /ikeeping_loginApi/src/main/java/com/zz/ikeeping/api/login/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.api.login.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.RequestHandlerSelectors; 7 | import springfox.documentation.service.ApiInfo; 8 | import springfox.documentation.service.Contact; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | 12 | @Configuration //标记这是一个配置 13 | public class SwaggerConfig { 14 | public ApiInfo createA(){ 15 | ApiInfo info = new ApiInfoBuilder().title("统一登录鉴权中心-数据接口平台"). 16 | contact(new Contact("nick","https://github.com/yuuyoo/ikeeping_parent","975270653@qq.com")). 17 | description("实现统一登录鉴权中心").build(); 18 | return info; 19 | } 20 | /* 21 | * 创建AOPI应用 22 | * appinfo()增加API相关信息 23 | * 通过select()函数返回一个ApiSelectorBuilder实例 24 | * 用来控制那些接口暴露给Swagger来展现 25 | * 采用置顶扫描的包路径来定意思置顶的要建立API的目录 26 | * */ 27 | @Bean 28 | public Docket createDocket(){ 29 | Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(createA()).select(). 30 | apis(RequestHandlerSelectors.basePackage("com.zz.ikeeping.api.login.controller")). 31 | build(); 32 | return docket; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/controller/AddressController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.Address; 5 | import com.zz.ikeeping.server.user.service.AddressService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.*; 8 | 9 | @RestController 10 | public class AddressController { 11 | @Autowired 12 | private AddressService addressService; 13 | // 查询指定用户的所有非默认地址 14 | @GetMapping("address/selectByUid.do") 15 | public R selectAddByUid(@RequestParam("token") String token){ 16 | return addressService.selectById(token); 17 | } 18 | // 添加指定用户的收货地址 19 | @PostMapping("address/insert.do") 20 | public R insert(@RequestBody Address address) { 21 | return addressService.insert(address); 22 | } 23 | // 查询用户的默认收货地址 24 | @GetMapping("address/selectByDefult") 25 | public R selectByDefult(String token) { 26 | return addressService.selectByDefult(token); 27 | } 28 | // 修改收货地址信息 29 | @PostMapping("address/updateadd") 30 | public R updateadd(@RequestBody Address address) { 31 | return addressService.updateByAddid(address); 32 | } 33 | // 删除指定id的地址信息 34 | @DeleteMapping("address/deleteById") 35 | public R deleteById(@RequestParam("addid")Integer addid) { 36 | return addressService.deleteById(addid); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/service/impl/CartVoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.service.impl; 2 | 3 | import com.zz.ikeeping.common.jwt.JwtUtil; 4 | import com.zz.ikeeping.common.vo.R; 5 | import com.zz.ikeeping.service.login.dao.CartDao; 6 | import com.zz.ikeeping.service.login.model.LoginToken; 7 | import com.zz.ikeeping.service.login.service.CartVoService; 8 | import com.zz.ikeeping.service.login.utils.UserTokenUtil; 9 | import com.zz.ikeeping.service.login.vo.CartVo; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | import org.springframework.web.bind.annotation.RequestParam; 13 | 14 | import java.util.List; 15 | 16 | @Service 17 | public class CartVoServiceImpl implements CartVoService { 18 | /** 19 | * @author : nick 20 | * @date : 2019-06-30 21:32 21 | **/ 22 | @Autowired 23 | private CartDao cartDao; 24 | 25 | 26 | @Override 27 | public R all() { 28 | // LoginToken loginToken= UserTokenUtil.parseToken(JwtUtil.parseJWT(token)); 29 | // int id = loginToken.getUid(); 30 | List cartVos = cartDao.selectAll(); 31 | return R.setOK("OK",cartVos); 32 | } 33 | 34 | @Override 35 | public R delete(@RequestParam(value="id",required=true) List id) { 36 | int i = cartDao.deleteById(id); 37 | if (i ==0 ){ 38 | return R.setERROR("删除失败"); 39 | } 40 | return R.setOK("删除成功"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ikeeping_message/src/main/resources/mapper/MessageMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | id, pcode, type, title, content, receive, flag 16 | 17 | 23 | 24 | 25 | insert into message (pcode, type, title, content, receive, flag) 26 | values (#{pcode,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, 27 | #{title,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{receive,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}) 28 | 29 | 30 | -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/java/com/zz/ikeeping/pay/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.RequestHandlerSelectors; 7 | import springfox.documentation.service.ApiInfo; 8 | import springfox.documentation.service.Contact; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | 12 | /** 13 | * 配置swagger 14 | */ 15 | @Configuration //标记这是一个配置 16 | public class SwaggerConfig { 17 | /** 18 | * 创建API的基本信息(这些基本信息会展示在文档页面中) 19 | * 访问地址: http://项目实际地址/swagger-ui.html 20 | * */ 21 | public ApiInfo createA(){ 22 | ApiInfo info=new ApiInfoBuilder().title("统一支付管理平台"). 23 | contact( new Contact("DJL","","yuuyoo@163.com")). 24 | description("实现支付功能").build(); 25 | return info; 26 | } 27 | /** 28 | * 创建API应用 29 | * appinfo()增加API相关信息 30 | * 通过select()函数返回一个ApiSelectorBuilder实例, 31 | * 用来控制那些接口暴露给Swagger来展现 32 | * 采用置顶扫描的包路径来定义指定要建立API的目录 33 | */ 34 | @Bean//创建对象 修饰方法 方法的返回值必须是引用类型 对象存储在IOC容器 35 | public Docket createDocket(){ 36 | Docket docket=new Docket(DocumentationType.SWAGGER_2).apiInfo(createA()).select(). 37 | apis(RequestHandlerSelectors.basePackage("com.zz.ikeeping.pay.controller")). 38 | build(); 39 | return docket; 40 | } 41 | } -------------------------------------------------------------------------------- /ikeeping_loginApi/src/main/java/com/zz/ikeeping/api/login/service/LoginService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.api.login.service; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | 5 | import com.zz.ikeeping.entity.User; 6 | import org.springframework.cloud.openfeign.FeignClient; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestBody; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | import java.rmi.server.UID; 14 | import java.util.List; 15 | 16 | @FeignClient(name = "LoginProvider") 17 | public interface LoginService { 18 | //登录 19 | @PostMapping("/login/login.do") 20 | R login(@RequestParam("phone")String phone, @RequestParam("password")String password); 21 | 22 | //检查是否有效 23 | @GetMapping("/login/checklogin.do") 24 | R check(@RequestParam("token")String token); 25 | 26 | //注销 27 | @GetMapping("/login/exit.do") 28 | R exit(@RequestParam("token")String token); 29 | //更新用户信息 30 | @PostMapping("/user/update.do") 31 | R update(@RequestBody User user); 32 | 33 | //根据id删除购物车的信息 34 | @GetMapping("/cart/delete.do") 35 | R delete(@RequestParam(value="id",required=true) List id); 36 | 37 | //查询购物车的所有商品的信息,展示商品的名称、价格、图片地址、数量 38 | @GetMapping("/cart/all.do") 39 | R selectAllCart(); 40 | 41 | //根据状态查询订单详情 42 | @GetMapping("/order/.select.do") 43 | R selectByStatus(@RequestParam("status") int status,@RequestParam("uid") int uid); 44 | } -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/java/com/zz/ikeeping/pay/controller/AliPayController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.pay.entity.AliPay; 5 | import com.zz.ikeeping.pay.service.AliPayService; 6 | import io.swagger.annotations.Api; 7 | import io.swagger.annotations.ApiOperation; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestBody; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | /** 15 | * @author DJL 16 | * @create 2019-06-28 20:11 17 | * @desc 支付宝支付控制器端口 18 | **/ 19 | @Api(value = "统一的支付宝支付接口平台", tags = "支付宝支付数据接口") 20 | @RestController 21 | public class AliPayController { 22 | 23 | @Autowired(required = false) 24 | private AliPayService aliPayService; 25 | 26 | // 生成订单支付信息 27 | @ApiOperation("生成支付宝支付订单信息") 28 | @PostMapping("/pay/alipay/orderpay.do") 29 | public R orderPay(@RequestBody AliPay pay) { 30 | return aliPayService.orderPay(pay); 31 | } 32 | 33 | // 查询订单支付状态 34 | @ApiOperation("查询支付宝支付订单信息") 35 | @GetMapping("/pay/alipay/querypay.do") 36 | public R queryOrderPay( String orderNo) { 37 | return aliPayService.queryOrderPay(orderNo); 38 | } 39 | 40 | // 关闭支付订单 41 | @ApiOperation("关闭支付宝支付订单") 42 | @PostMapping("/pay/alipay/closepay.do") 43 | public R closeOrderPay(String orderNo) { 44 | return aliPayService.closeOrderPay(orderNo); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/service/impl/NewsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news.service.impl; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import com.zz.ikeeping.common.vo.PageBean; 6 | import com.zz.ikeeping.common.vo.R; 7 | import com.zz.ikeeping.entity.News; 8 | import com.zz.ikeeping.news.dao.NewsMapper; 9 | import com.zz.ikeeping.news.service.NewsService; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | import org.springframework.web.multipart.MultipartFile; 13 | 14 | import java.util.Date; 15 | import java.util.List; 16 | import java.util.Map; 17 | 18 | @Service 19 | public class NewsServiceImpl implements NewsService { 20 | @Autowired 21 | private NewsMapper newsMapper; 22 | @Override 23 | public R insert(News news) { 24 | newsMapper.insert(news); 25 | return R.setOK(); 26 | } 27 | 28 | @Override 29 | public R queryPage(Map map) { 30 | int page = Integer.parseInt(map.get("page")); 31 | int count =Integer.parseInt(map.get("count")); 32 | PageHelper.startPage(page,count); 33 | PageInfo pageInfo = new PageInfo(newsMapper.selectAll(map)); 34 | PageBean pageBean = new PageBean<>(); 35 | pageBean.setCount(count); 36 | pageBean.setCurrPage(page); 37 | pageBean.setTotalPage(pageInfo.getPages()); 38 | pageBean.setTotalCount((int) pageInfo.getTotal()); 39 | pageBean.setData(pageInfo.getList()); 40 | return R.setOK("ok",pageBean); 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/java/com/zz/ikeeping/pay/controller/WechatPayController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.pay.entity.WechatPay; 5 | import com.zz.ikeeping.pay.service.WechatPayService; 6 | import io.swagger.annotations.Api; 7 | import io.swagger.annotations.ApiOperation; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestBody; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | /** 15 | * @author DJL 16 | * @create 2019-06-27 22:30 17 | * @desc 微信支付控制器 18 | **/ 19 | @Api(value = "统一的微信支付接口平台", tags = "微信支付数据接口") 20 | @RestController 21 | public class WechatPayController { 22 | 23 | @Autowired(required = false) 24 | private WechatPayService wechatPayService; 25 | 26 | // 生成订单支付信息 27 | @ApiOperation("生成微信支付订单信息") 28 | @PostMapping("/pay/wechat/orderpay.do") 29 | public R orderPay(@RequestBody WechatPay pay) { 30 | return wechatPayService.orderPay(pay); 31 | } 32 | 33 | // 查询订单支付状态 34 | @ApiOperation("查询微信支付订单信息") 35 | @GetMapping("/pay/wechat/querypay.do") 36 | public R queryOrderPay( String orderNo) { 37 | return wechatPayService.queryOrderPay(orderNo); 38 | } 39 | 40 | // 关闭支付订单 41 | @ApiOperation("关闭微信支付订单") 42 | @PostMapping("/pay/wechat/closepay.do") 43 | public R closeOrderPay(String orderNo) { 44 | return wechatPayService.closeOrderPay(orderNo); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.RequestHandlerSelectors; 7 | import springfox.documentation.service.ApiInfo; 8 | import springfox.documentation.service.Contact; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | 12 | /** 13 | *@Author feri 14 | *@Date Created in 2019/6/3 14:45 15 | * Swagger设置 16 | */ 17 | @Configuration //标记这是一个配置 18 | public class SwaggerConfig { 19 | /** 20 | * 创建API的基本信息(这些基本信息会展示在文档页面中) 21 | * 访问地址: http://项目实际地址/swagger-ui.html 22 | * */ 23 | public ApiInfo createA(){ 24 | ApiInfo info=new ApiInfoBuilder().title("统一消息平台"). 25 | contact( new Contact("杨超杰","http://www.mobiletrain.org","2687518378@qq.com")). 26 | description("实现短信、邮箱等发送信息").build(); 27 | return info; 28 | } 29 | /** 30 | * 创建API应用 31 | * appinfo()增加API相关信息 32 | * 通过select()函数返回一个ApiSelectorBuilder实例, 33 | * 用来控制那些接口暴露给Swagger来展现 34 | * 采用置顶扫描的包路径来定义指定要建立API的目录 35 | */ 36 | @Bean//创建对象 修饰方法 方法的返回值必须是引用类型 对象存储在IOC容器 37 | public Docket createDocket(){ 38 | Docket docket=new Docket(DocumentationType.SWAGGER_2).apiInfo(createA()).select(). 39 | apis(RequestHandlerSelectors.basePackage("com.zz.ikeeping.news.controller")). 40 | build(); 41 | return docket; 42 | } 43 | } -------------------------------------------------------------------------------- /ikeeping_message/src/main/java/com/zz/ikeeping/message/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.message.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.RequestHandlerSelectors; 7 | import springfox.documentation.service.ApiInfo; 8 | import springfox.documentation.service.Contact; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | 12 | /** 13 | *@Author feri 14 | *@Date Created in 2019/6/3 14:45 15 | * Swagger设置 16 | */ 17 | @Configuration //标记这是一个配置 18 | public class SwaggerConfig { 19 | /** 20 | * 创建API的基本信息(这些基本信息会展示在文档页面中) 21 | * 访问地址: http://项目实际地址/swagger-ui.html 22 | * */ 23 | public ApiInfo createA(){ 24 | ApiInfo info=new ApiInfoBuilder().title("统一消息平台"). 25 | contact( new Contact("爱健身","https://github.com/yuuyoo/ikeeping_parent","")). 26 | description("实现短信、邮箱等发送信息").build(); 27 | return info; 28 | } 29 | /** 30 | * 创建API应用 31 | * appinfo()增加API相关信息 32 | * 通过select()函数返回一个ApiSelectorBuilder实例, 33 | * 用来控制那些接口暴露给Swagger来展现 34 | * 采用置顶扫描的包路径来定义指定要建立API的目录 35 | */ 36 | @Bean//创建对象 修饰方法 方法的返回值必须是引用类型 对象存储在IOC容器 37 | public Docket createDocket(){ 38 | Docket docket=new Docket(DocumentationType.SWAGGER_2).apiInfo(createA()).select(). 39 | apis(RequestHandlerSelectors.basePackage("com.zz.ikeeping.message.core.controller")). 40 | build(); 41 | return docket; 42 | } 43 | } -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.RequestHandlerSelectors; 7 | import springfox.documentation.service.ApiInfo; 8 | import springfox.documentation.service.Contact; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | 12 | /** 13 | * @author DJL 14 | * @create 2019-06-24 21:58 15 | * @desc 统一API接口平台 16 | **/ 17 | @Configuration 18 | public class SwaggerConfig { 19 | /** 20 | * 创建API的基本信息(这些基本信息会展示在文档页面中) 21 | * 访问地址: http://项目实际地址/swagger-ui.html 22 | * */ 23 | public ApiInfo createA(){ 24 | ApiInfo info=new ApiInfoBuilder().title("iKeeping-爱健身统一API接口平台"). 25 | contact( new Contact("iKeeping-爱健身","https://github.com/yuuyoo/ikeeping_parent","yuuyoo@163.com")). 26 | description("实现API请求").build(); 27 | return info; 28 | } 29 | /** 30 | * 创建API应用 31 | * appinfo()增加API相关信息 32 | * 通过select()函数返回一个ApiSelectorBuilder实例, 33 | * 用来控制那些接口暴露给Swagger来展现 34 | * 采用置顶扫描的包路径来定义指定要建立API的目录 35 | */ 36 | @Bean//创建对象 修饰方法 方法的返回值必须是引用类型 对象存储在IOC容器 37 | public Docket createDocket(){ 38 | Docket docket=new Docket(DocumentationType.SWAGGER_2).apiInfo(createA()).select(). 39 | apis(RequestHandlerSelectors.basePackage("com.zz.ikeeping.ikeeping_api.controller")). 40 | build(); 41 | return docket; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ikeeping_sns/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ikeeping_parent 7 | com.zz.ikeeping 8 | 0.1 9 | 10 | 4.0.0 11 | 12 | ikeeping_sns 13 | 14 | 15 | 16 | com.zz.ikeeping 17 | ikeeping_entity 18 | 19 | 20 | 21 | com.zz.ikeeping 22 | ikeeping_common 23 | 24 | 25 | 26 | org.springframework.cloud 27 | spring-cloud-starter-netflix-eureka-client 28 | 29 | 30 | 31 | 32 | mysql 33 | mysql-connector-java 34 | 35 | 36 | 37 | 38 | org.mybatis.spring.boot 39 | mybatis-spring-boot-starter 40 | 41 | 42 | 43 | 44 | com.alibaba 45 | druid 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /ikeeping_sports/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ikeeping_parent 7 | com.zz.ikeeping 8 | 0.1 9 | 10 | 4.0.0 11 | 12 | ikeeping_sports 13 | 14 | 15 | com.zz.ikeeping 16 | ikeeping_entity 17 | 18 | 19 | 20 | com.zz.ikeeping 21 | ikeeping_common 22 | 23 | 24 | 25 | org.springframework.cloud 26 | spring-cloud-starter-netflix-eureka-client 27 | 28 | 29 | 30 | 31 | mysql 32 | mysql-connector-java 33 | 34 | 35 | 36 | 37 | org.mybatis.spring.boot 38 | mybatis-spring-boot-starter 39 | 40 | 41 | 42 | 43 | com.alibaba 44 | druid 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ikeeping_sns/src/main/resources/mapper/CommentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | rid, ruid, rcontent, rimgurl, rnumber, rcount, rzan 7 | 8 | 9 | 11 | 22 | 23 | 24 | insert into t_comment(ruid,uid,cmid,content,creatortime) values(#{ruid},#{uid},#{cmid},#{content},now()); 25 | 26 | 27 | 28 | insert into t_comment(ruid,uid,cmid,content,creatortime) values(#{ruid},#{uid},#{cmid},#{content},now()); 29 | 30 | 31 | 34 | 35 | 36 | update t_comment set count=#{count} where id = #{id} 37 | 38 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/service/SnsService.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.service; 2 | 3 | 4 | import com.zz.ikeeping.common.vo.R; 5 | import com.zz.ikeeping.entity.Comment; 6 | import com.zz.ikeeping.entity.CommunityDetail; 7 | import org.springframework.cloud.openfeign.FeignClient; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | @FeignClient(name = "CommentProvider") 11 | public interface SnsService { 12 | 13 | @GetMapping("sns/showTopicType.do") 14 | R selectTopicType(); 15 | 16 | @GetMapping("sns/selectDetail.do") 17 | R selectDetail(); 18 | 19 | @GetMapping("sns/showTopicComment.do") 20 | R showTopicComment(@RequestParam("id") int id); 21 | 22 | @GetMapping("sns/commentCount.do") 23 | R commentCount(@RequestParam("id") int id); 24 | 25 | @GetMapping("sns/newPublishTopicDetail.do") 26 | R newPublishTopicDetail(@RequestParam("cmid") int cmid); 27 | 28 | @GetMapping("sns/showTopicAtMostComment.do") 29 | R showTopicAtMostComment(@RequestParam("cmid") int cmid); 30 | 31 | @GetMapping("sns/pageViewCount.do") 32 | R pageViewCount(@RequestParam("id") int id, @RequestParam("IP") String IP); 33 | 34 | @GetMapping("sns/allCommont.do") 35 | R allCommont(); 36 | 37 | @PostMapping("sns/add.do") 38 | R add(@RequestBody CommunityDetail detail); 39 | 40 | @PostMapping("sns/addCommont.do") 41 | R addCommont(@RequestBody Comment comment); 42 | 43 | @PostMapping("sns/replyCommont.do") 44 | R replyCommont(@RequestBody Comment comment); 45 | 46 | @PutMapping("sns/topic.do") 47 | R topicPraise(@RequestParam("id") int id, @RequestParam("count") int count); 48 | 49 | @PutMapping("sns/commont.do") 50 | R commont(@RequestParam("id") int id, @RequestParam("count") int count); 51 | } 52 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/java/com/zz/ikeeping/news/controller/NewsDetailController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.news.controller; 2 | 3 | import com.zz.ikeeping.common.config.ProjectConfig; 4 | import com.zz.ikeeping.common.util.JedisUtil; 5 | import com.zz.ikeeping.common.vo.R; 6 | import com.zz.ikeeping.entity.NewsDetail; 7 | import com.zz.ikeeping.news.service.NewsDetailService; 8 | import io.swagger.annotations.Api; 9 | import io.swagger.annotations.ApiOperation; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.*; 13 | 14 | @Api(value = "咨讯详情",tags = "咨询详情") 15 | @Controller 16 | @ResponseBody 17 | public class NewsDetailController { 18 | @Autowired 19 | private NewsDetailService detailService; 20 | 21 | //rcount打赏数 22 | @ApiOperation(value = "详情查询",notes ="详情查询") 23 | @GetMapping("/newsd/find.do") 24 | public R find(int id){ 25 | return detailService.selectAll(id); 26 | } 27 | 28 | 29 | @ApiOperation(value = "更新",notes ="详情查询") 30 | @PutMapping("/newsd/update.do") 31 | public R update(@RequestBody NewsDetail detail){ 32 | return detailService.update(detail); 33 | } 34 | 35 | @ApiOperation(value = "推送健身类型",notes ="详情查询") 36 | @GetMapping("/newsd/push.do") 37 | public R push(String newstype){ 38 | 39 | return R.setOK("ok",detailService.push(newstype)); 40 | } 41 | 42 | @ApiOperation(value = "推送营养餐",notes ="详情查询") 43 | @GetMapping("/newsd/pushgood.do") 44 | public R pushgood(String name){ 45 | return R.setOK("ok",detailService.pushgood(name)); 46 | } 47 | 48 | @ApiOperation(value = "推荐优惠卷",notes ="详情查询") 49 | @GetMapping("/newsd/sale.do") //详情id 50 | public R sale(int id){ 51 | return R.setOK("ok",detailService.sale(id)); 52 | } 53 | 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/java/com/zz/ikeeping/pay/controller/QrCodeController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay.controller; 2 | 3 | import com.zz.ikeeping.common.util.Base64Util; 4 | import com.zz.ikeeping.pay.util.QrCodeUtil; 5 | import io.swagger.annotations.Api; 6 | import io.swagger.annotations.ApiOperation; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | 10 | import javax.imageio.ImageIO; 11 | import javax.servlet.http.HttpServletResponse; 12 | import java.awt.image.BufferedImage; 13 | import java.io.IOException; 14 | 15 | /** 16 | * @author DJL 17 | * @create 2019-06-28 16:52 18 | * @desc 根据接收的支付地址转为支付二维码 19 | **/ 20 | @Api(value = "支付链接生成二维码", tags = "支付链接生成二维码图片数据接口") 21 | @Controller 22 | public class QrCodeController { 23 | 24 | 25 | @ApiOperation("普通支付链接生成二维码图片") 26 | @GetMapping("/pay/qrcode/createqrcode.do") 27 | public void createQrCode(String msg, HttpServletResponse response) { 28 | // 根据支付地址生成二维码 29 | BufferedImage image = QrCodeUtil.createQrCode(msg, 400); 30 | // 将二维码图片通过响应对象输出到用户浏览器 31 | try { 32 | ImageIO.write(image, "png", response.getOutputStream()); 33 | } catch (IOException e) { 34 | e.printStackTrace(); 35 | } 36 | } 37 | 38 | @ApiOperation("Base64编码的支付链接生成二维码图片") 39 | @GetMapping("/pay/qrcode/payqrcode.do") 40 | public void payCode(String msg, HttpServletResponse response) { 41 | // 地址解码 42 | String payUrl = new String(Base64Util.base64Dec(msg)); 43 | // 根据支付地址生成二维码 44 | BufferedImage image = QrCodeUtil.createQrCode(payUrl, 400); 45 | // 将二维码图片通过响应对象输出到用户浏览器 46 | try { 47 | ImageIO.write(image, "png", response.getOutputStream()); 48 | } catch (IOException e) { 49 | e.printStackTrace(); 50 | } 51 | } 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/controller/UserSignController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.controller; 2 | 3 | import com.zz.ikeeping.common.config.ProjectConfig; 4 | import com.zz.ikeeping.common.vo.R; 5 | import com.zz.ikeeping.ikeeping_api.service.UserSignService; 6 | import io.swagger.annotations.Api; 7 | import io.swagger.annotations.ApiOperation; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestParam; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | import javax.servlet.http.HttpServletRequest; 15 | 16 | @RestController 17 | @Api(value = "用户签到接口",tags = "用户签到接口") 18 | public class UserSignController { 19 | @Autowired 20 | private UserSignService signService; 21 | //查询所有的签到信息 22 | @ApiOperation(value = "查询所有的签到信息") 23 | @GetMapping("usersign/all.do") 24 | public R all(HttpServletRequest request){ 25 | return signService.all(request.getHeader(ProjectConfig.TOKENHEAD)); 26 | } 27 | 28 | @ApiOperation(value = "查看最近签到信息") 29 | @GetMapping("/usersign/single.do") 30 | public R single(HttpServletRequest request){ 31 | return signService.single(request.getHeader(ProjectConfig.TOKENHEAD)); 32 | } 33 | @ApiOperation(value = "5/30天内签到信息") 34 | @GetMapping("/usersign/day.do") 35 | public R signDays(HttpServletRequest request,@RequestParam("days") int days){ 36 | return signService.signDays(request.getHeader(ProjectConfig.TOKENHEAD),days); 37 | } 38 | @ApiOperation(value = "签到") 39 | @PostMapping("/usersign/signsave.do") 40 | public R save(HttpServletRequest request){ 41 | return signService.save(request.getHeader(ProjectConfig.TOKENHEAD)); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/service/impl/UserUpdateServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.service.impl; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.zz.ikeeping.common.config.ProjectConfig; 5 | import com.zz.ikeeping.common.jwt.JwtUtil; 6 | import com.zz.ikeeping.common.util.EncryptionUtil; 7 | import com.zz.ikeeping.common.util.JedisUtil; 8 | import com.zz.ikeeping.common.vo.R; 9 | import com.zz.ikeeping.entity.User; 10 | import com.zz.ikeeping.service.login.dao.UserInfoDao; 11 | import com.zz.ikeeping.service.login.model.LoginToken; 12 | import com.zz.ikeeping.service.login.service.UserUpdateService; 13 | import com.zz.ikeeping.service.login.utils.UserTokenUtil; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.stereotype.Service; 16 | 17 | import javax.servlet.http.HttpServletRequest; 18 | 19 | @Service 20 | public class UserUpdateServiceImpl implements UserUpdateService { 21 | 22 | 23 | @Autowired 24 | private UserInfoDao userInfoDao; 25 | @Autowired 26 | private JedisUtil jedisUtil; 27 | 28 | @Override 29 | public R UserInfoUpdate(User user) { 30 | user.setPassword(EncryptionUtil.RSAEnc(ProjectConfig.PASSRSAPRI,user.getPassword())); 31 | 32 | int i = userInfoDao.userInfoupdate(user); 33 | if (i == 0){ 34 | return R.setERROR("更新操作失败"); 35 | } 36 | return R.setOK("更新成功",i); 37 | } 38 | public static void main(String[] args) { 39 | 40 | 41 | String token ="eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI1OTQ5NDAzMjc3Nzc3OTYwOTYiLCJzdWIiOiJ7XCJpZFwiOlwiNTk0OTQwMzI3Nzc3Nzk2MDk2XCIsXCJwaG9uZVwiOlwiMTg1MzAyNTAzMjFcIixcInVpZFwiOjN9IiwiaWF0IjoxNTYxODg2NDI3LCJleHAiOjE1NjE4ODgyMjd9.EB6YaDSHYfjM6cG0vUhXHwmFFIN5p6GP4J7hC5tpsXY"; 42 | LoginToken loginToken= UserTokenUtil.parseToken(JwtUtil.parseJWT(token)); 43 | System.out.println(loginToken.getUid()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ikeeping_common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ikeeping_parent 7 | com.zz.ikeeping 8 | 0.1 9 | 10 | 4.0.0 11 | ikeeping_common 12 | 13 | jar 14 | 15 | 16 | org.projectlombok 17 | lombok 18 | 19 | 20 | 21 | redis.clients 22 | jedis 23 | 24 | 25 | 26 | com.alibaba 27 | fastjson 28 | 29 | 30 | 31 | javax.mail 32 | mail 33 | 34 | 35 | com.auth0 36 | java-jwt 37 | 38 | 39 | 40 | io.jsonwebtoken 41 | jjwt 42 | 43 | 44 | org.projectlombok 45 | lombok 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /ikeeping_sns/src/main/resources/mapper/CommunityDetailMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | xqid, cmid, uid, nrtime, gps, xqcontent, xqimgurl 7 | 8 | 9 | 16 | 17 | 25 | 26 | 27 | update t_communitydetail set count=#{count} where id = #{id} 28 | 29 | 30 | 31 | insert into t_communitydetail(cmid,uid,pubtime,location,content,imgurl,count) values(#{cmid},#{uid},now(),#{location},#{content},#{imgurl},#{count}) 32 | 33 | 34 | 45 | -------------------------------------------------------------------------------- /ikeeping_serverUser/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ikeeping_parent 7 | com.zz.ikeeping 8 | 0.1 9 | 10 | 4.0.0 11 | 12 | ikeeping_serverUser 13 | 14 | 15 | com.zz.ikeeping 16 | ikeeping_entity 17 | 18 | 19 | com.zz.ikeeping 20 | ikeeping_common 21 | 22 | 23 | org.springframework.cloud 24 | spring-cloud-starter-netflix-eureka-client 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-web 30 | 31 | 32 | 33 | 34 | com.zz.ikeeping 35 | ikeeping_entity 36 | 37 | 38 | 39 | 40 | mysql 41 | mysql-connector-java 42 | 43 | 44 | 45 | com.alibaba 46 | druid 47 | 48 | 49 | 50 | 51 | org.mybatis.spring.boot 52 | mybatis-spring-boot-starter 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /ikeeping_loginApi/src/main/java/com/zz/ikeeping/api/login/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.api.login.controller; 2 | 3 | import com.zz.ikeeping.api.login.service.LoginService; 4 | 5 | import com.zz.ikeeping.common.config.ProjectConfig; 6 | import com.zz.ikeeping.common.vo.R; 7 | 8 | import com.zz.ikeeping.entity.User; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | import java.util.List; 14 | 15 | 16 | @RestController 17 | public class LoginController { 18 | @Autowired 19 | private LoginService loginService; 20 | // @Autowired 21 | // private UpdateService updateService; 22 | //登录 23 | @PostMapping("/api/login/login.do") 24 | public R login(String phone, String password){ 25 | return loginService.login(phone, password); 26 | } 27 | 28 | //检查是否有效 29 | @GetMapping("api/login/checklogin.do") 30 | public R check(HttpServletRequest request){ 31 | return loginService.check(request.getHeader(ProjectConfig.TOKENHEAD)); 32 | } 33 | 34 | //注销 35 | @GetMapping("/login/exit.do") 36 | public R exit(HttpServletRequest request){ 37 | return loginService.exit(request.getHeader(ProjectConfig.TOKENHEAD)); 38 | 39 | } 40 | 41 | //更新用户信息 42 | @PostMapping("/api/user/update.do") 43 | public R udate(@RequestBody User user){ 44 | return loginService.update(user); 45 | } 46 | 47 | //根据id删除购物车的商品信息 48 | @GetMapping("/api/cart/delete.do") 49 | public R delete(@RequestParam(value="id",required=true) List id){ 50 | return loginService.delete(id); 51 | } 52 | 53 | //查询购物车的有所的商品信息展示购物车的商品的名称、价格、图片地址、数量 54 | @GetMapping("/api/cart/all.do") 55 | public R selectAllCart(){ 56 | return loginService.selectAllCart(); 57 | } 58 | 59 | //根据状态查询订单详情 60 | @GetMapping("/api/order/select.do") 61 | public R selectByStatus(int status, int uid){ 62 | return loginService.selectByStatus(status,uid); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /ikeeping_common/src/main/java/com/zz/ikeeping/common/util/FileUtil.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.common.util; 2 | 3 | import sun.java2d.pipe.SpanShapeRenderer; 4 | 5 | import java.io.File; 6 | import java.text.SimpleDateFormat; 7 | import java.util.Date; 8 | import java.util.UUID; 9 | 10 | public class FileUtil { 11 | public static File createDir(String realFile,String desFile){ 12 | File dir=new File(realFile,desFile); 13 | if(!dir.exists()){ 14 | dir.mkdirs(); 15 | } 16 | return dir; 17 | } 18 | //每月新建文件夹 19 | public static File createMonthDir(String realFile,String desFile) { 20 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM"); 21 | String dirName=sdf.format(new Date()); 22 | File dir=createDir(realFile, desFile); 23 | //是否存在当前月份的文件夹 24 | // String[] dirs=dir.list(); 25 | // boolean isHave=false; 26 | // for(String f:dirs){ 27 | // if(f.equals(dirName)){ 28 | // isHave=true; 29 | // } 30 | // } 31 | File desDir=new File(dir,dirName); 32 | if(!desDir.exists()){ 33 | desDir.mkdirs(); 34 | } 35 | return desDir; 36 | } 37 | //每日新建文件夹 38 | public static File createDayDir(String realFile,String desFile) { 39 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); 40 | String dirName=sdf.format(new Date()); 41 | File dir=createDir(realFile, desFile); 42 | File desDir=new File(dir,dirName); 43 | if(!desDir.exists()){ 44 | desDir.mkdirs(); 45 | } 46 | return desDir; 47 | } 48 | //自动清除3个月以上的日志内容 49 | public static boolean clearDir(String realFile,String desFile){ 50 | return true; 51 | } 52 | //截取并重命名 53 | public static String renameFile(String fileName){ 54 | if(fileName.length()>50){ 55 | fileName=fileName.substring(fileName.length()-50); 56 | } 57 | return System.currentTimeMillis()+"_"+UUID.randomUUID().toString().replace("-","")+"_"+fileName; 58 | } 59 | 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/controller/GoodsController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.ikeeping_api.service.GoodsService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestParam; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | @RestController 11 | public class GoodsController { 12 | 13 | @Autowired 14 | private GoodsService goodsService; 15 | 16 | @GetMapping("/api/goods/") 17 | public R levelList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count){ 18 | return goodsService.levelList(typeid, page, count); 19 | } 20 | 21 | @GetMapping("/api/goods/price/asc") 22 | public R priceAscList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count){ 23 | return goodsService.priceAscList(typeid, page, count); 24 | } 25 | @GetMapping("/api/goods/price/desc") 26 | public R priceDescList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count){ 27 | return goodsService.priceDescList(typeid, page, count); 28 | } 29 | 30 | @GetMapping("/api/goods/sellcount/asc") 31 | public R sellAscList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count){ 32 | return goodsService.sellAscList(typeid, page, count); 33 | } 34 | @GetMapping("/api/goods/sellcount/desc") 35 | public R sellDescList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count){ 36 | return goodsService.sellDescList(typeid, page, count); 37 | } 38 | 39 | @GetMapping("/api/goods/info") 40 | public R detail(@RequestParam("gid") Integer gid){ 41 | return goodsService.detail(gid); 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ikeeping_parent 7 | com.zz.ikeeping 8 | 0.1 9 | 10 | 4.0.0 11 | 12 | ikeeping_serverLogin 13 | war 14 | 15 | 16 | com.zz.ikeeping 17 | ikeeping_entity 18 | 19 | 20 | 21 | com.zz.ikeeping 22 | ikeeping_common 23 | 24 | 25 | 26 | mysql 27 | mysql-connector-java 28 | 29 | 30 | 31 | org.mybatis.spring.boot 32 | mybatis-spring-boot-starter 33 | 34 | 35 | 36 | com.alibaba 37 | druid 38 | 39 | 40 | org.springframework.cloud 41 | spring-cloud-starter-netflix-eureka-client 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /ikeeping_loginApi/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ikeeping_parent 7 | com.zz.ikeeping 8 | 0.1 9 | 10 | 4.0.0 11 | 12 | ikeeping_loginApi 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-web 17 | 18 | 19 | org.springframework.cloud 20 | spring-cloud-starter-netflix-eureka-client 21 | 22 | 23 | org.springframework.cloud 24 | spring-cloud-starter-openfeign 25 | 26 | 27 | 28 | 29 | io.springfox 30 | springfox-swagger2 31 | 32 | 33 | 34 | io.springfox 35 | springfox-swagger-ui 36 | 37 | 38 | org.apache.httpcomponents 39 | httpclient 40 | 41 | 42 | com.zz.ikeeping 43 | ikeeping_common 44 | 45 | 46 | com.zz.ikeeping 47 | ikeeping_entity 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /ikeeping_api/src/main/java/com/zz/ikeeping/ikeeping_api/controller/AddressController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.ikeeping_api.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.Address; 5 | import com.zz.ikeeping.ikeeping_api.service.AddressService; 6 | import io.swagger.annotations.Api; 7 | import io.swagger.annotations.ApiOperation; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | @Api(value = "地址管理接口", tags = "地址管理接口") 12 | @RestController 13 | public class AddressController { 14 | @Autowired 15 | private AddressService addressService; 16 | 17 | /** 18 | * 查询某登陆用户的所有非默认售货地址 19 | * @param token 20 | * @return 21 | */ 22 | @ApiOperation("查询某登陆用户的所有非默认售货地址") 23 | @GetMapping("api/address/selectByUid") 24 | public R selectAddByUid(@RequestParam("token") String token) { 25 | return addressService.selectAddByUid(token); 26 | } 27 | 28 | /** 29 | * 添加用户收货地址信息 30 | * @param address 31 | * @return 32 | */ 33 | @ApiOperation("添加用户收货地址信息") 34 | @PostMapping("address/insert.do") 35 | public R insert(@RequestBody Address address){ 36 | return addressService.insert(address); 37 | } 38 | 39 | /** 40 | * 查询用户的默认收货地址 41 | * @param token 42 | * @return 43 | */ 44 | @ApiOperation("查询用户的默认收货地址") 45 | @GetMapping("address/selectByDefult") 46 | public R selectByDefult(String token) { 47 | return addressService.selectByDefult(token); 48 | } 49 | 50 | /** 51 | * 修改收货地址信息 52 | * @param address 53 | * @return 54 | */ 55 | @ApiOperation("修改收货地址信息") 56 | @PostMapping("address/updateadd") 57 | public R updateadd(@RequestBody Address address) { 58 | return addressService.updateadd(address); 59 | } 60 | 61 | /** 62 | * 删除指定id的地址信息 63 | * @param addid 64 | * @return 65 | */ 66 | @ApiOperation("删除指定id的地址信息") 67 | @DeleteMapping("address/deleteById") 68 | public R deleteById(@RequestParam("addid")Integer addid) { 69 | return addressService.deleteById(addid); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /ikeeping_serverShop/src/main/java/com/zz/ikeeping/server/shop/controller/GoodsController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.shop.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.server.shop.service.GoodsService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestParam; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | @RestController 11 | public class GoodsController { 12 | 13 | @Autowired 14 | private GoodsService goodsService; 15 | 16 | @GetMapping("/goods/list/level") 17 | public R levelList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count){ 18 | return goodsService.getGoodsPageByType(typeid, page, count); 19 | } 20 | 21 | @GetMapping("/goods/list/price/asc") 22 | public R priceAscList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count){ 23 | return goodsService.getGoodsPageByTypePriceAsc(typeid, page, count); 24 | } 25 | @GetMapping("/goods/list/price/desc") 26 | public R priceDescList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count){ 27 | return goodsService.getGoodsPageByTypePriceDesc(typeid, page, count); 28 | } 29 | 30 | @GetMapping("/goods/list/sellcount/asc") 31 | public R sellAscList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count){ 32 | return goodsService.getGoodsPageByTypeSellAsc(typeid, page, count); 33 | } 34 | @GetMapping("/goods/list/sellcount/desc") 35 | public R sellDescList(@RequestParam("typeid") Integer typeid, @RequestParam("page") Integer page, @RequestParam("count") Integer count){ 36 | return goodsService.getGoodsPageByTypeSellDesc(typeid, page, count); 37 | } 38 | 39 | @GetMapping("/goods/detail") 40 | public R detail(@RequestParam("gid") Integer gid){ 41 | return goodsService.getById(gid); 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /ikeeping_payApi/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ikeeping_parent 7 | com.zz.ikeeping 8 | 0.1 9 | 10 | 4.0.0 11 | 12 | ikeeping_payApi 13 | 14 | 15 | 16 | com.google.zxing 17 | javase 18 | 19 | 20 | com.zz.ikeeping 21 | ikeeping_common 22 | 23 | 24 | 25 | org.jdom 26 | jdom 27 | 28 | 29 | org.projectlombok 30 | lombok 31 | 32 | 33 | io.springfox 34 | springfox-swagger2 35 | 36 | 37 | io.springfox 38 | springfox-swagger-ui 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-test 43 | 44 | 45 | com.alipay.sdk 46 | alipay-sdk-java 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.springframework.boot 54 | spring-boot-maven-plugin 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /ikeeping_news/src/main/resources/mapper/NewsCMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | id, nid, comment, ccount, pcount 13 | 14 | 15 | 16 | insert into t_newsc (nid, comment, 17 | ccount, pcount) 18 | values ( #{nid,jdbcType=INTEGER}, #{comment,jdbcType=VARCHAR}, 19 | #{ccount,jdbcType=INTEGER}, #{pcount,jdbcType=INTEGER}) 20 | 21 | 22 | 23 | update t_newsc 24 | 25 | 26 | nid = #{nid,jdbcType=INTEGER}, 27 | 28 | 29 | comment = #{comment,jdbcType=VARCHAR}, 30 | 31 | 32 | ccount = #{ccount,jdbcType=INTEGER}, 33 | 34 | 35 | pcount = #{pcount,jdbcType=INTEGER}, 36 | 37 | 38 | where nid= #{nid,jdbcType=INTEGER} 39 | 40 | 41 | update t_newsc 42 | set nid = #{nid,jdbcType=INTEGER}, 43 | comment = #{comment,jdbcType=VARCHAR}, 44 | ccount = #{ccount,jdbcType=INTEGER}, 45 | pcount = #{pcount,jdbcType=INTEGER} 46 | where cid = #{cid,jdbcType=INTEGER} 47 | 48 | 49 | 53 | -------------------------------------------------------------------------------- /ikeeping_resourceApi/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ikeeping_parent 7 | com.zz.ikeeping 8 | 0.1 9 | 10 | 4.0.0 11 | 12 | 13 | ikeeping_resourceApi 14 | war 15 | 16 | 17 | 18 | org.springframework.boot 19 | spring-boot-starter-web 20 | 21 | 22 | commons-fileupload 23 | commons-fileupload 24 | 25 | 26 | 27 | commons-io 28 | commons-io 29 | 30 | 31 | com.zz.ikeeping 32 | ikeeping_common 33 | 34 | 35 | 36 | 37 | io.springfox 38 | springfox-swagger2 39 | 40 | 41 | 42 | io.springfox 43 | springfox-swagger-ui 44 | 45 | 46 | com.qiniu 47 | qiniu-java-sdk 48 | 49 | 50 | com.aliyun.oss 51 | aliyun-sdk-oss 52 | 53 | 54 | -------------------------------------------------------------------------------- /ikeeping_api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ikeeping_parent 7 | com.zz.ikeeping 8 | 0.1 9 | 10 | 4.0.0 11 | 12 | ikeeping_api 13 | war 14 | 15 | 16 | org.springframework.cloud 17 | spring-cloud-starter-netflix-eureka-client 18 | 19 | 20 | org.springframework.cloud 21 | spring-cloud-starter-openfeign 22 | 23 | 24 | 25 | 26 | io.springfox 27 | springfox-swagger2 28 | 29 | 30 | 31 | io.springfox 32 | springfox-swagger-ui 33 | 34 | 35 | com.zz.ikeeping 36 | ikeeping_entity 37 | 38 | 39 | com.zz.ikeeping 40 | ikeeping_common 41 | 42 | 43 | org.apache.httpcomponents 44 | httpclient 45 | 46 | 47 | org.springframework.boot 48 | spring-boot-starter-test 49 | test 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # 爱健身-iKeeping V1.0 微信小程序 2 | 3 | ## 一、产品原型 4 | [http://www.jisuapp.cn/make/makeapp/71zg1cwG11.html][产品原型] 5 | 6 | [产品原型]: http://www.jisuapp.cn/make/makeapp/71zg1cwG11.html 7 | 8 | ## 二、技术选型 9 | - **开发工具:** IDE开发工具(Idea)+WorkBatch+Git+GitHub+Maven+Pd+Hbuild-X(uni-app)+Tomcat 10 | 11 | - **服务器运行环境:** Linux服务器、Docker容器 12 | 13 | - **数据库:** Mysql、Oracle 14 | 15 | - **No-SQL数据库:** Redis(缓存、数据共享、榜单) 16 | 17 | - **测试:** swagger(在线文档、测试)、单元测试、jmeter(压力测试) 18 | 19 | - **微服务:** SpringBoot+SpringCloud(注册中心:Eureka、Zookeeper 网关:zuul 熔断器:Hystrix 声明式:Feign 负载均衡:Ribbon 配置:Config) 20 | 21 | - **核心框架:** Spring+SpringMVC+Mybatis 22 | 23 | - **亮点技术:** 搜索(Elasticsearch)、消息中间件(RabbitMQ)、定时(Quartz、Spring Task)、数据库分片(Mycat) 24 | 25 | - **第三方:** 短信、支付(支付宝和微信)、统计、图表(Echarts)、物流、实时计步 26 | 27 | ## 三、实现功能 28 | - **用户中心** 29 | - 注册 30 | - 完善资料 31 | - 签到 32 | - **登录中心** 33 | - JWT(Json Web Token) 34 | - **资讯中心** 35 | - 文章列表 36 | - 文章评论 37 | - 文章推荐 38 | - 优惠券领取 39 | - **社区中心** 40 | - 健身分享 41 | - 话题讨论 42 | - 评论 43 | - 分享 44 | - 距离最近的健身分享 45 | - **运动中心** 46 | - 运动计步 47 | - 身体素质 48 | - 健康指数 49 | - **健身商城** 50 | - 办卡 51 | - 私教课程 52 | - 健身餐 53 | - 饮品 54 | - 装备 55 | - **搜索服务** 56 | - Elasticsearch 57 | - **缓存中心** 58 | - 通用数据缓存 59 | - 数据优化 60 | - **购物车服务** 61 | - 服务 62 | - RabbitMQ 63 | - **消息监听服务** 64 | - 消息消费 65 | - **订单服务** 66 | - 订单 67 | - **支付服务** 68 | - 支付宝支付 69 | - 微信支付 70 | - **物流服务** 71 | - 物流跟踪 72 | ## 四、项目上线 73 | - Nginx 负载均衡 74 | - Swagger 在线API文档 75 | - 测试报告 76 | 77 | ## 五、终端联调 78 | - 微信小程序端测试 79 | 80 | ## 六、优化处理 81 | - 前端优化 82 | - 后端优化 83 | - 数据优化 84 | - SQL优化 85 | - 缓存处理 86 | - 数据分片 87 | - 读写分离 88 | - 环境优化 89 | - Tomcat 优化 90 | - JVM 优化 91 | 92 | ## 七、开发文档 93 | 1. 需求文档 94 | 2. 功能文档 95 | 3. 概要文档 96 | 4. 数据接口文档 97 | 5. 测试用例文档 98 | 6. 测试报告文档 99 | 7. 压力测试文档 100 | 8. 部署文档 101 | 9. 数据库设计文档 102 | 10. 需求变更文档 103 | 11. 项目计划进度文档 104 | 105 | ## 八、代码仓库地址 106 | [https://github.com/yuuyoo/ikeeping_parent][仓库地址] 107 | 108 | [仓库地址]: https://github.com/yuuyoo/ikeeping_parent 109 | 110 | ## 项目成员 111 | - 段继亮 (主负责人) 112 | - 彭伟 (负责人) 113 | - 马少康 114 | - 彭伟 115 | - 何梦月 116 | - 池智发 117 | - 亓慧珍 118 | - 霍鑫亮 119 | - 杨超杰 120 | - 田宇飞 121 | ## 联系我们 122 | Email: yuuyoo@163.com 123 | 124 | 125 | -------------------------------------------------------------------------------- /ikeeping_news/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ikeeping_parent 7 | com.zz.ikeeping 8 | 0.1 9 | 10 | 4.0.0 11 | 12 | ikeeping_news 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-web 17 | 18 | 19 | com.zz.ikeeping 20 | ikeeping_entity 21 | 22 | 23 | com.zz.ikeeping 24 | ikeeping_common 25 | 26 | 27 | 28 | mysql 29 | mysql-connector-java 30 | 31 | 32 | 33 | org.mybatis.spring.boot 34 | mybatis-spring-boot-starter 35 | 36 | 37 | 38 | com.alibaba 39 | druid 40 | 41 | 42 | io.springfox 43 | springfox-swagger2 44 | 45 | 46 | 47 | io.springfox 48 | springfox-swagger-ui 49 | 50 | 51 | 52 | 53 | com.github.pagehelper 54 | pagehelper-spring-boot-starter 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /ikeeping_serverLogin/src/main/java/com/zz/ikeeping/service/login/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.service.login.controller; 2 | 3 | import com.zz.ikeeping.common.vo.R; 4 | import com.zz.ikeeping.entity.User; 5 | import com.zz.ikeeping.service.login.service.CartVoService; 6 | import com.zz.ikeeping.service.login.service.LoginService; 7 | import com.zz.ikeeping.service.login.service.OrdersStstusService; 8 | import com.zz.ikeeping.service.login.service.UserUpdateService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | import java.util.List; 14 | 15 | @RestController 16 | public class LoginController { 17 | @Autowired 18 | private LoginService loginService; 19 | @Autowired 20 | private UserUpdateService updateService; 21 | @Autowired 22 | private CartVoService cartVoService; 23 | @Autowired 24 | private OrdersStstusService ststusService; 25 | 26 | //登录 27 | @PostMapping("/login/login.do") 28 | public R login(@RequestParam("phone")String phone, @RequestParam("password")String password){ 29 | return loginService.login(phone, password); 30 | } 31 | 32 | //检查是否有效 33 | @GetMapping("/login/checklogin.do") 34 | public R check(@RequestParam("token")String token){ 35 | return loginService.checkLogin(token); 36 | } 37 | 38 | //注销 39 | @GetMapping("/login/exit.do") 40 | public R exit(@RequestParam("token")String token){ 41 | return loginService.exitLogin(token); 42 | } 43 | 44 | //更新用户信息 45 | @PostMapping("/user/update.do") 46 | public R update(@RequestBody User user){ 47 | return updateService.UserInfoUpdate(user); 48 | } 49 | 50 | //根据id删除购物车的商品信息 51 | @GetMapping("/cart/delete.do") 52 | public R delete(@RequestParam(value="id",required=true) List id){ 53 | return cartVoService.delete(id); 54 | } 55 | 56 | //查找购物车的所有的商品信息包括商品名称、价格、图片地址、数量 57 | @GetMapping("/cart/all.do") 58 | public R selectAllCart(){ 59 | return cartVoService.all(); 60 | } 61 | 62 | //根据状态查询订单 63 | @GetMapping("/order/select.do") 64 | public R selectByStatus(@RequestParam("status") int status, @RequestParam("uid") int uid){ 65 | return ststusService.selectByStatus(status,uid); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /ikeeping_serverUser/src/main/java/com/zz/ikeeping/server/user/service/impl/AddressServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.server.user.service.impl; 2 | 3 | import com.zz.ikeeping.common.jwt.JwtUtil; 4 | import com.zz.ikeeping.common.model.LoginToken; 5 | import com.zz.ikeeping.common.vo.R; 6 | import com.zz.ikeeping.entity.Address; 7 | import com.zz.ikeeping.server.user.dao.AddressMapper; 8 | import com.zz.ikeeping.server.user.service.AddressService; 9 | import com.zz.ikeeping.server.user.util.UserTokenUtil; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | 13 | import java.rmi.server.UID; 14 | import java.util.List; 15 | 16 | 17 | @Service 18 | public class AddressServiceImpl implements AddressService { 19 | @Autowired 20 | private AddressMapper addressMapper; 21 | 22 | @Override 23 | public R selectById(String token) { 24 | // 解析token获取uid 25 | LoginToken loginToken = UserTokenUtil.parseToken(JwtUtil.parseJWT(token)); 26 | Integer uid = loginToken.getUid(); 27 | System.out.println(uid); 28 | List
list = addressMapper.selectByUid(uid); 29 | list.toString(); 30 | return R.setOK("OK", addressMapper.selectByUid(uid)); 31 | } 32 | 33 | @Override 34 | public R selectByDefult(String token) { 35 | LoginToken loginToken = UserTokenUtil.parseToken(JwtUtil.parseJWT(token)); 36 | Integer uid = loginToken.getUid(); 37 | return R.setOK("OK", addressMapper.selectByDefault(uid)); 38 | } 39 | 40 | @Override 41 | public R deleteById(Integer addid) { 42 | Address address = addressMapper.selectByAddid(addid); 43 | if(address != null) { 44 | addressMapper.deleteById(addid); 45 | return R.setOK("OK"); 46 | } else { 47 | return R.setERROR("该信息不存在"); 48 | } 49 | 50 | } 51 | 52 | @Override 53 | public R insert(Address address) { 54 | 55 | addressMapper.insert(address); 56 | return R.setOK("添加地址成功"); 57 | } 58 | 59 | /*@Override 60 | public R updateDefult(Integer addid) { 61 | addressMapper.updateDefault(addid); 62 | return R.setOK("OK"); 63 | }*/ 64 | 65 | 66 | @Override 67 | public R updateByAddid(Address address) { 68 | 69 | addressMapper.update(address); 70 | return R.setOK("OK"); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/java/com/zz/ikeeping/pay/util/MD5Util.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay.util; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | import java.net.URLEncoder; 5 | import java.security.MessageDigest; 6 | 7 | /** 8 | * MD5生成工具 9 | */ 10 | public class MD5Util { 11 | /** 12 | * 字节数组转16进制字符串 13 | * @param b 字节数组 14 | * @return 15 | */ 16 | private static String byteArrayToHexString(byte b[]) { 17 | StringBuffer resultSb = new StringBuffer(); 18 | for (int i = 0; i < b.length; i++) { 19 | resultSb.append(byteToHexString(b[i])); 20 | } 21 | return resultSb.toString(); 22 | } 23 | 24 | /** 25 | * 字节转16进制字符串 26 | * @param b 字节 27 | * @return 28 | */ 29 | private static String byteToHexString(byte b) { 30 | int n = b; 31 | if (n < 0) { 32 | n += 256; 33 | } 34 | int d1 = n / 16; 35 | int d2 = n % 16; 36 | return hexDigits[d1] + hexDigits[d2]; 37 | } 38 | 39 | /** 40 | * MD5加密 41 | * @param origin 需要加密明文字符串 42 | * @param charsetname md5加密后的密文 43 | * @return 44 | */ 45 | public static String MD5Encode(String origin, String charsetname) { 46 | String resultString = null; 47 | try { 48 | resultString = new String(origin); 49 | MessageDigest md = MessageDigest.getInstance("MD5"); 50 | if (charsetname == null || "".equals(charsetname)) { 51 | resultString = byteArrayToHexString(md.digest(resultString 52 | .getBytes())); 53 | } 54 | else { 55 | resultString = byteArrayToHexString(md.digest(resultString 56 | .getBytes(charsetname))); 57 | } 58 | } catch (Exception exception) { 59 | } 60 | return resultString; 61 | } 62 | 63 | /** 64 | * 16进制字符字典 65 | */ 66 | private static final String hexDigits[] = {"0", "1", "2", "3", "4", "5", 67 | "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" 68 | }; 69 | 70 | /** 71 | * url地址编码 72 | * @param src 原url地址 73 | * @return 74 | * @throws UnsupportedEncodingException 75 | */ 76 | public static String UrlEncode(String src) throws 77 | UnsupportedEncodingException { 78 | return URLEncoder.encode(src, "UTF-8").replace("+", "%20"); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/java/com/zz/ikeeping/pay/service/impl/AliPayServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay.service.impl; 2 | 3 | import com.alipay.api.AlipayApiException; 4 | import com.zz.ikeeping.common.util.Base64Util; 5 | import com.zz.ikeeping.common.vo.R; 6 | import com.zz.ikeeping.pay.config.SystemConfig; 7 | import com.zz.ikeeping.pay.entity.AliPay; 8 | import com.zz.ikeeping.pay.service.AliPayService; 9 | import com.zz.ikeeping.pay.util.AliPayUtil; 10 | import org.springframework.stereotype.Service; 11 | 12 | /** 13 | * @author DJL 14 | * @create 2019-06-28 19:56 15 | * @desc 支付宝支付订单生成接口的实现类 16 | **/ 17 | @Service 18 | public class AliPayServiceImpl implements AliPayService { 19 | 20 | // 生成订单支付信息 21 | public R orderPay(AliPay pay) { 22 | 23 | if (pay != null) { 24 | // 设置支付金额为0.01元 支付宝默认支付单位为元 25 | pay.setTotal_amount(0.01); 26 | try { 27 | String payUrl = AliPayUtil.aliPay(pay); 28 | if (payUrl != null && payUrl.length() > 0) { 29 | String m = Base64Util.base64Enc(payUrl.getBytes()); 30 | return R.setOK("支付宝支付链接成功生成", SystemConfig.PAYURL + "pay/qrcode/payqrcode.do?msg=" + m); 31 | } 32 | } catch (AlipayApiException e) { 33 | e.printStackTrace(); 34 | } 35 | 36 | } 37 | 38 | return R.setERROR("网络异常,请联系客服"); 39 | } 40 | 41 | // 查询订单支付状态 42 | public R queryOrderPay(String orderNo) { 43 | 44 | if (orderNo != null && orderNo.length() > 0) { 45 | try { 46 | String msg = AliPayUtil.aliPayQuery(orderNo); 47 | if (msg != null && msg.length() > 0) { 48 | return R.setOK("支付订单查询成功", msg); 49 | } 50 | } catch (AlipayApiException e) { 51 | e.printStackTrace(); 52 | } 53 | 54 | } 55 | 56 | return R.setERROR("网络异常,请稍后再试"); 57 | } 58 | 59 | // 关闭支付订单 60 | public R closeOrderPay(String orderNo) { 61 | if (orderNo != null && orderNo.length() > 0) { 62 | try { 63 | String msg = AliPayUtil.closeOrder(orderNo); 64 | if (msg != null && msg.length() > 0) { 65 | return R.setOK(msg); 66 | } 67 | } catch (AlipayApiException e) { 68 | e.printStackTrace(); 69 | } 70 | 71 | } 72 | 73 | return R.setERROR("网络异常,请稍后再试"); 74 | 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /ikeeping_payApi/src/main/java/com/zz/ikeeping/pay/config/AliPayConfig.java: -------------------------------------------------------------------------------- 1 | package com.zz.ikeeping.pay.config; 2 | 3 | /** 4 | * @author DJL 5 | * @create 2019-06-28 19:38 6 | * @desc 支付宝支付接口配置类 7 | **/ 8 | public class AliPayConfig { 9 | // 支付宝支付接口url地址,固定 10 | public static final String PAY_URL="https://openapi.alipay.com/gateway.do"; 11 | // 支付宝支付应用ID 12 | public static final String APP_ID="2017091608770636"; 13 | // 私钥 14 | public static final String APP_PRIVATE_KEY="MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCh1qI8uo1qhrcePsa5JUAoYUX8HfPuBt7kc90aCP1M/v61/uzaU/lyGQeChKV3jdDTn2Lcq6kT5JBl3TLiaYHmO6cId1nQAIUxiT9zhB9crc4wAx8CVabMbcqUefs7Xsp+YhhUgU5X6GOS3emkUeL7RegBnL8vayfEBeUDgBxsk/K/VygBA8sapsEhnoOrB6bhMY4GaJrxb0kg9Ej8x4kpExLcxkT+UgcOiJvh6vpBZo5CJsiPQkFvSsNsWY2uSDudSL/KqpMxz+yPfVvZDt4fOfyi+CfYR43Jlo4tsT7joqH2JT06BH+KdJyc1D3Lqw7w/WdmZtmoLghH0kRZawrLAgMBAAECggEAYYtpm+rhQ7zQ8HTr+DogknYW5Z/0H5qai93d/Uw/yEHFqlJt1iZZKlE1upBS311l6beesdzxeuD/u7X4bokjV27K/YpaYsl9fl74FJslAApuRXgMH68aawsd2CIxsBYxPL3JZl3Np6SVJ7eDlJwakFMRRK+CeIVAoaDf6R01hKctkYnnE0wT+ffQNKWsISoEyiKVT3g5fur7iPOuDlDXsfi6Mm+e75wCXTmRRHmb8lPBAMLV+Kj5DFxg8dwNz81Fs4ZM2Aq0lBaTfy1H1zSlM1m42wcsMYDcgdEH9aq+OgqK+cny6umgs7/Alg7IgV/9b7AhKdvAqLy2ERUJtooj2QKBgQDeIoDW3HuTq7sBaBnu63f7icT2RM3fApfOiGM4UDtxPvc5dS5S//o3E8p+rbp21FfBeyLOJFd9dg/eu+ETA+63QMPw4Kq4AH/EA5AFohaOQ0IKFDjYyxfyD8ajA4USDwdiaW2/vmMeAtGSv+W5zWb9/t49LOTwzEW904+yOGcmhQKBgQC6guDZ0Ob4o9nx5XwZXEe2di4MupARHceGzmolyDvs3Qi/w+8QntrDvfqIJoqoxOG5NVi3jtjkqtJtMaPyxqNWTabWOOTLbrsqlvPUmeCl0j3FVFKAGcV7/b9XkLvh1DtnIe6rhhZCVB4e4bL/katpOTgulhmSMaWIaztGU0F1DwKBgQCTeobdn/6vuSlsMqhdFppPN1W8R0wDjt4o8iYlwibk9e//hswdsPN307zyQ/dzY2FsBIvEHx6zHkpFD6nMDSVVJzuv1gmiJjqtccwR4V5mT0MuG+TuElCwlkbD/ddAeRfm/6Ys0oNN7oMjkiI8LKH/alI0fXT2Zji7YhWaNpZNXQKBgEU6q0duWS1VdGJrcgLf0+aQO0uSPEN+MD+Dgrb/ee7TpJm5mpUqwb0CWWoMFE/MtJRQjtujdDJ8jZrmYBqPTLWOIS1G9PXl5idK3Lq/Wzlxrmf+gpj19+2sJEfWe0a5xkrjt3mHTd/U5VFFKXHfmiZ2jLoOEPPI5c6bLudNo/BVAoGBAMvwRxLO4xb11Ip4rnEHkw3Qn8lrddoC3/m7haHYZ5DyGe8wdCdEi6wyk5MvlNQdqdVg5bqV0AiotIBcd5Pemabun2WaB11h/6SSb6wKY4Fnz+H155zaEww4no9BTG9llqQV7H8AS77dN1bxhcpE/MGFoB9JFU0D+BwXAnth4z1u"; 15 | // 公钥 16 | public static final String ALIPAY_PUBLIC_KEY="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx7jJT+PSEM6ZiimTW0SGUfg4cJU04H/mQqkL2mk7KaHXFQqMh4US6xYkDlaEXzOOfxevuBqWOaB4/8TleO1CHZHXWHu9Xc+iYtJPNJGrxoGLM+6Cg9IafJTygRoaqdH0SoVMpxFdOpUftNdXHO+G0ZpS/7c1zpn8G64zN5J17IFrLcUlsEnSgOrJxsS2Q50b44er0KQlj76pehB2sTveHS2vdhqXzrv+oq99XtUKEY1a3nwDjXneI7YYKLHD9KU53pti/ibLDkOEjO4+DRowd+wfSwkmWGVL3X320mvCfrg/aMN71B/cyyhW0mQ4cxqh2UcnpxLm0v/+uC7dSCyAJwIDAQAB"; 17 | 18 | } 19 | --------------------------------------------------------------------------------