1 文件已复制
16 文件已重命名
102个文件已修改
1个文件已删除
13个文件已添加
| | |
| | | @TableField("latitude") |
| | | private Double latitude; |
| | | |
| | | @ApiModelProperty(value = "学习人数") |
| | | @TableField(exist = false) |
| | | private Integer count; |
| | | |
| | | } |
New file |
| | |
| | | package com.xinquan.course.api.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/9/7 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "课程视图对象") |
| | | public class CourseVO { |
| | | |
| | | @ApiModelProperty(value = "课程id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "课程类型 1=线上课程 2=线下课程") |
| | | private Integer courseType; |
| | | |
| | | @ApiModelProperty(value = "课程分类id") |
| | | private Long cateId; |
| | | |
| | | @ApiModelProperty(value = "课程标题") |
| | | private String courseTitle; |
| | | |
| | | @ApiModelProperty(value = "课程描述") |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "上架状态 1=上架 2=下架") |
| | | private Integer listingStatus; |
| | | |
| | | @ApiModelProperty(value = "推荐课程 1=推荐 2=不推荐") |
| | | private Integer recommend; |
| | | |
| | | @ApiModelProperty(value = "价格设定 1=免费 2=会员免费 3=单独收费") |
| | | private Integer chargeType; |
| | | |
| | | @ApiModelProperty(value = "通用价格") |
| | | private BigDecimal generalPrice; |
| | | |
| | | @ApiModelProperty(value = "IOS内购价格") |
| | | private BigDecimal iosPrice; |
| | | |
| | | @ApiModelProperty(value = "排序权重") |
| | | private Integer sortNum; |
| | | |
| | | @ApiModelProperty(value = "导师") |
| | | private String tutor; |
| | | |
| | | @ApiModelProperty(value = "列表封面图") |
| | | private String coverUrl; |
| | | |
| | | @ApiModelProperty(value = "详情页封面图|详情页视频") |
| | | private String detailUrl; |
| | | |
| | | @ApiModelProperty(value = "课程简介") |
| | | private String briefIntroduction; |
| | | |
| | | @ApiModelProperty(value = "微信二维码") |
| | | private String wxQrCode; |
| | | |
| | | @ApiModelProperty(value = "课程地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | | private String addressDetail; |
| | | |
| | | @ApiModelProperty(value = "课程地址经度") |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty(value = "课程地址纬度") |
| | | private Double latitude; |
| | | @ApiModelProperty(value = "已学习人数") |
| | | private Integer count; |
| | | @ApiModelProperty(value = "是否购买 0否1是") |
| | | private Integer isBuy; |
| | | @ApiModelProperty(value = "当前用户是否为会员") |
| | | private Integer isVip; |
| | | @ApiModelProperty(value = "头像列表") |
| | | private List<String> headers; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.xinquan.course.api.vo; |
| | | |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.course.api.domain.Course; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/9/7 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "轮播图视图对象") |
| | | public class StudyPageVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -7433787602665988956L; |
| | | |
| | | @ApiModelProperty(value = "已购买课程列表") |
| | | private PageDTO<CourseVO> courseList; |
| | | @ApiModelProperty(value = "免费课程") |
| | | private List<Course> freeCourseList; |
| | | } |
| | |
| | | @TableField("commission_amount") |
| | | private BigDecimal commissionAmount; |
| | | |
| | | @ApiModelProperty(value = "获得分佣的用户id") |
| | | @TableField("commission_id") |
| | | private Long commissionId; |
| | | |
| | | @ApiModelProperty(value = "改价金额") |
| | | @TableField("change_price") |
| | | private BigDecimal changePrice; |
| | |
| | | String source) { |
| | | return R.fail("获取订单列表失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<String> getCommissionByUserIds(String userIds) { |
| | | return R.fail("通过邀请人ids查询对应佣金失败"); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import com.xinquan.order.api.factory.RemoteOrderFallbackFactory; |
| | | import java.util.List; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestHeader; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author mitao |
| | |
| | | R<List<Order>> getOrderListByType(@RequestParam("userId") Long userId, |
| | | @RequestParam("orderFrom") Integer orderFrom, |
| | | @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | |
| | | @GetMapping("/client/order/order/getCommissionByUserIds/{userIds}") |
| | | public R<String> getCommissionByUserIds(@PathVariable("userIds") String userIds); |
| | | } |
| | |
| | | import com.xinquan.common.core.constant.SecurityConstants; |
| | | import com.xinquan.common.core.constant.ServiceNameConstants; |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.system.api.domain.UserLevelSetting; |
| | | import com.xinquan.system.api.domain.vo.AppUserVO; |
| | | import com.xinquan.system.api.domain.vo.BannerVO; |
| | | import com.xinquan.system.api.factory.RemoteBannerFallbackFactory; |
| | | import java.util.List; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestHeader; |
| | | |
| | | /** |
| | |
| | | @GetMapping("/inner/system/banner/getBannerList") |
| | | R<List<BannerVO>> getBannerList( |
| | | @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | |
| | | /** |
| | | * 远程调用根据树苗等级获取疗愈图标和疗愈名称 |
| | | * |
| | | * @return 用户信息 |
| | | * @see AppUserVO |
| | | */ |
| | | @GetMapping("/system/user-level-setting/getIconNameByLevel/{level}") |
| | | R<UserLevelSetting> getIconNameByLevel(@PathVariable("level")Integer level); |
| | | } |
File was renamed from xinquan-api/xinquan-api-user/src/main/java/com/xinquan/user/api/domain/AppUser.java |
| | |
| | | package com.xinquan.user.api.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | |
| | | @ApiModelProperty(value = "注销时间") |
| | | @TableField("logout_time") |
| | | private LocalDateTime logoutTime; |
| | | @ApiModelProperty(value = "签到时间 用于判断树苗打卡获取能量值") |
| | | @TableField("signTime") |
| | | private LocalDateTime signTime; |
| | | |
| | | @ApiModelProperty(value = "用户等级id") |
| | | @TableField("level_setting_id") |
| | |
| | | @ApiModelProperty(value = "标签id,多个id使用英文逗号拼接") |
| | | @TableField("tag_id") |
| | | private String tagId; |
| | | @ApiModelProperty(value = "是否弹窗心泉之树提示 1是2否") |
| | | @TableField("isFirst") |
| | | private Integer isFirst; |
| | | @ApiModelProperty(value = "当前剩余能量值") |
| | | @TableField("energy_value") |
| | | private Integer energyValue; |
| | | @ApiModelProperty(value = "帮助人数") |
| | | @TableField(exist = false) |
| | | private Integer count; |
| | | @ApiModelProperty(value = "佣金金额") |
| | | @TableField(exist = false) |
| | | private BigDecimal money; |
| | | } |
File was renamed from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/AppUserBank.java |
| | |
| | | package com.xinquan.user.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
File was renamed from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/AppUserCourse.java |
| | |
| | | package com.xinquan.user.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | @TableField("order_id") |
| | | private Long orderId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "记录创建时间,前端忽略") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField(value = "create_time", fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | } |
File was renamed from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/AppUserEnergyRecord.java |
| | |
| | | package com.xinquan.user.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
File was renamed from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/AppUserMeditation.java |
| | |
| | | package com.xinquan.user.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
File was renamed from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/AppUserQuestion.java |
| | |
| | | package com.xinquan.user.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
File was renamed from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/AppUserTag.java |
| | |
| | | package com.xinquan.user.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
File was renamed from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/AppUserTree.java |
| | |
| | | package com.xinquan.user.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | |
| | | @TableField("tree_level_type") |
| | | private Integer treeLevelType; |
| | | |
| | | @ApiModelProperty(value = "成长值") |
| | | @ApiModelProperty(value = "当前树苗成长值") |
| | | @TableField("growth_value") |
| | | private Integer growthValue; |
| | | |
| | | @ApiModelProperty(value = "当前能量值") |
| | | @TableField("current_energy_value") |
| | | private Integer currentEnergyValue; |
| | | |
| | | @ApiModelProperty(value = "是否重新播种 1=是 2=否") |
| | | @TableField("sow_again") |
| | | private Integer sowAgain; |
| | | |
| | | @ApiModelProperty(value = "是否枯萎 1=是 2=否") |
| | | @TableField("status") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "每日疗愈30分钟是否完成 1是2否") |
| | | @TableField(exist = false) |
| | | private Integer taskOne; |
| | | @ApiModelProperty(value = "每日疗愈60分钟是否完成 1是2否") |
| | | @TableField(exist = false) |
| | | private Integer taskTwo; |
| | | @ApiModelProperty(value = "是否完成签到 1是 2否") |
| | | @TableField(exist = false) |
| | | private Integer isSign; |
| | | @ApiModelProperty(value = "升到下一等级成长阈值") |
| | | @TableField(exist = false) |
| | | private Integer nextLevel; |
| | | |
| | | } |
File was renamed from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/AppUserViewingHistory.java |
| | |
| | | package com.xinquan.user.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | |
| | | @TableField("viewing_type") |
| | | private Integer viewingType; |
| | | |
| | | |
| | | @ApiModelProperty(value = "上次观看到xx分钟") |
| | | @TableField("minuteLook") |
| | | private Integer minuteLook; |
| | | @ApiModelProperty(value = "上次观看到xx秒") |
| | | @TableField("secondLook") |
| | | private Integer secondLook; |
| | | @ApiModelProperty(value = "章节id 类型为课程存储") |
| | | @TableField("chapterId") |
| | | private Long chapterId; |
| | | @ApiModelProperty(value = "是否观看完毕 1是2否 类型为课程的时候存储") |
| | | @TableField("isOver") |
| | | private Integer isOver; |
| | | @ApiModelProperty(value = "疗愈观看时长 单位秒") |
| | | @TableField("timeLook") |
| | | private Integer timeLook; |
| | | } |
File was renamed from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/AppUserWalletRecord.java |
| | |
| | | package com.xinquan.user.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import java.math.BigDecimal; |
File was renamed from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/AppUserWithdraw.java |
| | |
| | | package com.xinquan.user.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import java.math.BigDecimal; |
File was renamed from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/NoticeRecord.java |
| | |
| | | package com.xinquan.user.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
File was renamed from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/Prize.java |
| | |
| | | package com.xinquan.user.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import java.math.BigDecimal; |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "奖品兑换记录id") |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id",type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "奖品id") |
| | | @TableField("prize_id") |
| | | private Long prizeId; |
| | | |
| | | @ApiModelProperty(value = "奖品名称") |
| | | @TableField("`name`") |
| | |
| | | @TableField("energy_value") |
| | | private Integer energyValue; |
| | | |
| | | @ApiModelProperty(value = "兑换状态 1=兑换中 2=已兑换") |
| | | @ApiModelProperty(value = "上架状态 1=上架 2=下架") |
| | | @TableField("`status`") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "排序权重") |
| | | @TableField("sort_num") |
| | | private Integer sortNum; |
| | | @ApiModelProperty(value = "兑换状态 1=已兑换 2=未兑换") |
| | | @TableField(exist = false) |
| | | private Integer receiveStatus; |
| | | |
| | | @ApiModelProperty(value = "兑换时间") |
| | | @TableField("redemption_time") |
New file |
| | |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import java.math.BigDecimal; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.xinquan.common.core.web.domain.BaseModel; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 奖品兑换记录表 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-08-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("t_prize_redemption_record") |
| | | @ApiModel(value="PrizeRedemptionRecord对象", description="奖品兑换记录表") |
| | | public class PrizeRedemptionRecord extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | @TableId(value = "id",type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | @ApiModelProperty(value = "兑换状态1待领取2已兑换") |
| | | @TableField("status") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "奖品id") |
| | | @TableField("prize_id") |
| | | private Long prizeId; |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | @ApiModelProperty(value = "兑换码") |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | } |
File was renamed from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/Tag.java |
| | |
| | | package com.xinquan.user.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
File was renamed from xinquan-modules/xinquan-system/src/main/java/com/xinquan/system/domain/UserLevelSetting.java |
| | |
| | | package com.xinquan.system.domain; |
| | | package com.xinquan.system.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
New file |
| | |
| | | package com.xinquan.system.api.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/9/7 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "根据手机号查询用户信息VO") |
| | | public class AppUserDetailVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -6948932379350815750L; |
| | | |
| | | @ApiModelProperty(value = "App用户id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "手机号码") |
| | | private String cellPhone; |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatar; |
| | | @ApiModelProperty(value = "昵称") |
| | | private String nickname; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
copy from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/AppUserEnergyRecord.java
copy to xinquan-api/xinquan-api-system/src/main/java/com/xinquan/system/api/domain/vo/AppUserEnergyRecordVO.java
File was copied from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/AppUserEnergyRecord.java |
| | |
| | | package com.xinquan.user.domain; |
| | | package com.xinquan.system.api.domain.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.xinquan.common.core.web.domain.BaseModel; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.xinquan.common.core.web.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-08-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("t_app_user_energy_record") |
| | | @ApiModel(value="AppUserEnergyRecord对象", description="用户能量值记录表") |
| | | public class AppUserEnergyRecord extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | @ApiModel(value="AppUserEnergyRecordVO对象", description="用户能量值明细") |
| | | public class AppUserEnergyRecordVO { |
| | | |
| | | @ApiModelProperty(value = "用户能量值记录id") |
| | | @TableId(value = "id",type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "变动类型 1=增加 2=减少") |
| | | @TableField("change_type") |
| | | private Integer changeType; |
| | | |
| | | @ApiModelProperty(value = "能量值") |
| | | @TableField("energy_value") |
| | | private Integer energyValue; |
| | | @ApiModelProperty(value = "时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "原因") |
| | | @TableField("reason") |
| | | private String reason; |
| | | |
| | | |
New file |
| | |
| | | package com.xinquan.system.api.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/9/7 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "个人中心-用户信息VO") |
| | | public class AppUserInfoVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -6948932379350815750L; |
| | | |
| | | @ApiModelProperty(value = "App用户id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "手机号码") |
| | | private String cellPhone; |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatar; |
| | | @ApiModelProperty(value = "昵称") |
| | | private String nickname; |
| | | @ApiModelProperty(value = "累计练习天数") |
| | | private Integer cumulative; |
| | | @ApiModelProperty(value = "今日练习时长 单位分钟") |
| | | private Integer today; |
| | | @ApiModelProperty(value = "连续练习天数") |
| | | private Integer continuity; |
| | | @ApiModelProperty(value = "疗愈等级") |
| | | private Integer level; |
| | | @ApiModelProperty(value = "疗愈等级名称") |
| | | private String levelName; |
| | | @ApiModelProperty(value = "疗愈等级图标") |
| | | private String levelIcon; |
| | | @ApiModelProperty(value = "是否是vip 1是2否") |
| | | private Integer isVip; |
| | | @ApiModelProperty(value = "会员到期时间") |
| | | private String vipExpireTime; |
| | | } |
File was renamed from xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/vo/AppUserVO.java |
| | |
| | | package com.xinquan.user.domain.vo; |
| | | package com.xinquan.system.api.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | |
| | | @ApiModelProperty(value = "标签id,多个id使用英文逗号拼接") |
| | | private String tagId; |
| | | |
| | | } |
New file |
| | |
| | | package com.xinquan.system.api.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/9/7 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "用户信息VO") |
| | | public class InviteRankListVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -6948932379350815750L; |
| | | |
| | | @ApiModelProperty(value = "App用户id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatar; |
| | | |
| | | @ApiModelProperty(value = "昵称") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty(value = "帮助人数") |
| | | private Integer count; |
| | | @ApiModelProperty(value = "佣金金额") |
| | | private BigDecimal money; |
| | | |
| | | } |
New file |
| | |
| | | package com.xinquan.system.api.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/9/7 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "修改用户信息") |
| | | public class UpdateAppUserDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -6948932379350815750L; |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatar; |
| | | |
| | | @ApiModelProperty(value = "昵称") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty(value = "签名") |
| | | private String signature; |
| | | |
| | | @ApiModelProperty(value = "性别 1=男 2=女 3=保密") |
| | | private Integer gender; |
| | | |
| | | @ApiModelProperty(value = "生日") |
| | | private String birthday; |
| | | |
| | | @ApiModelProperty(value = "学历") |
| | | private String education; |
| | | |
| | | @ApiModelProperty(value = "行业") |
| | | private String industry; |
| | | |
| | | @ApiModelProperty(value = "公司") |
| | | private String company; |
| | | |
| | | @ApiModelProperty(value = "职业") |
| | | private String occupation; |
| | | |
| | | @ApiModelProperty(value = "所在地") |
| | | private String location; |
| | | |
| | | @ApiModelProperty(value = "故乡") |
| | | private String hometown; |
| | | |
| | | @ApiModelProperty(value = "邮箱") |
| | | private String email; |
| | | |
| | | } |
New file |
| | |
| | | package com.xinquan.system.api.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/9/7 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "浇水返回对象") |
| | | public class WateringVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -6948932379350815750L; |
| | | |
| | | @ApiModelProperty(value = "是否升级") |
| | | private Boolean isNext; |
| | | @ApiModelProperty(value = "浇水后的成长值") |
| | | private Integer growthValue; |
| | | @ApiModelProperty(value = "是否枯萎 1是2否(暂时不用)") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "阈值") |
| | | private Integer nextLevel; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.system.api.RemoteBannerService; |
| | | import com.xinquan.system.api.domain.UserLevelSetting; |
| | | import com.xinquan.system.api.domain.vo.BannerVO; |
| | | import java.util.List; |
| | | import org.slf4j.Logger; |
| | |
| | | public R<List<BannerVO>> getBannerList(String source) { |
| | | return R.fail("获取轮播图失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<UserLevelSetting> getIconNameByLevel(Integer level) { |
| | | return R.fail("远程调用根据树苗等级获取疗愈图标和疗愈名称" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | package com.xinquan.user.api.factory; |
| | | |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.system.api.domain.AppUserCourse; |
| | | import com.xinquan.system.api.domain.vo.AppUserVO; |
| | | import com.xinquan.system.api.model.AppCaptchaBody; |
| | | import com.xinquan.system.api.model.AppLoginUser; |
| | | import com.xinquan.system.api.model.AppVerifyCellPhoneBody; |
| | | import com.xinquan.system.api.model.AppWXLoginBody; |
| | | import com.xinquan.user.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUserViewingHistory; |
| | | import com.xinquan.user.api.domain.dto.AppUserDTO; |
| | | import com.xinquan.user.api.feign.RemoteAppUserService; |
| | | import java.util.Collection; |
| | |
| | | public RemoteAppUserService create(Throwable cause) { |
| | | return new RemoteAppUserService() { |
| | | @Override |
| | | public R<List<String>> getUserByCourseId(Long courseId) { |
| | | public R<AppUserVO> getCurrentUser() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R<PageDTO<AppUserCourse>> getPayCourse(Integer pageCurr, Integer pageSize) { |
| | | return R.fail("查询用户已购课程失败"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public R<AppUserViewingHistory> getCourseStudyHistory(Long chapterId) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R<List<AppUser>> getUserByCourseId(Long courseId) { |
| | | return R.fail("查询课程加入学习人数"); |
| | | } |
| | | |
| | |
| | | import com.xinquan.common.core.constant.SecurityConstants; |
| | | import com.xinquan.common.core.constant.ServiceNameConstants; |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.system.api.domain.AppUserCourse; |
| | | import com.xinquan.system.api.domain.vo.AppUserVO; |
| | | import com.xinquan.system.api.model.AppCaptchaBody; |
| | | import com.xinquan.system.api.model.AppLoginUser; |
| | | import com.xinquan.system.api.model.AppVerifyCellPhoneBody; |
| | | import com.xinquan.system.api.model.AppWXLoginBody; |
| | | import com.xinquan.user.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUserViewingHistory; |
| | | import com.xinquan.user.api.domain.dto.AppUserDTO; |
| | | import com.xinquan.user.api.factory.RemoteAppUserFallbackFactory; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @FeignClient(contextId = "remoteAppUserService", value = ServiceNameConstants.APP_USER_SERVICE, fallbackFactory = RemoteAppUserFallbackFactory.class) |
| | | public interface RemoteAppUserService { |
| | | |
| | | @PostMapping("/client/app-user/getCurrentUser") |
| | | public R<AppUserVO> getCurrentUser(); |
| | | @GetMapping("/client/app-user-course/getPayCourse/{pageCurr}/{pageSize}") |
| | | R<PageDTO<AppUserCourse>> getPayCourse(@PathVariable("pageCurr")Integer pageCurr, @PathVariable("pageSize")Integer pageSize); |
| | | @PostMapping("/user/app-user-viewing-history/getCourseStudyHistory") |
| | | R<AppUserViewingHistory> getCourseStudyHistory(@RequestParam("chapterId") Long chapterId); |
| | | |
| | | @GetMapping("/client/app-user-course/getUserByCourseId/{courseId}") |
| | | R<List<String>> getUserByCourseId(@PathVariable("courseId") Long courseId); |
| | | R<List<AppUser>> getUserByCourseId(@PathVariable("courseId") Long courseId); |
| | | |
| | | /** |
| | | * 获取未注销的用户信息 |
| | |
| | | @ApiOperation(value = "发送验证码",tags = {"APP端"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "cellPhone", value = "手机号码", required = true, dataType = "String", paramType = "query"), |
| | | @ApiImplicitParam(name = "type", value = "类型 1=注册 2=验证码登录 3=找回密码 4=第三方登录后验证手机", required = true, dataType = "Integer", paramType = "query")}) |
| | | @ApiImplicitParam(name = "type", value = "类型 1=注册 2=验证码登录 3=找回密码 4=第三方登录后验证手机 5=切换手机号", required = true, dataType = "Integer", paramType = "query")}) |
| | | public R<?> sendCaptchaCode( |
| | | @RequestParam(value = "cellPhone", required = true) String cellPhone, |
| | | @RequestParam("type") Integer type) { |
| | |
| | | import com.xinquan.system.api.model.AppVerifyCellPhoneBody; |
| | | import com.xinquan.system.api.model.AppWXLoginBody; |
| | | import com.xinquan.system.api.model.LoginUser; |
| | | import com.xinquan.user.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.user.api.domain.dto.AppUserDTO; |
| | | import com.xinquan.user.api.feign.RemoteAppUserService; |
| | | import java.math.BigDecimal; |
| | |
| | | * 成功标记 |
| | | */ |
| | | public static final Integer SUCCESS = 200; |
| | | public static final Integer TOKEN_ERROR = 501; |
| | | |
| | | /** |
| | | * 失败标记 |
| | |
| | | |
| | | /** 成功 */ |
| | | public static final int SUCCESS = Constants.SUCCESS; |
| | | /** |
| | | * token失效 |
| | | */ |
| | | public static final int TOKEN_ERROR = Constants.TOKEN_ERROR; |
| | | |
| | | /** 失败 */ |
| | | public static final int FAIL = Constants.FAIL; |
| | |
| | | return restResult(null, SUCCESS, null); |
| | | } |
| | | |
| | | public static <T> R<T> tokenError(String msg) |
| | | { |
| | | return restResult(null, TOKEN_ERROR, msg); |
| | | } |
| | | public static <T> R<T> ok(T data) |
| | | { |
| | | return restResult(data, SUCCESS, null); |
| | |
| | | import com.xinquan.common.core.utils.page.BeanUtils; |
| | | import com.xinquan.common.core.utils.page.CollUtils; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.common.security.utils.SecurityUtils; |
| | | import com.xinquan.course.api.domain.Course; |
| | | import com.xinquan.course.api.vo.CourseVO; |
| | | import com.xinquan.course.api.vo.StudyPageVO; |
| | | import com.xinquan.course.domain.CourseChapter; |
| | | import com.xinquan.course.domain.vo.ClientCourseCategoryVO; |
| | | import com.xinquan.course.domain.vo.ClientCourseVO; |
| | |
| | | import com.xinquan.course.service.CourseChapterService; |
| | | import com.xinquan.course.service.CourseService; |
| | | import com.xinquan.system.api.RemoteBannerService; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUserCourse; |
| | | import com.xinquan.system.api.domain.AppUserViewingHistory; |
| | | import com.xinquan.system.api.domain.vo.AppUserVO; |
| | | import com.xinquan.system.api.domain.vo.BannerVO; |
| | | import com.xinquan.user.api.feign.RemoteAppUserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | private final CourseCategoryService courseCategoryService; |
| | | private final CourseService courseService; |
| | | private final RemoteBannerService remoteBannerService; |
| | | private final RemoteAppUserService appUserService; |
| | | private final RemoteAppUserService remoteAppUserService; |
| | | |
| | | @Resource |
| | | private CourseChapterService courseChapterService; |
| | | |
| | |
| | | * |
| | | * @return 课程详情 |
| | | */ |
| | | @GetMapping("/getCourseInfoById") |
| | | @ApiOperation(value = "根据id获取课程详情-线下课程") |
| | | public R<Course> getCourseInfoById(String id) { |
| | | return R.ok(courseService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 课程详情 |
| | | * |
| | | * @return 课程详情 |
| | | */ |
| | | @GetMapping("/getPayCourseInfoById") |
| | | @ApiOperation(value = "根据id获取课程详情-付费课程") |
| | | @PostMapping("/getPayCourseInfoById") |
| | | @ApiOperation(value = "根据id获取课程详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "课程id", name = "id", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "分页参数,当前页码", name = "pageCurr", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(value = "分页参数,每页数量", name = "pageSize", required = true, dataType = "Integer") |
| | | }) |
| | | public R<ClientCourseVO> getPayCourseInfoById(@RequestParam(value = "id")Long id, |
| | | @RequestParam(value = "pageCurr", defaultValue = "1") Integer pageCurr, |
| | | @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | public R<ClientCourseVO> getPayCourseInfoById(@RequestParam(value = "id")Long id) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId == 0)return R.tokenError("登录失效"); |
| | | AppUserVO data1 = remoteAppUserService.getCurrentUser().getData(); |
| | | |
| | | Course byId = courseService.getById(id); |
| | | ClientCourseVO clientCourseVO = new ClientCourseVO(); |
| | | BeanUtils.copyProperties(byId, clientCourseVO); |
| | | if (data1.getVipExpireTime()!=null && data1.getVipExpireTime().isAfter(LocalDateTime.now())){ |
| | | clientCourseVO.setIsVip(1); |
| | | }else{ |
| | | clientCourseVO.setIsVip(0); |
| | | } |
| | | // 查询用户是否已购买该课程 |
| | | // 查询章节 |
| | | Page<CourseChapter> page = courseChapterService.lambdaQuery() |
| | | List<CourseChapter> page = courseChapterService.lambdaQuery() |
| | | .eq(CourseChapter::getCourseId, id) |
| | | .orderByDesc(CourseChapter::getSortNum) |
| | | .page(new Page<>(pageCurr, pageSize)); |
| | | if (CollUtils.isEmpty(page.getRecords())) { |
| | | PageDTO<CourseChapter> empty = PageDTO.empty(page); |
| | | clientCourseVO.setList(empty); |
| | | } |
| | | .list(); |
| | | clientCourseVO.setIsBuy(0); |
| | | // 查询学习人数和头像列表 |
| | | List<String> data = appUserService.getUserByCourseId(id).getData(); |
| | | List<AppUser> data = remoteAppUserService.getUserByCourseId(id).getData(); |
| | | if (data!=null){ |
| | | clientCourseVO.setCount(data.size()); |
| | | if (data.size()>=5){ |
| | | clientCourseVO.setHeaders(data.stream().limit(5).map(AppUser::getAvatar).collect(Collectors.toList())); |
| | | }else{ |
| | | clientCourseVO.setHeaders(data.stream().map(AppUser::getAvatar).collect(Collectors.toList())); |
| | | } |
| | | List<Long> collect = data.stream().map(AppUser::getUserId).collect(Collectors.toList()); |
| | | if (!collect.isEmpty()){ |
| | | if (collect.contains(userId)){ |
| | | clientCourseVO.setIsBuy(1); |
| | | } |
| | | } |
| | | } |
| | | clientCourseVO.setHeaders(data); |
| | | // 查询推荐课程 |
| | | |
| | | List<Course> list = courseService.lambdaQuery().eq(Course::getCateId, byId.getCateId()) |
| | | .eq(Course::getCourseType,1) |
| | | .eq(Course::getRecommend, 1).list(); |
| | | List<Course> courses = new ArrayList<>(); |
| | | // 随机获取两个课程 |
| | | if (CollUtils.isNotEmpty(list)) { |
| | | int size = list.size(); |
| | | int index = (int) (Math.random() * size); |
| | | if (size >= 2){ |
| | | for (int i = 0; i < 2; i++) { |
| | | courses.add(list.get(index)); |
| | | } |
| | | }else{ |
| | | courses.add(list.get(index)); |
| | | } |
| | | } |
| | | clientCourseVO.setList2(courses); |
| | | return R.ok(clientCourseVO); |
| | | } |
| | | |
| | |
| | | @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(courseService.getCoursePageList(courseTitle, cateId, pageCurr, pageSize)); |
| | | } |
| | | @PostMapping("/studyPageByChapterId") |
| | | @ApiOperation(value = "课程学习页面") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "章节id", name = "chapterId", required = true, dataType = "Long"), |
| | | @ApiImplicitParam(value = "分页参数,当前页码", name = "pageCurr", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(value = "分页参数,每页数量", name = "pageSize", required = true, dataType = "Integer") |
| | | }) |
| | | public R<PageDTO<CourseChapter>> studyPageByChapterId(@RequestParam(value = "chapterId")Long chapterId, |
| | | @RequestParam(value = "pageCurr", defaultValue = "1") Integer pageCurr, |
| | | @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | CourseChapter byId1 = courseChapterService.getById(chapterId); |
| | | Long id = byId1.getCourseId(); |
| | | // 查询章节 |
| | | Page<CourseChapter> page = courseChapterService.lambdaQuery() |
| | | .eq(CourseChapter::getCourseId, id) |
| | | .orderByDesc(CourseChapter::getSortNum) |
| | | .page(new Page<>(pageCurr, pageSize)); |
| | | if (CollUtils.isEmpty(page.getRecords())) { |
| | | PageDTO<CourseChapter> empty = PageDTO.empty(page); |
| | | return R.ok(empty); |
| | | } |
| | | PageDTO<CourseChapter> courseChapterPageDTO = PageDTO.of(page, CourseChapter.class); |
| | | if (CollUtils.isNotEmpty(courseChapterPageDTO.getList())) { |
| | | for (CourseChapter courseChapter : courseChapterPageDTO.getList()) { |
| | | AppUserViewingHistory data = remoteAppUserService.getCourseStudyHistory(courseChapter.getId()).getData(); |
| | | if (data!=null){ |
| | | courseChapter.setMinuteLook(data.getMinuteLook()); |
| | | courseChapter.setSecondLook(data.getSecondLook()); |
| | | courseChapter.setIsOver(data.getIsOver()); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | @PostMapping("/confirmOrder") |
| | | @ApiOperation(value = "确认订单页面") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "课程id", name = "courseId", required = true, dataType = "Long") |
| | | }) |
| | | public R<Course> studyPageByChapterId(@RequestParam(value = "courseId")Long courseId) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId == 0)return R.tokenError("登录失效"); |
| | | Course byId = courseService.getById(courseId); |
| | | return R.ok(byId); |
| | | } |
| | | @PostMapping("/successOrder") |
| | | @ApiOperation(value = "支付成功页面") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "课程id", name = "courseId", required = true, dataType = "Long") |
| | | }) |
| | | public R<List<Course>> successOrder(@RequestParam(value = "courseId")Long courseId) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId == 0)return R.tokenError("登录失效"); |
| | | Course byId = courseService.getById(courseId); |
| | | List<Course> list = courseService.lambdaQuery().eq(Course::getCateId, byId.getCateId()) |
| | | .eq(Course::getCourseType, 1).list(); |
| | | for (Course course : list) { |
| | | List<AppUser> data = remoteAppUserService.getUserByCourseId(courseId).getData(); |
| | | course.setCount(data.size()); |
| | | } |
| | | List<Course> courses = new ArrayList<>(); |
| | | |
| | | // 如果list集合数据大于2 随机获取两个返回 |
| | | if (CollUtils.isNotEmpty(list) && list.size() > 4) { |
| | | int size = list.size(); |
| | | int index = (int) (Math.random() * size); |
| | | for (int i = 0; i < 4; i++) { |
| | | courses.add(list.get(index)); |
| | | } |
| | | return R.ok(courses); |
| | | }else { |
| | | return R.ok(list); |
| | | } |
| | | } |
| | | @GetMapping("/studyPage") |
| | | @ApiOperation(value = "学习") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "分页参数,当前页码", name = "pageCurr", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(value = "分页参数,每页数量", name = "pageSize", required = true, dataType = "Integer") |
| | | }) |
| | | public R<StudyPageVO> studyPage(@RequestParam(value = "pageCurr", defaultValue = "1") Integer pageCurr, |
| | | @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId == 0)return R.tokenError("登录失效"); |
| | | StudyPageVO studyPageVO = new StudyPageVO(); |
| | | |
| | | PageDTO<AppUserCourse> data = remoteAppUserService.getPayCourse(pageCurr, pageSize).getData(); |
| | | List<AppUserCourse> list = data.getList(); |
| | | if (CollUtils.isNotEmpty(list)) { |
| | | List<Long> courseIds = list.stream().map(AppUserCourse::getCourseId).collect(Collectors.toList()); |
| | | Page<Course> page = courseService.lambdaQuery() |
| | | .in(Course::getId, courseIds) |
| | | .page(new Page<>(pageCurr, pageSize)); |
| | | if (CollUtils.isEmpty(page.getRecords())) { |
| | | PageDTO<CourseVO> empty = PageDTO.empty(page); |
| | | studyPageVO.setCourseList(empty); |
| | | }else{ |
| | | PageDTO<CourseVO> courseChapterPageDTO = PageDTO.of(page, CourseVO.class); |
| | | studyPageVO.setCourseList(courseChapterPageDTO); |
| | | } |
| | | } |
| | | // 查询两个相同类型的线上免费课程 |
| | | List<Course> freeCourseList = courseService.lambdaQuery() |
| | | .eq(Course::getCourseType, 1) |
| | | .eq(Course::getChargeType, 1) |
| | | .list(); |
| | | // 随机获取两个 |
| | | if (CollUtils.isNotEmpty(freeCourseList) && freeCourseList.size() > 2) { |
| | | int size = freeCourseList.size(); |
| | | int index = (int) (Math.random() * size); |
| | | List<Course> courses = new ArrayList<>(); |
| | | for (int i = 0; i < 2; i++) { |
| | | courses.add(freeCourseList.get(index)); |
| | | } |
| | | studyPageVO.setFreeCourseList(courses); |
| | | }else{ |
| | | studyPageVO.setFreeCourseList(freeCourseList); |
| | | } |
| | | return R.ok(studyPageVO); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.xinquan.course.domain.TutorSpecialColumn; |
| | | import com.xinquan.course.domain.TutorSpecialColumnCourse; |
| | | import com.xinquan.course.domain.vo.ClientCourseVO; |
| | | import com.xinquan.course.domain.vo.TutorCourseVO; |
| | | import com.xinquan.course.domain.vo.TutorVo; |
| | | import com.xinquan.course.service.CourseCategoryService; |
| | | import com.xinquan.course.service.CourseService; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private CourseService courseService; |
| | | @PostMapping("/getCoursePageList") |
| | | @ApiOperation(value = "导师专栏",tags = "导师专栏") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "分页参数,当前页码", name = "pageCurr", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(value = "分页参数,每页数量", name = "pageSize", required = true, dataType = "Integer") |
| | | }) |
| | | public R<TutorVo> getCourseList( |
| | | @RequestParam(value = "pageCurr", defaultValue = "1") Integer pageCurr, |
| | | @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | |
| | | public R<TutorVo> getCourseList() { |
| | | TutorVo tutorVo = new TutorVo(); |
| | | TutorSpecialColumn one = tutorSpecialColumnService.lambdaQuery().one(); |
| | | List<TutorCourseVO> clientCourseVOS = new ArrayList<>(); |
| | | if (one!=null){ |
| | | TutorSpecialColumnCourse one1 = tutorSpecialColumnCourseService.lambdaQuery().eq(TutorSpecialColumnCourse::getTutorSpecialColumnId, one.getId()).one(); |
| | | BeanUtils.copyProperties(one, tutorVo); |
| | | Page<Course> page = courseService.lambdaQuery() |
| | | List<Course> page = courseService.lambdaQuery() |
| | | .in(Course::getId, Arrays.asList(one1.getCourseId().split(","))) |
| | | .orderByDesc(Course::getSortNum) |
| | | .page(new Page<>(pageCurr, pageSize)); |
| | | if (CollUtils.isEmpty(page.getRecords())) { |
| | | PageDTO.empty(page); |
| | | .orderByDesc(Course::getSortNum).list().stream().limit(2).collect(Collectors.toList()); |
| | | for (Course course : page) { |
| | | TutorCourseVO tutorCourseVO = new TutorCourseVO(); |
| | | BeanUtils.copyProperties(course, tutorCourseVO); |
| | | clientCourseVOS.add(tutorCourseVO); |
| | | } |
| | | tutorVo.setList(PageDTO.of(page, ClientCourseVO.class)); |
| | | tutorVo.setList(clientCourseVOS); |
| | | return R.ok(tutorVo); |
| | | }else{ |
| | | tutorVo.setList(clientCourseVOS); |
| | | return R.ok(tutorVo); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "视频时长 单位秒") |
| | | @TableField("duration") |
| | | private Double duration; |
| | | private Integer duration; |
| | | @ApiModelProperty(value = "上次观看到xx分钟") |
| | | @TableField(exist = false) |
| | | private Integer minuteLook; |
| | | @ApiModelProperty(value = "上次观看到xx秒") |
| | | @TableField(exist = false) |
| | | private Integer secondLook; |
| | | @ApiModelProperty(value = "是否观看完成 0否1是") |
| | | @TableField(exist = false) |
| | | private Integer isOver; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "视频讲解") |
| | | @TableField("video_url") |
| | | private String videoUrl; |
| | | @ApiModelProperty(value = "视频封面") |
| | | @TableField("cover_url") |
| | | private String coverUrl; |
| | | |
| | | @ApiModelProperty(value = "导师简介") |
| | | @TableField("tutor_introduction") |
| | |
| | | package com.xinquan.course.domain.vo; |
| | | |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.course.api.domain.Course; |
| | | import com.xinquan.course.domain.CourseChapter; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | private Double latitude; |
| | | @ApiModelProperty(value = "已学习人数") |
| | | private Integer count; |
| | | @ApiModelProperty(value = "是否购买 0否1是") |
| | | private Integer isBuy; |
| | | @ApiModelProperty(value = "当前用户是否为会员") |
| | | private Integer isVip; |
| | | @ApiModelProperty(value = "头像列表") |
| | | private List<String> headers; |
| | | @ApiModelProperty(value = "章节列表") |
| | | private PageDTO<CourseChapter> list; |
| | | private List<CourseChapter> list; |
| | | @ApiModelProperty(value = "推荐课程") |
| | | private List<Course> list2; |
| | | |
| | | } |
New file |
| | |
| | | package com.xinquan.course.domain.vo; |
| | | |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.course.api.domain.Course; |
| | | import com.xinquan.course.domain.CourseChapter; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/9/7 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "课程视图对象") |
| | | public class StudyCourseVO { |
| | | |
| | | @ApiModelProperty(value = "课程id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "课程标题") |
| | | private String courseTitle; |
| | | @ApiModelProperty(value = "章节列表") |
| | | private PageDTO<CourseChapter> list; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.xinquan.course.domain.vo; |
| | | |
| | | import com.xinquan.course.api.domain.Course; |
| | | import com.xinquan.course.domain.CourseChapter; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/9/7 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "课程视图对象") |
| | | public class TutorCourseVO { |
| | | |
| | | @ApiModelProperty(value = "课程id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "课程类型 1=线上课程 2=线下课程") |
| | | private Integer courseType; |
| | | |
| | | @ApiModelProperty(value = "课程分类id") |
| | | private Long cateId; |
| | | |
| | | @ApiModelProperty(value = "课程标题") |
| | | private String courseTitle; |
| | | |
| | | @ApiModelProperty(value = "课程描述") |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "上架状态 1=上架 2=下架") |
| | | private Integer listingStatus; |
| | | |
| | | @ApiModelProperty(value = "推荐课程 1=推荐 2=不推荐") |
| | | private Integer recommend; |
| | | |
| | | @ApiModelProperty(value = "价格设定 1=免费 2=会员免费 3=单独收费") |
| | | private Integer chargeType; |
| | | |
| | | @ApiModelProperty(value = "通用价格") |
| | | private BigDecimal generalPrice; |
| | | |
| | | @ApiModelProperty(value = "IOS内购价格") |
| | | private BigDecimal iosPrice; |
| | | |
| | | @ApiModelProperty(value = "排序权重") |
| | | private Integer sortNum; |
| | | |
| | | @ApiModelProperty(value = "导师") |
| | | private String tutor; |
| | | |
| | | @ApiModelProperty(value = "列表封面图") |
| | | private String coverUrl; |
| | | |
| | | @ApiModelProperty(value = "详情页封面图|详情页视频") |
| | | private String detailUrl; |
| | | |
| | | @ApiModelProperty(value = "课程简介") |
| | | private String briefIntroduction; |
| | | |
| | | @ApiModelProperty(value = "微信二维码") |
| | | private String wxQrCode; |
| | | |
| | | @ApiModelProperty(value = "课程地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | | private String addressDetail; |
| | | |
| | | @ApiModelProperty(value = "课程地址经度") |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty(value = "课程地址纬度") |
| | | private Double latitude; |
| | | @ApiModelProperty(value = "已学习人数") |
| | | private Integer count; |
| | | @ApiModelProperty(value = "是否购买 0否1是") |
| | | private Integer isBuy; |
| | | @ApiModelProperty(value = "当前用户是否为会员") |
| | | private Integer isVip; |
| | | |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/9/7 |
| | |
| | | @ApiModel(value = "导师专栏对象") |
| | | public class TutorVo extends TutorSpecialColumn { |
| | | @ApiModelProperty(value = "相关课程") |
| | | private PageDTO<ClientCourseVO> list; |
| | | private List<TutorCourseVO> list; |
| | | } |
| | |
| | | package com.xinquan.meditation.controller.client; |
| | | |
| | | |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.meditation.api.domain.Meditation; |
| | | import com.xinquan.meditation.domain.MeditationHall; |
| | | import com.xinquan.meditation.domain.vo.ClientMeditationQuestionVO; |
| | | import com.xinquan.meditation.service.MeditationHallService; |
| | | import com.xinquan.meditation.service.MeditationService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class ClientMeditationController { |
| | | |
| | | private final MeditationService meditationService; |
| | | |
| | | private final MeditationHallService meditationHallService; |
| | | /** |
| | | * 获取冥想馆列表 |
| | | */ |
| | | @GetMapping("/getMeditationPage") |
| | | @ApiOperation(value = "获取冥想馆列表-分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "lon", value = "经度", dataType = "String", required = false), |
| | | @ApiImplicitParam(name = "lat", value = "纬度", dataType = "String", required = false), |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", required = false), |
| | | @ApiImplicitParam(name = "pageCurr", value = "分页参数,当前页码", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "分页参数,每页数量", dataType = "Integer", required = true) |
| | | }) |
| | | public R<PageDTO<MeditationHall>> getMeditationPage( |
| | | String lon, |
| | | String lat, |
| | | String name, |
| | | Integer pageCurr, |
| | | Integer pageSize) { |
| | | PageDTO<MeditationHall> res = meditationService.getMeditationPage(lon,lat,name,pageCurr,pageSize); |
| | | return R.ok(res); |
| | | } |
| | | @GetMapping("/getMeditationInfo") |
| | | @ApiOperation(value = "获取冥想馆详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", required = true), |
| | | }) |
| | | public R<MeditationHall> getMeditationPage( |
| | | @RequestParam("id") Long id) |
| | | { |
| | | MeditationHall byId = meditationHallService.getById(id); |
| | | return R.ok(byId); |
| | | } |
| | | } |
| | | |
| | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <p> |
| | | * 冥想馆表 |
| | |
| | | @ApiModelProperty(value = "简介") |
| | | @TableField("brief_introduction") |
| | | private String briefIntroduction; |
| | | @ApiModelProperty(value = "距离用户xx米") |
| | | @TableField(exist = false) |
| | | private BigDecimal distance; |
| | | |
| | | |
| | | } |
| | |
| | | package com.xinquan.meditation.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.common.core.web.page.PageInfo; |
| | | import com.xinquan.meditation.api.domain.Meditation; |
| | | import com.xinquan.meditation.domain.MeditationHall; |
| | | import com.xinquan.meditation.domain.vo.ClientMeditationQuestionVO; |
| | | import com.xinquan.meditation.domain.vo.ClientMeditationVO; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | |
| | | */ |
| | | List<ClientMeditationVO> getMeditationListByTagId(@Param("tagIdSet") Set<Long> tagIdSet, |
| | | @Param("sanskritFlag") Integer sanskritFlag); |
| | | |
| | | List<MeditationHall> getMeditationPage(@Param("pageInfo") PageInfo<MeditationHall> pageInfo, |
| | | @Param("lon")String lon, |
| | | @Param("lat")String lat, @Param("name")String name); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.meditation.api.domain.Meditation; |
| | | import com.xinquan.meditation.domain.MeditationHall; |
| | | import com.xinquan.meditation.domain.vo.ClientMeditationAndCateVO; |
| | | import com.xinquan.meditation.domain.vo.ClientMeditationDetailsVO; |
| | | import com.xinquan.meditation.domain.vo.ClientMeditationQuestionVO; |
| | |
| | | * @param id 冥想音频id |
| | | */ |
| | | void favorite(Long id); |
| | | |
| | | PageDTO<MeditationHall> getMeditationPage(String lon, String lat,String name, Integer pageCurr, Integer pageSize); |
| | | |
| | | } |
| | |
| | | import com.xinquan.common.core.utils.page.BeanUtils; |
| | | import com.xinquan.common.core.utils.page.CollUtils; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.common.core.web.page.PageInfo; |
| | | import com.xinquan.common.security.utils.SecurityUtils; |
| | | import com.xinquan.meditation.api.domain.Meditation; |
| | | import com.xinquan.meditation.domain.MeditationCategory; |
| | | import com.xinquan.meditation.domain.MeditationMusic; |
| | | import com.xinquan.meditation.domain.MeditationQuestion; |
| | | import com.xinquan.meditation.domain.MeditationQuestionLike; |
| | | import com.xinquan.meditation.domain.MeditationUserFavorite; |
| | | import com.xinquan.meditation.domain.*; |
| | | import com.xinquan.meditation.domain.vo.ClientMeditationAndCateVO; |
| | | import com.xinquan.meditation.domain.vo.ClientMeditationCategoryVO; |
| | | import com.xinquan.meditation.domain.vo.ClientMeditationDetailsVO; |
| | |
| | | import com.xinquan.meditation.service.MeditationUserFavoriteService; |
| | | import com.xinquan.order.api.domain.Order; |
| | | import com.xinquan.order.api.feign.RemoteOrderService; |
| | | import com.xinquan.user.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.user.api.domain.dto.AppUserDTO; |
| | | import com.xinquan.user.api.feign.RemoteAppUserService; |
| | | import java.util.Arrays; |
| | |
| | | import java.util.stream.Collectors; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | this.updateById(meditation); |
| | | } |
| | | |
| | | @Override |
| | | public PageDTO<MeditationHall> getMeditationPage(String lon, String lat,String name, Integer pageCurr, Integer pageSize) { |
| | | PageInfo<MeditationHall> pageInfo = new PageInfo<>(pageCurr, pageSize); |
| | | List<MeditationHall> list = this.baseMapper.getMeditationPage(pageInfo,lon, lat,name); |
| | | if (!StringUtils.hasLength(lon) || !StringUtils.hasLength(lat)){ |
| | | for (MeditationHall meditationHall : list) { |
| | | meditationHall.setDistance(null); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return PageDTO.of(pageInfo, MeditationHall.class); |
| | | } |
| | | |
| | | /** |
| | | * 获取冥想音频提问列表-分页 |
| | | * |
| | |
| | | </where> |
| | | ORDER BY sort_num DESC |
| | | </select> |
| | | <select id="getMeditationPage" resultType="com.xinquan.meditation.domain.MeditationHall"> |
| | | |
| | | SELECT |
| | | t1.id as id, |
| | | t1.hall_name as hallName, |
| | | t1.listing_status as listingStatus, |
| | | t1.contact_number as contactNumber, |
| | | t1.address as address, |
| | | t1.longitude as longitude, |
| | | t1.latitude as latitude, |
| | | t1.cover_url as coverUrl, |
| | | ROUND( |
| | | 6378.138 * 2 * ASIN( |
| | | SQRT( |
| | | POW( |
| | | SIN( |
| | | ( |
| | | #{lat} * PI() / 180 - t1.lat * PI() / 180 |
| | | ) / 2 |
| | | ), |
| | | 2 |
| | | ) + COS(#{lat} * PI() / 180) * COS(t1.lat * PI() / 180) * POW( |
| | | SIN( |
| | | ( |
| | | #{lon} * PI() / 180 - t1.lon * PI() / 180 |
| | | ) / 2 |
| | | ), |
| | | 2 |
| | | ) |
| | | ) |
| | | ) * 1000 |
| | | ) AS distance |
| | | from t_meditation_hall t1 |
| | | where 1=1 |
| | | and t1.status = 1 |
| | | and t1.del_flag = 0 |
| | | <if test="name!=null and name!=''"> |
| | | and t1.hall_name like CONCAT('%', #{name}, '%') |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.order.api.domain.Order; |
| | | import com.xinquan.order.domain.vo.ClientPlaceOrderVO; |
| | | import com.xinquan.order.service.OrderService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class ClientOrderController { |
| | | |
| | | private OrderService orderService; |
| | | /** |
| | | * 根据邀请用户ids 查询对应佣金 |
| | | */ |
| | | @GetMapping("/getCommissionByUserIds/{userIds}") |
| | | public R<String> getCommissionByUserIds(@PathVariable("userIds") String userIds) { |
| | | String[] split = userIds.split(","); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (String s : split) { |
| | | List<Order> list = orderService.lambdaQuery().eq(Order::getAppUserId, s) |
| | | .eq(Order::getPaymentStatus, 2).list(); |
| | | BigDecimal commissionAmount = list.stream() |
| | | .filter(t -> t.getCommissionAmount()!= null) |
| | | .map(Order::getCommissionAmount) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | stringBuilder.append(commissionAmount).append(","); |
| | | } |
| | | StringBuilder stringBuilder1 = stringBuilder.deleteCharAt(stringBuilder.length() - 1); |
| | | return R.ok(stringBuilder1.toString()); |
| | | } |
| | | |
| | | /** |
| | | * 创建待支付订单 |
| | |
| | | import com.xinquan.order.service.OrderService; |
| | | import com.xinquan.order.utils.JuHeFuUtil; |
| | | import com.xinquan.order.utils.OrderUtil; |
| | | import com.xinquan.user.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.user.api.domain.dto.AppUserDTO; |
| | | import com.xinquan.user.api.feign.RemoteAppUserService; |
| | | import java.math.BigDecimal; |
| | |
| | | package com.xinquan.system.controller; |
| | | |
| | | |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.common.security.utils.SecurityUtils; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.system.domain.CommonQuestion; |
| | | import com.xinquan.system.service.CommonQuestionService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.omg.CORBA.PRIVATE_MEMBER; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/system/common-question") |
| | | public class CommonQuestionController { |
| | | |
| | | @Resource |
| | | private CommonQuestionService commonQuestionService; |
| | | @PostMapping("/getQrCode") |
| | | @ApiOperation(value = "获取客服微信二维码",tags = "获取客服微信二维码") |
| | | public R getQrCode() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId==0)return R.tokenError("登录失效"); |
| | | CommonQuestion one = commonQuestionService.lambdaQuery().eq(CommonQuestion::getType, 2).one(); |
| | | return R.ok(one.getCustomerServiceQrCode()); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.xinquan.system.controller; |
| | | |
| | | |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.system.domain.ContentSetting; |
| | | import com.xinquan.system.service.ContentSettingService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/system/content-setting") |
| | | public class ContentSettingController { |
| | | @Resource |
| | | private ContentSettingService contentSettingService; |
| | | /** |
| | | * 获取协议 |
| | | * |
| | | */ |
| | | @PostMapping("/getCoursePageList") |
| | | @ApiOperation(value = "获取内容、协议1=用户协议 2=隐私协议 3=关于心泉 4= 新手冥想指南 5=课程/冥想音频购买协议 6=能量规则说明",tags = "富文本规则说明") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "内容类型 1=用户协议 2=隐私协议 3=关于心泉 4= 新手冥想指南 5=课程/冥想音频购买协议 6=能量规则说明", name = "contentType", required = true, dataType = "int"), |
| | | }) |
| | | public R<String> getCourseList(@RequestParam(value = "contentType", required = true) int contentType) { |
| | | ContentSetting one = contentSettingService.lambdaQuery().eq(ContentSetting::getContentType, contentType).one(); |
| | | if (one!=null){ |
| | | return R.ok(one.getContent()); |
| | | }else{ |
| | | return R.ok(); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | package com.xinquan.system.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.system.api.domain.vo.AppUserVO; |
| | | import com.xinquan.system.api.domain.UserLevelSetting; |
| | | import com.xinquan.system.service.UserLevelSettingService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/system/user-level-setting") |
| | | public class UserLevelSettingController { |
| | | |
| | | @Resource |
| | | private UserLevelSettingService userLevelSettingService; |
| | | /** |
| | | * 远程调用根据树苗等级获取疗愈图标和疗愈名称 |
| | | * |
| | | * @return 用户信息 |
| | | * @see AppUserVO |
| | | */ |
| | | @GetMapping("/getIconNameByLevel/{level}") |
| | | public R<UserLevelSetting> getIconNameByLevel(@PathVariable("level")Integer level) { |
| | | UserLevelSetting one = userLevelSettingService.lambdaQuery() |
| | | .eq(UserLevelSetting::getTreeLevelType, level).one(); |
| | | return R.ok(one); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.xinquan.system.controller; |
| | | |
| | | |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.system.domain.ContentSetting; |
| | | import com.xinquan.system.domain.VipSetting; |
| | | import com.xinquan.system.service.VipSettingService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.omg.CORBA.PRIVATE_MEMBER; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/system/vip-setting") |
| | | public class VipSettingController { |
| | | |
| | | @Resource |
| | | private VipSettingService vipSettingService; |
| | | @PostMapping("/getVipPrice") |
| | | @ApiOperation(value = "安卓-获取月度 季度 年度会员价格",tags = "会员") |
| | | public R<VipSetting> getVipPrice() { |
| | | VipSetting one = vipSettingService.lambdaQuery().eq(VipSetting::getClientType, 1) |
| | | .eq(VipSetting::getSettingType, 1).one(); |
| | | return R.ok(one); |
| | | } |
| | | @PostMapping("/getVipPriceApple") |
| | | @ApiOperation(value = "苹果-获取月度 季度 年度会员价格",tags = "会员") |
| | | public R<VipSetting> getVipPriceApple() { |
| | | VipSetting one = vipSettingService.lambdaQuery().eq(VipSetting::getClientType, 2) |
| | | .eq(VipSetting::getSettingType, 1).one(); |
| | | return R.ok(one); |
| | | } |
| | | @PostMapping("/getVipContent") |
| | | @ApiOperation(value = "获取会员权益介绍/获取会员用户协议/获取续费管理说明",tags = "会员") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "内容类型 1=会员权益介绍 2=会员用户协议 3=续费管理说明", name = "type", required = true, dataType = "int"), |
| | | }) |
| | | public R<String> getVipPriceApple(Integer type) { |
| | | VipSetting one = vipSettingService.lambdaQuery() |
| | | .eq(VipSetting::getSettingType, type+1).one(); |
| | | return R.ok(one.getContent()); |
| | | } |
| | | } |
| | | |
| | |
| | | @TableField("content") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "类型1问题 2客服微信") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | |
| | | } |
| | |
| | | @TableField("tree_level_type") |
| | | private Integer treeLevelType; |
| | | |
| | | @ApiModelProperty(value = "树苗阶段") |
| | | @TableField("level_name") |
| | | private String levelName; |
| | | |
| | | @ApiModelProperty(value = "成长值") |
| | | @TableField("growth_value") |
| | | private Integer growthValue; |
| | |
| | | package com.xinquan.system.mapper; |
| | | |
| | | import com.xinquan.system.domain.UserLevelSetting; |
| | | import com.xinquan.system.api.domain.UserLevelSetting; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | |
| | | package com.xinquan.system.service; |
| | | |
| | | import com.xinquan.system.domain.UserLevelSetting; |
| | | import com.xinquan.system.api.domain.UserLevelSetting; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | |
| | | package com.xinquan.system.service.impl; |
| | | |
| | | import com.xinquan.system.domain.UserLevelSetting; |
| | | import com.xinquan.system.api.domain.UserLevelSetting; |
| | | import com.xinquan.system.mapper.UserLevelSettingMapper; |
| | | import com.xinquan.system.service.UserLevelSettingService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | <mapper namespace="com.xinquan.system.mapper.UserLevelSettingMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.domain.UserLevelSetting"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.UserLevelSetting"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | package com.xinquan.user.controller.client; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.common.core.utils.page.BeanUtils; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.common.core.web.domain.BaseModel; |
| | | import com.xinquan.common.security.utils.SecurityUtils; |
| | | import com.xinquan.order.api.feign.RemoteOrderService; |
| | | import com.xinquan.system.api.RemoteBannerService; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUserTree; |
| | | import com.xinquan.system.api.domain.AppUserViewingHistory; |
| | | import com.xinquan.system.api.domain.UserLevelSetting; |
| | | import com.xinquan.system.api.domain.vo.*; |
| | | import com.xinquan.user.domain.dto.UserAnswerDTO; |
| | | import com.xinquan.user.domain.vo.AppUserVO; |
| | | import com.xinquan.user.domain.vo.TagVO; |
| | | import com.xinquan.user.service.AppUserService; |
| | | import com.xinquan.user.service.AppUserTreeService; |
| | | import com.xinquan.user.service.AppUserViewingHistoryService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import static com.xinquan.common.core.enums.TreeLevelEnum.TOWERING_TREES; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class ClientAppUserController { |
| | | |
| | | private final AppUserService appUserService; |
| | | @Resource |
| | | private AppUserViewingHistoryService appUserViewingHistoryService; |
| | | |
| | | @Resource |
| | | private AppUserTreeService appUserTreeService; |
| | | @Resource |
| | | private RemoteBannerService remoteBannerService; |
| | | @Resource |
| | | private RemoteOrderService remoteOrderService; |
| | | public static void main(String[] args) { |
| | | LocalDateTime dateTime = LocalDateTime.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | String formattedDateTime = dateTime.format(formatter); |
| | | System.err.println(formattedDateTime); |
| | | } |
| | | /** |
| | | * 爱心助力榜单-分页 |
| | | * |
| | | * @param pageCurr 分页参数,当前页码 |
| | | * @param pageSize 分页参数,每页数量 |
| | | * @return 课程分页列表 |
| | | */ |
| | | @PostMapping("/myInviteRankList") |
| | | @ApiOperation(value = "我的助力-分页", tags = {"个人中心"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "分页参数,当前页码", name = "pageCurr", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(value = "分页参数,每页数量", name = "pageSize", required = true, dataType = "Integer") |
| | | }) |
| | | public R<PageDTO<InviteRankListVO>> myInviteRankList( |
| | | @RequestParam(value = "pageCurr", defaultValue = "1") Integer pageCurr, |
| | | @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId == 0)return R.tokenError("登录失效"); |
| | | Page<AppUser> page = appUserService.lambdaQuery().ne(AppUser::getUserStatus, 3) |
| | | .eq(AppUser::getInviteUserId, userId) |
| | | .page(new Page<>(pageCurr, pageSize)); |
| | | // 查询登录用户邀请了哪些人 |
| | | List<Long> collect = page.getRecords().stream().map(AppUser::getId).collect(Collectors.toList()); |
| | | if (collect.isEmpty())return R.ok(PageDTO.empty(page)); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | collect.forEach(id -> stringBuilder.append(id).append(",")); |
| | | // 去除最后一位 |
| | | StringBuilder stringBuilder1 = stringBuilder.deleteCharAt(stringBuilder.length() - 1); |
| | | String[] split = stringBuilder1.toString().split(","); |
| | | for (int i = 0; i < page.getRecords().size(); i++) { |
| | | AppUser appUser = page.getRecords().get(i); |
| | | appUser.setMoney(new BigDecimal(split[i])); |
| | | } |
| | | // 根据佣金金额 从大到小排序 |
| | | page.getRecords().sort((o1, o2) -> o2.getMoney().compareTo(o1.getMoney())); |
| | | return R.ok(PageDTO.of(page, InviteRankListVO.class)); |
| | | } |
| | | /** |
| | | * 爱心助力榜单-分页 |
| | | * |
| | | * @param pageCurr 分页参数,当前页码 |
| | | * @param pageSize 分页参数,每页数量 |
| | | * @return 课程分页列表 |
| | | */ |
| | | @PostMapping("/inviteRankList") |
| | | @ApiOperation(value = "爱心助力榜单-分页", tags = {"个人中心"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "分页参数,当前页码", name = "pageCurr", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(value = "分页参数,每页数量", name = "pageSize", required = true, dataType = "Integer") |
| | | }) |
| | | public R<PageDTO<InviteRankListVO>> inviteRankList( |
| | | @RequestParam(value = "pageCurr", defaultValue = "1") Integer pageCurr, |
| | | @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | Page<AppUser> page = appUserService.lambdaQuery().ne(AppUser::getUserStatus, 3) |
| | | .page(new Page<>(pageCurr, pageSize)); |
| | | for (AppUser appUser : page.getRecords()) { |
| | | int size = appUserService.lambdaQuery().ne(AppUser::getUserStatus, 3) |
| | | .eq(AppUser::getInviteUserId, appUser.getId()) |
| | | .list().size(); |
| | | appUser.setCount(size); |
| | | } |
| | | // 根据帮助人数 从大到小排序 |
| | | page.getRecords().sort((o1, o2) -> o2.getCount() - o1.getCount()); |
| | | return R.ok(PageDTO.of(page, InviteRankListVO.class)) ; |
| | | } |
| | | @PostMapping("/getUserInfo") |
| | | @ApiOperation(value = "获取用户信息", tags = {"个人中心"}) |
| | | public R<AppUserInfoVO> getUserInfo() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId == 0)return R.tokenError("登录失效"); |
| | | AppUserInfoVO appUserInfoVO = new AppUserInfoVO(); |
| | | AppUserVO currentUser = appUserService.getCurrentUser(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | if (currentUser.getVipExpireTime() == null){ |
| | | appUserInfoVO.setIsVip(2); |
| | | }else if (currentUser.getVipExpireTime().isAfter(LocalDateTime.now())){ |
| | | appUserInfoVO.setIsVip(1); |
| | | String formattedDateTime =currentUser.getVipExpireTime().format(formatter); |
| | | appUserInfoVO.setVipExpireTime(formattedDateTime); |
| | | }else{ |
| | | String formattedDateTime =currentUser.getVipExpireTime().format(formatter); |
| | | appUserInfoVO.setVipExpireTime(formattedDateTime); |
| | | appUserInfoVO.setIsVip(2); |
| | | } |
| | | // 查询用户累计学习天数 |
| | | List<AppUserViewingHistory> com = appUserViewingHistoryService.cumulative(userId); |
| | | appUserInfoVO.setCumulative(com.size()); |
| | | // 查询用户今日学习多少分钟 |
| | | int temp = appUserViewingHistoryService.today(userId); |
| | | if (temp == 0){ |
| | | appUserInfoVO.setToday(0); |
| | | }else if (temp<60){ |
| | | // 不足一分钟按一分钟计算 |
| | | appUserInfoVO.setToday(1); |
| | | }else{ |
| | | appUserInfoVO.setToday(temp/60); |
| | | } |
| | | // 查询用户连续观看天数 |
| | | List<AppUserViewingHistory> list = appUserViewingHistoryService.lambdaQuery().eq(AppUserViewingHistory::getAppUserId, userId) |
| | | .eq(AppUserViewingHistory::getViewingType, 1) |
| | | .orderByDesc(BaseModel::getCreateTime).list(); |
| | | Set<LocalDate> viewingDates = list.stream() |
| | | .map(record -> LocalDate.parse(record.getCreateTime().toLocalDate().toString(), formatter)) |
| | | .collect(Collectors.toCollection(HashSet::new)); |
| | | // 获取今天的日期 |
| | | LocalDate today = LocalDate.now(); |
| | | // 计算连续观看天数 |
| | | int consecutiveDays = 0; |
| | | LocalDate currentDate = today; |
| | | // 如果今天没有观看 也进入循环判断 |
| | | while (viewingDates.contains(currentDate)||LocalDate.parse(currentDate.toString(), formatter).equals(today)) { |
| | | if (!viewingDates.contains(currentDate)){ |
| | | // 如果今天没有观看 |
| | | currentDate = currentDate.minusDays(1); |
| | | continue; |
| | | } |
| | | consecutiveDays++; |
| | | currentDate = currentDate.minusDays(1); |
| | | } |
| | | appUserInfoVO.setToday(consecutiveDays); |
| | | List<AppUserTree> list1 = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, userId) |
| | | .list(); |
| | | // 查询用户等级最高的那颗树苗 |
| | | AppUserTree tree = list1.stream().max((o1, o2) -> { |
| | | if (o1.getTreeLevelType() > o2.getTreeLevelType()) { |
| | | return 1; |
| | | } else if (o1.getTreeLevelType() < o2.getTreeLevelType()) { |
| | | return -1; |
| | | } else { |
| | | return 0; |
| | | } |
| | | }).orElse(null); |
| | | // 查询疗愈等级 名称 图标 |
| | | int level = 1; |
| | | if (tree != null){ |
| | | level = tree.getTreeLevelType(); |
| | | } |
| | | appUserInfoVO.setLevel(level); |
| | | // 根据等级查询疗愈名称和图标 |
| | | UserLevelSetting data = remoteBannerService.getIconNameByLevel(level).getData(); |
| | | appUserInfoVO.setLevelName(data.getLevelName()); |
| | | appUserInfoVO.setLevelIcon(data.getLevelIcon()); |
| | | return R.ok(appUserInfoVO); |
| | | } |
| | | @PostMapping("/getUserDetail") |
| | | @ApiOperation(value = "获取个人资料", tags = {"个人中心"}) |
| | | public R<AppUser> getUserDetail() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId == 0)return R.tokenError("登录失效"); |
| | | AppUser appUser = appUserService.lambdaQuery().eq(AppUser::getId, userId).one(); |
| | | return R.ok(appUser); |
| | | } |
| | | @PostMapping("/getTotalEnergyValue") |
| | | @ApiOperation(value = "获取用户当前累计能量值",tags = "树苗打卡站") |
| | | public R getTotalEnergyValue() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId==0)return R.tokenError("登录失效"); |
| | | AppUser byId = appUserService.getById(userId); |
| | | return R.ok(byId.getTotalEnergyValue()); |
| | | } |
| | | @PostMapping("/updateUserDetail") |
| | | @ApiOperation(value = "修改个人资料", tags = {"个人中心"}) |
| | | public R<AppUser> updateUserDetail(UpdateAppUserDTO dto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId == 0)return R.tokenError("登录失效"); |
| | | AppUser byId = appUserService.getById(userId); |
| | | BeanUtils.copyProperties(dto, byId); |
| | | // LambdaUpdateWrapper<AppUser> updateWrapper = new LambdaUpdateWrapper<>(AppUser.class); |
| | | // updateWrapper.set(AppUser::getNickname, byId.getNickname()); |
| | | // updateWrapper.set(AppUser::getSignature, byId.getSignature()); |
| | | // updateWrapper.set(AppUser::getAvatar, byId.getAvatar()); |
| | | // updateWrapper.set(AppUser::getGender, byId.getGender()); |
| | | // updateWrapper.set(AppUser::getBirthday, byId.getBirthday()); |
| | | // updateWrapper.set(AppUser::getEducation, byId.getEducation()); |
| | | // updateWrapper.set(AppUser::getIndustry, byId.getIndustry()); |
| | | // updateWrapper.set(AppUser::getCompany, byId.getCompany()); |
| | | // updateWrapper.set(AppUser::getOccupation, byId.getOccupation()); |
| | | // updateWrapper.set(AppUser::getLocation, byId.getLocation()); |
| | | // updateWrapper.set(AppUser::getHometown, byId.getHometown()); |
| | | // appUserService.update(byId, ) |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 获取当前登录用户信息 |
| | | * |
| | | * @return 用户信息 |
| | | * @see com.xinquan.user.domain.vo.AppUserVO |
| | | * @see AppUserVO |
| | | */ |
| | | @PostMapping("/getCurrentUser") |
| | | @ApiOperation(value = "获取当前用户信息", tags = {"用户端-用户信息相关接口"}) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 通过手机号查询用户端用户信息 |
| | | * |
| | | * @return 用户信息 |
| | | * @see AppUserVO |
| | | */ |
| | | @PostMapping("/getUserByPhone") |
| | | @ApiOperation(value = "根据用户手机号查询用户信息") |
| | | public R<AppUserDetailVO> getCurrentUser(String phone) { |
| | | AppUser one = appUserService.lambdaQuery().eq(AppUser::getCellPhone, phone).one(); |
| | | AppUserDetailVO appUserDetailVO = new AppUserDetailVO(); |
| | | appUserDetailVO.setId(one.getId()); |
| | | appUserDetailVO.setCellPhone(one.getCellPhone()); |
| | | appUserDetailVO.setAvatar(one.getAvatar()); |
| | | appUserDetailVO.setNickname(one.getNickname()); |
| | | return R.ok(appUserDetailVO); |
| | | } |
| | | @PostMapping("/getUserBalance") |
| | | @ApiOperation(value = "查询当前用户余额") |
| | | public R<String> getUserBalance() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId == 0)return R.tokenError("登录失效"); |
| | | AppUser one = appUserService.lambdaQuery().eq(AppUser::getUserId, userId).one(); |
| | | return R.ok(one.getBalance().toString()); |
| | | } |
| | | |
| | | /** |
| | | * 获取问题二的标签列表 |
| | | * |
| | | * @return List<TagVO> |
| | |
| | | package com.xinquan.user.controller.client; |
| | | |
| | | |
| | | import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.C; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.user.api.domain.AppUser; |
| | | import com.xinquan.user.domain.AppUserCourse; |
| | | import com.xinquan.user.domain.vo.AppUserVO; |
| | | import com.xinquan.common.core.utils.page.CollUtils; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.common.security.utils.SecurityUtils; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUserCourse; |
| | | import com.xinquan.system.api.domain.vo.AppUserVO; |
| | | import com.xinquan.user.service.AppUserCourseService; |
| | | import com.xinquan.user.service.AppUserService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | * 远程调用 根据课程id 查询拥有课程的用户 |
| | | * |
| | | * @return 用户信息 |
| | | * @see com.xinquan.user.domain.vo.AppUserVO |
| | | * @see AppUserVO |
| | | */ |
| | | @GetMapping("/getUserByCourseId/{courseId}") |
| | | public R<List<String>> getUserByCourseId(@PathVariable("courseId") Long courseId) { |
| | | public R<List<AppUser>> getUserByCourseId(@PathVariable("courseId") Long courseId) { |
| | | List<Long> collect = appUserCourseService.lambdaQuery().eq(AppUserCourse::getCourseId, courseId).list() |
| | | .stream().map(AppUserCourse::getAppUserId).collect(Collectors.toList()); |
| | | // 批量查询用户头像 |
| | | List<String> collect1 = appUserService.lambdaQuery().in(!collect.isEmpty(), AppUser::getId, collect).list() |
| | | .stream().map(AppUser::getAvatar).collect(Collectors.toList()); |
| | | List<AppUser> collect1 = appUserService.lambdaQuery().in(!collect.isEmpty(), AppUser::getId, collect).list(); |
| | | return R.ok(collect1); |
| | | } |
| | | /** |
| | | * 远程调用 查询当前登录用户已购买课程 |
| | | * |
| | | * @return 用户信息 |
| | | * @see AppUserVO |
| | | */ |
| | | @GetMapping("/getPayCourse/{pageCurr}/{pageSize}") |
| | | public R<PageDTO<AppUserCourse>> getPayCourse(@PathVariable("pageCurr")Integer pageCurr |
| | | ,@PathVariable("pageSize")Integer pageSize) { |
| | | Page<AppUserCourse> page = appUserCourseService.lambdaQuery() |
| | | .eq(AppUserCourse::getCourseId, SecurityUtils.getUserId()) |
| | | .orderByDesc(AppUserCourse::getCreateTime) |
| | | .page(new Page<>(pageCurr, pageSize)); |
| | | if (CollUtils.isEmpty(page.getRecords())) { |
| | | PageDTO<AppUserCourse> empty = PageDTO.empty(page); |
| | | return R.ok(empty); |
| | | } |
| | | PageDTO<AppUserCourse> courseChapterPageDTO = PageDTO.of(page, AppUserCourse.class); |
| | | return R.ok(courseChapterPageDTO); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | package com.xinquan.user.controller.client; |
| | | |
| | | |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import com.alibaba.fastjson2.util.UUIDUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.common.core.utils.page.CollUtils; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.common.core.web.domain.BaseModel; |
| | | import com.xinquan.common.security.utils.SecurityUtils; |
| | | import com.xinquan.system.api.RemoteUserService; |
| | | import com.xinquan.system.api.domain.*; |
| | | import com.xinquan.system.api.domain.vo.AppUserEnergyRecordVO; |
| | | import com.xinquan.system.api.domain.vo.WateringVO; |
| | | import com.xinquan.user.domain.vo.EnergyVO; |
| | | import com.xinquan.user.domain.vo.ExchangeRecordVO; |
| | | import com.xinquan.user.service.*; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.Mapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/client/app-user-tree") |
| | | public class ClientAppUserTreeController { |
| | | @Resource |
| | | private AppUserTreeService appUserTreeService; |
| | | @Resource |
| | | private AppUserViewingHistoryService appUserViewingHistoryService; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | @Resource |
| | | private AppUserEnergyRecordService appUserEnergyRecordService; |
| | | @Resource |
| | | private PrizeService prizeService; |
| | | @Resource |
| | | private PrizeRedemptionRecordService prizeRedemptionRecordService; |
| | | |
| | | @PostMapping("/getUserTree") |
| | | @ApiOperation(value = "获取用户树苗",tags = "树苗打卡站") |
| | | public R<AppUserTree> getUserTree() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId==0)return R.tokenError("登录失效"); |
| | | AppUser byId = appUserService.getById(userId); |
| | | |
| | | // 查询用户今日观看疗愈多少秒 |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDateTime startOfDay = now.toLocalDate().atStartOfDay(); |
| | | LocalDateTime endOfDay = now.toLocalDate().atTime(LocalTime.MAX); |
| | | List<AppUserViewingHistory> list = appUserViewingHistoryService |
| | | .lambdaQuery().eq(AppUserViewingHistory::getAppUserId, userId) |
| | | .eq(AppUserViewingHistory::getViewingType, 1) |
| | | .eq(BaseModel::getDelFlag,0) |
| | | .between(AppUserViewingHistory::getCreateTime, startOfDay,endOfDay).list(); |
| | | int temp = 0; |
| | | for (AppUserViewingHistory appUserViewingHistory : list) { |
| | | temp += appUserViewingHistory.getTimeLook(); |
| | | } |
| | | |
| | | AppUserTree one = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, userId) |
| | | .eq(AppUserTree::getSowAgain,2).one(); |
| | | if (one == null){ |
| | | AppUserTree appUserTree = new AppUserTree(); |
| | | appUserTree.setAppUserId(userId); |
| | | appUserTree.setTreeLevelType(1); |
| | | appUserTree.setGrowthValue(0); |
| | | appUserTree.setSowAgain(2); |
| | | appUserTree.setCreateTime(LocalDateTime.now()); |
| | | // 如果用户的签到时间是今天 那么修改为已签到 |
| | | if (byId.getSignTime().toLocalDate().equals(LocalDateTime.now().toLocalDate())){ |
| | | appUserTree.setIsSign(1); |
| | | }else{ |
| | | appUserTree.setIsSign(2); |
| | | } |
| | | if (temp>=60){ |
| | | appUserTree.setTaskOne(1); |
| | | appUserTree.setTaskTwo(1); |
| | | } |
| | | else if (temp>=30){ |
| | | appUserTree.setTaskOne(1); |
| | | appUserTree.setTaskTwo(2); |
| | | }else{ |
| | | appUserTree.setTaskOne(2); |
| | | appUserTree.setTaskTwo(2); |
| | | } |
| | | appUserTree.setNextLevel(1000); |
| | | appUserTreeService.save(appUserTree); |
| | | return R.ok(appUserTree); |
| | | }else{ |
| | | if (temp>=60){ |
| | | one.setTaskOne(1); |
| | | one.setTaskTwo(1); |
| | | } |
| | | else if (temp>=30){ |
| | | one.setTaskOne(1); |
| | | one.setTaskTwo(2); |
| | | }else{ |
| | | one.setTaskOne(2); |
| | | one.setTaskTwo(2); |
| | | } |
| | | // 如果用户的签到时间是今天 那么修改为已签到 |
| | | if (byId.getSignTime().toLocalDate().equals(LocalDateTime.now().toLocalDate())){ |
| | | one.setIsSign(1); |
| | | }else{ |
| | | one.setIsSign(2); |
| | | } |
| | | switch (one.getTreeLevelType()){ |
| | | case 1: |
| | | one.setNextLevel(1000); |
| | | break; |
| | | case 2: |
| | | one.setNextLevel(1000); |
| | | break; |
| | | case 3: |
| | | one.setNextLevel(1000); |
| | | break; |
| | | case 4: |
| | | one.setNextLevel(1000); |
| | | break; |
| | | case 5: |
| | | one.setNextLevel(2000); |
| | | break; |
| | | case 6: |
| | | one.setNextLevel(2000); |
| | | break; |
| | | case 7: |
| | | one.setNextLevel(2000); |
| | | break; |
| | | case 8: |
| | | one.setNextLevel(2000); |
| | | break; |
| | | case 9: |
| | | one.setNextLevel(2400); |
| | | break; |
| | | case 10: |
| | | one.setNextLevel(2400); |
| | | break; |
| | | } |
| | | return R.ok(one); |
| | | |
| | | } |
| | | } |
| | | @PostMapping("/restart") |
| | | @ApiOperation(value = "重新播种",tags = "树苗打卡站") |
| | | public R restart() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId==0)return R.tokenError("登录失效"); |
| | | AppUserTree one = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, userId) |
| | | .eq(AppUserTree::getSowAgain,2).one(); |
| | | one.setSowAgain(1); |
| | | appUserTreeService.updateById(one); |
| | | AppUserTree appUserTree = new AppUserTree(); |
| | | appUserTree.setAppUserId(userId); |
| | | appUserTree.setTreeLevelType(1); |
| | | appUserTree.setGrowthValue(0); |
| | | appUserTree.setSowAgain(2); |
| | | appUserTree.setCreateTime(LocalDateTime.now()); |
| | | appUserTreeService.save(appUserTree); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/watering") |
| | | @ApiOperation(value = "浇水 返回值true证明升级了 false没升级",tags = "树苗打卡站") |
| | | public R<WateringVO> watering() { |
| | | WateringVO wateringVO = new WateringVO(); |
| | | |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId==0)return R.tokenError("登录失效"); |
| | | AppUser byId = appUserService.getById(userId); |
| | | AppUserTree one = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, userId) |
| | | .eq(AppUserTree::getSowAgain,2).one(); |
| | | Integer currentEnergyValue = byId.getEnergyValue(); |
| | | byId.setEnergyValue(0); |
| | | // 判断能否升级 |
| | | int temp = 0; |
| | | switch (one.getTreeLevelType()){ |
| | | case 1: |
| | | temp=1000; |
| | | break; |
| | | case 2: |
| | | temp=1000; |
| | | break; |
| | | case 3: |
| | | temp=1000; |
| | | break; |
| | | case 4: |
| | | temp=1000; |
| | | break; |
| | | case 5: |
| | | temp=2000; |
| | | break; |
| | | case 6: |
| | | temp=2000; |
| | | break; |
| | | case 7: |
| | | temp=2000; |
| | | break; |
| | | case 8: |
| | | temp=2000; |
| | | break; |
| | | case 9: |
| | | temp=2400; |
| | | break; |
| | | case 10: |
| | | temp=2400; |
| | | break; |
| | | } |
| | | wateringVO.setNextLevel(temp); |
| | | // 升级阈值 |
| | | if (one.getGrowthValue()+currentEnergyValue>=temp){ |
| | | // 升级咯 如果当前等级已经为10级 |
| | | if (one.getTreeLevelType()==10){ |
| | | one.setGrowthValue(one.getGrowthValue()+currentEnergyValue); |
| | | appUserTreeService.updateById(one); |
| | | wateringVO.setIsNext(false); |
| | | wateringVO.setNextLevel(2400); |
| | | }else{ |
| | | // 升级 |
| | | one.setTreeLevelType(one.getTreeLevelType()+1); |
| | | one.setGrowthValue(one.getGrowthValue()+currentEnergyValue-temp); |
| | | appUserTreeService.updateById(one); |
| | | switch (one.getTreeLevelType()+1){ |
| | | case 2: |
| | | temp=1000; |
| | | break; |
| | | case 3: |
| | | temp=1000; |
| | | break; |
| | | case 4: |
| | | temp=1000; |
| | | break; |
| | | case 5: |
| | | temp=2000; |
| | | break; |
| | | case 6: |
| | | temp=2000; |
| | | break; |
| | | case 7: |
| | | temp=2000; |
| | | break; |
| | | case 8: |
| | | temp=2000; |
| | | break; |
| | | case 9: |
| | | temp=2400; |
| | | break; |
| | | case 10: |
| | | temp=2400; |
| | | break; |
| | | } |
| | | wateringVO.setNextLevel(temp); |
| | | wateringVO.setIsNext(true); |
| | | } |
| | | }else{ |
| | | // 不能升级 |
| | | one.setGrowthValue(one.getGrowthValue()+currentEnergyValue-temp); |
| | | appUserTreeService.updateById(one); |
| | | wateringVO.setIsNext(false); |
| | | } |
| | | wateringVO.setGrowthValue(one.getGrowthValue()); |
| | | return R.ok(wateringVO); |
| | | } |
| | | @PostMapping("/sign") |
| | | @ApiOperation(value = "签到",tags = "树苗打卡站") |
| | | public R sign() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId==0)return R.tokenError("登录失效"); |
| | | // 给用户加10能量 |
| | | AppUser byId = appUserService.getById(userId); |
| | | byId.setTotalEnergyValue(byId.getTotalEnergyValue()+10); |
| | | byId.setEnergyValue(byId.getEnergyValue()+10); |
| | | appUserService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/isFirst") |
| | | @ApiOperation(value = "是否首次进入 ",tags = "树苗打卡站") |
| | | public R isFirst() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId==0)return R.tokenError("登录失效"); |
| | | AppUser byId = appUserService.getById(userId); |
| | | if (byId.getIsFirst() == 1){ |
| | | byId.setIsFirst(2); |
| | | appUserService.updateById(byId); |
| | | return R.ok(true); |
| | | }else{ |
| | | return R.ok(false); |
| | | } |
| | | } |
| | | @PostMapping("/energyDetail") |
| | | @ApiOperation(value = "能量值明细 ",tags = "树苗打卡站") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "state", value = "状态1全部 2增加 3扣除", dataType = "int", required = false), |
| | | @ApiImplicitParam(name = "pageCurr", value = "分页参数,当前页码", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "分页参数,每页数量", dataType = "Integer", required = true) |
| | | }) |
| | | public R<PageDTO<AppUserEnergyRecordVO>> energyDetail(Integer state,Integer pageCurr,Integer pageSize) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId==0)return R.tokenError("登录失效"); |
| | | EnergyVO energyVO = new EnergyVO(); |
| | | energyVO.setEnergyTotal(appUserService.getById(userId).getTotalEnergyValue()); |
| | | LambdaQueryWrapper<AppUserEnergyRecord> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if (state!=null){ |
| | | switch (state){ |
| | | case 2: |
| | | lambdaQueryWrapper.eq(AppUserEnergyRecord::getChangeType, 1); |
| | | break; |
| | | case 3: |
| | | lambdaQueryWrapper.eq(AppUserEnergyRecord::getChangeType, 2); |
| | | break; |
| | | } |
| | | } |
| | | lambdaQueryWrapper.eq(AppUserEnergyRecord::getAppUserId, userId).orderByDesc(BaseModel::getCreateTime); |
| | | Page<AppUserEnergyRecord> page = appUserEnergyRecordService.page(new Page<>(pageCurr, pageSize), lambdaQueryWrapper); |
| | | if (CollUtils.isEmpty(page.getRecords())){ |
| | | PageDTO<AppUserEnergyRecordVO> empty = PageDTO.empty(page); |
| | | energyVO.setList(new ArrayList<AppUserEnergyRecordVO>()); |
| | | return R.ok(empty); |
| | | } |
| | | PageDTO<AppUserEnergyRecordVO> appUserEnergyRecordVOPageDTO = PageDTO.of(page, AppUserEnergyRecordVO.class); |
| | | energyVO.setList(appUserEnergyRecordVOPageDTO.getList()); |
| | | return R.ok(appUserEnergyRecordVOPageDTO); |
| | | } |
| | | @PostMapping("/goodsList") |
| | | @ApiOperation(value = "能量兑换礼物列表 ",tags = "树苗打卡站") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pageCurr", value = "分页参数,当前页码", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "分页参数,每页数量", dataType = "Integer", required = true) |
| | | }) |
| | | public R<PageDTO<Prize>> goodsList(Integer pageCurr,Integer pageSize) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId==0)return R.tokenError("登录失效"); |
| | | Page<Prize> page = prizeService.lambdaQuery() |
| | | .eq(Prize::getStatus, 1) |
| | | .orderByDesc(BaseModel::getCreateTime).page(new Page<>(pageCurr, pageSize)); |
| | | |
| | | if (CollUtils.isEmpty(page.getRecords())){ |
| | | PageDTO<Prize> empty = PageDTO.empty(page); |
| | | return R.ok(empty); |
| | | } |
| | | for (Prize record : page.getRecords()) { |
| | | PrizeRedemptionRecord one = prizeRedemptionRecordService.lambdaQuery() |
| | | .eq(PrizeRedemptionRecord::getPrizeId, record.getId()) |
| | | .eq(PrizeRedemptionRecord::getAppUserId, userId).one(); |
| | | if (one == null){ |
| | | record.setReceiveStatus(2); |
| | | } |
| | | } |
| | | PageDTO<Prize> res = PageDTO.of(page, Prize.class); |
| | | return R.ok(res); |
| | | } |
| | | @PostMapping("/exchange") |
| | | @ApiOperation(value = "兑换奖品 ",tags = "树苗打卡站") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "prizeId", value = "奖品id", dataType = "Long", required = true), |
| | | }) |
| | | public R exchange(Long prizeId) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId==0)return R.tokenError("登录失效"); |
| | | AppUser byId1 = appUserService.getById(userId); |
| | | Prize byId = prizeService.getById(prizeId); |
| | | if (byId1.getTotalEnergyValue()<=byId.getEnergyValue()){ |
| | | return R.fail("能量值不足"); |
| | | } |
| | | PrizeRedemptionRecord one = prizeRedemptionRecordService.lambdaQuery() |
| | | .eq(PrizeRedemptionRecord::getPrizeId, prizeId) |
| | | .eq(PrizeRedemptionRecord::getAppUserId, userId).one(); |
| | | if (one!=null){ |
| | | return R.fail("奖品已兑换"); |
| | | } |
| | | PrizeRedemptionRecord prizeRedemptionRecord = new PrizeRedemptionRecord(); |
| | | prizeRedemptionRecord.setStatus(1); |
| | | prizeRedemptionRecord.setPrizeId(prizeId); |
| | | prizeRedemptionRecord.setAppUserId(userId); |
| | | prizeRedemptionRecord.setCreateTime(LocalDateTime.now()); |
| | | String code = RandomUtil.randomNumbers(6); |
| | | prizeRedemptionRecord.setCode(code); |
| | | prizeRedemptionRecordService.save(prizeRedemptionRecord); |
| | | // 随机生成6位纯数字验证码 |
| | | return R.ok(); |
| | | } |
| | | @PostMapping("/exchangeRecordList") |
| | | @ApiOperation(value = "兑换记录 ",tags = "树苗打卡站") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pageCurr", value = "分页参数,当前页码", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "分页参数,每页数量", dataType = "Integer", required = true) |
| | | }) |
| | | public R<PageDTO<ExchangeRecordVO>> exchangeRecordList(Integer pageCurr, Integer pageSize) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId==0)return R.tokenError("登录失效"); |
| | | Page<PrizeRedemptionRecord> page = prizeRedemptionRecordService.lambdaQuery() |
| | | .eq(PrizeRedemptionRecord::getAppUserId, userId) |
| | | .orderByDesc(BaseModel::getCreateTime).page(new Page<>(pageCurr, pageSize)); |
| | | |
| | | if (CollUtils.isEmpty(page.getRecords())){ |
| | | PageDTO<ExchangeRecordVO> empty = PageDTO.empty(page); |
| | | return R.ok(empty); |
| | | } |
| | | PageDTO<ExchangeRecordVO> res = PageDTO.of(page, ExchangeRecordVO.class); |
| | | |
| | | for (ExchangeRecordVO record : res.getList()) { |
| | | Prize temp = prizeService.lambdaQuery() |
| | | .eq(Prize::getId, record.getId()).one(); |
| | | if (temp != null){ |
| | | record.setName(temp.getName()); |
| | | record.setCoverUrl(temp.getCoverUrl()); |
| | | record.setWorth(temp.getWorth()); |
| | | record.setEnergyValue(temp.getEnergyValue()); |
| | | } |
| | | } |
| | | return R.ok(res); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.common.core.web.domain.BaseModel; |
| | | import com.xinquan.common.security.service.TokenService; |
| | | import com.xinquan.common.security.utils.SecurityUtils; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUserTree; |
| | | import com.xinquan.system.api.domain.AppUserViewingHistory; |
| | | import com.xinquan.system.api.domain.vo.AppUserVO; |
| | | import com.xinquan.user.service.AppUserService; |
| | | import com.xinquan.user.service.AppUserTreeService; |
| | | import com.xinquan.user.service.AppUserViewingHistoryService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class ClientAppUserViewingHistoryController { |
| | | |
| | | private final AppUserViewingHistoryService appUserViewingHistoryService; |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private AppUserTreeService appUserTreeService; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | /** |
| | | * 记录用户观看记录 |
| | | * |
| | |
| | | * @param viewingType 观看类型 1=疗愈 2=课程 |
| | | */ |
| | | @PostMapping("/saveViewingHistory") |
| | | @ApiOperation(value = "记录用户观看记录", tags = {"用户端-用户相关接口"}) |
| | | @ApiOperation(value = "记录用户观看冥想记录", tags = {"用户端-用户相关接口"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "bizId", value = "业务id", dataType = "Long", required = true), |
| | | @ApiImplicitParam(name = "viewingType", value = "观看类型 1=疗愈 2=课程", dataType = "Integer", required = true) |
| | | @ApiImplicitParam(name = "id", value = "冥想id", dataType = "Long", required = true), |
| | | @ApiImplicitParam(name = "timeLook", value = "播放时长单位秒", dataType = "Integer", required = true) |
| | | }) |
| | | public R<?> saveViewingRecord(@RequestParam("bizId") Long bizId, |
| | | @RequestParam("viewingType") Integer viewingType) { |
| | | appUserViewingHistoryService.saveViewingRecord(bizId, viewingType); |
| | | public R<?> saveViewingRecord(@RequestParam("id") Long id, |
| | | @RequestParam("timeLook") Integer timeLook) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId == 0)return R.tokenError("登录失效"); |
| | | AppUser byId = appUserService.getById(userId); |
| | | |
| | | AppUserViewingHistory appUserViewingHistory = new AppUserViewingHistory(); |
| | | appUserViewingHistory.setAppUserId(userId); |
| | | appUserViewingHistory.setBizId(id); |
| | | appUserViewingHistory.setViewingType(1); |
| | | appUserViewingHistory.setTimeLook(timeLook); |
| | | appUserViewingHistory.setCreateTime(LocalDateTime.now()); |
| | | appUserViewingHistoryService.save(appUserViewingHistory); |
| | | // 查询用户今日观看了多久冥想 如果达到30分钟 用户能量+10 如果达到60分钟 用户能量额外增加20 |
| | | // 查询用户今日观看疗愈多少秒 |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDateTime startOfDay = now.toLocalDate().atStartOfDay(); |
| | | LocalDateTime endOfDay = now.toLocalDate().atTime(LocalTime.MAX); |
| | | List<AppUserViewingHistory> list = appUserViewingHistoryService |
| | | .lambdaQuery().eq(AppUserViewingHistory::getAppUserId, userId) |
| | | .eq(AppUserViewingHistory::getViewingType, 1) |
| | | .eq(BaseModel::getDelFlag,0) |
| | | .between(AppUserViewingHistory::getCreateTime, startOfDay,endOfDay).list(); |
| | | int temp = 0; |
| | | for (AppUserViewingHistory appUserViewingHistory1 : list) { |
| | | temp += appUserViewingHistory1.getTimeLook(); |
| | | } |
| | | AppUserTree one = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, userId) |
| | | .eq(AppUserTree::getSowAgain,2).one(); |
| | | if (one == null){ |
| | | AppUserTree appUserTree = new AppUserTree(); |
| | | appUserTree.setAppUserId(userId); |
| | | appUserTree.setTreeLevelType(1); |
| | | appUserTree.setGrowthValue(0); |
| | | |
| | | appUserTree.setSowAgain(2); |
| | | appUserTree.setCreateTime(LocalDateTime.now()); |
| | | if (temp>=60){ |
| | | byId.setEnergyValue(byId.getEnergyValue()+30); |
| | | } |
| | | else if (temp>=30){ |
| | | byId.setEnergyValue(byId.getEnergyValue()+10); |
| | | } |
| | | appUserService.updateById(byId); |
| | | appUserTreeService.save(appUserTree); |
| | | }else{ |
| | | if (temp>=60){ |
| | | byId.setEnergyValue(byId.getEnergyValue()+30); |
| | | } |
| | | else if (temp>=30){ |
| | | byId.setEnergyValue(byId.getEnergyValue()+10); |
| | | } |
| | | appUserService.updateById(byId); |
| | | appUserTreeService.updateById(one); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | @PostMapping("/saveCourseStudyHistory") |
| | | @ApiOperation(value = "记录用户观看课程记录", tags = {"用户端-用户相关接口"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "chapterId", value = "章节id", dataType = "Long", required = true), |
| | | @ApiImplicitParam(name = "isOver", value = "是否观看完成 1是2否", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "minuteLook", value = "观看到xx分钟", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "secondLook", value = "观看到xx秒", dataType = "int", required = true), |
| | | }) |
| | | public R<?> saveCourseStudyHistory(@RequestParam("chapterId") Long chapterId, |
| | | @RequestParam("minuteLook") Integer minuteLook, |
| | | @RequestParam("secondLook") Integer secondLook, |
| | | @RequestParam("isOver") Integer isOver |
| | | ) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId == 0)return R.tokenError("登录失效"); |
| | | AppUserViewingHistory one = appUserViewingHistoryService.lambdaQuery() |
| | | .eq(AppUserViewingHistory::getAppUserId, userId) |
| | | .eq(AppUserViewingHistory::getViewingType, 2) |
| | | .eq(AppUserViewingHistory::getChapterId, chapterId).one(); |
| | | if (one!=null){ |
| | | if (one.getIsOver() == 1){ |
| | | // 如果已经看完了 那么不更新状态 只更新观看时间 |
| | | one.setMinuteLook(minuteLook); |
| | | one.setSecondLook(secondLook); |
| | | }else{ |
| | | one.setIsOver(isOver); |
| | | } |
| | | appUserViewingHistoryService.updateById(one); |
| | | }else{ |
| | | AppUserViewingHistory appUserViewingHistory = new AppUserViewingHistory(); |
| | | appUserViewingHistory.setAppUserId(userId); |
| | | appUserViewingHistory.setBizId(chapterId); |
| | | appUserViewingHistory.setViewingType(2); |
| | | appUserViewingHistory.setMinuteLook(minuteLook); |
| | | appUserViewingHistory.setSecondLook(secondLook); |
| | | appUserViewingHistory.setChapterId(chapterId); |
| | | appUserViewingHistory.setIsOver(isOver); |
| | | appUserViewingHistoryService.save(appUserViewingHistory); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | @PostMapping("/getCourseStudyHistory") |
| | | public R<AppUserViewingHistory> getCourseStudyHistory(@RequestParam("chapterId") Long chapterId) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (userId == 0)return R.tokenError("登录失效"); |
| | | AppUserViewingHistory one = appUserViewingHistoryService.lambdaQuery() |
| | | .eq(AppUserViewingHistory::getAppUserId, userId) |
| | | .eq(AppUserViewingHistory::getViewingType, 2) |
| | | .eq(AppUserViewingHistory::getChapterId, chapterId).one(); |
| | | if (one==null){ |
| | | AppUserViewingHistory appUserViewingHistory = new AppUserViewingHistory(); |
| | | appUserViewingHistory.setAppUserId(userId); |
| | | appUserViewingHistory.setBizId(chapterId); |
| | | appUserViewingHistory.setViewingType(2); |
| | | appUserViewingHistory.setMinuteLook(0); |
| | | appUserViewingHistory.setSecondLook(0); |
| | | appUserViewingHistory.setChapterId(chapterId); |
| | | appUserViewingHistory.setIsOver(2); |
| | | appUserViewingHistoryService.save(appUserViewingHistory); |
| | | return R.ok(appUserViewingHistory); |
| | | } |
| | | return R.ok(one); |
| | | } |
| | | |
| | | // @PostMapping("/studyRecord") |
| | | // @ApiOperation(value = "学习页面记录观看到xx分钟xx秒") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(value = "章节id", name = "chapterId", required = true, dataType = "String"), |
| | | // @ApiImplicitParam(value = "上次观看到xx分钟", name = "minuteLook", required = true, dataType = "Integer"), |
| | | // @ApiImplicitParam(value = "上次观看到xx秒", name = "secondLook", required = true, dataType = "Integer"), |
| | | // @ApiImplicitParam(value = "是否观看完成", name = "isOver", required = true, dataType = "Integer"), |
| | | // }) |
| | | // public R studyRecord(@RequestParam(value = "chapterId")Long chapterId, |
| | | // @RequestParam(value = "minuteLook") Integer minuteLook, |
| | | // @RequestParam(value = "secondLook") Integer secondLook, |
| | | // @RequestParam(value = "isOver") Integer isOver |
| | | // ) { |
| | | // Long userId = SecurityUtils.getUserId(); |
| | | // if (userId == 0)return R.tokenError("登录失效"); |
| | | // AppUserViewingHistory one = appUserViewingHistoryService.lambdaQuery() |
| | | // .eq(AppUserViewingHistory::getAppUserId, userId) |
| | | // .eq(AppUserViewingHistory::getViewingType, 2) |
| | | // .eq(AppUserViewingHistory::getChapterId, chapterId).one(); |
| | | // if (one!=null){ |
| | | // if (one.getIsOver() == 1){ |
| | | // // 如果已经看完了 那么不更新状态 只更新观看时间 |
| | | // one.setMinuteLook(minuteLook); |
| | | // one.setSecondLook(secondLook); |
| | | // }else{ |
| | | // one.setIsOver(isOver); |
| | | // } |
| | | // appUserViewingHistoryService.updateById(one); |
| | | // }else{ |
| | | // AppUserViewingHistory appUserViewingHistory = new AppUserViewingHistory(); |
| | | // appUserViewingHistory.setAppUserId(userId); |
| | | // appUserViewingHistory.setBizId(chapterId); |
| | | // appUserViewingHistory.setViewingType(2); |
| | | // appUserViewingHistory.setMinuteLook(minuteLook); |
| | | // appUserViewingHistory.setSecondLook(secondLook); |
| | | // appUserViewingHistory.setChapterId(chapterId); |
| | | // appUserViewingHistory.setIsOver(isOver); |
| | | // appUserViewingHistoryService.save(appUserViewingHistory); |
| | | // } |
| | | // return R.ok(); |
| | | // } |
| | | } |
| | | |
| | |
| | | package com.xinquan.user.controller.client; |
| | | |
| | | |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.system.api.domain.Tag; |
| | | import com.xinquan.user.domain.dto.UserAnswerDTO; |
| | | import com.xinquan.user.service.TagService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/client/tag") |
| | | public class ClientTagController { |
| | | @Resource |
| | | private TagService tagService; |
| | | @PostMapping("/saveUserAnswers") |
| | | @ApiOperation(value = "获取问题二标签列表", tags = {"用户端-计划引导相关接口"}) |
| | | public R<List<Tag>> saveUserAnswers() { |
| | | List<Tag> list = tagService.lambdaQuery().eq(Tag::getTagType, 2).list(); |
| | | |
| | | return R.ok(list); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.xinquan.system.api.model.AppLoginUser; |
| | | import com.xinquan.system.api.model.AppVerifyCellPhoneBody; |
| | | import com.xinquan.system.api.model.AppWXLoginBody; |
| | | import com.xinquan.user.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.user.api.domain.dto.AppUserDTO; |
| | | import com.xinquan.user.service.AppUserService; |
| | | import java.util.Collection; |
New file |
| | |
| | | package com.xinquan.user.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/9/4 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "能量值明细") |
| | | public class EnergyDetailVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -1776068531441762518L; |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "原因") |
| | | private String reason; |
| | | |
| | | @ApiModelProperty(value = "变动类型 1=增加 2=减少") |
| | | private Integer changeType; |
| | | |
| | | @ApiModelProperty(value = "能量值") |
| | | private Integer energy_value; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.xinquan.user.domain.vo; |
| | | |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.system.api.domain.AppUserEnergyRecord; |
| | | import com.xinquan.system.api.domain.vo.AppUserEnergyRecordVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/9/4 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "能量值对象") |
| | | public class EnergyVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -1776068531441762518L; |
| | | |
| | | |
| | | @ApiModelProperty(value = "累计能量值") |
| | | private Integer energyTotal; |
| | | |
| | | @ApiModelProperty(value = "能量值明细") |
| | | private List<AppUserEnergyRecordVO> list; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.xinquan.user.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/9/4 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "奖品兑换记录") |
| | | public class ExchangeRecordVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -1776068531441762518L; |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "奖品名称") |
| | | private String name; |
| | | @ApiModelProperty(value = "封面图") |
| | | private String coverUrl; |
| | | @ApiModelProperty(value = "奖品价值") |
| | | private BigDecimal worth; |
| | | @ApiModelProperty(value = "所需能量值") |
| | | private Integer energyValue; |
| | | @ApiModelProperty(value = "1待领取 2已领取") |
| | | private Integer status; |
| | | |
| | | |
| | | } |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.user.domain.AppUserBank; |
| | | import com.xinquan.system.api.domain.AppUserBank; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.user.domain.AppUserCourse; |
| | | import com.xinquan.system.api.domain.AppUserCourse; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.user.domain.AppUserEnergyRecord; |
| | | import com.xinquan.system.api.domain.AppUserEnergyRecord; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.user.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.user.domain.AppUserMeditation; |
| | | import com.xinquan.system.api.domain.AppUserMeditation; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.xinquan.user.domain.AppUserQuestion; |
| | | import com.xinquan.system.api.domain.AppUserQuestion; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.user.domain.AppUserTag; |
| | | import com.xinquan.system.api.domain.AppUserTag; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.user.domain.AppUserTree; |
| | | import com.xinquan.system.api.domain.AppUserTree; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.user.domain.AppUserViewingHistory; |
| | | import com.xinquan.system.api.domain.AppUserViewingHistory; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface AppUserViewingHistoryMapper extends BaseMapper<AppUserViewingHistory> { |
| | | |
| | | List<AppUserViewingHistory> cumulative(@Param("userId") Long userId); |
| | | |
| | | int today(@Param("userId") Long userId); |
| | | } |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.user.domain.AppUserWalletRecord; |
| | | import com.xinquan.system.api.domain.AppUserWalletRecord; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.user.domain.AppUserWithdraw; |
| | | import com.xinquan.system.api.domain.AppUserWithdraw; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.user.domain.NoticeRecord; |
| | | import com.xinquan.system.api.domain.NoticeRecord; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.user.domain.Prize; |
| | | import com.xinquan.system.api.domain.Prize; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.user.domain.PrizeRedemptionRecord; |
| | | import com.xinquan.system.api.domain.PrizeRedemptionRecord; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xinquan.user.domain.Tag; |
| | | import com.xinquan.system.api.domain.Tag; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.xinquan.user.domain.AppUserBank; |
| | | import com.xinquan.system.api.domain.AppUserBank; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xinquan.user.domain.AppUserCourse; |
| | | import com.xinquan.system.api.domain.AppUserCourse; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xinquan.user.domain.AppUserEnergyRecord; |
| | | import com.xinquan.system.api.domain.AppUserEnergyRecord; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xinquan.user.domain.AppUserMeditation; |
| | | import com.xinquan.system.api.domain.AppUserMeditation; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.xinquan.user.domain.AppUserQuestion; |
| | | import com.xinquan.system.api.domain.AppUserQuestion; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.system.api.model.AppCaptchaBody; |
| | | import com.xinquan.system.api.model.AppLoginUser; |
| | | import com.xinquan.system.api.model.AppVerifyCellPhoneBody; |
| | | import com.xinquan.system.api.model.AppWXLoginBody; |
| | | import com.xinquan.user.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.user.api.domain.dto.AppUserDTO; |
| | | import com.xinquan.user.domain.dto.UserAnswerDTO; |
| | | import com.xinquan.user.domain.vo.AppUserVO; |
| | | import com.xinquan.system.api.domain.vo.AppUserVO; |
| | | import com.xinquan.user.domain.vo.TagVO; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | |
| | | * 获取当前登录用户信息 |
| | | * |
| | | * @return 用户信息 |
| | | * @see com.xinquan.user.domain.vo.AppUserVO |
| | | * @see AppUserVO |
| | | */ |
| | | AppUserVO getCurrentUser(); |
| | | } |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xinquan.user.domain.AppUserTag; |
| | | import com.xinquan.system.api.domain.AppUserTag; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xinquan.user.domain.AppUserTree; |
| | | import com.xinquan.system.api.domain.AppUserTree; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xinquan.user.domain.AppUserViewingHistory; |
| | | import com.xinquan.system.api.domain.AppUserViewingHistory; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param viewingType 观看类型 1=疗愈 2=课程 |
| | | */ |
| | | void saveViewingRecord(Long bizId, Integer viewingType); |
| | | |
| | | List<AppUserViewingHistory> cumulative(Long userId); |
| | | |
| | | int today(Long userId); |
| | | |
| | | } |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xinquan.user.domain.AppUserWalletRecord; |
| | | import com.xinquan.system.api.domain.AppUserWalletRecord; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xinquan.user.domain.AppUserWithdraw; |
| | | import com.xinquan.system.api.domain.AppUserWithdraw; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xinquan.user.domain.NoticeRecord; |
| | | import com.xinquan.system.api.domain.NoticeRecord; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xinquan.user.domain.PrizeRedemptionRecord; |
| | | import com.xinquan.system.api.domain.PrizeRedemptionRecord; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xinquan.user.domain.Prize; |
| | | import com.xinquan.system.api.domain.Prize; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xinquan.user.domain.Tag; |
| | | import com.xinquan.system.api.domain.Tag; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.xinquan.user.service.impl; |
| | | |
| | | import com.xinquan.user.domain.AppUserBank; |
| | | import com.xinquan.system.api.domain.AppUserBank; |
| | | import com.xinquan.user.mapper.AppUserBankMapper; |
| | | import com.xinquan.user.service.AppUserBankService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | package com.xinquan.user.service.impl; |
| | | |
| | | import com.xinquan.user.domain.AppUserCourse; |
| | | import com.xinquan.system.api.domain.AppUserCourse; |
| | | import com.xinquan.user.mapper.AppUserCourseMapper; |
| | | import com.xinquan.user.service.AppUserCourseService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | package com.xinquan.user.service.impl; |
| | | |
| | | import com.xinquan.user.domain.AppUserEnergyRecord; |
| | | import com.xinquan.system.api.domain.AppUserEnergyRecord; |
| | | import com.xinquan.user.mapper.AppUserEnergyRecordMapper; |
| | | import com.xinquan.user.service.AppUserEnergyRecordService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | package com.xinquan.user.service.impl; |
| | | |
| | | import com.xinquan.user.domain.AppUserMeditation; |
| | | import com.xinquan.system.api.domain.AppUserMeditation; |
| | | import com.xinquan.user.mapper.AppUserMeditationMapper; |
| | | import com.xinquan.user.service.AppUserMeditationService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | package com.xinquan.user.service.impl; |
| | | |
| | | import com.xinquan.user.domain.AppUserQuestion; |
| | | import com.xinquan.system.api.domain.AppUserQuestion; |
| | | import com.xinquan.user.mapper.AppUserQuestionMapper; |
| | | import com.xinquan.user.service.AppUserQuestionService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.xinquan.system.api.model.AppLoginUser; |
| | | import com.xinquan.system.api.model.AppVerifyCellPhoneBody; |
| | | import com.xinquan.system.api.model.AppWXLoginBody; |
| | | import com.xinquan.user.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.user.api.domain.dto.AppUserDTO; |
| | | import com.xinquan.user.domain.AppUserQuestion; |
| | | import com.xinquan.user.domain.AppUserTree; |
| | | import com.xinquan.user.domain.Tag; |
| | | import com.xinquan.system.api.domain.AppUserQuestion; |
| | | import com.xinquan.system.api.domain.AppUserTree; |
| | | import com.xinquan.system.api.domain.Tag; |
| | | import com.xinquan.user.domain.dto.UserAnswerDTO; |
| | | import com.xinquan.user.domain.vo.AppUserVO; |
| | | import com.xinquan.system.api.domain.vo.AppUserVO; |
| | | import com.xinquan.user.domain.vo.TagVO; |
| | | import com.xinquan.user.mapper.AppUserMapper; |
| | | import com.xinquan.user.service.AppUserQuestionService; |
| | |
| | | appUserTree.setTreeLevelType(TreeLevelEnum.SEED.getCode()); |
| | | appUserTree.setGrowthValue(0); |
| | | appUserTree.setSowAgain(2); |
| | | appUserTree.setCurrentEnergyValue(0); |
| | | appUserTreeService.save(appUserTree); |
| | | } |
| | | |
| | |
| | | * 获取当前登录用户信息 |
| | | * |
| | | * @return 用户信息 |
| | | * @see com.xinquan.user.domain.vo.AppUserVO |
| | | * @see AppUserVO |
| | | */ |
| | | @Override |
| | | public AppUserVO getCurrentUser() { |
| | |
| | | package com.xinquan.user.service.impl; |
| | | |
| | | import com.xinquan.user.domain.AppUserTag; |
| | | import com.xinquan.system.api.domain.AppUserTag; |
| | | import com.xinquan.user.mapper.AppUserTagMapper; |
| | | import com.xinquan.user.service.AppUserTagService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | package com.xinquan.user.service.impl; |
| | | |
| | | import com.xinquan.user.domain.AppUserTree; |
| | | import com.xinquan.system.api.domain.AppUserTree; |
| | | import com.xinquan.user.mapper.AppUserTreeMapper; |
| | | import com.xinquan.user.service.AppUserTreeService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | package com.xinquan.user.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xinquan.user.domain.AppUserViewingHistory; |
| | | import com.xinquan.system.api.domain.AppUserViewingHistory; |
| | | import com.xinquan.user.mapper.AppUserViewingHistoryMapper; |
| | | import com.xinquan.user.service.AppUserViewingHistoryService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | appUserViewingHistory.setViewingType(viewingType); |
| | | this.save(appUserViewingHistory); |
| | | } |
| | | |
| | | @Override |
| | | public List<AppUserViewingHistory> cumulative(Long userId) { |
| | | return this.baseMapper.cumulative(userId); |
| | | } |
| | | |
| | | @Override |
| | | public int today(Long userId) { |
| | | return this.baseMapper.today(userId); |
| | | } |
| | | } |
| | |
| | | package com.xinquan.user.service.impl; |
| | | |
| | | import com.xinquan.user.domain.AppUserWalletRecord; |
| | | import com.xinquan.system.api.domain.AppUserWalletRecord; |
| | | import com.xinquan.user.mapper.AppUserWalletRecordMapper; |
| | | import com.xinquan.user.service.AppUserWalletRecordService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | package com.xinquan.user.service.impl; |
| | | |
| | | import com.xinquan.user.domain.AppUserWithdraw; |
| | | import com.xinquan.system.api.domain.AppUserWithdraw; |
| | | import com.xinquan.user.mapper.AppUserWithdrawMapper; |
| | | import com.xinquan.user.service.AppUserWithdrawService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | package com.xinquan.user.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xinquan.user.domain.NoticeRecord; |
| | | import com.xinquan.system.api.domain.NoticeRecord; |
| | | import com.xinquan.user.mapper.NoticeRecordMapper; |
| | | import com.xinquan.user.service.NoticeRecordService; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | package com.xinquan.user.service.impl; |
| | | |
| | | import com.xinquan.user.domain.PrizeRedemptionRecord; |
| | | import com.xinquan.system.api.domain.PrizeRedemptionRecord; |
| | | import com.xinquan.user.mapper.PrizeRedemptionRecordMapper; |
| | | import com.xinquan.user.service.PrizeRedemptionRecordService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | package com.xinquan.user.service.impl; |
| | | |
| | | import com.xinquan.user.domain.Prize; |
| | | import com.xinquan.system.api.domain.Prize; |
| | | import com.xinquan.user.mapper.PrizeMapper; |
| | | import com.xinquan.user.service.PrizeService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | package com.xinquan.user.service.impl; |
| | | |
| | | import com.xinquan.user.domain.Tag; |
| | | import com.xinquan.system.api.domain.Tag; |
| | | import com.xinquan.user.mapper.TagMapper; |
| | | import com.xinquan.user.service.TagService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.AppUserBankMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.domain.AppUserBank"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.AppUserBank"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.AppUserCourseMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.domain.AppUserCourse"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.AppUserCourse"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="course_id" property="courseId" /> |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.AppUserEnergyRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.domain.AppUserEnergyRecord"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.AppUserEnergyRecord"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.AppUserMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.api.domain.AppUser"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.AppUser"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.AppUserMeditationMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.domain.AppUserMeditation"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.AppUserMeditation"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="meditation_id" property="meditationId" /> |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.AppUserQuestionMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.domain.AppUserQuestion"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.AppUserQuestion"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.AppUserTagMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.domain.AppUserTag"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.AppUserTag"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="tag_id" property="tagId" /> |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.AppUserTreeMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.domain.AppUserTree"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.AppUserTree"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.AppUserViewingHistoryMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.domain.AppUserViewingHistory"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.AppUserViewingHistory"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | update_time, |
| | | id, app_user_id, biz_id, viewing_type |
| | | </sql> |
| | | <select id="cumulative" resultType="com.xinquan.system.api.domain.AppUserViewingHistory"> |
| | | SELECT |
| | | app_user_id, |
| | | DATE(create_time) AS view_date |
| | | FROM |
| | | t_app_user_viewing_history |
| | | WHERE |
| | | app_user_id = #{userId} |
| | | viewing_type = 1 |
| | | AND del_flag = 0 |
| | | GROUP BY |
| | | app_user_id, |
| | | DATE(create_time) |
| | | </select> |
| | | <select id="today" resultType="java.lang.Integer"> |
| | | SELECT |
| | | SUM(timeLook) |
| | | FROM |
| | | t_app_user_viewing_history |
| | | WHERE |
| | | app_user_id = #{userId} |
| | | AND viewing_type = 1 |
| | | |
| | | AND DATE(create_time) = CURDATE() |
| | | GROUP BY |
| | | app_user_id; |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.AppUserWalletRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.domain.AppUserWalletRecord"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.AppUserWalletRecord"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.AppUserWithdrawMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.domain.AppUserWithdraw"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.AppUserWithdraw"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.NoticeRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.domain.NoticeRecord"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.NoticeRecord"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.PrizeMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.domain.Prize"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.Prize"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.PrizeRedemptionRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.domain.PrizeRedemptionRecord"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.PrizeRedemptionRecord"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | <mapper namespace="com.xinquan.user.mapper.TagMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.user.domain.Tag"> |
| | | <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.Tag"> |
| | | <id column="id" property="id" /> |
| | | <id column="tag_type" property="tagType"/> |
| | | <result column="del_flag" property="delFlag" /> |