├── hutu-common └── src │ └── main │ └── java │ └── org │ └── nott │ └── common │ ├── exception │ ├── WebSocketInitException.java │ ├── UserNotFoundException.java │ ├── PasswordNotMatchesException.java │ ├── HutuBizException.java │ └── HttpFetchException.java │ ├── annotation │ ├── JustLogin.java │ ├── ClearCache.java │ ├── PayApi.java │ └── RedisCache.java │ ├── config │ ├── SwaggerConfig.java │ ├── WebConfig.java │ ├── JedisPoolYmlConfig.java │ ├── BusinessConfig.java │ ├── RedisConfig.java │ ├── WebSocketConfig.java │ └── AsyncExecutorConfig.java │ ├── thread │ └── pool │ │ └── HutuThreadPoolExecutor.java │ ├── handler │ ├── MbpMetaObjectHandler.java │ └── HttpHandler.java │ ├── idWorker │ └── CustomIdGenerator.java │ ├── aop │ └── LoginAspect.java │ ├── delayed │ └── DelayedTask.java │ ├── utils │ ├── SequenceUtils.java │ └── RequestUriUtils.java │ ├── configuration │ └── CrossConfiguration.java │ └── ResponseEntity.java ├── hutu-service ├── src │ └── main │ │ └── java │ │ └── org │ │ └── nott │ │ └── service │ │ ├── mapper │ │ ├── oss │ │ │ └── OssFileMapper.java │ │ ├── api │ │ │ ├── BizCommonRemarkMapper.java │ │ │ ├── BizSkuCatalogRelationMapper.java │ │ │ ├── BizItemMapper.java │ │ │ ├── BizCommentMapper.java │ │ │ ├── BizPackageMapper.java │ │ │ ├── BizPayWayMapper.java │ │ │ ├── BizSkuItemMapper.java │ │ │ ├── BizShopInfoMapper.java │ │ │ ├── BizTableInfoMapper.java │ │ │ ├── BizMenuCatalogMapper.java │ │ │ ├── BizBusinessConfigMapper.java │ │ │ ├── BizUserPointLogMapper.java │ │ │ ├── BizItemSkuRelationMapper.java │ │ │ ├── BizCouponConditionMapper.java │ │ │ ├── BizUserCouponRelationMapper.java │ │ │ ├── BizUserMapper.java │ │ │ ├── BizCouponMapper.java │ │ │ ├── BizUserPackageMapper.java │ │ │ ├── BizMenuMapper.java │ │ │ ├── BizSkuCatalogMapper.java │ │ │ └── BizPayOrderMapper.java │ │ └── admin │ │ │ ├── SysUserMapper.java │ │ │ ├── SysUserRoleMapper.java │ │ │ ├── SysRolePermissionMapper.java │ │ │ ├── SysRoleMapper.java │ │ │ └── SysPermissionMapper.java │ │ ├── admin │ │ ├── SysRoleService.java │ │ ├── SysUserRoleService.java │ │ ├── SysPermissionService.java │ │ ├── SysRolePermissionService.java │ │ ├── StpInterfaceImpl.java │ │ └── SysUserService.java │ │ ├── api │ │ ├── BizPackageService.java │ │ ├── BizTableInfoService.java │ │ ├── BizSkuCatalogRelationService.java │ │ ├── BizCouponConditionService.java │ │ ├── BizCommentService.java │ │ ├── BizUserCouponRelationService.java │ │ ├── BizCommonRemarkService.java │ │ ├── BizUserPointLogService.java │ │ ├── BizMenuCatalogService.java │ │ ├── BizItemService.java │ │ └── BizPayWayService.java │ │ └── pay │ │ └── PayService.java └── pom.xml ├── hutu-app ├── api │ └── src │ │ └── main │ │ ├── resources │ │ ├── mapper │ │ │ ├── BizItemMapper.xml │ │ │ ├── BizCommentMapper.xml │ │ │ ├── BizPackageMapper.xml │ │ │ ├── BizPayWayMapper.xml │ │ │ ├── BizSkuItemMapper.xml │ │ │ ├── SysUserMapper.xml │ │ │ ├── BizShopInfoMapper.xml │ │ │ ├── BizTableInfoMapper.xml │ │ │ ├── BizCommonRemarkMapper.xml │ │ │ ├── BizMenuCatalogMapper.xml │ │ │ ├── BizUserPointLogMapper.xml │ │ │ ├── BizBusinessConfigMapper.xml │ │ │ ├── BizCouponConditionMapper.xml │ │ │ ├── BizItemSkuRelationMapper.xml │ │ │ ├── BizUserCouponRelationMapper.xml │ │ │ ├── BizSkuCatalogRelationMapper.xml │ │ │ ├── BizUserMapper.xml │ │ │ ├── BizCouponMapper.xml │ │ │ ├── BizUserPackageMapper.xml │ │ │ ├── BizMenuMapper.xml │ │ │ ├── BizSkuCatalogMapper.xml │ │ │ └── BizPayOrderMapper.xml │ │ └── logback-dev.xml │ │ └── java │ │ └── org │ │ └── nott │ │ ├── web │ │ └── controller │ │ │ ├── SysFileController.java │ │ │ ├── BizCommentController.java │ │ │ ├── BizPackageController.java │ │ │ ├── BizTableInfoController.java │ │ │ ├── BizCouponController.java │ │ │ ├── BizCommonRemarkController.java │ │ │ ├── BizPayWayController.java │ │ │ ├── BizSkuController.java │ │ │ ├── BizItemController.java │ │ │ ├── BizBusinessConfigController.java │ │ │ ├── BizMenuCatalogController.java │ │ │ ├── BizMenuController.java │ │ │ └── BizShopInfoController.java │ │ └── HutuApiApplication.java ├── oss │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── mapper │ │ │ │ └── OssFileMapper.xml │ │ │ ├── logback-dev.xml │ │ │ └── application.yml │ │ │ └── java │ │ │ └── org │ │ │ └── nott │ │ │ └── oss │ │ │ └── HutuOssApplication.java │ └── pom.xml ├── admin │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── mapper │ │ │ │ ├── SysUserRoleMapper.xml │ │ │ │ ├── SysRolePermissionMapper.xml │ │ │ │ ├── SysUserMapper.xml │ │ │ │ ├── SysRoleMapper.xml │ │ │ │ └── SysPermissionMapper.xml │ │ │ └── logback-dev.xml │ │ │ └── java │ │ │ └── org │ │ │ └── nott │ │ │ ├── admin │ │ │ └── controller │ │ │ │ ├── common │ │ │ │ └── CommonController.java │ │ │ │ ├── SysBizMenuController.java │ │ │ │ ├── SysBizPackageController.java │ │ │ │ ├── SysBizPayWayController.java │ │ │ │ ├── SysBizTableInfoController.java │ │ │ │ ├── SysBizItemController.java │ │ │ │ ├── SysBizCouponConditionController.java │ │ │ │ ├── SysBizCouponController.java │ │ │ │ ├── SysBizUserPointController.java │ │ │ │ ├── SysBizUserPointLogController.java │ │ │ │ ├── SysBizUserController.java │ │ │ │ ├── SysBizCommentController.java │ │ │ │ ├── SysBizUserPackageController.java │ │ │ │ ├── SysBizSkuController.java │ │ │ │ └── SysBizPayOrderController.java │ │ │ └── HutuAdminApplication.java │ └── pom.xml └── pom.xml ├── hutu-model ├── src │ └── main │ │ └── java │ │ └── org │ │ └── nott │ │ ├── vo │ │ ├── ShopInfoVo.java │ │ ├── AdminTokenVo.java │ │ ├── pay │ │ │ ├── BaseResultVo.java │ │ │ ├── PayResultVo.java │ │ │ ├── RefundResultVo.java │ │ │ └── QueryResultVo.java │ │ ├── ExternalBaseUserInfo.java │ │ ├── SysUserInfoVo.java │ │ ├── AlipayUserInfo.java │ │ ├── UserLoginInfoVo.java │ │ ├── OrderItemVo.java │ │ ├── UserBalanceVo.java │ │ ├── CommonRemarkVo.java │ │ ├── SkuCatalogItemVo.java │ │ ├── FrontOrderVo.java │ │ ├── MenuCatalogVo.java │ │ ├── WechatUserInfoVo.java │ │ ├── MenuItemVo.java │ │ ├── ItemSkuVo.java │ │ ├── PayWayVo.java │ │ ├── UserCouponVo.java │ │ ├── OssFileVo.java │ │ ├── SettleOrderVo.java │ │ ├── UserPackageVo.java │ │ ├── PayOrderVo.java │ │ └── MyPayOrderVo.java │ │ ├── enums │ │ ├── HandleOrderExpireType.java │ │ ├── YesOrNoEnum.java │ │ ├── PayTypeEnum.java │ │ ├── CouponConditionTypeEnum.java │ │ ├── UserPointUseEnum.java │ │ ├── OrderMessageType.java │ │ ├── PickTypeEnum.java │ │ ├── OrderStatusEnum.java │ │ ├── BusinessPlatformEnum.java │ │ └── TimeEnum.java │ │ ├── model │ │ ├── inter │ │ │ ├── BaseJsonInfo.java │ │ │ ├── BalanceRefundInfo.java │ │ │ ├── BalancePayInfo.java │ │ │ └── OrderWsMessageInfo.java │ │ ├── BizSkuCatalogRelation.java │ │ ├── BizCommonRemark.java │ │ ├── BizTableInfo.java │ │ ├── BizSkuCatalog.java │ │ ├── SysRole.java │ │ ├── SysUserRole.java │ │ ├── SysRolePermission.java │ │ ├── BizUserCouponRelation.java │ │ ├── BizBusinessConfig.java │ │ ├── BizItemSkuRelation.java │ │ ├── BizComment.java │ │ ├── BizUserPackage.java │ │ ├── SysFile.java │ │ ├── BizSkuItem.java │ │ ├── BizPayWay.java │ │ ├── OssFile.java │ │ ├── SysPermission.java │ │ ├── BizMenu.java │ │ ├── BizUserPointLog.java │ │ ├── BizCoupon.java │ │ ├── BizUser.java │ │ ├── BizMenuCatalog.java │ │ ├── SysUser.java │ │ ├── BizPackage.java │ │ ├── BizCouponCondition.java │ │ ├── BizItem.java │ │ └── BizShopInfo.java │ │ └── dto │ │ ├── UserPackageQueryDTO.java │ │ ├── UserRegisterDTO.java │ │ ├── UserLoginDTO.java │ │ ├── PayWayQueryDTO.java │ │ ├── MyOrderQueryDTO.java │ │ ├── SkuCatalogSearchDTO.java │ │ ├── ItemSearchDTO.java │ │ ├── AdminLoginDTO.java │ │ ├── PayDTO.java │ │ ├── UserProfileDTO.java │ │ ├── RefundDTO.java │ │ ├── SysUserInfoDTO.java │ │ ├── MiniProgramPhoneInfoDTO.java │ │ ├── UserPackageAddDTO.java │ │ ├── UserPackageUpDateDTO.java │ │ ├── PayGatewayDTO.java │ │ ├── OrderItemDTO.java │ │ └── UserSettleOrderDTO.java └── pom.xml ├── hutu-web-socket └── src │ └── main │ ├── resources │ ├── application.yml │ └── logback-dev.xml │ └── java │ └── org │ └── nott │ └── ws │ ├── HutuWebSocketApplication.java │ ├── api │ └── BizPayOrderWsApi.java │ └── initializer │ └── ChannelInitializer.java ├── hutu-external ├── src │ └── main │ │ └── java │ │ └── org │ │ └── nott │ │ └── external │ │ ├── wechat │ │ └── config │ │ │ └── WechatAppConfig.java │ │ └── alipay │ │ ├── config │ │ └── AlipayConfig.java │ │ └── api │ │ └── AlipayApi.java └── pom.xml ├── hutu-feign ├── src │ └── main │ │ └── java │ │ └── org │ │ └── nott │ │ └── feign │ │ ├── BizPayOrderWsClient.java │ │ └── OssClient.java └── pom.xml ├── nginx └── nginx.conf ├── hutu-security ├── src │ └── main │ │ └── java │ │ └── org │ │ └── nott │ │ └── security │ │ ├── constant │ │ └── SecurityConstants.java │ │ ├── configuration │ │ └── SpringSecurityConfiguration.java │ │ └── interceptor │ │ ├── LoginInterceptor.java │ │ └── AuthorizationInterceptor.java └── pom.xml ├── .gitignore └── doc └── readme-old.md /hutu-common/src/main/java/org/nott/common/exception/WebSocketInitException.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.exception; 2 | 3 | /** 4 | * @author Nott 5 | * @date 2024-11-26 6 | */ 7 | public class WebSocketInitException extends RuntimeException{ 8 | } 9 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/oss/OssFileMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.oss; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import org.nott.model.OssFile; 5 | 6 | public interface OssFileMapper extends BaseMapper { 7 | } 8 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizItemMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/annotation/JustLogin.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Documented 6 | @Target(ElementType.METHOD) 7 | @Retention(RetentionPolicy.RUNTIME) 8 | public @interface JustLogin { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizCommentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizPackageMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizPayWayMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizSkuItemMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/SysUserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/oss/src/main/resources/mapper/OssFileMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizShopInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizTableInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/resources/mapper/SysUserRoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizCommonRemarkMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizMenuCatalogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizUserPointLogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizBusinessConfigMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/resources/mapper/SysRolePermissionMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizCouponConditionMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizItemSkuRelationMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizUserCouponRelationMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizCommonRemarkMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import org.nott.model.BizCommonRemark; 5 | 6 | public interface BizCommonRemarkMapper extends BaseMapper { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizSkuCatalogRelationMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/ShopInfoVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import lombok.Data; 4 | import org.nott.model.BizShopInfo; 5 | 6 | /** 7 | * @author Nott 8 | * @date 2024-7-2 9 | */ 10 | 11 | @Data 12 | public class ShopInfoVo extends BizShopInfo { 13 | 14 | private boolean isOpen; 15 | } 16 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/admin/SysUserMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.admin; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import org.nott.model.SysUser; 5 | 6 | public interface SysUserMapper extends BaseMapper { 7 | SysUser getUserByUsername(String username); 8 | } 9 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizSkuCatalogRelationMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import org.nott.model.BizSkuCatalogRelation; 5 | 6 | public interface BizSkuCatalogRelationMapper extends BaseMapper { 7 | } 8 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/AdminTokenVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @author Nott 7 | * @date 2024-6-6 8 | */ 9 | 10 | @Data 11 | public class AdminTokenVo { 12 | 13 | private String tokenValue; 14 | 15 | private String tokenName; 16 | 17 | private Object loginId; 18 | } 19 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/pay/BaseResultVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo.pay; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import lombok.Data; 5 | 6 | /** 7 | * @author Nott 8 | * @date 2025-3-31 9 | */ 10 | @Data 11 | @ApiModel("基础支付结果Vo") 12 | public abstract class BaseResultVo { 13 | 14 | private String orderNo; 15 | } 16 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/enums/HandleOrderExpireType.java: -------------------------------------------------------------------------------- 1 | package org.nott.enums; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public enum HandleOrderExpireType { 7 | DELAYED_QUEUE("delayedQueue"); 8 | 9 | HandleOrderExpireType(String name) { 10 | this.name = name; 11 | } 12 | 13 | private String name; 14 | } 15 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/inter/BaseJsonInfo.java: -------------------------------------------------------------------------------- 1 | package org.nott.model.inter; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | 5 | /** 6 | * @author Nott 7 | * @date 2024-12-24 8 | */ 9 | public abstract class BaseJsonInfo { 10 | 11 | public String toJSONString(){ 12 | return JSON.toJSONString(this); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/inter/BalanceRefundInfo.java: -------------------------------------------------------------------------------- 1 | package org.nott.model.inter; 2 | 3 | import lombok.Data; 4 | 5 | import java.math.BigDecimal; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2025-3-31 10 | */ 11 | @Data 12 | public class BalanceRefundInfo { 13 | 14 | private BigDecimal actualRefund; 15 | 16 | private BigDecimal giftRefund; 17 | } 18 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/annotation/ClearCache.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Documented 6 | @Target(ElementType.METHOD) 7 | @Retention(RetentionPolicy.RUNTIME) 8 | public @interface ClearCache { 9 | 10 | String key(); 11 | 12 | String item(); 13 | 14 | boolean runBefore() default false; 15 | } 16 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/exception/UserNotFoundException.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.exception; 2 | 3 | /** 4 | * @author Nott 5 | * @date 2024-6-6 6 | */ 7 | public class UserNotFoundException extends RuntimeException { 8 | public UserNotFoundException() { 9 | } 10 | 11 | public UserNotFoundException(String message) { 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/enums/YesOrNoEnum.java: -------------------------------------------------------------------------------- 1 | package org.nott.enums; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * @author Nott 7 | * @date 2024-8-19 8 | */ 9 | @Getter 10 | public enum YesOrNoEnum { 11 | YES(1), 12 | NO(0) 13 | ; 14 | 15 | YesOrNoEnum(Integer value) { 16 | this.value = value; 17 | } 18 | 19 | private Integer value; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/ExternalBaseUserInfo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @author Nott 7 | * @date 2024-6-14 8 | */ 9 | 10 | @Data 11 | public class ExternalBaseUserInfo { 12 | 13 | private String openId; 14 | 15 | private String phone; 16 | 17 | private String nickName; 18 | 19 | private String avatarUrl; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizItemMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizItem; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-05-24 13 | */ 14 | public interface BizItemMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-web-socket/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | ws: 2 | port: 2999 3 | path: /ws 4 | boss-group: 2 5 | worker-group: 20 6 | heart-beat-msg: ping 7 | heart-beat-resp: pong 8 | show-idle-msg: false 9 | 10 | spring: 11 | application: 12 | name: Hutu-WebSocket 13 | 14 | logging: 15 | config: classpath:logback-dev.xml 16 | level: 17 | org.nott.ws: debug 18 | 19 | server: 20 | port: 8888 -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/common/CommonController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller.common; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | 7 | public class CommonController { 8 | 9 | @Autowired 10 | private T service; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizCommentMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizComment; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-06-13 13 | */ 14 | public interface BizCommentMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizPackageMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizPackage; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-05-24 13 | */ 14 | public interface BizPackageMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizPayWayMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizPayWay; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-05-24 13 | */ 14 | public interface BizPayWayMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizSkuItemMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizSkuItem; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-06-03 13 | */ 14 | public interface BizSkuItemMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizShopInfoMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizShopInfo; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-06-26 13 | */ 14 | public interface BizShopInfoMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/SysUserInfoVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2024-6-12 10 | */ 11 | 12 | @Data 13 | public class SysUserInfoVo { 14 | 15 | private List roles; 16 | 17 | private String name; 18 | 19 | private String avatar; 20 | 21 | private String introduction; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/admin/SysUserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.admin; 2 | 3 | import org.nott.model.SysUserRole; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-06-07 13 | */ 14 | public interface SysUserRoleMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizTableInfoMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizTableInfo; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-05-24 13 | */ 14 | public interface BizTableInfoMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/exception/PasswordNotMatchesException.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.exception; 2 | 3 | /** 4 | * @author Nott 5 | * @date 2024-6-6 6 | */ 7 | public class PasswordNotMatchesException extends RuntimeException{ 8 | 9 | public PasswordNotMatchesException() { 10 | } 11 | 12 | public PasswordNotMatchesException(String message) { 13 | super(message); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizMenuCatalogMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizMenuCatalog; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-05-24 13 | */ 14 | public interface BizMenuCatalogMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/UserPackageQueryDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import lombok.Data; 5 | 6 | import javax.validation.constraints.NotNull; 7 | 8 | /** 9 | * @author Nott 10 | * @date 2024-6-3 11 | */ 12 | 13 | @Data 14 | @ApiModel("用户购物袋查询对象") 15 | public class UserPackageQueryDTO { 16 | 17 | @NotNull(message = "用户id不能为空") 18 | private Long userId; 19 | } 20 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizUserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | update biz_user set `point` = (#{originPoint} - #{usePoint}) where id = #{userId} 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/AlipayUserInfo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @author Nott 7 | * @date 2024-6-14 8 | */ 9 | 10 | @Data 11 | public class AlipayUserInfo extends ExternalBaseUserInfo { 12 | 13 | private String avatar; 14 | 15 | private String city; 16 | 17 | private String nickName; 18 | 19 | private String province; 20 | 21 | private String userId; 22 | } 23 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizBusinessConfigMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizBusinessConfig; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2025-04-15 13 | */ 14 | public interface BizBusinessConfigMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizUserPointLogMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizUserPointLog; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 用户积分日志表 Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-08-16 13 | */ 14 | public interface BizUserPointLogMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/UserRegisterDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import lombok.Data; 5 | 6 | /** 7 | * @author Nott 8 | * @date 2024-6-25 9 | */ 10 | @ApiModel("用户注册DTO") 11 | @Data 12 | public class UserRegisterDTO { 13 | 14 | private String code; 15 | 16 | private String avatarUrl; 17 | 18 | private String nickName; 19 | 20 | private String phone; 21 | } 22 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/admin/SysRolePermissionMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.admin; 2 | 3 | import org.nott.model.SysRolePermission; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-06-07 13 | */ 14 | public interface SysRolePermissionMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizItemSkuRelationMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizItemSkuRelation; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-06-03 13 | */ 14 | public interface BizItemSkuRelationMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizCouponConditionMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizCouponCondition; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 优惠券规则表 Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-08-16 13 | */ 14 | public interface BizCouponConditionMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/java/org/nott/web/controller/SysFileController.java: -------------------------------------------------------------------------------- 1 | package org.nott.web.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | *

8 | * 前端控制器 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-07-10 13 | */ 14 | @RestController 15 | @RequestMapping("/sysFile") 16 | public class SysFileController { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/java/org/nott/web/controller/BizCommentController.java: -------------------------------------------------------------------------------- 1 | package org.nott.web.controller; 2 | import org.springframework.web.bind.annotation.RequestMapping; 3 | import org.springframework.web.bind.annotation.RestController; 4 | 5 | /** 6 | *

7 | * 前端控制器 8 | *

9 | * 10 | * @author nott 11 | * @since 2024-06-13 12 | */ 13 | @RestController 14 | @RequestMapping("/bizComment") 15 | public class BizCommentController { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/java/org/nott/web/controller/BizPackageController.java: -------------------------------------------------------------------------------- 1 | package org.nott.web.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | *

8 | * 前端控制器 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-05-24 13 | */ 14 | @RestController 15 | @RequestMapping("/bizPackage") 16 | public class BizPackageController { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/UserLoginInfoVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @author Nott 7 | * @date 2024-6-14 8 | */ 9 | 10 | @Data 11 | public class UserLoginInfoVo { 12 | 13 | private boolean alreadyRegister; 14 | 15 | private String token; 16 | 17 | private String phone; 18 | 19 | private String username; 20 | 21 | private String avatarUrl; 22 | 23 | private Integer gender; 24 | } 25 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizUserCouponRelationMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizUserCouponRelation; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 用户-优惠券关系表 Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-08-19 13 | */ 14 | public interface BizUserCouponRelationMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/java/org/nott/web/controller/BizTableInfoController.java: -------------------------------------------------------------------------------- 1 | package org.nott.web.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | *

8 | * 前端控制器 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-05-24 13 | */ 14 | @RestController 15 | @RequestMapping("/bizTableInfo") 16 | public class BizTableInfoController { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/annotation/PayApi.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.annotation; 2 | 3 | import org.springframework.core.annotation.AliasFor; 4 | 5 | import java.lang.annotation.*; 6 | 7 | @Documented 8 | @Target(ElementType.TYPE) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface PayApi { 11 | 12 | @AliasFor("code") 13 | String value() default ""; 14 | 15 | @AliasFor("value") 16 | String code() default ""; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizSkuCatalogRelation.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * sku-子项关系表 7 | * @author Nott 8 | * @date 2024-6-18 9 | */ 10 | 11 | @Data 12 | public class BizSkuCatalogRelation { 13 | 14 | private Long id; 15 | 16 | /** 17 | * sku分类id 18 | */ 19 | private Long skuCatalogId; 20 | 21 | /** 22 | * sku子项id 23 | */ 24 | private Long skuItemId; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/OrderItemVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import lombok.Data; 5 | import org.nott.dto.OrderItemDTO; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2024-11-20 12 | */ 13 | @Data 14 | @ApiModel("订单商品列表Vo对象") 15 | public class OrderItemVo extends OrderItemDTO implements Serializable { 16 | 17 | private static final long serialVersionUID = 1L; 18 | } 19 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/SysBizMenuController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | *

8 | * 前端控制器 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-06-07 13 | */ 14 | @RestController 15 | @RequestMapping("/sys/bizMenu") 16 | public class SysBizMenuController { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/SysBizPackageController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | *

8 | * 前端控制器 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-06-07 13 | */ 14 | @RestController 15 | @RequestMapping("/sys/bizPackage") 16 | public class SysBizPackageController { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/SysBizPayWayController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | *

8 | * 前端控制器 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-06-07 13 | */ 14 | @RestController 15 | @RequestMapping("/sys/bizPayWay") 16 | public class SysBizPayWayController { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizUserMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizUser; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-05-24 13 | */ 14 | public interface BizUserMapper extends BaseMapper { 15 | 16 | int costPointByCas(Long userId,Long originPoint, Long usePoint); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2024-8-9 10 | */ 11 | 12 | @Data 13 | @Component 14 | @ConfigurationProperties(prefix = "swagger2") 15 | public class SwaggerConfig { 16 | 17 | private String groupName; 18 | } 19 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/SysBizTableInfoController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | *

8 | * 前端控制器 9 | *

10 | * 11 | * @author nott 12 | * @since 2024-06-07 13 | */ 14 | @RestController 15 | @RequestMapping("/sys/bizTableInfo") 16 | public class SysBizTableInfoController { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/resources/mapper/SysUserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/admin/SysRoleMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.admin; 2 | 3 | import org.nott.model.SysRole; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * Mapper 接口 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-06-07 15 | */ 16 | public interface SysRoleMapper extends BaseMapper { 17 | 18 | List getRoleByUserId(Object loginId); 19 | } 20 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/enums/PayTypeEnum.java: -------------------------------------------------------------------------------- 1 | package org.nott.enums; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * @author Nott 7 | * @date 2025-3-31 8 | */ 9 | @Getter 10 | public enum PayTypeEnum { 11 | 12 | QUERY(0, "查询"), 13 | PAY(1, "支付"), 14 | REFUND(2, "退款"); 15 | 16 | private Integer val; 17 | 18 | private String desc; 19 | 20 | PayTypeEnum(Integer val, String desc) { 21 | this.val = val; 22 | this.desc = desc; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2025-3-18 10 | */ 11 | @Data 12 | @Component 13 | @ConfigurationProperties(prefix = "web") 14 | public class WebConfig { 15 | 16 | private String basePath; 17 | 18 | private String uploadPath; 19 | } 20 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/UserBalanceVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.math.BigDecimal; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2025-3-14 10 | */ 11 | @Data 12 | public class UserBalanceVo { 13 | 14 | private BigDecimal actualBalance; 15 | 16 | private BigDecimal giftBalance; 17 | 18 | private BigDecimal total; 19 | 20 | public void total(){ 21 | this.total = this.actualBalance.add(this.giftBalance); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizCouponMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizCoupon; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * 用户优惠券表 Mapper 接口 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-08-16 15 | */ 16 | public interface BizCouponMapper extends BaseMapper { 17 | 18 | List getCouponsByUserId(Long userId); 19 | } 20 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/enums/CouponConditionTypeEnum.java: -------------------------------------------------------------------------------- 1 | package org.nott.enums; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * 优惠券条件类型枚举, 0-时间 1-满减 2-关联业务 3-全部 7 | * @author Nott 8 | * @date 2024-8-19 9 | */ 10 | 11 | @Getter 12 | public enum CouponConditionTypeEnum { 13 | 14 | TIME(0), 15 | FULL_DISCOUNT(1), 16 | BIZ_REL(2), 17 | ALL(3); 18 | 19 | private Integer type; 20 | 21 | CouponConditionTypeEnum(Integer type) { 22 | this.type = type; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/SysBizItemController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller; 2 | 3 | import org.nott.common.ResponseEntity; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | /** 8 | *

9 | * 前端控制器 10 | *

11 | * 12 | * @author nott 13 | * @since 2024-06-07 14 | */ 15 | @RestController 16 | @RequestMapping("/sys/bizItem") 17 | public class SysBizItemController { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/annotation/RedisCache.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Documented 6 | @Target(ElementType.METHOD) 7 | @Retention(RetentionPolicy.RUNTIME) 8 | public @interface RedisCache { 9 | 10 | /** 11 | * 缓存Key 12 | */ 13 | String key() default ""; 14 | 15 | /** 16 | * 业务id,key+id存在时使用Hashset 17 | */ 18 | String item(); 19 | 20 | /** 21 | * 过期时间 22 | */ 23 | long expire() default -1; 24 | } 25 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/enums/UserPointUseEnum.java: -------------------------------------------------------------------------------- 1 | package org.nott.enums; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * 积分使用事件枚举 7 | * @author Nott 8 | * @date 2024-8-16 9 | */ 10 | 11 | @Getter 12 | public enum UserPointUseEnum { 13 | USER_Active(0,"消费抵扣"), 14 | SYS_EXPIRED(1,"过期系统扣除"); 15 | 16 | private Integer value; 17 | 18 | private String mark; 19 | 20 | UserPointUseEnum(Integer value, String mark) { 21 | this.value = value; 22 | this.mark = mark; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/admin/SysPermissionMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.admin; 2 | 3 | import org.nott.model.SysPermission; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * Mapper 接口 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-06-07 15 | */ 16 | public interface SysPermissionMapper extends BaseMapper { 17 | 18 | List getPermissionByUserId(Object loginId); 19 | } 20 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/resources/mapper/SysRoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/UserLoginDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import javax.validation.constraints.NotEmpty; 8 | 9 | 10 | /** 11 | * @author Nott 12 | * @date 2024-7-6 13 | */ 14 | @Data 15 | @ApiModel("用户登录DTO") 16 | public class UserLoginDTO { 17 | 18 | @ApiModelProperty(value = "手机号",required = true) 19 | @NotEmpty(message = "必填元素不能为空") 20 | private String phone; 21 | } 22 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/admin/SysRoleService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.admin; 2 | 3 | import org.nott.model.SysRole; 4 | import org.nott.service.mapper.admin.SysRoleMapper; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import org.springframework.stereotype.Service; 7 | 8 | /** 9 | *

10 | * 服务实现类 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-06-07 15 | */ 16 | @Service 17 | public class SysRoleService extends ServiceImpl { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/PayWayQueryDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import javax.validation.constraints.NotNull; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2024-8-8 12 | */ 13 | 14 | @ApiModel("查询支付方式DTO") 15 | @Data 16 | public class PayWayQueryDTO { 17 | 18 | @ApiModelProperty(value = "当前业务平台",required = true) 19 | @NotNull(message = "平台为空") 20 | private String platformName; 21 | } 22 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/api/BizPackageService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.api; 2 | 3 | import org.nott.model.BizPackage; 4 | import org.nott.service.mapper.api.BizPackageMapper; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import org.springframework.stereotype.Service; 7 | 8 | /** 9 | *

10 | * 服务实现类 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-05-24 15 | */ 16 | @Service 17 | public class BizPackageService extends ServiceImpl { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/CommonRemarkVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2025-3-24 10 | */ 11 | 12 | @Data 13 | @ApiModel("常用备注Vo") 14 | public class CommonRemarkVo { 15 | 16 | @ApiModelProperty("id") 17 | private Long id; 18 | 19 | @ApiModelProperty("内容") 20 | private String context; 21 | 22 | @ApiModelProperty("删除标识") 23 | private Integer delFlag; 24 | } 25 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/SkuCatalogItemVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import lombok.Data; 4 | import org.nott.model.BizSkuItem; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Nott 10 | * @date 2024-6-18 11 | */ 12 | 13 | @Data 14 | public class SkuCatalogItemVo { 15 | 16 | private Long skuCatalogId; 17 | 18 | private String skuCatalogName; 19 | 20 | private Integer disPlayOrder; 21 | 22 | private Long itemId; 23 | 24 | private String itemName; 25 | 26 | private List skuItems; 27 | } 28 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/admin/SysUserRoleService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.admin; 2 | 3 | import org.nott.model.SysUserRole; 4 | import org.nott.service.mapper.admin.SysUserRoleMapper; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import org.springframework.stereotype.Service; 7 | 8 | /** 9 | *

10 | * 服务实现类 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-06-07 15 | */ 16 | @Service 17 | public class SysUserRoleService extends ServiceImpl { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/api/BizTableInfoService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.api; 2 | 3 | import org.nott.model.BizTableInfo; 4 | import org.nott.service.mapper.api.BizTableInfoMapper; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import org.springframework.stereotype.Service; 7 | 8 | /** 9 | *

10 | * 服务实现类 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-05-24 15 | */ 16 | @Service 17 | public class BizTableInfoService extends ServiceImpl { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/MyOrderQueryDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.math.BigDecimal; 8 | import java.util.Date; 9 | 10 | /** 11 | * @author Nott 12 | * @date 2024-12-11 13 | */ 14 | @Data 15 | @ApiModel("查询我的订单DTO") 16 | public class MyOrderQueryDTO { 17 | 18 | @ApiModelProperty("状态") 19 | private Integer status; 20 | 21 | @ApiModelProperty("关键字") 22 | private String keyWord; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/SkuCatalogSearchDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import io.swagger.annotations.ApiOperation; 6 | import lombok.Data; 7 | 8 | /** 9 | * @author Nott 10 | * @date 2024-6-18 11 | */ 12 | @ApiModel("sku分类查询DTO") 13 | @Data 14 | public class SkuCatalogSearchDTO { 15 | 16 | @ApiModelProperty("商品名称") 17 | private String itemName; 18 | 19 | @ApiModelProperty("sku分类名称") 20 | private String catalogName; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/inter/BalancePayInfo.java: -------------------------------------------------------------------------------- 1 | package org.nott.model.inter; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.math.BigDecimal; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2025-3-31 12 | */ 13 | @Data 14 | @ApiModel("余额支付信息") 15 | public class BalancePayInfo { 16 | 17 | @ApiModelProperty("实际支付金额") 18 | private BigDecimal actualDispose; 19 | 20 | @ApiModelProperty("赠送支付金额") 21 | private BigDecimal giftDispose; 22 | } 23 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/api/BizSkuCatalogRelationService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.api; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import org.nott.model.BizSkuCatalogRelation; 5 | import org.nott.service.mapper.api.BizSkuCatalogRelationMapper; 6 | import org.springframework.stereotype.Service; 7 | 8 | /** 9 | * @author Nott 10 | * @date 2024-6-18 11 | */ 12 | 13 | @Service 14 | public class BizSkuCatalogRelationService extends ServiceImpl { 15 | } 16 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/admin/SysPermissionService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.admin; 2 | 3 | import org.nott.model.SysPermission; 4 | import org.nott.service.mapper.admin.SysPermissionMapper; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import org.springframework.stereotype.Service; 7 | 8 | /** 9 | *

10 | * 服务实现类 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-06-07 15 | */ 16 | @Service 17 | public class SysPermissionService extends ServiceImpl { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/SysBizCouponConditionController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | /** 8 | *

9 | * 优惠券规则表 前端控制器 10 | *

11 | * 12 | * @author nott 13 | * @since 2024-08-16 14 | */ 15 | @Api("优惠券规则管理") 16 | @RestController 17 | @RequestMapping("/sys/bizCouponCondition") 18 | public class SysBizCouponConditionController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/FrontOrderVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2024-12-6 10 | */ 11 | @Data 12 | @ApiModel("顾客前面订单信息对象") 13 | public class FrontOrderVo { 14 | 15 | 16 | @ApiModelProperty("订单数") 17 | private Integer orderCount; 18 | 19 | @ApiModelProperty("菜品数") 20 | private Integer pieceCount; 21 | 22 | @ApiModelProperty("预计等待时间") 23 | private Integer waitTime; 24 | } 25 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/MenuCatalogVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2024-7-3 10 | */ 11 | @Data 12 | public class MenuCatalogVo implements Serializable { 13 | 14 | private static final long serialVersionUID = 1L; 15 | 16 | private Long id; 17 | 18 | private Long shopId; 19 | 20 | private String catalogName; 21 | 22 | private String catalogDesc; 23 | 24 | private String mark; 25 | 26 | private String imgUrl; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/enums/OrderMessageType.java: -------------------------------------------------------------------------------- 1 | package org.nott.enums; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import lombok.Getter; 5 | 6 | /** 7 | * 订单消息类型枚举 8 | */ 9 | @Getter 10 | public enum OrderMessageType { 11 | 12 | /** 13 | * 下单 14 | */ 15 | IN("in"), 16 | /** 17 | * 完成 18 | */ 19 | FINISH("finish"), 20 | /** 21 | * 用户取餐 22 | */ 23 | TAKED("taked"), 24 | ; 25 | 26 | private String val; 27 | 28 | OrderMessageType(String val) { 29 | this.val = val; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/admin/SysRolePermissionService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.admin; 2 | 3 | import org.nott.model.SysRolePermission; 4 | import org.nott.service.mapper.admin.SysRolePermissionMapper; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import org.springframework.stereotype.Service; 7 | 8 | /** 9 | *

10 | * 服务实现类 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-06-07 15 | */ 16 | @Service 17 | public class SysRolePermissionService extends ServiceImpl{ 18 | 19 | } 20 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/api/BizCouponConditionService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.api; 2 | 3 | import org.nott.model.BizCouponCondition; 4 | import org.nott.service.mapper.api.BizCouponConditionMapper; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import org.springframework.stereotype.Service; 7 | 8 | /** 9 | *

10 | * 优惠券规则表 服务实现类 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-08-16 15 | */ 16 | @Service 17 | public class BizCouponConditionService extends ServiceImpl { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizCommonRemark.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 常用备注 9 | * @author Nott 10 | * @date 2025-3-24 11 | */ 12 | 13 | @Data 14 | public class BizCommonRemark implements Serializable { 15 | 16 | private static final long serialVersionUID = 1L; 17 | 18 | /** 19 | * id 20 | */ 21 | private Long id; 22 | 23 | /** 24 | * 内容 25 | */ 26 | private String context; 27 | 28 | /** 29 | * 删除标识 30 | */ 31 | private Integer delFlag; 32 | } 33 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/WechatUserInfoVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @author Nott 7 | * @date 2024-6-14 8 | */ 9 | 10 | @Data 11 | public class WechatUserInfoVo extends ExternalBaseUserInfo { 12 | 13 | private String openid; 14 | 15 | private String nickname; 16 | 17 | private Integer sex; 18 | 19 | private String province; 20 | 21 | private String city; 22 | 23 | private String country; 24 | 25 | private String headimgurl; 26 | 27 | private String privilege; 28 | 29 | private String unionid; 30 | } 31 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/ItemSearchDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | import javax.validation.constraints.NotEmpty; 10 | 11 | /** 12 | * @author Nott 13 | * @date 2024-5-24 14 | */ 15 | 16 | @ApiModel("商品搜索-DTO") 17 | @Setter 18 | @Getter 19 | public class ItemSearchDTO { 20 | 21 | @ApiModelProperty(value = "关键字",required = true) 22 | @NotEmpty(message = "搜索信息不能为空") 23 | private String keyWord; 24 | } 25 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/SysBizCouponController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import org.springframework.web.bind.annotation.RestController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 用户优惠券表 前端控制器 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-08-16 15 | */ 16 | @Api("用户优惠券管理") 17 | @RestController 18 | @RequestMapping("/sys/bizCoupon") 19 | public class SysBizCouponController { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/AdminLoginDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import javax.validation.constraints.NotNull; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2024-6-6 12 | */ 13 | @ApiModel("后台登录-DTO") 14 | @Data 15 | public class AdminLoginDTO { 16 | 17 | @ApiModelProperty("用户名") 18 | @NotNull(message = "用户名不能为空") 19 | private String username; 20 | 21 | @ApiModelProperty("密码") 22 | @NotNull(message = "密码不能为空") 23 | private String password; 24 | } 25 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizUserPackageMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.nott.model.BizUserPackage; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.nott.vo.UserPackageVo; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * Mapper 接口 12 | *

13 | * 14 | * @author nott 15 | * @since 2024-06-03 16 | */ 17 | public interface BizUserPackageMapper extends BaseMapper { 18 | 19 | List selectUserPackageByUserId(Long userId); 20 | 21 | void removeByUserId(long userId); 22 | } 23 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/SysBizUserPointController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import org.springframework.web.bind.annotation.RestController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 用户积分表 前端控制器 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-08-16 15 | */ 16 | 17 | @Api("用户积分管理") 18 | @RestController 19 | @RequestMapping("/sys/bizUserPoint") 20 | public class SysBizUserPointController { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/config/JedisPoolYmlConfig.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2024-6-12 10 | */ 11 | @Data 12 | @Component 13 | @ConfigurationProperties(prefix = "spring.redis.jedis.pool") 14 | public class JedisPoolYmlConfig { 15 | 16 | private Integer maxIdle; 17 | 18 | private Integer minIdle; 19 | 20 | private Integer maxActive; 21 | 22 | private Long TimeOut; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /hutu-external/src/main/java/org/nott/external/wechat/config/WechatAppConfig.java: -------------------------------------------------------------------------------- 1 | package org.nott.external.wechat.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 5 | import org.springframework.boot.context.properties.ConfigurationProperties; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * @author Nott 10 | * @date 2024-6-14 11 | */ 12 | 13 | @Data 14 | @Component 15 | @ConfigurationProperties(prefix = "wechat.app") 16 | public class WechatAppConfig { 17 | 18 | private String appId; 19 | 20 | private String appSecret; 21 | } 22 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/PayDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2025-3-28 10 | */ 11 | 12 | @Data 13 | @ApiModel("支付DTO") 14 | public class PayDTO { 15 | 16 | @ApiModelProperty("支付订单号") 17 | private String payNo; 18 | 19 | @ApiModelProperty("支付订单id") 20 | private Long payOrderId; 21 | 22 | @ApiModelProperty("支付方式") 23 | private String payCode; 24 | 25 | @ApiModelProperty("额外信息") 26 | private String extra; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/SysBizUserPointLogController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 用户积分日志表 前端控制器 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-08-16 15 | */ 16 | @Api("用户积分日志管理") 17 | @RestController 18 | @RequestMapping("/sys/bizUserPointLog") 19 | public class SysBizUserPointLogController { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/UserProfileDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2024-7-9 10 | */ 11 | @ApiModel("用户个人信息DTO") 12 | @Data 13 | public class UserProfileDTO { 14 | 15 | @ApiModelProperty("头像地址") 16 | private String avatarUrl; 17 | 18 | @ApiModelProperty("性别 0-女 1-男") 19 | private Integer gender; 20 | 21 | @ApiModelProperty("昵称") 22 | private String username; 23 | 24 | @ApiModelProperty("手机号") 25 | private String phone; 26 | } 27 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/enums/PickTypeEnum.java: -------------------------------------------------------------------------------- 1 | package org.nott.enums; 2 | 3 | import lombok.Getter; 4 | 5 | import java.util.Arrays; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2024-11-18 10 | */ 11 | @Getter 12 | public enum PickTypeEnum { 13 | EAT_IN(0), 14 | TACK_OUT(1); 15 | 16 | 17 | private Integer val; 18 | 19 | PickTypeEnum(Integer val) { 20 | this.val = val; 21 | } 22 | 23 | public static PickTypeEnum getByVal(Integer val){ 24 | return Arrays.stream(PickTypeEnum.values()).filter(r -> r.getVal().equals(val)) 25 | .findFirst().orElse(null); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/pay/PayService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.pay; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import org.nott.dto.PayDTO; 5 | import org.nott.dto.RefundDTO; 6 | import org.nott.vo.pay.PayResultVo; 7 | import org.nott.vo.pay.QueryResultVo; 8 | import org.nott.vo.pay.RefundResultVo; 9 | 10 | /** 11 | * @author Nott 12 | * @date 2025-3-28 13 | */ 14 | public interface PayService { 15 | 16 | PayResultVo doPay(PayDTO payDTO); 17 | 18 | RefundResultVo doRefund(RefundDTO refundDTO); 19 | 20 | void notify(JSONObject obj); 21 | 22 | QueryResultVo query(String orderNo); 23 | } 24 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/config/BusinessConfig.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2024-11-18 10 | */ 11 | @Data 12 | @ConfigurationProperties(prefix = "business") 13 | @Component 14 | public class BusinessConfig { 15 | 16 | private String prefixEatIn; 17 | 18 | private String prefixTakeOut; 19 | 20 | private Long orderExpire; 21 | 22 | private Integer orderLength; 23 | 24 | private String checkType; 25 | } 26 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizTableInfo.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import java.io.Serializable; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | /** 9 | *

10 | * 门店桌台信息表 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-05-24 15 | */ 16 | @Getter 17 | @Setter 18 | @TableName("biz_table_info") 19 | public class BizTableInfo implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | private Long id; 24 | 25 | /** 26 | * 桌面信息 27 | */ 28 | private String tableName; 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizCouponMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | -------------------------------------------------------------------------------- /hutu-external/src/main/java/org/nott/external/alipay/config/AlipayConfig.java: -------------------------------------------------------------------------------- 1 | package org.nott.external.alipay.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2024-6-14 10 | */ 11 | 12 | @Data 13 | @Component 14 | @ConfigurationProperties(prefix = "alipay") 15 | public class AlipayConfig { 16 | 17 | private String appId; 18 | 19 | private String privateKey; 20 | 21 | private String publicKey; 22 | 23 | private String signType; 24 | 25 | private String notifyUrl; 26 | } 27 | -------------------------------------------------------------------------------- /hutu-feign/src/main/java/org/nott/feign/BizPayOrderWsClient.java: -------------------------------------------------------------------------------- 1 | package org.nott.feign; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import org.nott.common.ResponseEntity; 5 | import org.springframework.cloud.openfeign.FeignClient; 6 | import org.springframework.web.bind.annotation.*; 7 | 8 | // 没有使用注册中心,使用url方式调用 9 | @FeignClient(value = "payOrder-ws", url = "http://localhost:8888", path = "/ws/payOrder/") 10 | public interface BizPayOrderWsClient { 11 | 12 | @PostMapping("sendMessage2Shop/{shopId}") 13 | @ResponseBody 14 | ResponseEntity sendMessage2Shop(@PathVariable("shopId") Long shopId,@RequestBody JSONObject message); 15 | } 16 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 5 | import org.springframework.boot.context.properties.ConfigurationProperties; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * @author Nott 10 | * @date 2024-6-12 11 | */ 12 | @Data 13 | @Component 14 | @ConfigurationProperties(prefix = "spring.redis") 15 | public class RedisConfig { 16 | 17 | private String host; 18 | 19 | private Integer database; 20 | 21 | private Integer port; 22 | 23 | private String password; 24 | } 25 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/MenuItemVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2024-5-24 10 | */ 11 | 12 | @Data 13 | public class MenuItemVo { 14 | 15 | private Long itemId; 16 | 17 | private String itemName; 18 | 19 | private String menuCatalogId; 20 | 21 | private String itemDesc; 22 | 23 | private String originAmount; 24 | 25 | private String actuallyAmount; 26 | 27 | private String itemTag; 28 | 29 | private List itemImage; 30 | 31 | private String special; 32 | 33 | private Integer expectMakeTime; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/api/BizCommentService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.api; 2 | 3 | import org.nott.feign.OssClient; 4 | import org.nott.model.BizComment; 5 | import org.nott.service.mapper.api.BizCommentMapper; 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.web.multipart.MultipartFile; 9 | 10 | import javax.annotation.Resource; 11 | 12 | /** 13 | *

14 | * 服务实现类 15 | *

16 | * 17 | * @author nott 18 | * @since 2024-06-13 19 | */ 20 | @Service 21 | public class BizCommentService extends ServiceImpl { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/enums/OrderStatusEnum.java: -------------------------------------------------------------------------------- 1 | package org.nott.enums; 2 | 3 | import lombok.Getter; 4 | 5 | import java.util.Arrays; 6 | 7 | @Getter 8 | public enum OrderStatusEnum { 9 | 10 | INIT(0), 11 | PROCESSING(1), 12 | PAYED(2), 13 | REFUND(3), 14 | EXPIRE(4), 15 | FAILED(5), 16 | FINISH(6); 17 | 18 | private Integer val; 19 | 20 | OrderStatusEnum(Integer val) { 21 | this.val = val; 22 | } 23 | 24 | public static PickTypeEnum getByVal(Integer val){ 25 | return Arrays.stream(PickTypeEnum.values()).filter(r -> r.getVal().equals(val)) 26 | .findFirst().orElse(null); 27 | } 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/api/BizUserCouponRelationService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.api; 2 | 3 | import org.nott.model.BizCoupon; 4 | import org.nott.model.BizUserCouponRelation; 5 | import org.nott.service.mapper.api.BizUserCouponRelationMapper; 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 用户-优惠券关系表 服务实现类 14 | *

15 | * 16 | * @author nott 17 | * @since 2024-08-19 18 | */ 19 | @Service 20 | public class BizUserCouponRelationService extends ServiceImpl { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/pay/PayResultVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo.pay; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.math.BigDecimal; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2025-3-28 12 | */ 13 | 14 | @Data 15 | @ApiModel("支付结果Vo") 16 | public class PayResultVo extends BaseResultVo { 17 | 18 | @ApiModelProperty("支付订单id") 19 | private String payOrderId; 20 | @ApiModelProperty("外部订单号") 21 | private String outTradeNo; 22 | @ApiModelProperty("支付方式") 23 | private String payCode; 24 | @ApiModelProperty("支付金额") 25 | private BigDecimal payAmount; 26 | } 27 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizSkuCatalog.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import java.io.Serializable; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | /** 9 | *

10 | * sku分类表 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-06-03 15 | */ 16 | @Getter 17 | @Setter 18 | @TableName("biz_sku_catalog") 19 | public class BizSkuCatalog implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /** 24 | * id 25 | */ 26 | private Long id; 27 | 28 | /** 29 | * sku分类名称 30 | */ 31 | private String skuCatalogName; 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/ItemSkuVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | import org.nott.model.BizSkuItem; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * @author Nott 12 | * @date 2024-6-3 13 | */ 14 | @Data 15 | @ApiModel("商品SKU VO对象") 16 | public class ItemSkuVo { 17 | @ApiModelProperty("sku分类名称") 18 | private String skuCatalogName; 19 | @ApiModelProperty("sku展示顺序") 20 | private Integer displayOrder; 21 | @ApiModelProperty("分类id") 22 | private Long catalogId; 23 | @ApiModelProperty("sku子项列表") 24 | private List skuItems; 25 | } 26 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/SysRole.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import java.io.Serializable; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | /** 9 | *

10 | * 系统角色表 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-06-07 15 | */ 16 | @Getter 17 | @Setter 18 | @TableName("sys_role") 19 | public class SysRole implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | private Long id; 24 | 25 | /** 26 | * 角色名称 27 | */ 28 | private String roleName; 29 | 30 | /** 31 | * 备注 32 | */ 33 | private String remark; 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/config/WebSocketConfig.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2024-11-26 10 | */ 11 | @Data 12 | @Component 13 | @ConfigurationProperties("ws") 14 | public class WebSocketConfig { 15 | 16 | private Integer port; 17 | 18 | private String path; 19 | 20 | private Integer workerGroup; 21 | 22 | private Integer bossGroup; 23 | 24 | private String heartBeatMsg; 25 | 26 | private String heartBeatResp; 27 | 28 | private boolean showIdleMsg; 29 | } 30 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizMenuMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import org.nott.model.BizMenu; 5 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 6 | import org.nott.vo.MenuItemVo; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * Mapper 接口 13 | *

14 | * 15 | * @author nott 16 | * @since 2024-05-24 17 | */ 18 | public interface BizMenuMapper extends BaseMapper { 19 | 20 | List getMenuItemListByCatalogId(String catalogId); 21 | 22 | List getMenuItemListByShopCatalogId(@Param("shopId") Long shopId, @Param("catalogId") String catalogId); 23 | } 24 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/SysUserRole.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import java.io.Serializable; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | /** 9 | *

10 | * 系统用户-角色关系表 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-06-07 15 | */ 16 | @Getter 17 | @Setter 18 | @TableName("sys_user_role") 19 | public class SysUserRole implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | private Long id; 24 | 25 | /** 26 | * 系统用户id 27 | */ 28 | private Long userId; 29 | 30 | /** 31 | * 角色id 32 | */ 33 | private Long roleId; 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/thread/pool/HutuThreadPoolExecutor.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.thread.pool; 2 | 3 | import com.google.common.util.concurrent.ThreadFactoryBuilder; 4 | 5 | import java.util.concurrent.*; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2024-11-19 10 | */ 11 | public class HutuThreadPoolExecutor { 12 | 13 | private static final ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() 14 | .setNameFormat("hutu-pool-%d").build(); 15 | 16 | public static ExecutorService threadPool = new ThreadPoolExecutor(5, 200, 17 | 0L, TimeUnit.MILLISECONDS, 18 | new LinkedBlockingQueue(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); 19 | } 20 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/pay/RefundResultVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo.pay; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.math.BigDecimal; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2025-3-28 12 | */ 13 | 14 | @Data 15 | @ApiModel("退款结果Vo") 16 | public class RefundResultVo extends BaseResultVo { 17 | 18 | @ApiModelProperty("退款订单号") 19 | private String refundNo; 20 | 21 | @ApiModelProperty("外部退款订单号") 22 | private String outRefundTradeNo; 23 | 24 | @ApiModelProperty("退款金额") 25 | private BigDecimal refundAmount; 26 | 27 | @ApiModelProperty("退款状态") 28 | private Integer refundStatus; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/SysRolePermission.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import java.io.Serializable; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | /** 9 | *

10 | * 系统角色-权限关系表 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-06-07 15 | */ 16 | @Getter 17 | @Setter 18 | @TableName("sys_role_permission") 19 | public class SysRolePermission implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | private Long id; 24 | 25 | /** 26 | * 角色id 27 | */ 28 | private Long roleId; 29 | 30 | /** 31 | * 权限id 32 | */ 33 | private Long permissionId; 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/RefundDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.math.BigDecimal; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2025-3-28 12 | */ 13 | 14 | @Data 15 | @ApiModel("退款DTO") 16 | public class RefundDTO { 17 | 18 | @ApiModelProperty("支付订单号") 19 | private String payNo; 20 | 21 | @ApiModelProperty("是否全额退款") 22 | private boolean isFull; 23 | 24 | @ApiModelProperty("退款金额") 25 | private BigDecimal refundAmount; 26 | 27 | @ApiModelProperty("退款原因") 28 | private String refundReason; 29 | 30 | @ApiModelProperty("额外信息") 31 | private String extra; 32 | } 33 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/SysUserInfoDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import javax.validation.constraints.NotNull; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2024-6-17 12 | */ 13 | 14 | @ApiModel("系统用户DTO") 15 | @Data 16 | public class SysUserInfoDTO { 17 | 18 | @ApiModelProperty(value = "用户名",required = true) 19 | @NotNull(message = "用户名称不能为空") 20 | private String username; 21 | 22 | @ApiModelProperty(value = "密码",required = true) 23 | @NotNull(message = "密码不能为空") 24 | private String password; 25 | 26 | @ApiModelProperty(value = "头像地址") 27 | private String avatarUrl; 28 | } 29 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizUserCouponRelation.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import java.io.Serializable; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | /** 9 | *

10 | * 用户-优惠券关系表 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-08-19 15 | */ 16 | @Getter 17 | @Setter 18 | @TableName("biz_user_coupon_relation") 19 | public class BizUserCouponRelation implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | private Long id; 24 | 25 | /** 26 | * 用户id 27 | */ 28 | private Long userId; 29 | 30 | /** 31 | * 优惠券id 32 | */ 33 | private Long couponId; 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/resources/mapper/SysPermissionMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/enums/BusinessPlatformEnum.java: -------------------------------------------------------------------------------- 1 | package org.nott.enums; 2 | 3 | import lombok.Getter; 4 | 5 | import java.util.Arrays; 6 | 7 | /** 8 | * 运行平台枚举 9 | */ 10 | 11 | @Getter 12 | public enum BusinessPlatformEnum { 13 | 14 | WX_MINIPROGRAM("MP-WEIXIN"), 15 | ALIPAY_MINIPROGRAM("MP-ALIPAY"), 16 | WEB("WEB") ; 17 | 18 | private String name; 19 | 20 | BusinessPlatformEnum(String name) { 21 | this.name = name; 22 | } 23 | 24 | public static BusinessPlatformEnum getByName(String name){ 25 | return Arrays.stream(BusinessPlatformEnum.values()) 26 | .filter(r -> name.equalsIgnoreCase(r.getName())) 27 | .findAny() 28 | .orElse(null); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/PayWayVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2024-6-26 10 | */ 11 | 12 | @Data 13 | @ApiModel("支付方式VO") 14 | public class PayWayVo { 15 | 16 | @ApiModelProperty("支付方式id") 17 | private Long id; 18 | 19 | @ApiModelProperty("名称") 20 | private String paymentName; 21 | 22 | @ApiModelProperty("展示顺序") 23 | private Integer displayOrder; 24 | 25 | @ApiModelProperty("图标") 26 | private String icon; 27 | 28 | @ApiModelProperty("是否收起") 29 | private Integer packUp; 30 | 31 | @ApiModelProperty("支付code") 32 | private String payCode; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizBusinessConfig.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import java.io.Serializable; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | /** 9 | *

10 | * 11 | *

12 | * 13 | * @author nott 14 | * @since 2025-04-15 15 | */ 16 | @Getter 17 | @Setter 18 | @TableName("biz_business_config") 19 | public class BizBusinessConfig implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /** 24 | * id 25 | */ 26 | private Long id; 27 | 28 | /** 29 | * 业务key 30 | */ 31 | private String bizKey; 32 | 33 | /** 34 | * 业务正文 35 | */ 36 | private String bizContext; 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /hutu-app/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | hutu-order 7 | org.nott 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | hutu-app 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/exception/HutuBizException.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.exception; 2 | 3 | /** 4 | * @author Nott 5 | * @date 2024-5-24 6 | */ 7 | public class HutuBizException extends RuntimeException{ 8 | 9 | public HutuBizException() { 10 | } 11 | 12 | public HutuBizException(String message) { 13 | super(message); 14 | } 15 | 16 | public HutuBizException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | 20 | public HutuBizException(Throwable cause) { 21 | super(cause); 22 | } 23 | 24 | public HutuBizException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 25 | super(message, cause, enableSuppression, writableStackTrace); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/exception/HttpFetchException.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.exception; 2 | 3 | /** 4 | * @author Nott 5 | * @date 2024-6-14 6 | */ 7 | public class HttpFetchException extends RuntimeException { 8 | public HttpFetchException() { 9 | } 10 | 11 | public HttpFetchException(String message) { 12 | super(message); 13 | } 14 | 15 | public HttpFetchException(String message, Throwable cause) { 16 | super(message, cause); 17 | } 18 | 19 | public HttpFetchException(Throwable cause) { 20 | super(cause); 21 | } 22 | 23 | public HttpFetchException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 24 | super(message, cause, enableSuppression, writableStackTrace); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/MiniProgramPhoneInfoDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import javax.validation.constraints.NotEmpty; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2024-7-9 12 | */ 13 | @Data 14 | @ApiModel("uni-app小程序登录DTO") 15 | public class MiniProgramPhoneInfoDTO { 16 | 17 | @ApiModelProperty(value = "微信code",required = true) 18 | @NotEmpty(message = "code不能为空") 19 | private String code; 20 | 21 | @ApiModelProperty(value = "加密数据",required = true) 22 | @NotEmpty(message = "encryptedData不能为空") 23 | private String encryptedData; 24 | 25 | @ApiModelProperty(value = "iv") 26 | @NotEmpty(message = "iv不能为空") 27 | private String iv; 28 | } 29 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/handler/MbpMetaObjectHandler.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.handler; 2 | 3 | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; 4 | import org.apache.ibatis.reflection.MetaObject; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.util.Date; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2024-5-24 12 | */ 13 | 14 | @Component 15 | public class MbpMetaObjectHandler implements MetaObjectHandler { 16 | 17 | @Override 18 | public void insertFill(MetaObject metaObject) { 19 | this.strictInsertFill(metaObject, "createTime", Date.class, new Date()); 20 | } 21 | 22 | @Override 23 | public void updateFill(MetaObject metaObject) { 24 | this.strictUpdateFill(metaObject, "updateTime", Date.class, new Date()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/enums/TimeEnum.java: -------------------------------------------------------------------------------- 1 | package org.nott.enums; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public enum TimeEnum { 7 | 8 | SECOND(1000L, 1L, "秒"), 9 | MINUTE(60 * 1000L, 60L, "分钟"), 10 | HOUR(60 * 60 * 1000L, 60 * 60L, "小时"), 11 | DAY(24 * 60 * 60 * 1000L, 24 * 60 * 60L, "天"), 12 | WEEK(7 * 24 * 60 * 60 * 1000L, 7 * 24 * 60 * 60L, "周"), 13 | MONTH(30 * 24 * 60 * 60 * 1000L, 30 * 24 * 60 * 60L, "月"), 14 | YEAR(365 * 24 * 60 * 60 * 1000L, 365 * 24 * 60 * 60L, "年"); 15 | 16 | private final Long millis; 17 | private final Long seconds; 18 | private final String unit; 19 | 20 | TimeEnum(Long millis, Long seconds, String unit) { 21 | this.millis = millis; 22 | this.seconds = seconds; 23 | this.unit = unit; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizItemSkuRelation.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import java.io.Serializable; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | /** 9 | *

10 | * 商品-sku关系表 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-06-03 15 | */ 16 | @Getter 17 | @Setter 18 | @TableName("biz_item_sku_relation") 19 | public class BizItemSkuRelation implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | private Long id; 24 | 25 | /** 26 | * 产品id 27 | */ 28 | private Long itemId; 29 | 30 | /** 31 | * 排序 32 | */ 33 | private Integer displayOrder; 34 | 35 | /** 36 | * sku分类id 37 | */ 38 | private Long skuCatalogId; 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizUserPackageMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 | delete from biz_user_package where user_id = #{userId} 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /hutu-app/oss/src/main/resources/logback-dev.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | false 8 | 9 | %white(%d{yyyy-MM-dd HH:mm:ss}) %highlight(%lsn) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n) 10 | utf8 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/UserPackageAddDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import javax.validation.constraints.NotNull; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2024-6-3 12 | */ 13 | 14 | @Data 15 | @ApiModel("用户购物袋DTO") 16 | public class UserPackageAddDTO { 17 | 18 | // @NotNull(message = "用户id不能为空") 19 | // private Long userId; 20 | 21 | @ApiModelProperty(value = "商品id",required = true) 22 | @NotNull(message = "产品id不能为空") 23 | private Long itemId; 24 | 25 | @ApiModelProperty(value = "数量",required = true) 26 | @NotNull(message = "产品数量不能为空") 27 | private Integer itemPiece; 28 | 29 | @ApiModelProperty(value = "SKU正文,逗号分割") 30 | private String skuItemContents; 31 | } 32 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/resources/logback-dev.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | false 8 | 9 | %white(%d{yyyy-MM-dd HH:mm:ss}) %highlight(%lsn) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n) 10 | utf8 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /hutu-web-socket/src/main/resources/logback-dev.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | false 8 | 9 | %white(%d{yyyy-MM-dd HH:mm:ss}) %highlight(%lsn) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n) 10 | utf8 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | 2 | #user nobody; 3 | worker_processes 1; 4 | 5 | #error_log logs/error.log; 6 | #error_log logs/error.log notice; 7 | #error_log logs/error.log info; 8 | 9 | pid logs/nginx.pid; 10 | 11 | 12 | events { 13 | worker_connections 1024; 14 | } 15 | 16 | 17 | http { 18 | include mime.types; 19 | default_type application/octet-stream; 20 | 21 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 22 | '$status $body_bytes_sent "$http_referer" ' 23 | '"$http_user_agent" "$http_x_forwarded_for"'; 24 | 25 | access_log logs/access.log main; 26 | 27 | sendfile on; 28 | #tcp_nopush on; 29 | 30 | #keepalive_timeout 0; 31 | keepalive_timeout 65; 32 | 33 | #gzip on; 34 | 35 | include conf.d/*.conf; 36 | } 37 | -------------------------------------------------------------------------------- /hutu-web-socket/src/main/java/org/nott/ws/HutuWebSocketApplication.java: -------------------------------------------------------------------------------- 1 | package org.nott.ws; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.nott.feign.BizPayOrderWsClient; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.cloud.openfeign.EnableFeignClients; 8 | import org.springframework.scheduling.annotation.EnableAsync; 9 | 10 | @Slf4j 11 | @SpringBootApplication(scanBasePackages = {"org.nott.ws", "org.nott.common.config", "org.nott.common.utils"}) 12 | @EnableFeignClients(clients = BizPayOrderWsClient.class) 13 | @EnableAsync 14 | public class HutuWebSocketApplication { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(HutuWebSocketApplication.class, args); 18 | log.info("Hutu-WebSocket 服务启动"); 19 | } 20 | } -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/UserCouponVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | import org.nott.model.BizCouponCondition; 7 | 8 | import java.math.BigDecimal; 9 | 10 | /** 11 | * @author Nott 12 | * @date 2024-8-19 13 | */ 14 | 15 | @Data 16 | @ApiModel("用户优惠券VO") 17 | public class UserCouponVo { 18 | 19 | @ApiModelProperty("优惠券id") 20 | private Long id; 21 | 22 | @ApiModelProperty("主标题") 23 | private String titile; 24 | 25 | @ApiModelProperty("折扣金额") 26 | private BigDecimal discountFee; 27 | 28 | @ApiModelProperty("二级标题") 29 | private String subTitle; 30 | 31 | @ApiModelProperty("当前是否可用") 32 | private boolean isUsable; 33 | 34 | @ApiModelProperty("使用条件") 35 | private BizCouponCondition condition; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizComment.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import java.io.Serializable; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | /** 9 | *

10 | * 用户评论表 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-06-13 15 | */ 16 | @Getter 17 | @Setter 18 | @TableName("biz_comment") 19 | public class BizComment implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | private Long id; 24 | 25 | /** 26 | * 评价打分 27 | */ 28 | private String commentRate; 29 | 30 | /** 31 | * 评价正文 32 | */ 33 | private String commentContext; 34 | 35 | /** 36 | * 评价图片 37 | */ 38 | private String commentUrls; 39 | 40 | /** 41 | * 评价用户id 42 | */ 43 | private Long commentUserId; 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizUserPackage.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import java.io.Serializable; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | /** 9 | *

10 | * 用户购物袋表 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-06-03 15 | */ 16 | @Getter 17 | @Setter 18 | @TableName("biz_user_package") 19 | public class BizUserPackage implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | private Long id; 24 | 25 | /** 26 | * 用户id 27 | */ 28 | private Long userId; 29 | 30 | /** 31 | * 产品id 32 | */ 33 | private Long itemId; 34 | 35 | /** 36 | * 选购件数 37 | */ 38 | private Integer itemPiece; 39 | 40 | /** 41 | * 选购规格,以逗号分隔 42 | */ 43 | private String skuItemContents; 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/OssFileVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | /** 8 | * @author Nott 9 | * @date 2025-3-18 10 | */ 11 | @Data 12 | @ApiModel("Oss文件信息") 13 | public class OssFileVo { 14 | 15 | @ApiModelProperty("id") 16 | private Long id; 17 | 18 | @ApiModelProperty("业务id") 19 | private Long bizId; 20 | 21 | @ApiModelProperty("存储名称") 22 | private String fileName; 23 | 24 | @ApiModelProperty("原始名称") 25 | private String originName; 26 | 27 | @ApiModelProperty("访问路径") 28 | private String path; 29 | 30 | @ApiModelProperty("文件后缀") 31 | private String prefix; 32 | 33 | @ApiModelProperty("创建时间") 34 | private String createTime; 35 | 36 | @ApiModelProperty("更新时间") 37 | private String updateTime; 38 | } 39 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/handler/HttpHandler.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.handler; 2 | 3 | import com.alibaba.fastjson2.JSON; 4 | import org.nott.common.ResponseEntity; 5 | 6 | import javax.servlet.http.HttpServletResponse; 7 | import java.io.IOException; 8 | import java.io.PrintWriter; 9 | 10 | /** 11 | * @author Nott 12 | * @date 2024-6-6 13 | */ 14 | 15 | public class HttpHandler { 16 | 17 | public static void writeResponse(ResponseEntity responseEntity, HttpServletResponse httpServletResponse) throws IOException { 18 | httpServletResponse.setStatus(200); 19 | httpServletResponse.setHeader("Content-type", "text/html;charset=UTF-8"); 20 | httpServletResponse.setCharacterEncoding("UTF-8"); 21 | PrintWriter writer = httpServletResponse.getWriter(); 22 | writer.write(JSON.toJSONString(responseEntity)); 23 | writer.flush(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/SettleOrderVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.math.BigDecimal; 8 | import java.util.Date; 9 | 10 | /** 11 | * @author Nott 12 | * @date 2024-10-8 13 | */ 14 | @ApiModel("用户结算Vo") 15 | @Data 16 | public class SettleOrderVo { 17 | 18 | @ApiModelProperty("应付总金额") 19 | private BigDecimal totalAmount; 20 | 21 | @ApiModelProperty("订单表id") 22 | private Long orderId; 23 | 24 | @ApiModelProperty("内部订单号") 25 | private String orderNo; 26 | 27 | @ApiModelProperty("店内用餐号") 28 | private String shopOrderNo; 29 | 30 | @ApiModelProperty("创建时间") 31 | private Date createTime; 32 | 33 | @ApiModelProperty("过期时间") 34 | private Long expireTime; 35 | 36 | @ApiModelProperty("用户id") 37 | private Long userId; 38 | } 39 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizSkuCatalogMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.nott.dto.SkuCatalogSearchDTO; 7 | import org.nott.model.BizSkuCatalog; 8 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 9 | import org.nott.vo.SkuCatalogItemVo; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | *

15 | * Mapper 接口 16 | *

17 | * 18 | * @author nott 19 | * @since 2024-06-03 20 | */ 21 | public interface BizSkuCatalogMapper extends BaseMapper { 22 | 23 | Page selectCatalogItemByPage(IPage page, @Param("skuCatalogSearchDTO") SkuCatalogSearchDTO skuCatalogSearchDTO, @Param("offset") int offset, @Param("size") Integer size); 24 | } 25 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/pay/QueryResultVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo.pay; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.math.BigDecimal; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2025-3-31 12 | */ 13 | @Data 14 | @ApiModel("查询结果Vo") 15 | public class QueryResultVo extends BaseResultVo { 16 | 17 | @ApiModelProperty("支付订单编号") 18 | private String orderNo; 19 | 20 | @ApiModelProperty("退款订单编号") 21 | private String refundOrderNo; 22 | 23 | @ApiModelProperty("支付方式") 24 | private String payCode; 25 | 26 | @ApiModelProperty("支付金额") 27 | private BigDecimal totalAmount; 28 | 29 | @ApiModelProperty("支付状态") 30 | private Integer status; 31 | 32 | @ApiModelProperty("退款状态") 33 | private Integer refundStatus; 34 | 35 | @ApiModelProperty("附加信息") 36 | private String extra; 37 | } 38 | -------------------------------------------------------------------------------- /hutu-security/src/main/java/org/nott/security/constant/SecurityConstants.java: -------------------------------------------------------------------------------- 1 | package org.nott.security.constant; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | /** 7 | * @author Nott 8 | * @date 2024-6-11 9 | */ 10 | public class SecurityConstants { 11 | 12 | public static final String ADMIN_REQUEST_SUFFIX = "/sys/"; 13 | 14 | public final static List PERMITTED_URL = Arrays.asList( 15 | "/external/wechat/miniProgramLogin", 16 | "/sys/admin/login", 17 | "/bizUser/login", 18 | "/sys/admin/logout", 19 | "/error", 20 | "/doc.html", 21 | "/webjars/**", 22 | "/swagger-ui.html", 23 | "/swagger-resources", 24 | "/swagger-resources/**" 25 | ); 26 | 27 | public final static String ERROR_URL = "/error"; 28 | 29 | public static final String ADMIN_ROLE_NAME = "admin"; 30 | } 31 | -------------------------------------------------------------------------------- /hutu-model/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | hutu-order 7 | org.nott 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | hutu-model 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | 21 | org.nott 22 | hutu-common 23 | 1.0-SNAPSHOT 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | /target 3 | 4 | tests 5 | test 6 | /test 7 | 8 | build 9 | /budil 10 | 11 | log 12 | *.log 13 | /log 14 | 15 | .iml 16 | .idea 17 | 18 | .github 19 | 20 | .env.* 21 | 22 | node_modules 23 | 24 | application-dev.yml 25 | 26 | .DS_Store 27 | node_modules/ 28 | dist/ 29 | 30 | dist_*/ 31 | dist_*/** 32 | 33 | uniapp-hutu-user/uniapp-hutu-user/unpackage/ 34 | uniapp-hutu-user/uniapp-hutu-user/unpackage/* 35 | uniapp-hutu-user/uniapp-hutu-user/unpackage/** 36 | #uniapp-hutu-user/uniapp-hutu-user/unpackage/dist 37 | uniapp-hutu-user/uniapp-hutu-user/node_modules/ 38 | vue-hutu-admin/tests/* 39 | vue-hutu-admin/tests/** 40 | result.txt 41 | npm-debug.log* 42 | yarn-debug.log* 43 | yarn-error.log* 44 | **/*.log 45 | 46 | tests/**/coverage/ 47 | tests/e2e/reports 48 | selenium-debug.log 49 | 50 | # Editor directories and files 51 | .vscode 52 | *.suo 53 | *.ntvs* 54 | *.njsproj 55 | *.sln 56 | *.local 57 | 58 | package-lock.json 59 | yarn.lock 60 | 61 | web/upload 62 | 63 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/UserPackageUpDateDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import javax.validation.constraints.NotNull; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2024-11-18 12 | */ 13 | @Data 14 | @ApiModel("用户购物袋更新对象") 15 | public class UserPackageUpDateDTO { 16 | 17 | @ApiModelProperty("购物袋记录id") 18 | @NotNull(message = "id不能为空") 19 | private Long id; 20 | @ApiModelProperty("商品id") 21 | @NotNull(message = "商品id不能为空") 22 | private Long itemId; 23 | @ApiModelProperty("商品数量") 24 | private Integer itemPiece; 25 | @ApiModelProperty("所选SKU内容") 26 | private String skuItemContents; 27 | @ApiModelProperty("实际单价") 28 | private String singleActuallyAmount; 29 | @ApiModelProperty("商品名称") 30 | private String itemName; 31 | @ApiModelProperty("商品预览图片地址") 32 | private String itemImageUrls; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/SysBizUserController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import org.nott.common.ResponseEntity; 6 | import org.nott.service.api.BizUserService; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import javax.annotation.Resource; 12 | 13 | /** 14 | * @author Nott 15 | * @date 2024-6-12 16 | */ 17 | 18 | @Api(tags = "用户管理") 19 | @RestController 20 | @RequestMapping("/sys/bizUser/") 21 | public class SysBizUserController { 22 | 23 | @Resource 24 | private BizUserService bizUserService; 25 | 26 | @ApiOperation("数量统计") 27 | @GetMapping("/count") 28 | public ResponseEntity countBizUser(){ 29 | return ResponseEntity.successData(bizUserService.count()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/PayGatewayDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import javax.validation.constraints.NotBlank; 8 | import java.math.BigDecimal; 9 | 10 | /** 11 | * @author Nott 12 | * @date 2025-3-31 13 | */ 14 | 15 | @Data 16 | @ApiModel("支付网关DTO") 17 | public class PayGatewayDTO { 18 | 19 | @ApiModelProperty("订单号") 20 | private String orderNo; 21 | 22 | @ApiModelProperty("订单id") 23 | private String orderId; 24 | 25 | @NotBlank(message = "业务编码不能为空") 26 | @ApiModelProperty("业务编码") 27 | private String businessCode; 28 | 29 | @ApiModelProperty("支付方式") 30 | private String payCode; 31 | 32 | @ApiModelProperty("是否全额退款") 33 | private boolean isFull; 34 | 35 | @ApiModelProperty("退款金额") 36 | private BigDecimal refundAmount; 37 | 38 | @ApiModelProperty("退款原因") 39 | private String refundReason; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/SysBizCommentController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import org.nott.common.ResponseEntity; 6 | import org.nott.service.api.BizCommentService; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import javax.annotation.Resource; 12 | 13 | /** 14 | * @author Nott 15 | * @date 2024-6-13 16 | */ 17 | 18 | @Api(tags = "商品评论管理") 19 | @RestController 20 | @RequestMapping("/sys/bizComment/") 21 | public class SysBizCommentController { 22 | 23 | @Resource 24 | private BizCommentService bizCommentService; 25 | 26 | @ApiOperation("评论数量统计") 27 | @GetMapping("count") 28 | public ResponseEntity count(){ 29 | return ResponseEntity.successData(bizCommentService.count()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/logback-dev.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | false 8 | 9 | %white(%d{yyyy-MM-dd HH:mm:ss}) %highlight(%lsn) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n) 10 | utf8 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/UserPackageVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2024-6-3 12 | */ 13 | @Data 14 | @ApiModel("用户购物袋返回VO") 15 | public class UserPackageVo { 16 | 17 | @ApiModelProperty("购物袋记录id") 18 | private Long id; 19 | @ApiModelProperty("用户id") 20 | private Long userId; 21 | @ApiModelProperty("商品id") 22 | private Long itemId; 23 | @ApiModelProperty("商品数量") 24 | private Integer itemPiece; 25 | @ApiModelProperty("所选SKU内容") 26 | private String skuItemContents; 27 | @ApiModelProperty("实际单价") 28 | private String singleActuallyAmount; 29 | @ApiModelProperty("商品名称") 30 | private String itemName; 31 | @ApiModelProperty("商品预览图片地址") 32 | private List itemImageUrls; 33 | @ApiModelProperty("预计制作时间") 34 | private Integer expectMakeTime; 35 | } 36 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/mapper/api/BizPayOrderMapper.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.mapper.api; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import org.apache.ibatis.annotations.Param; 5 | import org.nott.model.BizPayOrder; 6 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 7 | import org.nott.vo.FrontOrderVo; 8 | import org.nott.vo.MyPayOrderVo; 9 | 10 | import javax.validation.constraints.NotNull; 11 | import java.util.List; 12 | 13 | /** 14 | *

15 | * Mapper 接口 16 | *

17 | * 18 | * @author nott 19 | * @since 2024-05-24 20 | */ 21 | public interface BizPayOrderMapper extends BaseMapper { 22 | 23 | List selectOrderMoney(); 24 | 25 | FrontOrderVo orderFrontQueryByOrderId(@Param("settleTime") String settleTime,@Param("orderId") Long orderId); 26 | 27 | Page queryOrderPageByUserId(Page page, @NotNull @Param("id") long id, @Param("status") Integer status, @Param("keyWord") String keyWord); 28 | } 29 | -------------------------------------------------------------------------------- /hutu-app/oss/src/main/java/org/nott/oss/HutuOssApplication.java: -------------------------------------------------------------------------------- 1 | package org.nott.oss; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.nott.feign.OssClient; 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | import org.springframework.cloud.openfeign.EnableFeignClients; 9 | 10 | /** 11 | * @author Nott 12 | * @date 2025-3-18 13 | */ 14 | 15 | @Slf4j 16 | @EnableFeignClients(clients = OssClient.class) 17 | @MapperScan("org.nott.service.mapper.oss") 18 | @SpringBootApplication(scanBasePackages = { 19 | "org.nott.oss", 20 | "org.nott.service.oss", 21 | "org.nott.common.config", 22 | "org.nott.common.handler"}) 23 | public class HutuOssApplication { 24 | 25 | public static void main(String[] args) { 26 | 27 | SpringApplication.run(HutuOssApplication.class, args); 28 | 29 | log.info("Hutu-Order-Oss started successfully"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizMenuMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 15 | 26 | 27 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/idWorker/CustomIdGenerator.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.idWorker; 2 | 3 | import java.util.concurrent.atomic.AtomicLong; 4 | import org.springframework.stereotype.Component; 5 | 6 | import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; 7 | 8 | import lombok.extern.slf4j.Slf4j; 9 | 10 | /** 11 | * 自定义ID生成器 12 | */ 13 | @Slf4j 14 | public class CustomIdGenerator implements IdentifierGenerator { 15 | 16 | /** 17 | * workerId,机器id 18 | * datacenterId,数据标识id 19 | */ 20 | private final SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0); 21 | 22 | /** 23 | * AtomicLong是作用是对长整形进行原子操作。 24 | * 在32位操作系统中,64位的long 和 double 变量由于会被JVM当作两个分离的32位来进行操作,所以不具有原子性。 25 | * 而使用AtomicLong能让long的操作保持原子型。 26 | * @param entity 27 | * @return 28 | */ 29 | @Override 30 | public Long nextId(Object entity) { 31 | AtomicLong al = new AtomicLong(idWorker.nextId()); 32 | final long id = al.get(); 33 | return id; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/aop/LoginAspect.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.aop; 2 | 3 | import cn.dev33.satoken.stp.StpUtil; 4 | import org.aspectj.lang.ProceedingJoinPoint; 5 | import org.aspectj.lang.annotation.Around; 6 | import org.aspectj.lang.annotation.Aspect; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.stereotype.Component; 10 | 11 | /** 12 | * 需用户登录态AOP组件 13 | * @author Nott 14 | * @date 2024-10-12 15 | */ 16 | @Aspect 17 | @Component 18 | public class LoginAspect { 19 | 20 | private final Logger log = LoggerFactory.getLogger(LoginAspect.class); 21 | 22 | @Around("@annotation(org.nott.common.annotation.JustLogin)") 23 | public Object doAround(ProceedingJoinPoint pjp) throws Throwable{ 24 | try { 25 | StpUtil.getLoginIdAsLong(); 26 | } catch (Exception e) { 27 | log.error("Method {} executed error,User dont login",pjp.getSignature().getName()); 28 | throw e; 29 | } 30 | return pjp.proceed(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/java/org/nott/web/controller/BizCouponController.java: -------------------------------------------------------------------------------- 1 | package org.nott.web.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import org.nott.common.ResponseEntity; 6 | import org.nott.service.api.BizCouponService; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import javax.annotation.Resource; 12 | 13 | /** 14 | *

15 | * 用户优惠券表 前端控制器 16 | *

17 | * 18 | * @author nott 19 | * @since 2024-08-16 20 | */ 21 | @Api("用户优惠券") 22 | @RestController 23 | @RequestMapping("/bizCoupon") 24 | public class BizCouponController { 25 | 26 | @Resource 27 | private BizCouponService bizCouponService; 28 | 29 | @PostMapping("myCoupon") 30 | @ApiOperation("查询当前用户的优惠券") 31 | public ResponseEntity myCoupon(){ 32 | return ResponseEntity.successData(bizCouponService.queryAvailableCoupon()); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/OrderItemDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import javax.validation.constraints.NotNull; 8 | import java.math.BigDecimal; 9 | 10 | /** 11 | * @author Nott 12 | * @date 2024-10-8 13 | */ 14 | @ApiModel("订单商品DTO") 15 | @Data 16 | public class OrderItemDTO { 17 | @ApiModelProperty("购物袋记录id") 18 | private Long id; 19 | 20 | @ApiModelProperty(value = "订购商品id", required = true) 21 | @NotNull 22 | private Long itemId; 23 | 24 | @ApiModelProperty("商品名称") 25 | private String itemName; 26 | 27 | @ApiModelProperty(value = "订购商品sku正文", required = true) 28 | private String skuItemContents; 29 | 30 | @ApiModelProperty(value = "订购商品数量", required = true) 31 | @NotNull 32 | private Integer itemPiece; 33 | 34 | @ApiModelProperty("商品单价") 35 | private BigDecimal singleActuallyAmount; 36 | 37 | @ApiModelProperty("预计制作时间") 38 | private Integer expectMakeTime; 39 | } 40 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/HutuAdminApplication.java: -------------------------------------------------------------------------------- 1 | package org.nott; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.nott.feign.BizPayOrderWsClient; 6 | import org.nott.feign.OssClient; 7 | import org.springframework.boot.SpringApplication; 8 | import org.springframework.boot.autoconfigure.SpringBootApplication; 9 | import org.springframework.cloud.openfeign.EnableFeignClients; 10 | import org.springframework.scheduling.annotation.EnableAsync; 11 | 12 | @EnableAsync 13 | @EnableFeignClients(clients = {BizPayOrderWsClient.class, OssClient.class}) 14 | @MapperScan("org.nott.service.mapper.**.*") 15 | @SpringBootApplication(scanBasePackages = { 16 | "org.nott.common", 17 | "org.nott.service.**.*", 18 | "org.nott.admin.*", 19 | "org.nott.security.*", 20 | }) 21 | @Slf4j 22 | public class HutuAdminApplication { 23 | public static void main(String[] args) { 24 | SpringApplication.run(HutuAdminApplication.class, args); 25 | log.info("hutu-admin-api on load"); 26 | } 27 | } -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/delayed/DelayedTask.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.delayed; 2 | 3 | import lombok.Data; 4 | import org.jetbrains.annotations.NotNull; 5 | 6 | import java.util.concurrent.Delayed; 7 | import java.util.concurrent.TimeUnit; 8 | 9 | /** 10 | * @author Nott 11 | * @date 2024-11-19 12 | */ 13 | @Data 14 | public class DelayedTask implements Delayed { 15 | 16 | private T data; 17 | 18 | private long startTime; 19 | 20 | private long delayTime; 21 | 22 | 23 | @Override 24 | public long getDelay(@NotNull TimeUnit unit) { 25 | long diff = delayTime - (System.currentTimeMillis() - startTime); 26 | return unit.convert(diff, TimeUnit.MILLISECONDS); 27 | } 28 | 29 | @Override 30 | public int compareTo(@NotNull Delayed o) { 31 | if (this.getDelay(TimeUnit.MILLISECONDS) < o.getDelay(TimeUnit.MILLISECONDS)) { 32 | return -1; 33 | } 34 | if (this.getDelay(TimeUnit.MILLISECONDS) > o.getDelay(TimeUnit.MILLISECONDS)) { 35 | return 1; 36 | } 37 | return 0; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/api/BizCommonRemarkService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.api; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 5 | import org.nott.common.utils.HutuUtils; 6 | import org.nott.model.BizCommonRemark; 7 | import org.nott.service.mapper.api.BizCommonRemarkMapper; 8 | import org.nott.vo.CommonRemarkVo; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | 14 | /** 15 | * 常用备注表 服务实现类 16 | * @author Nott 17 | * @date 2025-3-24 18 | */ 19 | @Service 20 | public class BizCommonRemarkService extends ServiceImpl { 21 | 22 | 23 | public List queryCommonRemark(int size) { 24 | LambdaQueryWrapper wrapper = new LambdaQueryWrapper().eq(BizCommonRemark::getDelFlag, 0).last("limit " + size); 25 | List list = this.list(wrapper); 26 | return HutuUtils.transToVos(list, CommonRemarkVo.class); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/api/BizUserPointLogService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.api; 2 | 3 | 4 | import com.baomidou.mybatisplus.core.toolkit.IdWorker; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import org.nott.enums.UserPointUseEnum; 7 | import org.nott.model.BizUserPointLog; 8 | import org.nott.service.mapper.api.BizUserPointLogMapper; 9 | import org.springframework.stereotype.Service; 10 | 11 | /** 12 | *

13 | * 用户积分日志表 服务实现类 14 | *

15 | * 16 | * @author nott 17 | * @since 2024-08-16 18 | */ 19 | @Service 20 | public class BizUserPointLogService extends ServiceImpl { 21 | 22 | 23 | public void saveLog(String fee, Long usePoint, UserPointUseEnum userPointUseEnum) { 24 | BizUserPointLog pointLog = new BizUserPointLog(); 25 | pointLog.setId(IdWorker.getId()); 26 | pointLog.setPoint(usePoint); 27 | pointLog.setBizFee(fee); 28 | pointLog.setType(userPointUseEnum.getValue()); 29 | pointLog.setDescription(userPointUseEnum.getMark()); 30 | this.save(pointLog); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/inter/OrderWsMessageInfo.java: -------------------------------------------------------------------------------- 1 | package org.nott.model.inter; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import java.util.Date; 9 | 10 | /** 11 | * @author Nott 12 | * @date 2024-12-24 13 | */ 14 | @Data 15 | @ApiModel("订单消息信息") 16 | public class OrderWsMessageInfo extends BaseJsonInfo{ 17 | 18 | @ApiModelProperty("消息类型") 19 | private String messageType; 20 | 21 | @ApiModelProperty("id") 22 | private Long id; 23 | @ApiModelProperty("菜品统计") 24 | private Integer itemPiece; 25 | @ApiModelProperty("预计等待时间") 26 | private Integer waitTime; 27 | @ApiModelProperty("0-单点 1-套餐") 28 | private Integer orderType; 29 | @ApiModelProperty("0-堂食 1-打包 2-外送") 30 | private Integer pickType; 31 | @ApiModelProperty("订单号") 32 | private String orderNo; 33 | @ApiModelProperty("订单备注") 34 | private String remark; 35 | @ApiModelProperty("支付时间") 36 | private Date settleTime; 37 | @ApiModelProperty("店铺id") 38 | private Long shopId; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/java/org/nott/web/controller/BizCommonRemarkController.java: -------------------------------------------------------------------------------- 1 | package org.nott.web.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import org.nott.common.ResponseEntity; 6 | import org.nott.service.api.BizCommonRemarkService; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import javax.annotation.Resource; 13 | 14 | /** 15 | * @author Nott 16 | * @date 2025-3-24 17 | */ 18 | 19 | @Api("常用备注") 20 | @RestController 21 | @RequestMapping("/bizCommonRemark") 22 | public class BizCommonRemarkController { 23 | 24 | @Resource 25 | private BizCommonRemarkService bizCommonRemarkService; 26 | 27 | @GetMapping("query/{size}") 28 | @ApiOperation("查询常用备注") 29 | public ResponseEntity queryCommonRemark(@PathVariable("size") int size) { 30 | return ResponseEntity.successData(bizCommonRemarkService.queryCommonRemark(size)); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/java/org/nott/HutuApiApplication.java: -------------------------------------------------------------------------------- 1 | package org.nott; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.nott.feign.BizPayOrderWsClient; 6 | import org.nott.feign.OssClient; 7 | import org.springframework.boot.SpringApplication; 8 | import org.springframework.boot.autoconfigure.SpringBootApplication; 9 | import org.springframework.cloud.openfeign.EnableFeignClients; 10 | import org.springframework.scheduling.annotation.EnableAsync; 11 | 12 | @EnableFeignClients(clients = { BizPayOrderWsClient.class, OssClient.class }) 13 | @MapperScan("org.nott.service.mapper.api") 14 | @SpringBootApplication(scanBasePackages = { 15 | "org.nott.common.*", 16 | "org.nott.service.api", 17 | "org.nott.web.*", 18 | "org.nott.security.*", 19 | "org.nott.service.pay", 20 | "org.nott.external.*", 21 | 22 | }) 23 | @Slf4j 24 | @EnableAsync 25 | public class HutuApiApplication { 26 | 27 | public static void main(String[] args) { 28 | SpringApplication.run(HutuApiApplication.class,args); 29 | log.info("hutu-order-api on load"); 30 | } 31 | } -------------------------------------------------------------------------------- /hutu-app/api/src/main/java/org/nott/web/controller/BizPayWayController.java: -------------------------------------------------------------------------------- 1 | package org.nott.web.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import org.nott.common.ResponseEntity; 6 | import org.nott.dto.PayWayQueryDTO; 7 | import org.nott.service.api.BizPayWayService; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestBody; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import javax.annotation.Resource; 14 | 15 | /** 16 | *

17 | * 前端控制器 18 | *

19 | * 20 | * @author nott 21 | * @since 2024-05-24 22 | */ 23 | @Api(tags = "支付方式") 24 | @RestController 25 | @RequestMapping("/bizPayWay") 26 | public class BizPayWayController { 27 | 28 | @Resource 29 | private BizPayWayService bizPayWayService; 30 | 31 | @ApiOperation("查询支付方式列表") 32 | @PostMapping("list") 33 | public ResponseEntity listPayWay(@RequestBody PayWayQueryDTO dto){ 34 | return ResponseEntity.successData(bizPayWayService.listPayWay(dto)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /hutu-service/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | hutu-order 7 | org.nott 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | hutu-service 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | 21 | 22 | org.nott 23 | hutu-model 24 | 1.0-SNAPSHOT 25 | 26 | 27 | 28 | org.nott 29 | hutu-feign 30 | 1.0-SNAPSHOT 31 | 32 | 33 | -------------------------------------------------------------------------------- /hutu-security/src/main/java/org/nott/security/configuration/SpringSecurityConfiguration.java: -------------------------------------------------------------------------------- 1 | package org.nott.security.configuration; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 6 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 7 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 8 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 9 | import org.springframework.security.crypto.password.PasswordEncoder; 10 | 11 | /** 12 | * @author Nott 13 | * @date 2024-6-6 14 | */ 15 | @EnableWebSecurity 16 | @Configuration 17 | public class SpringSecurityConfiguration extends WebSecurityConfigurerAdapter { 18 | 19 | @Bean 20 | public PasswordEncoder passwordEncoder(){ 21 | return new BCryptPasswordEncoder(); 22 | }; 23 | 24 | @Override 25 | protected void configure(HttpSecurity http) throws Exception { 26 | http.authorizeRequests().anyRequest().permitAll().and().csrf().disable(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizSkuCatalogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/SysFile.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import java.io.Serializable; 7 | import java.time.LocalDateTime; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | 11 | /** 12 | *

13 | * 系统文件表 14 | *

15 | * 16 | * @author nott 17 | * @since 2024-07-10 18 | */ 19 | @Getter 20 | @Setter 21 | @TableName("sys_file") 22 | public class SysFile implements Serializable { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | private Long id; 27 | 28 | /** 29 | * 文件原名 30 | */ 31 | private String originName; 32 | 33 | /** 34 | * 文件存储名称 35 | */ 36 | private String fileName; 37 | 38 | /** 39 | * 上传路径 40 | */ 41 | private String path; 42 | 43 | /** 44 | * 业务数据id 45 | */ 46 | private Long bizId; 47 | 48 | /** 49 | * 文件类型 50 | */ 51 | private String type; 52 | 53 | /** 54 | * 创建时间 55 | */ 56 | @TableField(fill = FieldFill.INSERT) 57 | private LocalDateTime createTime; 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/utils/SequenceUtils.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.utils; 2 | 3 | import org.nott.common.config.BusinessConfig; 4 | import org.nott.common.redis.RedisUtils; 5 | import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; 6 | import org.springframework.stereotype.Component; 7 | 8 | import javax.annotation.Resource; 9 | 10 | /** 11 | * @author Nott 12 | * @date 2024-11-18 13 | */ 14 | @Component 15 | @ConditionalOnBean(RedisUtils.class) 16 | public class SequenceUtils { 17 | 18 | @Resource 19 | private RedisUtils redisUtils; 20 | @Resource 21 | private BusinessConfig businessConfig; 22 | 23 | public String nextSeq(String prefix){ 24 | Long increment = redisUtils.getIncrement(prefix); 25 | String str = String.valueOf(increment); 26 | int len = str.length(); 27 | if (len >= businessConfig.getOrderLength()) { 28 | return str; 29 | } 30 | int rest = businessConfig.getOrderLength() - len; 31 | StringBuilder sb = new StringBuilder(prefix); 32 | for (int i = 0; i < rest; i++) { 33 | sb.append('0'); 34 | } 35 | sb.append(str); 36 | return sb.toString(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizSkuItem.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableLogic; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.time.LocalDateTime; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | *

14 | * sku子项表 15 | *

16 | * 17 | * @author nott 18 | * @since 2024-06-03 19 | */ 20 | @Getter 21 | @Setter 22 | @TableName("biz_sku_item") 23 | public class BizSkuItem implements Serializable { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | private Long id; 28 | 29 | // private Long skuCatalogId; 30 | 31 | private String skuItemContent; 32 | 33 | /** 34 | * 删除标识 35 | */ 36 | @TableLogic(delval = "1",value = "0") 37 | private Integer delFlag; 38 | 39 | /** 40 | * 创建时间 41 | */ 42 | @TableField(fill = FieldFill.INSERT) 43 | private LocalDateTime createTime; 44 | 45 | /** 46 | * 更新时间 47 | */ 48 | @TableField(fill = FieldFill.UPDATE) 49 | private LocalDateTime updateTime; 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/java/org/nott/web/controller/BizSkuController.java: -------------------------------------------------------------------------------- 1 | package org.nott.web.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import org.nott.common.ResponseEntity; 6 | import org.nott.vo.ItemSkuVo; 7 | import org.nott.service.api.BizItemSkuRelationService; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import javax.annotation.Resource; 14 | import java.util.List; 15 | 16 | /** 17 | * @author Nott 18 | * @date 2024-6-3 19 | */ 20 | @Api(tags = "SKU信息") 21 | @RestController 22 | @RequestMapping("/sku") 23 | public class BizSkuController { 24 | 25 | @Resource 26 | private BizItemSkuRelationService bizItemSkuRelationService; 27 | 28 | @ApiOperation("根据商品id查询sku列表") 29 | @GetMapping("{itemId}") 30 | public ResponseEntity skuCatalogByItemId(@PathVariable Long itemId){ 31 | List itemSkuVoList = bizItemSkuRelationService.selectItemSkuList(itemId); 32 | return ResponseEntity.successData(itemSkuVoList); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/api/BizMenuCatalogService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.api; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import org.nott.common.utils.HutuUtils; 5 | import org.nott.model.BizMenuCatalog; 6 | import org.nott.service.mapper.api.BizMenuCatalogMapper; 7 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 8 | import org.nott.vo.MenuCatalogVo; 9 | import org.nott.vo.MenuItemVo; 10 | import org.springframework.stereotype.Service; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | *

16 | * 服务实现类 17 | *

18 | * 19 | * @author nott 20 | * @since 2024-05-24 21 | */ 22 | @Service 23 | public class BizMenuCatalogService extends ServiceImpl { 24 | 25 | 26 | public List getCatalogByShopId(Long shopId) { 27 | LambdaQueryWrapper wrapper = new LambdaQueryWrapper() 28 | .eq(BizMenuCatalog::getShopId, shopId) 29 | .eq(BizMenuCatalog::getDelFlag, 0); 30 | List bizMenuCatalogs = this.list(wrapper); 31 | List vos = HutuUtils.transToVos(bizMenuCatalogs, MenuCatalogVo.class); 32 | return vos; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/api/BizItemService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.api; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import org.nott.common.redis.RedisUtils; 5 | import org.nott.model.BizItem; 6 | import org.nott.service.mapper.api.BizItemMapper; 7 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 8 | import org.springframework.stereotype.Service; 9 | 10 | import javax.annotation.Resource; 11 | import java.util.List; 12 | import java.util.Set; 13 | 14 | /** 15 | *

16 | * 服务实现类 17 | *

18 | * 19 | * @author nott 20 | * @since 2024-05-24 21 | */ 22 | @Service 23 | public class BizItemService extends ServiceImpl { 24 | 25 | @Resource 26 | private RedisUtils redisUtils; 27 | 28 | 29 | public List searchItemByName(String keyWord) { 30 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() 31 | .like(BizItem::getItemName, keyWord); 32 | List bizItems = this.list(queryWrapper); 33 | return bizItems; 34 | } 35 | 36 | 37 | public Set getSearchItemTags() { 38 | Set bizItemTags = (Set)redisUtils.sGet("bizItemTags"); 39 | return bizItemTags; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/utils/RequestUriUtils.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.utils; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * @author Nott 8 | * @date 2024-11-26 9 | */ 10 | public class RequestUriUtils { 11 | 12 | /** 13 | * 将路径参数转换成Map对象,如果路径参数出现重复参数名,将以最后的参数值为准 14 | * @param uri 传入的携带参数的路径 15 | * @return 16 | */ 17 | public static Map getParams(String uri) { 18 | Map params = new HashMap<>(10); 19 | 20 | int idx = uri.indexOf("?"); 21 | if (idx != -1) { 22 | String[] paramsArr = uri.substring(idx + 1).split("&"); 23 | 24 | for (String param : paramsArr) { 25 | idx = param.indexOf("="); 26 | params.put(param.substring(0, idx), param.substring(idx + 1)); 27 | } 28 | } 29 | 30 | return params; 31 | } 32 | 33 | /** 34 | * 获取URI中参数以外部分路径 35 | * @param uri 36 | * @return 37 | */ 38 | public static String getBasePath(String uri) { 39 | if (uri == null || uri.isEmpty()) 40 | return null; 41 | 42 | int idx = uri.indexOf("?"); 43 | if (idx == -1) 44 | return uri; 45 | 46 | return uri.substring(0, idx); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/SysBizUserPackageController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import org.nott.common.ResponseEntity; 6 | import org.nott.service.api.BizUserPackageService; 7 | import org.nott.vo.UserPackageVo; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import javax.annotation.Resource; 14 | import java.util.List; 15 | 16 | /** 17 | *

18 | * 前端控制器 19 | *

20 | * 21 | * @author nott 22 | * @since 2024-06-07 23 | */ 24 | @Api("购物袋管理") 25 | @RestController 26 | @RequestMapping("/sys/bizUserPackage") 27 | public class SysBizUserPackageController { 28 | 29 | @Resource 30 | private BizUserPackageService bizUserPackageService; 31 | 32 | @ApiOperation("查询用户购物袋") 33 | @PostMapping("/query/{userId}") 34 | public ResponseEntity queryPackage(@PathVariable Long userId){ 35 | List userPackageVos = bizUserPackageService.queryPackageInfoByUserId(userId); 36 | return ResponseEntity.successData(userPackageVos); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizPayWay.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import java.io.Serializable; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | /** 9 | *

10 | * 支付方式表 11 | *

12 | * 13 | * @author nott 14 | * @since 2024-05-24 15 | */ 16 | @Getter 17 | @Setter 18 | @TableName("biz_pay_way") 19 | public class BizPayWay implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | private Long id; 24 | /** 25 | * 支付编码 26 | */ 27 | private String payCode; 28 | 29 | /** 30 | * 交易地址 31 | */ 32 | private String payUrl; 33 | 34 | /** 35 | * 退款地址 36 | */ 37 | private String refundUrl; 38 | 39 | /** 40 | * 查询地址 41 | */ 42 | private String queryUrl; 43 | 44 | /** 45 | * 交易系统名称 46 | */ 47 | private String paymentName; 48 | 49 | /** 50 | * 展示排序 51 | */ 52 | private Integer displayOrder; 53 | /** 54 | * 图标地址 55 | */ 56 | private String icon; 57 | /** 58 | * 展示收起 0-不收起 1-收起 59 | */ 60 | private Integer packUp; 61 | /** 62 | * 是否在用 63 | */ 64 | private Integer isUsable; 65 | /** 66 | * 支持的平台(枚举) 67 | */ 68 | private String supportPlatform; 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/configuration/CrossConfiguration.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.configuration; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.bind.annotation.CrossOrigin; 6 | import org.springframework.web.cors.CorsConfiguration; 7 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; 8 | import org.springframework.web.filter.CorsFilter; 9 | 10 | /** 11 | * @author Nott 12 | * @date 2024-6-12 13 | */ 14 | 15 | //@Configuration 16 | public class CrossConfiguration { 17 | 18 | // @Bean 19 | public CorsFilter corsFilter() { 20 | //1. 添加 CORS配置信息 21 | CorsConfiguration config = new CorsConfiguration(); 22 | //放行哪些原始域 23 | config.addAllowedOrigin("*"); 24 | //是否发送 Cookie 25 | config.setAllowCredentials(true); 26 | //放行哪些请求方式 27 | config.addAllowedMethod("*"); 28 | //放行哪些原始请求头部信息 29 | config.addAllowedHeader("*"); 30 | //2. 添加映射路径 31 | UrlBasedCorsConfigurationSource corsConfigurationSource = new UrlBasedCorsConfigurationSource(); 32 | corsConfigurationSource.registerCorsConfiguration("/**",config); 33 | //3. 返回新的CorsFilter 34 | return new CorsFilter(corsConfigurationSource); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/admin/StpInterfaceImpl.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.admin; 2 | 3 | import cn.dev33.satoken.stp.StpInterface; 4 | import org.nott.service.mapper.admin.SysPermissionMapper; 5 | import org.nott.service.mapper.admin.SysRoleMapper; 6 | import org.nott.model.SysPermission; 7 | import org.nott.model.SysRole; 8 | import org.springframework.stereotype.Service; 9 | 10 | import javax.annotation.Resource; 11 | import java.util.List; 12 | import java.util.stream.Collectors; 13 | 14 | /** 15 | * @author Nott 16 | * @date 2024-6-7 17 | */ 18 | @Service 19 | public class StpInterfaceImpl implements StpInterface { 20 | 21 | @Resource 22 | private SysPermissionMapper sysPermissionMapper; 23 | 24 | @Resource 25 | private SysRoleMapper sysRoleMapper; 26 | 27 | 28 | public List getPermissionList(Object loginId, String loginKey) { 29 | List permission = sysPermissionMapper.getPermissionByUserId(loginId); 30 | return permission.stream().map(SysPermission::getPermissionName).collect(Collectors.toList()); 31 | } 32 | 33 | 34 | public List getRoleList(Object loginId, String loginKey) { 35 | List roles = sysRoleMapper.getRoleByUserId(loginId); 36 | return roles.stream().map(SysRole::getRoleName).collect(Collectors.toList()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/OssFile.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | import java.util.Date; 10 | 11 | /** 12 | * Oss文件 13 | * @author Nott 14 | * @date 2025-3-18 15 | */ 16 | 17 | @TableName("oss_file") 18 | @Data 19 | public class OssFile implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /** 24 | * id 25 | */ 26 | private Long id; 27 | 28 | /** 29 | * 业务id 30 | */ 31 | private Long bizId; 32 | 33 | /** 34 | * 存储名称 35 | */ 36 | private String fileName; 37 | 38 | /** 39 | * 原始名称 40 | */ 41 | private String originName; 42 | 43 | /** 44 | * 访问路径 45 | */ 46 | private String path; 47 | 48 | /** 49 | * 文件后缀 50 | */ 51 | private String prefix; 52 | 53 | /** 54 | * 创建时间 55 | */ 56 | @TableField(fill = FieldFill.INSERT) 57 | private Date createTime; 58 | 59 | /** 60 | * 更新时间 61 | */ 62 | @TableField(fill = FieldFill.UPDATE) 63 | private Date updateTime; 64 | 65 | /** 66 | * 删除标识 67 | */ 68 | private Integer delFlag; 69 | 70 | } 71 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/SysPermission.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import java.io.Serializable; 7 | import java.time.LocalDateTime; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | 11 | /** 12 | *

13 | * 系统权限表 14 | *

15 | * 16 | * @author nott 17 | * @since 2024-06-07 18 | */ 19 | @Getter 20 | @Setter 21 | @TableName("sys_permission") 22 | public class SysPermission implements Serializable { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | private Long id; 27 | 28 | /** 29 | * 菜单路径 30 | */ 31 | private String menuPath; 32 | 33 | /** 34 | * 访问地址 35 | */ 36 | private String requestUrl; 37 | 38 | /** 39 | * 图标 40 | */ 41 | private String icon; 42 | 43 | /** 44 | * 权限名称 45 | */ 46 | private String permissionName; 47 | 48 | /** 49 | * 删除标识 50 | */ 51 | private Integer delFlag; 52 | 53 | /** 54 | * 创建时间 55 | */ 56 | @TableField(fill = FieldFill.INSERT) 57 | private LocalDateTime createTime; 58 | 59 | /** 60 | * 删除时间 61 | */ 62 | @TableField(fill = FieldFill.INSERT_UPDATE) 63 | private LocalDateTime updateTime; 64 | 65 | 66 | } 67 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizMenu.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableLogic; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | *

14 | * 门店菜单表 15 | *

16 | * 17 | * @author nott 18 | * @since 2024-05-24 19 | */ 20 | @Getter 21 | @Setter 22 | @TableName("biz_menu") 23 | public class BizMenu implements Serializable { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | /** 28 | * id 29 | */ 30 | private Long id; 31 | 32 | /** 33 | * 菜单分类id 34 | */ 35 | private Long menuCatalogId; 36 | 37 | /** 38 | * 菜品名称 39 | */ 40 | private String itemId; 41 | 42 | /** 43 | * 门店id 44 | */ 45 | private Long shopId; 46 | 47 | /** 48 | * 删除标识 49 | */ 50 | @TableLogic(delval = "1",value = "0") 51 | private Integer delFlag; 52 | 53 | /** 54 | * 创建时间 55 | */ 56 | @TableField(fill = FieldFill.INSERT) 57 | private Date createTime; 58 | 59 | /** 60 | * 更新时间 61 | */ 62 | @TableField(fill = FieldFill.UPDATE) 63 | private Date updateTime; 64 | 65 | 66 | } 67 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/java/org/nott/web/controller/BizItemController.java: -------------------------------------------------------------------------------- 1 | package org.nott.web.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import org.nott.common.ResponseEntity; 6 | import org.nott.dto.ItemSearchDTO; 7 | import org.nott.model.BizItem; 8 | import org.nott.service.api.BizItemService; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import javax.annotation.Resource; 12 | import javax.validation.Valid; 13 | import java.util.List; 14 | import java.util.Set; 15 | 16 | /** 17 | *

18 | * 前端控制器 19 | *

20 | * 21 | * @author nott 22 | * @since 2024-05-24 23 | */ 24 | @Api(tags = "商品信息") 25 | @RestController 26 | @RequestMapping("/bizItem") 27 | public class BizItemController { 28 | 29 | @Resource 30 | private BizItemService bizItemService; 31 | 32 | @ApiOperation(value = "搜索商品") 33 | @PostMapping("search") 34 | public ResponseEntity searchItem(@RequestBody @Valid ItemSearchDTO dto){ 35 | List itemList = bizItemService.searchItemByName(dto.getKeyWord()); 36 | return ResponseEntity.successData(itemList); 37 | } 38 | 39 | @ApiOperation(value = "热搜tag") 40 | @GetMapping("searchTags") 41 | public ResponseEntity searchTags(){ 42 | Set tags = bizItemService.getSearchItemTags(); 43 | return ResponseEntity.successData(tags); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizUserPointLog.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import java.io.Serializable; 7 | import java.math.BigDecimal; 8 | import java.time.LocalDateTime; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | *

14 | * 用户积分日志表 15 | *

16 | * 17 | * @author nott 18 | * @since 2024-08-16 19 | */ 20 | @Getter 21 | @Setter 22 | @TableName("biz_user_point_log") 23 | public class BizUserPointLog implements Serializable { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | /** 28 | * id 29 | */ 30 | private Long id; 31 | 32 | /** 33 | * 用户id 34 | */ 35 | private Long userId; 36 | 37 | /** 38 | * 业务金额 39 | */ 40 | private String bizFee; 41 | 42 | /** 43 | * 添加积分 44 | */ 45 | private Long point; 46 | 47 | /** 48 | * 描述 49 | */ 50 | private String description; 51 | 52 | /** 53 | * 创建时间 54 | */ 55 | @TableField(fill = FieldFill.INSERT) 56 | private LocalDateTime createTime; 57 | 58 | /** 59 | * 删除标识 60 | */ 61 | private Integer delFlag; 62 | 63 | /** 64 | * 使用类型 0-主动 1-系统扣除 65 | */ 66 | private Integer type; 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /hutu-app/admin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | hutu-order 7 | org.nott 8 | 1.0-SNAPSHOT 9 | ../../pom.xml 10 | 11 | 4.0.0 12 | 13 | admin 14 | 15 | 16 | 8 17 | 8 18 | 19 | 20 | 21 | 22 | org.nott 23 | hutu-security 24 | 1.0-SNAPSHOT 25 | 26 | 27 | 28 | org.nott 29 | api 30 | 1.0-SNAPSHOT 31 | 32 | 33 | 34 | org.nott 35 | hutu-feign 36 | 1.0-SNAPSHOT 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/java/org/nott/web/controller/BizBusinessConfigController.java: -------------------------------------------------------------------------------- 1 | package org.nott.web.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import org.nott.common.ResponseEntity; 6 | import org.nott.service.api.BizBusinessConfigService; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | import javax.annotation.Resource; 12 | 13 | /** 14 | *

15 | * 前端控制器 16 | *

17 | * 18 | * @author nott 19 | * @since 2025-04-15 20 | */ 21 | @Api(tags = "业务配置") 22 | @RestController 23 | @RequestMapping("/bizConfig") 24 | public class BizBusinessConfigController { 25 | 26 | @Resource 27 | private BizBusinessConfigService bizBusinessConfigService; 28 | 29 | @ApiOperation("根据业务key查询业务配置") 30 | @RequestMapping("/getByKey/{key}") 31 | public ResponseEntity getByKey(@PathVariable(name = "key") String key){ 32 | return ResponseEntity.successData(bizBusinessConfigService.getByBizKey(key)); 33 | } 34 | 35 | @ApiOperation("查询Redis中的业务配置") 36 | @GetMapping("/getRedisConfig") 37 | public ResponseEntity getRedisConfig() { 38 | return ResponseEntity.successData(bizBusinessConfigService.getRedisConfig()); 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /hutu-external/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | hutu-order 7 | org.nott 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | hutu-external 13 | 14 | 15 | 8 16 | 8 17 | 4.39.60.ALL 18 | 19 | 20 | 21 | 22 | 23 | org.nott 24 | hutu-common 25 | 1.0-SNAPSHOT 26 | 27 | 28 | 29 | org.nott 30 | hutu-service 31 | 1.0-SNAPSHOT 32 | 33 | 34 | 35 | com.alipay.sdk 36 | alipay-sdk-java 37 | ${ali-pay.version} 38 | 39 | 40 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizCoupon.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import java.io.Serializable; 7 | import java.math.BigDecimal; 8 | import java.time.LocalDateTime; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | *

14 | * 用户优惠券表 15 | *

16 | * 17 | * @author nott 18 | * @since 2024-08-16 19 | */ 20 | @Getter 21 | @Setter 22 | @TableName("biz_coupon") 23 | public class BizCoupon implements Serializable { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | /** 28 | * id 29 | */ 30 | private Long id; 31 | 32 | /** 33 | * 条件id 34 | */ 35 | private Long conditionId; 36 | 37 | /** 38 | * 优惠券标题 39 | */ 40 | private String titile; 41 | 42 | /** 43 | * 二级标题 44 | */ 45 | private String subTitle; 46 | 47 | /** 48 | * 创建人id 49 | */ 50 | private Long creatorId; 51 | 52 | /** 53 | * 删除标识 54 | */ 55 | private Integer delFlag; 56 | 57 | /** 58 | * 创建时间 59 | */ 60 | @TableField(fill = FieldFill.INSERT) 61 | private LocalDateTime createTime; 62 | 63 | /** 64 | * 更新时间 65 | */ 66 | private LocalDateTime updateTime; 67 | 68 | /** 69 | * 满减金额 70 | */ 71 | private BigDecimal discountFee; 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/PayOrderVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | import org.nott.dto.OrderItemDTO; 7 | 8 | import java.io.Serializable; 9 | import java.math.BigDecimal; 10 | import java.util.Date; 11 | import java.util.List; 12 | 13 | /** 14 | * @author Nott 15 | * @date 2024-10-8 16 | */ 17 | @ApiModel("支付订单完成Vo") 18 | @Data 19 | public class PayOrderVo implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | @ApiModelProperty("订单号") 24 | private String orderNo; 25 | 26 | @ApiModelProperty("结算号-商家叫号") 27 | private String shopOrderNo; 28 | 29 | @ApiModelProperty("内部订单id") 30 | private Long payOrderId; 31 | 32 | @ApiModelProperty("结算时间") 33 | private Date settleTime; 34 | 35 | @ApiModelProperty("门店id") 36 | private Long shopId; 37 | 38 | @ApiModelProperty("门店名称") 39 | private String shopName; 40 | 41 | @ApiModelProperty("门店地址") 42 | private String shopAddress; 43 | 44 | @ApiModelProperty("订单商品内容") 45 | private List itemInfo; 46 | 47 | @ApiModelProperty("原价") 48 | private BigDecimal originAmount; 49 | 50 | @ApiModelProperty("实付") 51 | private BigDecimal totalAmount; 52 | 53 | @ApiModelProperty("本单餐品总等待时间") 54 | private Long waitTime; 55 | 56 | @ApiModelProperty("订单状态") 57 | private Integer orderStatus; 58 | } 59 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizUser.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import java.io.Serializable; 5 | import java.math.BigDecimal; 6 | import java.util.Date; 7 | import lombok.Getter; 8 | import lombok.Setter; 9 | 10 | /** 11 | *

12 | * 用户表 13 | *

14 | * 15 | * @author nott 16 | * @since 2024-05-24 17 | */ 18 | @Getter 19 | @Setter 20 | @TableName("biz_user") 21 | public class BizUser implements Serializable { 22 | 23 | private static final long serialVersionUID = 1L; 24 | 25 | private Long id; 26 | 27 | /** 28 | * 用户名 29 | */ 30 | private String username; 31 | 32 | /** 33 | * 手机号 34 | */ 35 | private String phone; 36 | 37 | /** 38 | * 微信/支付宝 openid 39 | */ 40 | private String openId; 41 | 42 | /** 43 | * 头像地址 44 | */ 45 | private String avatarUrl; 46 | 47 | /** 48 | * 性别 49 | */ 50 | private Integer gender; 51 | 52 | /** 53 | * 登录次数 54 | */ 55 | private Integer loginCount; 56 | 57 | /** 58 | * 注册时间 59 | */ 60 | private Date registTime; 61 | 62 | /** 63 | * 最后登录时间 64 | */ 65 | private Date lastLogTime; 66 | 67 | /** 68 | * 实际余额 69 | */ 70 | private BigDecimal actualBalance; 71 | 72 | /** 73 | * 赠送余额 74 | */ 75 | private BigDecimal giftBalance; 76 | 77 | /** 78 | * 积分 79 | */ 80 | private Long point; 81 | 82 | 83 | } 84 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/api/BizPayWayService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.api; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import org.nott.common.utils.HutuUtils; 5 | import org.nott.dto.PayWayQueryDTO; 6 | import org.nott.model.BizPayWay; 7 | import org.nott.service.mapper.api.BizPayWayMapper; 8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 9 | import org.nott.vo.PayWayVo; 10 | import org.springframework.stereotype.Service; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | /** 16 | *

17 | * 服务实现类 18 | *

19 | * 20 | * @author nott 21 | * @since 2024-05-24 22 | */ 23 | @Service 24 | public class BizPayWayService extends ServiceImpl { 25 | 26 | 27 | public List listPayWay(PayWayQueryDTO dto) { 28 | List vos = new ArrayList<>(); 29 | 30 | LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); 31 | 32 | wrapper.eq(BizPayWay::getIsUsable, 1) 33 | .eq(BizPayWay::getSupportPlatform,dto.getPlatformName()) 34 | .or().eq(BizPayWay::getSupportPlatform,"ALL") 35 | .orderByAsc(BizPayWay::getDisplayOrder); 36 | 37 | List payWays = this.list(wrapper); 38 | if (HutuUtils.isNotEmpty(payWays)) { 39 | payWays.forEach(r -> vos.add(HutuUtils.transToObject(r,PayWayVo.class))); 40 | } 41 | return vos; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /hutu-app/oss/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.nott 8 | hutu-order 9 | 1.0-SNAPSHOT 10 | ../../pom.xml 11 | 12 | 13 | oss 14 | 15 | 16 | 8 17 | 8 18 | UTF-8 19 | 20 | 21 | 22 | 23 | org.nott 24 | hutu-service 25 | 1.0-SNAPSHOT 26 | 27 | 28 | 29 | org.nott 30 | hutu-feign 31 | 1.0-SNAPSHOT 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizMenuCatalog.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableLogic; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | *

14 | * 门店菜单分类表 15 | *

16 | * 17 | * @author nott 18 | * @since 2024-05-24 19 | */ 20 | @Getter 21 | @Setter 22 | @TableName("biz_menu_catalog") 23 | public class BizMenuCatalog implements Serializable { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | private Long id; 28 | 29 | /** 30 | * 门店id 31 | */ 32 | private Long shopId; 33 | 34 | /** 35 | * 分类名称 36 | */ 37 | private String catalogName; 38 | 39 | /** 40 | * 分类描述 41 | */ 42 | private String catalogDesc; 43 | 44 | /** 45 | * 备注 46 | */ 47 | private String mark; 48 | 49 | /** 50 | * 预览图 51 | */ 52 | private String imgUrl; 53 | 54 | /** 55 | * 删除标识 56 | */ 57 | @TableLogic(delval = "1",value = "0") 58 | private Integer delFlag; 59 | 60 | /** 61 | * 创建时间 62 | */ 63 | @TableField(fill = FieldFill.INSERT) 64 | private Date createTime; 65 | 66 | /** 67 | * 更新时间 68 | */ 69 | @TableField(fill = FieldFill.UPDATE) 70 | private Date updateTime; 71 | 72 | 73 | } 74 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/SysUser.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableLogic; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | *

14 | * 系统用户表 15 | *

16 | * 17 | * @author nott 18 | * @since 2024-05-24 19 | */ 20 | @Getter 21 | @Setter 22 | @TableName("sys_user") 23 | public class SysUser implements Serializable { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | private Long id; 28 | 29 | /** 30 | * 员工姓名 31 | */ 32 | private String realName; 33 | 34 | /** 35 | * 用户名 36 | */ 37 | private String username; 38 | 39 | /** 40 | * 密码 41 | */ 42 | private String password; 43 | 44 | /** 45 | * 联系电话 46 | */ 47 | private String phone; 48 | 49 | /** 50 | * 头像 51 | */ 52 | private String avatarUrl; 53 | 54 | 55 | private Integer isLock; 56 | 57 | /** 58 | * 删除标识 59 | */ 60 | @TableLogic(delval = "1",value = "0") 61 | private Integer delFlag; 62 | 63 | /** 64 | * 创建时间 65 | */ 66 | @TableField(fill = FieldFill.INSERT) 67 | private Date createTime; 68 | 69 | /** 70 | * 更新时间 71 | */ 72 | @TableField(fill = FieldFill.UPDATE) 73 | private Date updateTime; 74 | 75 | 76 | } 77 | -------------------------------------------------------------------------------- /hutu-feign/src/main/java/org/nott/feign/OssClient.java: -------------------------------------------------------------------------------- 1 | package org.nott.feign; 2 | 3 | import org.nott.common.ResponseEntity; 4 | import org.nott.vo.OssFileVo; 5 | import org.springframework.cloud.openfeign.FeignClient; 6 | import org.springframework.http.MediaType; 7 | import org.springframework.web.bind.annotation.*; 8 | import org.springframework.web.multipart.MultipartFile; 9 | 10 | import java.util.List; 11 | 12 | @FeignClient(value = "oss", url = "http://localhost:9901", path = "/oss") 13 | public interface OssClient { 14 | 15 | @ResponseBody 16 | @PostMapping(value = "/upload/{bizId}",consumes = MediaType.MULTIPART_FORM_DATA_VALUE) 17 | ResponseEntity upload(@RequestBody MultipartFile file, @PathVariable("bizId") Long bizId) throws Exception; 18 | 19 | @ResponseBody 20 | @PostMapping(value = "/upload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE) 21 | ResponseEntity upload(@RequestBody MultipartFile file) throws Exception; 22 | 23 | @ResponseBody 24 | @PutMapping("/deleteByBizId/{bizId}") 25 | ResponseEntity deleteByBizId(@PathVariable("bizId") Long bizId); 26 | 27 | @ResponseBody 28 | @PutMapping("/deleteById/{id}") 29 | ResponseEntity deleteById(@PathVariable("id") Long id); 30 | 31 | @ResponseBody 32 | @PutMapping("/getByBizId/{bizId}") 33 | ResponseEntity> getByBizId(@PathVariable("bizId") Long bizId); 34 | 35 | @ResponseBody 36 | @PutMapping("/getByBizId") 37 | ResponseEntity> getByBizId(@RequestBody List bizId); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizPackage.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableLogic; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | 10 | import lombok.Getter; 11 | import lombok.Setter; 12 | 13 | /** 14 | *

15 | * 用户购物袋表(过时) 16 | *

17 | * 18 | * @author nott 19 | * @since 2024-05-24 20 | */ 21 | @Getter 22 | @Setter 23 | @TableName("biz_package") 24 | public class BizPackage implements Serializable { 25 | 26 | private static final long serialVersionUID = 1L; 27 | 28 | private Long id; 29 | 30 | /** 31 | * 包含菜品id 32 | */ 33 | private String items; 34 | 35 | /** 36 | * 套餐名称 37 | */ 38 | private String packageName; 39 | 40 | /** 41 | * 套餐原价 42 | */ 43 | private String packageOriginAmount; 44 | 45 | /** 46 | * 套餐现价 47 | */ 48 | private String packageActuallyAmount; 49 | 50 | /** 51 | * 删除标识 52 | */ 53 | @TableLogic(delval = "1",value = "0") 54 | private Integer delFlag; 55 | 56 | /** 57 | * 创建时间 58 | */ 59 | @TableField(fill = FieldFill.INSERT) 60 | private Date createTime; 61 | 62 | /** 63 | * 更新时间 64 | */ 65 | @TableField(fill = FieldFill.UPDATE) 66 | private Date updateTime; 67 | 68 | /** 69 | * 过期时间 70 | */ 71 | private Date expireTime; 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/SysBizSkuController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import io.swagger.annotations.Api; 5 | import io.swagger.annotations.ApiOperation; 6 | import org.nott.common.ResponseEntity; 7 | import org.nott.dto.SkuCatalogSearchDTO; 8 | import org.nott.service.api.BizSkuCatalogService; 9 | import org.nott.vo.SkuCatalogItemVo; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | import javax.annotation.Resource; 13 | 14 | /** 15 | *

16 | * 前端控制器 17 | *

18 | * 19 | * @author nott 20 | * @since 2024-06-07 21 | */ 22 | @Api(tags = "sku管理") 23 | @RestController 24 | @RequestMapping("/sys/sku") 25 | public class SysBizSkuController { 26 | 27 | @Resource 28 | private BizSkuCatalogService bizSkuCatalogService; 29 | 30 | @ApiOperation("分页查询分类下的sku item") 31 | @PostMapping("queryBizItemRelByPage/{page}/{size}") 32 | public ResponseEntity page(@RequestBody SkuCatalogSearchDTO skuCatalogSearchDTO, @PathVariable Integer page, @PathVariable Integer size) { 33 | Page skuCatalogItemVoPage = bizSkuCatalogService.pageSkuCatalog(skuCatalogSearchDTO, page, size); 34 | return ResponseEntity.successData(skuCatalogItemVoPage); 35 | } 36 | 37 | @ApiOperation("删除sku分类") 38 | @PostMapping("delete/{id}") 39 | public ResponseEntity deleteSkuCatalog(@PathVariable Long id) { 40 | bizSkuCatalogService.deleteSkuCatalog(id); 41 | return ResponseEntity.success(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /hutu-security/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | hutu-order 7 | org.nott 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | hutu-security 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-security 23 | 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-web 28 | 29 | 30 | 31 | 32 | cn.dev33 33 | sa-token-dao-redis-jackson 34 | 1.9.0 35 | 36 | 37 | 38 | org.nott 39 | hutu-common 40 | 1.0-SNAPSHOT 41 | 42 | 43 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/java/org/nott/web/controller/BizMenuCatalogController.java: -------------------------------------------------------------------------------- 1 | package org.nott.web.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import org.nott.common.ResponseEntity; 6 | import org.nott.common.annotation.RedisCache; 7 | import org.nott.service.api.BizMenuCatalogService; 8 | import org.nott.vo.MenuCatalogVo; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | import javax.annotation.Resource; 15 | import java.util.List; 16 | 17 | /** 18 | * 菜单分类控制层 19 | * 20 | * @author nott 21 | * @since 2024-05-24 22 | */ 23 | @Api(tags = "菜单分类") 24 | @RestController 25 | @RequestMapping("/bizMenuCatalog") 26 | public class BizMenuCatalogController { 27 | 28 | @Resource 29 | private BizMenuCatalogService bizMenuCatalogService; 30 | 31 | @Deprecated 32 | @ApiOperation(value = "分类列表") 33 | @GetMapping("/list") 34 | public ResponseEntity menuList() { 35 | return ResponseEntity.successData(bizMenuCatalogService.list()); 36 | } 37 | 38 | @GetMapping("listByShop/{shopId}") 39 | @RedisCache(item = "#shopId") 40 | @ApiOperation(value = "门店分类列表", notes = "根据门店id获取菜单分类") 41 | public ResponseEntity listByShop(@PathVariable Long shopId) { 42 | List vos = bizMenuCatalogService.getCatalogByShopId(shopId); 43 | return ResponseEntity.successData(vos); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /hutu-app/admin/src/main/java/org/nott/admin/controller/SysBizPayOrderController.java: -------------------------------------------------------------------------------- 1 | package org.nott.admin.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import org.nott.common.ResponseEntity; 6 | import org.nott.service.api.BizPayOrderService; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import javax.annotation.Resource; 13 | 14 | /** 15 | *

16 | * 前端控制器 17 | *

18 | * 19 | * @author nott 20 | * @since 2024-06-07 21 | */ 22 | 23 | @Api(tags = "订单管理") 24 | @RestController 25 | @RequestMapping("/sys/bizPayOrder") 26 | public class SysBizPayOrderController { 27 | 28 | @Resource 29 | private BizPayOrderService bizPayOrderService; 30 | 31 | @ApiOperation("数量统计") 32 | @GetMapping("/count") 33 | public ResponseEntity countOrder(){ 34 | return ResponseEntity.successData(bizPayOrderService.count()); 35 | } 36 | 37 | @ApiOperation("营业额统计") 38 | @GetMapping("/countPurchases") 39 | public ResponseEntity countPurchases(){ 40 | String count = bizPayOrderService.countPurchases(); 41 | return ResponseEntity.successData(count); 42 | } 43 | 44 | @ApiOperation("完成订单制作") 45 | @GetMapping("/finishOrder/{orderId}") 46 | public ResponseEntity finishOrder(@PathVariable("orderId") Long orderId){ 47 | bizPayOrderService.finishOrder(orderId); 48 | return ResponseEntity.success(); 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /doc/readme-old.md: -------------------------------------------------------------------------------- 1 | # 前序 2 | 糊涂点餐,一个基于uniapp+vue2+springboot2+mybatis-plus的点餐系统,适用于小型餐饮店、咖啡饮品店等业务场景。 3 | 4 | ## 在线预览 5 | 6 | 待部署。 7 | 8 | ## 项目文档 9 | 10 | 待更新。 11 | 12 | ## 技术选型 13 | 14 | 商家后台管理端使用vue.js 2.x
15 | 小程序端使用uni-app,方便后续可同步部署到支付宝、微信小程序、H5、app端
16 | 服务端使用的框架技术:SpringBoot2.x、Vue2.x、Netty4.x
17 | Sa-token、Spring Security、Redis、Mybatis-plus、AspectJ、Feign
18 | 项目中使用的协议:Http、WebSocket 19 | 20 | ## 对接系统 21 | 22 | 已开发 23 | - 微信小程序登录 24 | 25 | 开发中 26 | - 叫号大屏 27 | - 小票打印 28 | 29 | 将开发 30 | - 语言播报 31 | - 同城跑腿 32 | 33 | ## 系统模块 34 | 35 | ``` 36 | ├─db # 数据库脚本(mysql) 37 | ├─hutu-app # REST API模块(api+管理) 38 | ├─hutu-webSocket # ws通信模块(Netty) 39 | ├─hutu-feign # 跨应用调用api(openFeign) 40 | ├─hutu-model # 实体 41 | ├─hutu-external # 外部系统api(支付宝、微信) 42 | ├─hutu-common # 通用模块 43 | ├─hutu-security # 权限验证模块 44 | ├─hutu-service # 服务类模块 45 | ├─uniapp-hutu-user # 用户小程序端 46 | ├─vue-hutu-admin # 后台管理web端 47 | ├─vue-hutu-stuff # 商家叫号屏 48 | ``` 49 | ## 系统截图 50 | 51 | 待更新 52 | 53 | ## 运行项目 54 | 55 | 待更新 56 | 57 | ## 开发规范 58 | 59 | 对象模型 60 | 61 | |对象| 作用 |是否强制|命名| 62 | |--|-----------------|--|--| 63 | |VO(View Object)| 服务端返回前端的数据对象 |是|业务逻辑名称+Vo| 64 | |DTO(Data transfer Object)| 前后端、控制层与服务层传输对象 |是|业务逻辑名称+DTO| 65 | |PO(Persistent Object)| ORM框架中的持久化数据对象 |是|与数据表一一对应| 66 | 67 | 开发守则 68 | 69 | 1. 永不嵌套。语句嵌套不超过三层(最多三层),当使用语句嵌套时还未完成业务逻辑,需考虑重构或进行抽象。 70 | 2. 脱离注释。协同开发时不要强制依赖于前人的注释。 71 | 3. 提前返回。尽量多地使用卫语句,将程序提前结束返回,将真正的业务逻辑放在最后。 72 | 4. 先做出来。代码不需要一次性就达到完美地运行、效率最高目的。 73 | 5. 打好日志。当程序存在静默处理(定时任务、异步处理等得不到明确的返回结果任务)时需显式地打印日志。 74 | 6. 明确提交。Git提交信息需最大程度地精炼出当前commit包含的修改内容。 75 | 76 | 77 | ## 支持项目 78 | 79 | 如果您恰巧有餐饮小程序开发经验(包括前端、服务端、UI设计)
80 | 目前开发贡献仅有作者一人,如有兴趣可提供PR或Issues参与此项目的开发,谢谢。 81 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/dto/UserSettleOrderDTO.java: -------------------------------------------------------------------------------- 1 | package org.nott.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import javax.validation.constraints.NotEmpty; 8 | import java.math.BigDecimal; 9 | import java.util.List; 10 | 11 | /** 12 | * @author Nott 13 | * @date 2024-10-8 14 | */ 15 | @ApiModel("用户订单结算DTO") 16 | @Data 17 | public class UserSettleOrderDTO { 18 | 19 | @ApiModelProperty("是否使用优惠券") 20 | private boolean isUseCoupon; 21 | 22 | @ApiModelProperty("是否使用积分") 23 | private boolean isUsePoint; 24 | 25 | @ApiModelProperty("使用积分数量") 26 | private Long pointCount; 27 | 28 | @ApiModelProperty("使用优惠券id") 29 | private Long couponId; 30 | 31 | @ApiModelProperty("订单备注") 32 | private String remark; 33 | 34 | @ApiModelProperty("就餐方式 0-堂食 1-带走 2-自提 3-外卖") 35 | private Integer pickType; 36 | 37 | @ApiModelProperty("点餐类型 0-单点 1-套餐") 38 | private Integer orderType; 39 | 40 | @ApiModelProperty("订购商品列表") 41 | @NotEmpty(message = "商品不能为空") 42 | private List items; 43 | 44 | @ApiModelProperty("门店id") 45 | @NotEmpty(message = "门店不能为空") 46 | private Long shopId; 47 | 48 | @ApiModelProperty("总金额") 49 | private BigDecimal totalAmount; 50 | 51 | @ApiModelProperty("原始金额") 52 | private BigDecimal originAmount; 53 | 54 | @ApiModelProperty("支付方式code") 55 | private String payCode; 56 | 57 | public boolean isUseCoupon() { 58 | return couponId != null; 59 | } 60 | 61 | public boolean isUsePoint() { 62 | return pointCount != null && pointCount > 0; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/vo/MyPayOrderVo.java: -------------------------------------------------------------------------------- 1 | package org.nott.vo; 2 | 3 | import com.alibaba.fastjson2.annotation.JSONField; 4 | import com.fasterxml.jackson.annotation.JsonIgnore; 5 | import io.swagger.annotations.ApiModel; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.Data; 8 | 9 | import java.math.BigDecimal; 10 | import java.util.Date; 11 | import java.util.List; 12 | 13 | /** 14 | * @author Nott 15 | * @date 2024-12-11 16 | */ 17 | @Data 18 | @ApiModel("我的订单对象") 19 | public class MyPayOrderVo { 20 | 21 | @ApiModelProperty("订单商户地址") 22 | private String address; 23 | 24 | @ApiModelProperty("订单商户名称") 25 | private String shopName; 26 | 27 | @ApiModelProperty("商品列表") 28 | private List items; 29 | 30 | @ApiModelProperty("id") 31 | private Long id; 32 | 33 | @ApiModelProperty("0-单点 1-套餐") 34 | private Integer orderType; 35 | 36 | @ApiModelProperty("0-堂食 1-打包 2-外送") 37 | private Integer pickType; 38 | 39 | @ApiModelProperty("总金额") 40 | private BigDecimal totalAmount; 41 | 42 | @ApiModelProperty("原金额") 43 | private BigDecimal originAmount; 44 | 45 | @ApiModelProperty("菜品信息") 46 | @JsonIgnore 47 | private String itemInfo; 48 | 49 | @ApiModelProperty("菜品统计") 50 | private Integer itemPiece; 51 | 52 | @ApiModelProperty("预计等待时间") 53 | private Integer waitTime; 54 | 55 | @ApiModelProperty("0-初始化 1-进行中 2-支付 3-退单") 56 | private Integer orderStatus; 57 | 58 | @ApiModelProperty("创建时间") 59 | private Date createTime; 60 | 61 | @ApiModelProperty("支付时间") 62 | private Date settleTime; 63 | 64 | @ApiModelProperty("店铺id") 65 | private Long shopId; 66 | 67 | } 68 | -------------------------------------------------------------------------------- /hutu-security/src/main/java/org/nott/security/interceptor/LoginInterceptor.java: -------------------------------------------------------------------------------- 1 | package org.nott.security.interceptor; 2 | 3 | import cn.dev33.satoken.stp.StpUtil; 4 | import org.nott.security.constant.SecurityConstants; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.nott.common.ResponseEntity; 7 | import org.nott.common.handler.HttpHandler; 8 | import org.springframework.core.annotation.Order; 9 | import org.springframework.stereotype.Component; 10 | import org.springframework.util.AntPathMatcher; 11 | import org.springframework.web.servlet.HandlerInterceptor; 12 | 13 | import javax.servlet.http.HttpServletRequest; 14 | import javax.servlet.http.HttpServletResponse; 15 | 16 | 17 | /** 18 | * 基于SpringMvc的拦截器 19 | * 20 | * @author Nott 21 | * @date 2024-6-6 22 | */ 23 | @Order(1) 24 | @Component 25 | @Slf4j 26 | public class LoginInterceptor implements HandlerInterceptor { 27 | 28 | private final AntPathMatcher matcher = new AntPathMatcher(); 29 | 30 | @Override 31 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 32 | String requestURI = request.getRequestURI(); 33 | log.info("Request Url: [{}]", requestURI); 34 | 35 | for (String url : SecurityConstants.PERMITTED_URL) { 36 | if(matcher.match(url,requestURI)){ 37 | return true; 38 | } 39 | } 40 | String header = request.getHeader(StpUtil.getTokenName()); 41 | if (header == null) { 42 | HttpHandler.writeResponse(ResponseEntity.failure("请先登录", 401), response); 43 | return false; 44 | } 45 | StpUtil.checkLogin(); 46 | return true; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizCouponCondition.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import java.io.Serializable; 7 | import java.math.BigDecimal; 8 | import java.time.LocalDateTime; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | *

14 | * 优惠券规则表 15 | *

16 | * 17 | * @author nott 18 | * @since 2024-08-16 19 | */ 20 | @Getter 21 | @Setter 22 | @TableName("biz_coupon_condition") 23 | public class BizCouponCondition implements Serializable { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | /** 28 | * id 29 | */ 30 | private Long id; 31 | 32 | /** 33 | * 关联业务id 34 | */ 35 | private Long bizId; 36 | 37 | /** 38 | * 开始时间 39 | */ 40 | private LocalDateTime startTime; 41 | 42 | /** 43 | * 结束时间 44 | */ 45 | private LocalDateTime endTime; 46 | 47 | /** 48 | * 是否启用 49 | */ 50 | private Integer isEnable; 51 | 52 | /** 53 | * 创建时间 54 | */ 55 | @TableField(fill = FieldFill.INSERT) 56 | private LocalDateTime createTime; 57 | 58 | /** 59 | * 创建者id 60 | */ 61 | private Long creatorId; 62 | 63 | /** 64 | * 0-时间 1-满减 2-关联业务 3-全部 65 | */ 66 | private Integer type; 67 | 68 | /** 69 | * 金额条件 70 | */ 71 | private BigDecimal priceCondition; 72 | 73 | /** 74 | * 业务条件 75 | */ 76 | private String bizCondition; 77 | 78 | /** 79 | * 条件表达式 80 | */ 81 | private String conditionExpression; 82 | 83 | 84 | } 85 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizItem.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableLogic; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | 10 | import lombok.Getter; 11 | import lombok.Setter; 12 | 13 | /** 14 | *

15 | * 系统商品表 16 | *

17 | * 18 | * @author nott 19 | * @since 2024-05-24 20 | */ 21 | @Getter 22 | @Setter 23 | @TableName("biz_item") 24 | public class BizItem implements Serializable { 25 | 26 | private static final long serialVersionUID = 1L; 27 | 28 | private Long id; 29 | 30 | /** 31 | * 原始价格 32 | */ 33 | private String originAmount; 34 | 35 | /** 36 | * 现价 37 | */ 38 | private String actuallyAmount; 39 | 40 | /** 41 | * 商品名称 42 | */ 43 | private String itemName; 44 | 45 | /** 46 | * 商品描述 47 | */ 48 | private String itemDesc; 49 | 50 | /** 51 | * 商品标签 52 | */ 53 | private String itemTag; 54 | 55 | /** 56 | * 特殊tag 57 | */ 58 | private String special; 59 | 60 | /** 61 | * 删除标识 62 | */ 63 | @TableLogic(delval = "1",value = "0") 64 | private Integer delFlag; 65 | 66 | /** 67 | * 创建时间 68 | */ 69 | @TableField(fill = FieldFill.INSERT) 70 | private Date createTime; 71 | 72 | /** 73 | * 更新时间 74 | */ 75 | @TableField(fill = FieldFill.UPDATE) 76 | private Date updateTime; 77 | 78 | /** 79 | * 预计制作时长,单位:分 80 | */ 81 | private Integer expectMakeTime; 82 | 83 | 84 | } 85 | -------------------------------------------------------------------------------- /hutu-model/src/main/java/org/nott/model/BizShopInfo.java: -------------------------------------------------------------------------------- 1 | package org.nott.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import java.io.Serializable; 5 | import java.math.BigDecimal; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | /** 10 | *

11 | * 门店信息表 12 | *

13 | * 14 | * @author nott 15 | * @since 2024-06-26 16 | */ 17 | @Getter 18 | @Setter 19 | @TableName("biz_shop_info") 20 | public class BizShopInfo implements Serializable { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | private Long id; 25 | 26 | /** 27 | * 名称 28 | */ 29 | private String shopName; 30 | 31 | /** 32 | * 地址 33 | */ 34 | private String address; 35 | 36 | /** 37 | * 联系电话 38 | */ 39 | private String phone; 40 | 41 | /** 42 | * 营业时间 43 | */ 44 | private String startBusinessTime; 45 | 46 | /** 47 | * 打烊时间 48 | */ 49 | private String endBusinessTime; 50 | 51 | /** 52 | * 是否店休 53 | */ 54 | private Integer closeNow; 55 | 56 | /** 57 | * 经度 58 | */ 59 | private BigDecimal longitude; 60 | 61 | /** 62 | * 纬度 63 | */ 64 | private BigDecimal latitude; 65 | 66 | /** 67 | * 每周营业开始日 68 | */ 69 | private Integer weekStartDate; 70 | 71 | /** 72 | * 每周营业结束日 73 | */ 74 | private Integer weekEndDate; 75 | 76 | /** 77 | * 是否主店 78 | */ 79 | private Integer mainShop; 80 | 81 | /** 82 | * 封面图 83 | */ 84 | private String coverUrl; 85 | 86 | /** 87 | * 轮播图 88 | */ 89 | private String swipeImage; 90 | 91 | /** 92 | * 页面样式 93 | */ 94 | private String pageStyle; 95 | } 96 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/resources/mapper/BizPayOrderMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 23 | 24 | 46 | 47 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/ResponseEntity.java: -------------------------------------------------------------------------------- 1 | package org.nott.common; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @author Nott 7 | * @date 2024-5-24 8 | */ 9 | 10 | @Data 11 | public class ResponseEntity { 12 | 13 | private String message; 14 | 15 | private Integer code; 16 | 17 | private T data; 18 | 19 | public ResponseEntity() { 20 | } 21 | 22 | public ResponseEntity(String message, Integer code, T data) { 23 | this.message = message; 24 | this.code = code; 25 | this.data = data; 26 | } 27 | 28 | public ResponseEntity(String message, Integer code) { 29 | this.message = message; 30 | this.code = code; 31 | } 32 | 33 | public static ResponseEntity successData(T data) { 34 | return new ResponseEntity("成功", 200, data); 35 | } 36 | 37 | public static ResponseEntity successData(String message, T data) { 38 | return new ResponseEntity(message, 200, data); 39 | } 40 | 41 | public static ResponseEntity success(String message) { 42 | return new ResponseEntity(message, 200); 43 | } 44 | 45 | public static ResponseEntity success() { 46 | return new ResponseEntity("成功", 200); 47 | } 48 | 49 | public static ResponseEntity failure(String message, Integer code) { 50 | return new ResponseEntity(message, code); 51 | } 52 | 53 | public static ResponseEntity failure(String message) { 54 | return new ResponseEntity(message, -1); 55 | } 56 | 57 | public static ResponseEntity failure() { 58 | return new ResponseEntity("失败", -1); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /hutu-service/src/main/java/org/nott/service/admin/SysUserService.java: -------------------------------------------------------------------------------- 1 | package org.nott.service.admin; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | 5 | import org.nott.dto.SysUserInfoDTO; 6 | import org.nott.model.SysRole; 7 | import org.nott.service.admin.SysUserService; 8 | import org.nott.service.mapper.admin.SysRoleMapper; 9 | import org.nott.service.mapper.admin.SysUserMapper; 10 | import org.nott.model.SysUser; 11 | import org.nott.vo.SysUserInfoVo; 12 | import org.springframework.stereotype.Service; 13 | import javax.annotation.Resource; 14 | import java.util.List; 15 | import java.util.stream.Collectors; 16 | 17 | /** 18 | * @author Nott 19 | * @date 2024-6-6 20 | */ 21 | @Service 22 | public class SysUserService extends ServiceImpl{ 23 | 24 | @Resource 25 | private SysUserMapper sysUserMapper; 26 | @Resource 27 | private SysRoleMapper sysRoleMapper; 28 | 29 | 30 | public SysUser findUserByName(String username) { 31 | return sysUserMapper.getUserByUsername(username); 32 | } 33 | 34 | 35 | public SysUserInfoVo getUserInfoByLoginId(Object loginId) { 36 | SysUser user = getById(loginId + ""); 37 | SysUserInfoVo vo = new SysUserInfoVo(); 38 | vo.setAvatar(user.getAvatarUrl()); 39 | vo.setName(user.getUsername()); 40 | vo.setIntroduction(""); 41 | List roleList = sysRoleMapper.getRoleByUserId(loginId); 42 | List roles = roleList.stream().map(SysRole::getRoleName).collect(Collectors.toList()); 43 | vo.setRoles(roles); 44 | return vo; 45 | } 46 | 47 | 48 | public void updateUserInfo(Object loginId, SysUserInfoDTO userInfoDTO) { 49 | 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /hutu-security/src/main/java/org/nott/security/interceptor/AuthorizationInterceptor.java: -------------------------------------------------------------------------------- 1 | package org.nott.security.interceptor; 2 | 3 | import cn.dev33.satoken.stp.StpUtil; 4 | import org.nott.security.constant.SecurityConstants; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.core.annotation.Order; 7 | import org.springframework.stereotype.Component; 8 | import org.springframework.util.AntPathMatcher; 9 | import org.springframework.web.servlet.HandlerInterceptor; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | 14 | /** 15 | * @author Nott 16 | * @date 2024-6-11 17 | */ 18 | @Order(2) 19 | @Component 20 | @Slf4j 21 | public class AuthorizationInterceptor implements HandlerInterceptor { 22 | 23 | private final AntPathMatcher matcher = new AntPathMatcher(); 24 | 25 | @Override 26 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception{ 27 | log.info("AuthorizationInterceptor execute"); 28 | String requestURI = request.getRequestURI(); 29 | 30 | for (String url : SecurityConstants.PERMITTED_URL) { 31 | if (matcher.match(url, requestURI)) { 32 | return true; 33 | } 34 | } 35 | 36 | boolean admin = StpUtil.hasRole(SecurityConstants.ADMIN_ROLE_NAME); 37 | 38 | if (admin) { 39 | return true; 40 | } 41 | 42 | if (requestURI.startsWith(SecurityConstants.ADMIN_REQUEST_SUFFIX)) { 43 | requestURI = requestURI.replaceAll(SecurityConstants.ADMIN_REQUEST_SUFFIX, "").replaceAll("/", "."); 44 | StpUtil.checkPermission(requestURI); 45 | } 46 | 47 | return true; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /hutu-common/src/main/java/org/nott/common/config/AsyncExecutorConfig.java: -------------------------------------------------------------------------------- 1 | package org.nott.common.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.scheduling.annotation.AsyncConfigurer; 5 | import org.springframework.scheduling.annotation.EnableAsync; 6 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; 7 | import org.springframework.stereotype.Component; 8 | 9 | import java.util.concurrent.Executor; 10 | 11 | /** 12 | * @author Nott 13 | * @date 2024-12-24 14 | */ 15 | @Component 16 | public class AsyncExecutorConfig implements AsyncConfigurer { 17 | 18 | @Bean 19 | public Executor taskExecutor() { 20 | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); 21 | 22 | //核心线程数:线程池创建时候初始化的线程数,方法: 返回可用处理器的Java虚拟机的数量。 23 | executor.setCorePoolSize(Runtime.getRuntime().availableProcessors()); 24 | 25 | //线程池最大的线程数,默认是:Integer.MAX_VALUE 26 | //只有在缓冲队列满了之后才会申请超过核心线程数的线程 27 | executor.setMaxPoolSize(Runtime.getRuntime().availableProcessors()*5); 28 | 29 | //线程池的队列容量,用来缓冲执行任务的队列 30 | //默认是:Integer.MAX_VALUE 31 | executor.setQueueCapacity(Runtime.getRuntime().availableProcessors()*2); 32 | 33 | //线程池名的前缀:设置好了之后可以方便我们定位处理任务所在的线程池 34 | executor.setThreadNamePrefix("Hutu-async-executor-"); 35 | 36 | //允许线程的空闲时间N秒:当超过了核心线程出之外的线程在空闲时间到达之后会被销毁 37 | //默认是60秒 38 | //executor.setKeepAliveSeconds(120); 39 | 40 | //线程池对拒绝任务的处理策略:这里采用了CallerRunsPolicy策略 41 | //当线程池没有处理能力的时候,该策略会直接在 execute 方法调用的线程中运行被拒绝的任务; 42 | //如果执行程序已关闭,则会丢弃该任务 43 | //executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); 44 | 45 | return executor; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /hutu-web-socket/src/main/java/org/nott/ws/api/BizPayOrderWsApi.java: -------------------------------------------------------------------------------- 1 | package org.nott.ws.api; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import io.netty.channel.Channel; 5 | import io.netty.channel.group.ChannelGroup; 6 | import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.nott.common.ResponseEntity; 9 | import org.nott.feign.BizPayOrderWsClient; 10 | import org.nott.ws.handler.OrderServerHandler; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | /** 14 | * @author Nott 15 | * @date 2024-11-27 16 | */ 17 | @Slf4j 18 | @RestController 19 | @RequestMapping("/ws/payOrder/") 20 | public class BizPayOrderWsApi implements BizPayOrderWsClient { 21 | 22 | @PostMapping("sendMessage2Shop/{shopId}") 23 | public ResponseEntity sendMessage2Shop(@PathVariable("shopId") Long shopId, @RequestBody JSONObject message) { 24 | log.info("WsApi -> sendMessage2Shop -> shopId:[{}], message:[{}]", shopId, message); 25 | // 客户端下单完成 -> 发送到叫号大屏 26 | String shopIdStr = shopId + ""; 27 | if (!OrderServerHandler.SHOP_CHANNEL_MAP.containsKey(shopIdStr)) { 28 | log.error("未知的WebSocket分组:[{}]", shopId); 29 | return ResponseEntity.failure(); 30 | } 31 | ChannelGroup channels = OrderServerHandler.SHOP_CHANNEL_MAP.get(shopIdStr); 32 | if (channels.isEmpty()) { 33 | log.error("WebSocket分组:[{}],无连接客户端", shopId); 34 | return ResponseEntity.failure(); 35 | } 36 | for (Channel channel : channels) { 37 | log.info("发送信息到门店[{}]下的客户端", shopIdStr); 38 | channel.writeAndFlush(new TextWebSocketFrame(message.toJSONString())); 39 | } 40 | return ResponseEntity.success(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /hutu-app/api/src/main/java/org/nott/web/controller/BizMenuController.java: -------------------------------------------------------------------------------- 1 | package org.nott.web.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import org.nott.common.ResponseEntity; 6 | import org.nott.common.annotation.RedisCache; 7 | import org.nott.vo.MenuItemVo; 8 | import org.nott.service.api.BizMenuService; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | import javax.annotation.Resource; 15 | import java.util.List; 16 | 17 | /** 18 | * 菜单控制层 19 | * 20 | * @author nott 21 | * @since 2024-05-24 22 | */ 23 | @Api(tags = "菜单") 24 | @RestController 25 | @RequestMapping("/bizMenu") 26 | public class BizMenuController { 27 | 28 | @Resource 29 | private BizMenuService bizMenuService; 30 | 31 | @Deprecated 32 | @ApiOperation("菜单列表") 33 | @GetMapping("listByCatalogId/{catalogId}") 34 | public ResponseEntity listByCatalogId(@PathVariable("catalogId") String catalogId) { 35 | List menuList = bizMenuService.getByCatalogId(catalogId); 36 | return ResponseEntity.successData(menuList); 37 | } 38 | 39 | @ApiOperation(value = "门店菜单列表",tags = "根据门店+分类id查询") 40 | @GetMapping("listByShopCatalogId/{shopId}/{catalogId}") 41 | @RedisCache(item = "#catalogId") 42 | public ResponseEntity listByCatalogId(@PathVariable("shopId") Long shopId, @PathVariable("catalogId") String catalogId) { 43 | List menuList = bizMenuService.getByShopCatalogId(shopId,catalogId); 44 | return ResponseEntity.successData(menuList); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /hutu-app/oss/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9901 3 | 4 | web: 5 | base-path: '/usr1/local' 6 | upload-path: '/hutu-order/web/upload/static/' 7 | 8 | logging: 9 | config: classpath:logback-dev.xml 10 | level: 11 | org.nott.web.mapper: debug 12 | 13 | spring: 14 | mvc: 15 | throw-exception-if-no-handler-found: true 16 | resources: 17 | add-mappings: false 18 | application: 19 | name: hutu-order-oss 20 | jackson: 21 | time-zone: GMT+8 22 | date-format: yyyy-MM-dd HH:mm:ss 23 | datasource: 24 | url: jdbc:mysql://localhost:3306/hutu-order?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true 25 | username: root 26 | password: 123456 27 | driver-class-name: com.mysql.cj.jdbc.Driver 28 | type: com.zaxxer.hikari.HikariDataSource 29 | hikari: 30 | minimum-idle: 0 31 | maximum-pool-size: 20 32 | idle-timeout: 10000 33 | connection-test-query: select 1 34 | servlet: 35 | multipart: 36 | max-file-size: 20MB 37 | sa-token: 38 | # token 名称(同时也是 cookie 名称) 39 | token-name: Token 40 | # token 有效期(单位:秒) 默认30天,-1 代表永久有效 41 | timeout: 2592000 42 | # token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结 43 | active-timeout: -1 44 | # 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录) 45 | is-concurrent: true 46 | # 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token) 47 | is-share: true 48 | # token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik) 49 | token-style: uuid 50 | # 是否输出操作日志 51 | is-log: true -------------------------------------------------------------------------------- /hutu-app/api/src/main/java/org/nott/web/controller/BizShopInfoController.java: -------------------------------------------------------------------------------- 1 | package org.nott.web.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import org.nott.common.ResponseEntity; 6 | import org.nott.service.api.BizShopInfoService; 7 | import org.nott.vo.ShopInfoVo; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | import javax.annotation.Resource; 11 | import java.util.List; 12 | 13 | /** 14 | *

15 | * 前端控制器 16 | *

17 | * 18 | * @author nott 19 | * @since 2024-06-26 20 | */ 21 | @Api(tags = "门店信息") 22 | @RestController 23 | @RequestMapping("/bizShopInfo") 24 | public class BizShopInfoController { 25 | 26 | @Resource 27 | private BizShopInfoService bizShopInfoService; 28 | 29 | @ApiOperation("查询当前营业门店列表") 30 | @GetMapping("list") 31 | public ResponseEntity shopList(){ 32 | List shopInfos = bizShopInfoService.listShopInfo(); 33 | return ResponseEntity.successData(shopInfos); 34 | } 35 | 36 | @ApiOperation("查询默认门店") 37 | @GetMapping("default") 38 | public ResponseEntity defaultShop(){ 39 | ShopInfoVo vo = bizShopInfoService.getDefaultShop(); 40 | return ResponseEntity.successData(vo); 41 | } 42 | 43 | @ApiOperation("搜索门店") 44 | @GetMapping("search") 45 | public ResponseEntity search(String keyWord){ 46 | List vos = bizShopInfoService.searchShopByKeyWord(keyWord); 47 | return ResponseEntity.successData(vos); 48 | } 49 | 50 | @ApiOperation("根据id查询门店") 51 | @GetMapping("getById/{id}") 52 | public ResponseEntity getById(@PathVariable("id") Long id){ 53 | ShopInfoVo vo = bizShopInfoService.getShopById(id); 54 | return ResponseEntity.successData(vo); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /hutu-external/src/main/java/org/nott/external/alipay/api/AlipayApi.java: -------------------------------------------------------------------------------- 1 | package org.nott.external.alipay.api; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import org.nott.common.ResponseEntity; 6 | import org.nott.external.alipay.service.AlipayService; 7 | import org.nott.model.BizUser; 8 | import org.nott.service.api.BizUserService; 9 | import org.nott.vo.AlipayUserInfo; 10 | import org.nott.vo.UserLoginInfoVo; 11 | import org.springframework.web.bind.annotation.GetMapping; 12 | import org.springframework.web.bind.annotation.PathVariable; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RestController; 15 | 16 | import javax.annotation.Resource; 17 | import java.util.Objects; 18 | 19 | /** 20 | * 支付宝api 21 | * @author Nott 22 | * @date 2024-6-14 23 | */ 24 | @Api(tags = "支付宝api") 25 | @RestController 26 | @RequestMapping("/external/alipay/") 27 | public class AlipayApi { 28 | 29 | @Resource 30 | private AlipayService alipayService; 31 | @Resource 32 | private BizUserService bizUserService; 33 | 34 | @ApiOperation("支付宝oauth登录") 35 | @GetMapping("oauth/{code}") 36 | public ResponseEntity oauth(@PathVariable String code) { 37 | String accessToken = alipayService.getAccessTokenByCode(code); 38 | AlipayUserInfo alipayUserInfo = alipayService.fetchUserInfoByAcToken(accessToken); 39 | BizUser bizUser = bizUserService.getUserByOpenId(alipayUserInfo.getOpenId()); 40 | UserLoginInfoVo vo = Objects.isNull(bizUser) ? bizUserService.registerUser(alipayUserInfo) : bizUserService.loginUser(alipayUserInfo); 41 | // redisTemplate.opsForHash().put("AlipayLogInfo",vo.getLoginId() + "", accessToken); 42 | return ResponseEntity.successData(vo); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /hutu-web-socket/src/main/java/org/nott/ws/initializer/ChannelInitializer.java: -------------------------------------------------------------------------------- 1 | package org.nott.ws.initializer; 2 | 3 | import io.netty.channel.ChannelPipeline; 4 | import io.netty.channel.socket.SocketChannel; 5 | import io.netty.handler.codec.http.HttpObjectAggregator; 6 | import io.netty.handler.codec.http.HttpServerCodec; 7 | import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler; 8 | import io.netty.handler.codec.string.StringEncoder; 9 | import io.netty.handler.stream.ChunkedWriteHandler; 10 | import io.netty.handler.timeout.IdleStateHandler; 11 | import org.nott.common.config.WebSocketConfig; 12 | import org.nott.ws.handler.ClientHeartBeatHandler; 13 | import org.nott.ws.handler.OrderServerHandler; 14 | import org.springframework.stereotype.Component; 15 | 16 | import javax.annotation.Resource; 17 | 18 | /** 19 | * @author Nott 20 | * @date 2024-11-26 21 | */ 22 | @Component 23 | public class ChannelInitializer extends io.netty.channel.ChannelInitializer { 24 | 25 | @Resource 26 | private WebSocketConfig webSocketConfig; 27 | 28 | @Resource 29 | private ClientHeartBeatHandler clientHeartBeatHandler; 30 | 31 | @Resource 32 | private OrderServerHandler orderServerHandler; 33 | 34 | @Override 35 | protected void initChannel(SocketChannel sc) { 36 | ChannelPipeline pipeline = sc.pipeline(); 37 | pipeline.addLast(new HttpServerCodec()); 38 | pipeline.addLast(new HttpObjectAggregator(65536)); 39 | pipeline.addLast(new ChunkedWriteHandler()); 40 | pipeline.addLast(clientHeartBeatHandler); 41 | pipeline.addLast(orderServerHandler); 42 | pipeline.addLast(new IdleStateHandler(10,10,20)); 43 | pipeline.addLast(new WebSocketServerProtocolHandler(webSocketConfig.getPath(),null,true,65536,false,true)); 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /hutu-feign/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.nott 8 | hutu-order 9 | 1.0-SNAPSHOT 10 | 11 | 12 | hutu-feign 13 | 14 | 15 | 8 16 | 8 17 | UTF-8 18 | 19 | 20 | 21 | 22 | 23 | 24 | org.springframework.cloud 25 | spring-cloud-starter-openfeign 26 | 27 | 28 | 29 | 30 | org.springframework.cloud 31 | spring-cloud-starter-netflix-ribbon 32 | 33 | 34 | 35 | 36 | org.nott 37 | hutu-common 38 | 1.0-SNAPSHOT 39 | 40 | 41 | 42 | org.nott 43 | hutu-model 44 | 1.0-SNAPSHOT 45 | 46 | 47 | 48 | --------------------------------------------------------------------------------