16 | * 会员表 17 | *
18 | * 19 | * @author HAN 20 | * @since 2021-04-15 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @ApiModel(value="UcenterMember对象", description="会员表") 25 | public class UcenterMemberCommon implements Serializable { 26 | 27 | private static final long serialVersionUID = 1L; 28 | 29 | @ApiModelProperty(value = "会员id") 30 | @TableId(value = "id", type = IdType.ASSIGN_ID) 31 | @JsonSerialize(using = ToStringSerializer.class) 32 | private String id; 33 | 34 | @ApiModelProperty(value = "微信openid") 35 | private String openid; 36 | 37 | @ApiModelProperty(value = "邮箱号") 38 | private String email; 39 | 40 | @ApiModelProperty(value = "密码") 41 | private String password; 42 | 43 | @ApiModelProperty(value = "昵称") 44 | private String nickname; 45 | 46 | @ApiModelProperty(value = "性别 0 女,1 男") 47 | private Integer sex; 48 | 49 | @ApiModelProperty(value = "年龄") 50 | private Integer age; 51 | 52 | @ApiModelProperty(value = "用户头像") 53 | private String avatar; 54 | 55 | @ApiModelProperty(value = "用户签名") 56 | private String sign; 57 | 58 | @ApiModelProperty(value = "是否禁用 1(true)已禁用, 0(false)未禁用") 59 | private Boolean isDisabled; 60 | 61 | @ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除") 62 | @TableLogic 63 | private Boolean isDeleted; 64 | 65 | @ApiModelProperty(value = "创建时间") 66 | @TableField(fill = FieldFill.INSERT) 67 | private LocalDateTime gmtCreate; 68 | 69 | @ApiModelProperty(value = "更新时间") 70 | @TableField(fill = FieldFill.INSERT_UPDATE) 71 | private LocalDateTime gmtModified; 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /common/service_base/src/main/java/com/github/servicebase/exception/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.github.servicebase.exception; 2 | 3 | import com.github.utils.ResultCommon; 4 | import io.seata.core.context.RootContext; 5 | import io.seata.core.exception.TransactionException; 6 | import io.seata.tm.api.GlobalTransactionContext; 7 | import org.springframework.util.ObjectUtils; 8 | import org.springframework.web.bind.annotation.ControllerAdvice; 9 | import org.springframework.web.bind.annotation.ExceptionHandler; 10 | import org.springframework.web.bind.annotation.ResponseBody; 11 | 12 | /** 13 | * @author HAN 14 | * @version 1.0 15 | * @create 2021/4/5 16 | */ 17 | @ControllerAdvice 18 | public class GlobalExceptionHandler { 19 | 20 | /** 21 | * 处理全局异常 22 | */ 23 | @ResponseBody 24 | @ExceptionHandler(Exception.class) 25 | public ResultCommon error(Exception e) { 26 | e.printStackTrace(); 27 | try { 28 | // 回滚分布式事务 29 | if (!ObjectUtils.isEmpty(RootContext.getXID())) { 30 | GlobalTransactionContext.reload(RootContext.getXID()).rollback(); 31 | } 32 | } catch (TransactionException transactionException) { 33 | transactionException.printStackTrace(); 34 | } 35 | return ResultCommon.fail().setMessage("发生了错误"); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /common/service_base/src/main/java/com/github/servicebase/handler/TheMetaObjectHandler.java: -------------------------------------------------------------------------------- 1 | package com.github.servicebase.handler; 2 | 3 | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; 4 | import org.apache.ibatis.reflection.MetaObject; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.time.LocalDateTime; 8 | 9 | /** 10 | * @author HAN 11 | * @version 1.0 12 | * @create 2021/4/5 13 | */ 14 | @Component 15 | public class TheMetaObjectHandler implements MetaObjectHandler { 16 | @Override 17 | public void insertFill(MetaObject metaObject) { 18 | this.strictInsertFill(metaObject, "gmtCreate", LocalDateTime.class, LocalDateTime.now()); 19 | this.strictInsertFill(metaObject, "gmtModified", LocalDateTime.class, LocalDateTime.now()); 20 | } 21 | 22 | @Override 23 | public void updateFill(MetaObject metaObject) { 24 | this.strictInsertFill(metaObject, "gmtModified", LocalDateTime.class, LocalDateTime.now()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /common/spring_security/pom.xml: -------------------------------------------------------------------------------- 1 | 2 |16 | * 用户表 17 | *
18 | * 19 | * @author HAN 20 | * @since 2021-04-22 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @TableName("acl_user") 25 | @ApiModel(value="User对象", description="用户表") 26 | public class User implements Serializable { 27 | 28 | private static final long serialVersionUID = 1L; 29 | 30 | @ApiModelProperty(value = "会员id") 31 | @TableId(value = "id", type = IdType.ASSIGN_ID) 32 | @JsonSerialize(using = ToStringSerializer.class) 33 | private Long id; 34 | 35 | @ApiModelProperty(value = "用户名") 36 | private String username; 37 | 38 | @ApiModelProperty(value = "密码") 39 | private String password; 40 | 41 | @ApiModelProperty(value = "昵称") 42 | private String nickName; 43 | 44 | @ApiModelProperty(value = "用户头像") 45 | private String avatar; 46 | 47 | @ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除") 48 | @TableLogic 49 | private Integer isDeleted; 50 | 51 | @ApiModelProperty(value = "创建时间") 52 | @TableField(fill = FieldFill.INSERT) 53 | private LocalDateTime gmtCreate; 54 | 55 | @ApiModelProperty(value = "更新时间") 56 | @TableField(fill = FieldFill.INSERT_UPDATE) 57 | private LocalDateTime gmtModified; 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /common/spring_security/src/main/java/com/github/security/handler/DefaultPasswordEncoder.java: -------------------------------------------------------------------------------- 1 | package com.github.security.handler; 2 | 3 | import cn.hutool.crypto.SecureUtil; 4 | import org.springframework.security.crypto.password.PasswordEncoder; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.util.Objects; 8 | 9 | /** 10 | * @author HAN 11 | * @version 1.0 12 | * @create 04-24-0:05 13 | */ 14 | @Component 15 | public class DefaultPasswordEncoder implements PasswordEncoder { 16 | 17 | /** 18 | * 对密码进行md5加密 19 | * @param rawPassword 密码 20 | * @return 加密后的密码 21 | */ 22 | @Override 23 | public String encode(CharSequence rawPassword) { 24 | return SecureUtil.md5(rawPassword.toString()); 25 | } 26 | 27 | /** 28 | * 进行密码比对 29 | * @param rawPassword 传入的密码 30 | * @param encodedPassword 加密后的密码 31 | * @return true 密码一致 32 | */ 33 | @Override 34 | public boolean matches(CharSequence rawPassword, String encodedPassword) { 35 | return Objects.equals(SecureUtil.md5(rawPassword.toString()), encodedPassword); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /common/spring_security/src/main/java/com/github/security/handler/TokenLogoutHandler.java: -------------------------------------------------------------------------------- 1 | package com.github.security.handler; 2 | 3 | import com.github.utils.JwtUtils; 4 | import com.github.utils.ResponseUtil; 5 | import com.github.utils.ResultCommon; 6 | import org.springframework.data.redis.core.RedisTemplate; 7 | import org.springframework.security.core.Authentication; 8 | import org.springframework.security.web.authentication.logout.LogoutHandler; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | 13 | /** 14 | * @author HAN 15 | * @version 1.0 16 | * @create 04-24-0:17 17 | */ 18 | public class TokenLogoutHandler implements LogoutHandler { 19 | 20 | private RedisTemplate17 | * 权限 18 | *
19 | * 20 | * @author HAN 21 | * @since 2021-04-22 22 | */ 23 | @Data 24 | @EqualsAndHashCode(callSuper = false) 25 | @TableName("acl_permission") 26 | @ApiModel(value="Permission对象", description="权限") 27 | public class Permission implements Serializable { 28 | 29 | private static final long serialVersionUID = 1L; 30 | 31 | @ApiModelProperty(value = "编号") 32 | @TableId(value = "id", type = IdType.ASSIGN_ID) 33 | @JsonSerialize(using = ToStringSerializer.class) 34 | private Long id; 35 | 36 | @ApiModelProperty(value = "所属上级") 37 | @JsonSerialize(using = ToStringSerializer.class) 38 | private Long pid; 39 | 40 | @ApiModelProperty("层级") 41 | @TableField(exist = false) 42 | private Integer level; 43 | 44 | @ApiModelProperty("下级") 45 | @TableField(exist = false) 46 | private List16 | * 17 | *
18 | * 19 | * @author HAN 20 | * @since 2021-04-22 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @TableName("acl_role") 25 | @ApiModel(value="Role对象", description="") 26 | public class Role implements Serializable { 27 | 28 | private static final long serialVersionUID = 1L; 29 | 30 | @ApiModelProperty(value = "角色id") 31 | @TableId(value = "id", type = IdType.ASSIGN_ID) 32 | @JsonSerialize(using = ToStringSerializer.class) 33 | private Long id; 34 | 35 | @ApiModelProperty(value = "角色名称") 36 | private String roleName; 37 | 38 | @ApiModelProperty(value = "角色编码") 39 | private String roleCode; 40 | 41 | @ApiModelProperty(value = "备注") 42 | private String remark; 43 | 44 | @ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除") 45 | @TableLogic 46 | private Integer isDeleted; 47 | 48 | @ApiModelProperty(value = "创建时间") 49 | @TableField(fill = FieldFill.INSERT) 50 | private LocalDateTime gmtCreate; 51 | 52 | @ApiModelProperty(value = "更新时间") 53 | @TableField(fill = FieldFill.INSERT_UPDATE) 54 | private LocalDateTime gmtModified; 55 | 56 | 57 | } 58 | -------------------------------------------------------------------------------- /service/service_acl8008/src/main/java/com/github/acl/entity/RolePermission.java: -------------------------------------------------------------------------------- 1 | package com.github.acl.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | 11 | import java.io.Serializable; 12 | import java.time.LocalDateTime; 13 | 14 | /** 15 | *16 | * 角色权限 17 | *
18 | * 19 | * @author HAN 20 | * @since 2021-04-22 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @TableName("acl_role_permission") 25 | @ApiModel(value="RolePermission对象", description="角色权限") 26 | public class RolePermission implements Serializable { 27 | 28 | private static final long serialVersionUID = 1L; 29 | 30 | @TableId(value = "id", type = IdType.ASSIGN_ID) 31 | @JsonSerialize(using = ToStringSerializer.class) 32 | private Long id; 33 | 34 | @JsonSerialize(using = ToStringSerializer.class) 35 | private Long roleId; 36 | 37 | @JsonSerialize(using = ToStringSerializer.class) 38 | private Long permissionId; 39 | 40 | @ApiModelProperty(value = "创建时间") 41 | @TableField(fill = FieldFill.INSERT) 42 | private LocalDateTime gmtCreate; 43 | 44 | @ApiModelProperty(value = "更新时间") 45 | @TableField(fill = FieldFill.INSERT_UPDATE) 46 | private LocalDateTime gmtModified; 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /service/service_acl8008/src/main/java/com/github/acl/entity/UserRole.java: -------------------------------------------------------------------------------- 1 | package com.github.acl.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | 11 | import java.io.Serializable; 12 | import java.time.LocalDateTime; 13 | 14 | /** 15 | *16 | * 17 | *
18 | * 19 | * @author HAN 20 | * @since 2021-04-22 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @TableName("acl_user_role") 25 | @ApiModel(value="UserRole对象", description="") 26 | public class UserRole implements Serializable { 27 | 28 | private static final long serialVersionUID = 1L; 29 | 30 | @ApiModelProperty(value = "主键id") 31 | @TableId(value = "id", type = IdType.ASSIGN_ID) 32 | @JsonSerialize(using = ToStringSerializer.class) 33 | private Long id; 34 | 35 | @ApiModelProperty(value = "角色id") 36 | @JsonSerialize(using = ToStringSerializer.class) 37 | private Long roleId; 38 | 39 | @ApiModelProperty(value = "用户id") 40 | @JsonSerialize(using = ToStringSerializer.class) 41 | private Long userId; 42 | 43 | @ApiModelProperty(value = "创建时间") 44 | @TableField(fill = FieldFill.INSERT) 45 | private LocalDateTime gmtCreate; 46 | 47 | @ApiModelProperty(value = "更新时间") 48 | @TableField(fill = FieldFill.INSERT_UPDATE) 49 | private LocalDateTime gmtModified; 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /service/service_acl8008/src/main/java/com/github/acl/mapper/PermissionMapper.java: -------------------------------------------------------------------------------- 1 | package com.github.acl.mapper; 2 | 3 | import com.github.acl.entity.Permission; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.github.servicebase.cache.MybatisRedisCacheConfig; 6 | import org.apache.ibatis.annotations.CacheNamespace; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *12 | * 权限 Mapper 接口 13 | *
14 | * 15 | * @author HAN 16 | * @since 2021-04-22 17 | */ 18 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 19 | public interface PermissionMapper extends BaseMapper11 | * Mapper 接口 12 | *
13 | * 14 | * @author HAN 15 | * @since 2021-04-22 16 | */ 17 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 18 | public interface RoleMapper extends BaseMapper10 | * 角色权限 Mapper 接口 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-04-22 15 | */ 16 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 17 | public interface RolePermissionMapper extends BaseMapper10 | * 用户表 Mapper 接口 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-04-22 15 | */ 16 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 17 | public interface UserMapper extends BaseMapper11 | * Mapper 接口 12 | *
13 | * 14 | * @author HAN 15 | * @since 2021-04-22 16 | */ 17 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 18 | public interface UserRoleMapper extends BaseMapper16 | * 会员表 17 | *
18 | * 19 | * @author HAN 20 | * @since 2021-04-15 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @ApiModel(value="UcenterMember对象", description="会员表") 25 | public class UcenterMember implements Serializable { 26 | 27 | private static final long serialVersionUID = 1L; 28 | 29 | @ApiModelProperty(value = "会员id") 30 | @TableId(value = "id", type = IdType.ASSIGN_ID) 31 | @JsonSerialize(using = ToStringSerializer.class) 32 | private String id; 33 | 34 | @ApiModelProperty(value = "openid") 35 | private String openid; 36 | 37 | @ApiModelProperty(value = "邮箱号") 38 | private String email; 39 | 40 | @ApiModelProperty(value = "密码") 41 | private String password; 42 | 43 | @ApiModelProperty(value = "昵称") 44 | private String nickname; 45 | 46 | @ApiModelProperty(value = "性别 0 女,1 男") 47 | private Integer sex; 48 | 49 | @ApiModelProperty(value = "年龄") 50 | private Integer age; 51 | 52 | @ApiModelProperty(value = "用户头像") 53 | private String avatar; 54 | 55 | @ApiModelProperty(value = "用户签名") 56 | private String sign; 57 | 58 | @ApiModelProperty(value = "是否禁用 1(true)已禁用, 0(false)未禁用") 59 | private Boolean isDisabled; 60 | 61 | @ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除") 62 | @TableLogic 63 | private Boolean isDeleted; 64 | 65 | @ApiModelProperty(value = "创建时间") 66 | @TableField(fill = FieldFill.INSERT) 67 | private LocalDateTime gmtCreate; 68 | 69 | @ApiModelProperty(value = "更新时间") 70 | @TableField(fill = FieldFill.INSERT_UPDATE) 71 | private LocalDateTime gmtModified; 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /service/service_center8005/src/main/java/com/github/center/mapper/EmailMapper.java: -------------------------------------------------------------------------------- 1 | package com.github.center.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.github.center.thirdparty.Email; 5 | 6 | /** 7 | * @author HAN 8 | * @version 1.0 9 | * @create 04-21-16:02 10 | */ 11 | public interface EmailMapper extends BaseMapper10 | * 会员表 Mapper 接口 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-04-15 15 | */ 16 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 17 | public interface UcenterMemberMapper extends BaseMapper16 | * 首页banner表 17 | *
18 | * 19 | * @author HAN 20 | * @since 2021-04-13 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @ApiModel(value="CrmBanner对象", description="首页banner表") 25 | public class CrmBanner implements Serializable { 26 | 27 | private static final long serialVersionUID = 1L; 28 | 29 | @ApiModelProperty(value = "ID") 30 | @TableId(value = "id", type = IdType.ASSIGN_ID) 31 | @JsonSerialize(using = ToStringSerializer.class) 32 | private Long id; 33 | 34 | @ApiModelProperty(value = "标题") 35 | private String title; 36 | 37 | @ApiModelProperty(value = "图片地址") 38 | private String imageUrl; 39 | 40 | @ApiModelProperty(value = "链接地址") 41 | private String linkUrl; 42 | 43 | @ApiModelProperty(value = "排序") 44 | private Integer sort; 45 | 46 | @ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除") 47 | @TableLogic 48 | private Integer isDeleted; 49 | 50 | @ApiModelProperty(value = "创建时间") 51 | @TableField(fill = FieldFill.INSERT) 52 | private LocalDateTime gmtCreate; 53 | 54 | @ApiModelProperty(value = "更新时间") 55 | @TableField(fill = FieldFill.INSERT_UPDATE) 56 | private LocalDateTime gmtModified; 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /service/service_cms8004/src/main/java/com/github/cms/mapper/CrmBannerMapper.java: -------------------------------------------------------------------------------- 1 | package com.github.cms.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.github.cms.entity.CrmBanner; 5 | import com.github.servicebase.cache.MybatisRedisCacheConfig; 6 | import org.apache.ibatis.annotations.CacheNamespace; 7 | 8 | /** 9 | *10 | * 首页banner表 Mapper 接口 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-04-13 15 | */ 16 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 17 | public interface CrmBannerMapper extends BaseMapper10 | * 首页banner表 服务实现类 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-04-13 15 | */ 16 | @Service 17 | public class CrmBannerService extends ServiceImpl16 | * 评论 前端控制器 17 | *
18 | * 19 | * @author HAN 20 | * @since 2021-05-01 21 | */ 22 | @RestController 23 | @RequestMapping("/eduservice/edu-comment") 24 | @Api(tags = "评论功能") 25 | public class EduCommentController { 26 | 27 | @Autowired 28 | private EduCommentService eduCommentService; 29 | 30 | /** 31 | * 获取评论信息 32 | * @param courseId 课程id 33 | */ 34 | @GetMapping("{courseId}") 35 | @ApiOperation("获取评论") 36 | public ResultCommon getComment(@PathVariable("courseId") Long courseId) { 37 | List17 | * 课程科目 前端控制器 18 | *
19 | * 20 | * @author HAN 21 | * @since 2021-04-08 22 | */ 23 | @RestController 24 | @RequestMapping("/eduservice/subject") 25 | //@CrossOrigin 26 | @Api("课程分类") 27 | public class EduSubjectController { 28 | 29 | @Autowired 30 | private EduSubjectService eduSubjectService; 31 | 32 | /** 33 | * 获取课程分类 34 | * 获取上传过来的文件,把文件内容读取出来 35 | * @param file excel文件 36 | */ 37 | @PostMapping 38 | @ApiOperation("从excel文件中获取课程分类") 39 | public ResultCommon saveSubject(@RequestPart("file") MultipartFile file) { 40 | 41 | eduSubjectService.saveSubject(file); 42 | 43 | return ResultCommon.success(); 44 | } 45 | 46 | /** 47 | * 课程分类的树形结构 48 | */ 49 | @GetMapping 50 | @ApiOperation("递归获取课程分类信息") 51 | public ResultCommon getSubject() { 52 | 53 | List13 | * 课程视频 前端控制器 14 | *
15 | * 16 | * @author HAN 17 | * @since 2021-04-09 18 | */ 19 | @RestController 20 | @RequestMapping("/eduservice/video") 21 | public class EduVideoController { 22 | 23 | @Autowired 24 | private EduVideoService eduVideoService; 25 | 26 | /** 27 | * 根据id获取小节 28 | * 29 | */ 30 | @GetMapping("{id}") 31 | @ApiOperation("根据id获取小节") 32 | public ResultCommon getVideoById(@PathVariable("id") Long id) { 33 | EduVideo eduVideo = eduVideoService.getById(id); 34 | 35 | return ResultCommon.success().setData("items", eduVideo); 36 | } 37 | 38 | /** 39 | * 添加小节 40 | * 41 | * @param eduVideo 小节信息 42 | */ 43 | @PostMapping 44 | @ApiOperation("添加小节") 45 | public ResultCommon saveVideo(@RequestBody EduVideo eduVideo) { 46 | eduVideoService.save(eduVideo); 47 | 48 | return ResultCommon.success(); 49 | } 50 | 51 | /** 52 | * 删除小节 53 | * 54 | * @param id 小节id 55 | */ 56 | @DeleteMapping("{id}") 57 | @ApiOperation("删除小节") 58 | public ResultCommon deleteVideo(@PathVariable("id") Long id) { 59 | eduVideoService.removeVideo(id); 60 | 61 | return ResultCommon.success(); 62 | } 63 | 64 | /** 65 | * 更新小节 66 | */ 67 | @PutMapping 68 | @ApiOperation("更新小节") 69 | public ResultCommon updateVideo(@RequestBody EduVideo eduVideo) { 70 | eduVideoService.updateById(eduVideo); 71 | 72 | return ResultCommon.success(); 73 | } 74 | } 75 | 76 | -------------------------------------------------------------------------------- /service/service_edu8001/src/main/java/com/github/eduservice/controller/FrontTeacherController.java: -------------------------------------------------------------------------------- 1 | package com.github.eduservice.controller; 2 | 3 | import com.github.eduservice.entity.EduCourse; 4 | import com.github.eduservice.entity.EduTeacher; 5 | import com.github.eduservice.service.EduCourseService; 6 | import com.github.eduservice.service.EduTeacherService; 7 | import com.github.utils.ResultCommon; 8 | import io.swagger.annotations.Api; 9 | import io.swagger.annotations.ApiOperation; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * @author HAN 17 | * @version 1.0 18 | * @create 04-17-15:59 19 | */ 20 | @RestController 21 | //@CrossOrigin 22 | @RequestMapping("/eduservice/front-teacher") 23 | @Api("查询前台教师内容") 24 | public class FrontTeacherController { 25 | 26 | @Autowired 27 | private EduTeacherService eduTeacherService; 28 | 29 | @Autowired 30 | private EduCourseService eduCourseService; 31 | 32 | /** 33 | * 根据id查询教师和教师负责的课程 34 | * 35 | * @param id 教师id 36 | */ 37 | @GetMapping("{id}") 38 | @ApiOperation("查询教师信息以及负责的课程信息") 39 | public ResultCommon getTeacherCourse(@PathVariable("id") Long id) { 40 | 41 | // 查询教师信息 42 | EduTeacher eduTeacher = eduTeacherService.getById(id); 43 | 44 | // 查询课程信息 45 | List19 | * 课程 20 | *
21 | * 22 | * @author HAN 23 | * @since 2021-04-09 24 | */ 25 | @Data 26 | @EqualsAndHashCode(callSuper = false) 27 | @ApiModel(value="EduChapter对象", description="课程") 28 | public class EduChapter implements Serializable { 29 | 30 | private static final long serialVersionUID = 1L; 31 | 32 | @ApiModelProperty(value = "章节ID") 33 | @TableId(value = "id", type = IdType.ASSIGN_ID) 34 | @JsonSerialize(using = ToStringSerializer.class) 35 | private Long id; 36 | 37 | @ApiModelProperty(value = "课程ID") 38 | @JsonSerialize(using = ToStringSerializer.class) 39 | private Long courseId; 40 | 41 | @ApiModelProperty(value = "章节名称") 42 | private String title; 43 | 44 | @ApiModelProperty(value = "显示排序") 45 | private Integer sort; 46 | 47 | @ApiModelProperty(value = "创建时间") 48 | @TableField(fill = FieldFill.INSERT) 49 | @JsonSerialize(using = ToStringSerializer.class) 50 | private LocalDateTime gmtCreate; 51 | 52 | @ApiModelProperty(value = "更新时间") 53 | @TableField(fill = FieldFill.INSERT_UPDATE) 54 | @JsonSerialize(using = ToStringSerializer.class) 55 | private LocalDateTime gmtModified; 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /service/service_edu8001/src/main/java/com/github/eduservice/entity/EduComment.java: -------------------------------------------------------------------------------- 1 | package com.github.eduservice.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | 11 | import java.io.Serializable; 12 | import java.time.LocalDateTime; 13 | import java.util.List; 14 | 15 | /** 16 | *17 | * 评论 18 | *
19 | * 20 | * @author HAN 21 | * @since 2021-05-01 22 | */ 23 | @Data 24 | @EqualsAndHashCode(callSuper = false) 25 | @ApiModel(value="EduComment对象", description="评论") 26 | public class EduComment implements Serializable { 27 | 28 | private static final long serialVersionUID = 1L; 29 | 30 | @ApiModelProperty(value = "id") 31 | @TableId(value = "id", type = IdType.ASSIGN_ID) 32 | @JsonSerialize(using = ToStringSerializer.class) 33 | private Long id; 34 | 35 | @ApiModelProperty(value = "课程id") 36 | private String courseId; 37 | 38 | @ApiModelProperty(value = "父id(回复)") 39 | @JsonSerialize(using = ToStringSerializer.class) 40 | private Long parentId; 41 | 42 | @ApiModelProperty(value = "用户id") 43 | private String memberId; 44 | 45 | @ApiModelProperty(value = "用户昵称") 46 | private String nickname; 47 | 48 | @ApiModelProperty(value = "用户头像") 49 | private String avatar; 50 | 51 | @ApiModelProperty(value = "评论内容") 52 | private String content; 53 | 54 | @ApiModelProperty("子级信息") 55 | @TableField(exist = false) 56 | private List19 | * 课程简介 20 | *
21 | * 22 | * @author HAN 23 | * @since 2021-04-09 24 | */ 25 | @Data 26 | @EqualsAndHashCode(callSuper = false) 27 | @ApiModel(value="EduCourseDescription对象", description="课程简介") 28 | public class EduCourseDescription implements Serializable { 29 | 30 | private static final long serialVersionUID = 1L; 31 | 32 | @ApiModelProperty(value = "课程ID") 33 | @TableId(value = "id", type = IdType.INPUT) 34 | @JsonSerialize(using = ToStringSerializer.class) 35 | private Long id; 36 | 37 | @ApiModelProperty(value = "课程简介") 38 | private String description; 39 | 40 | @ApiModelProperty(value = "创建时间") 41 | @TableField(fill = FieldFill.INSERT) 42 | private LocalDateTime gmtCreate; 43 | 44 | @ApiModelProperty(value = "更新时间") 45 | @TableField(fill = FieldFill.INSERT_UPDATE) 46 | private LocalDateTime gmtModified; 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /service/service_edu8001/src/main/java/com/github/eduservice/entity/EduSubject.java: -------------------------------------------------------------------------------- 1 | package com.github.eduservice.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.IdType; 5 | import com.baomidou.mybatisplus.annotation.TableField; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | import com.fasterxml.jackson.annotation.JsonFormat; 8 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 9 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | import lombok.EqualsAndHashCode; 14 | 15 | import java.io.Serializable; 16 | import java.time.LocalDateTime; 17 | 18 | /** 19 | *20 | * 课程科目 21 | *
22 | * 23 | * @author HAN 24 | * @since 2021-04-08 25 | */ 26 | @Data 27 | @EqualsAndHashCode(callSuper = false) 28 | @ApiModel(value="EduSubject对象", description="课程科目") 29 | public class EduSubject implements Serializable { 30 | 31 | private static final long serialVersionUID = 1L; 32 | 33 | @ApiModelProperty(value = "课程类别ID") 34 | @TableId(value = "id", type = IdType.ASSIGN_ID) 35 | @JsonSerialize(using = ToStringSerializer.class) 36 | private Long id; 37 | 38 | @ApiModelProperty(value = "类别名称") 39 | private String title; 40 | 41 | @ApiModelProperty(value = "父ID") 42 | private Long parentId; 43 | 44 | @ApiModelProperty(value = "排序字段") 45 | private Integer sort; 46 | 47 | @ApiModelProperty(value = "创建时间") 48 | @TableField(fill = FieldFill.INSERT) 49 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+9") 50 | private LocalDateTime gmtCreate; 51 | 52 | @TableField(fill = FieldFill.INSERT_UPDATE) 53 | @ApiModelProperty(value = "更新时间") 54 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+9") 55 | private LocalDateTime gmtModified; 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /service/service_edu8001/src/main/java/com/github/eduservice/entity/EduTeacher.java: -------------------------------------------------------------------------------- 1 | package com.github.eduservice.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import com.fasterxml.jackson.annotation.JsonFormat; 5 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 6 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 7 | import io.swagger.annotations.ApiModel; 8 | import io.swagger.annotations.ApiModelProperty; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | 12 | import java.io.Serializable; 13 | import java.time.LocalDateTime; 14 | 15 | /** 16 | *17 | * 讲师 18 | *
19 | * 20 | * @author HAN 21 | * @since 2021-04-04 22 | */ 23 | @Data 24 | @EqualsAndHashCode(callSuper = false) 25 | @ApiModel(value="EduTeacher对象", description="讲师") 26 | public class EduTeacher implements Serializable { 27 | 28 | private static final long serialVersionUID = 1L; 29 | 30 | @ApiModelProperty(value = "讲师ID") 31 | @TableId(value = "id", type = IdType.ASSIGN_ID) 32 | @JsonSerialize(using = ToStringSerializer.class) // 解决雪花算法js精度不足问题 33 | private Long id; 34 | 35 | @ApiModelProperty(value = "讲师姓名") 36 | private String name; 37 | 38 | @ApiModelProperty(value = "讲师简介") 39 | private String intro; 40 | 41 | @ApiModelProperty(value = "讲师资历,一句话说明讲师") 42 | private String career; 43 | 44 | @ApiModelProperty(value = "头衔 1高级讲师 2首席讲师") 45 | private Integer level; 46 | 47 | @ApiModelProperty(value = "讲师头像") 48 | private String avatar; 49 | 50 | @ApiModelProperty(value = "排序") 51 | private Integer sort; 52 | 53 | @ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除") 54 | @TableLogic 55 | private Integer isDeleted; 56 | 57 | @ApiModelProperty(value = "创建时间") 58 | @TableField(fill = FieldFill.INSERT) 59 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+9") 60 | private LocalDateTime gmtCreate; 61 | 62 | @ApiModelProperty(value = "更新时间") 63 | @TableField(fill = FieldFill.INSERT_UPDATE) 64 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+9") 65 | private LocalDateTime gmtModified; 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /service/service_edu8001/src/main/java/com/github/eduservice/entity/EduVideo.java: -------------------------------------------------------------------------------- 1 | package com.github.eduservice.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | 11 | import java.io.Serializable; 12 | import java.time.LocalDateTime; 13 | 14 | /** 15 | *16 | * 课程视频 17 | *
18 | * 19 | * @author HAN 20 | * @since 2021-04-09 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @ApiModel(value="EduVideo对象", description="课程视频") 25 | public class EduVideo implements Serializable { 26 | 27 | private static final long serialVersionUID = 1L; 28 | 29 | @ApiModelProperty(value = "视频ID") 30 | @TableId(value = "id", type = IdType.ASSIGN_ID) 31 | @JsonSerialize(using = ToStringSerializer.class) 32 | private Long id; 33 | 34 | @ApiModelProperty(value = "课程ID") 35 | @JsonSerialize(using = ToStringSerializer.class) 36 | private Long courseId; 37 | 38 | @ApiModelProperty(value = "章节ID") 39 | @JsonSerialize(using = ToStringSerializer.class) 40 | private Long chapterId; 41 | 42 | @ApiModelProperty(value = "节点名称") 43 | private String title; 44 | 45 | @ApiModelProperty(value = "云端视频资源") 46 | private String videoSourceId; 47 | 48 | @ApiModelProperty(value = "原始文件名称") 49 | private String videoOriginalName; 50 | 51 | @ApiModelProperty(value = "排序字段") 52 | private Integer sort; 53 | 54 | @ApiModelProperty(value = "播放次数") 55 | private Long playCount; 56 | 57 | @ApiModelProperty(value = "是否可以试听:0收费 1免费") 58 | private Integer isFree; 59 | 60 | @ApiModelProperty(value = "视频时长(秒)") 61 | private Float duration; 62 | 63 | @ApiModelProperty(value = "Empty未上传 Transcoding转码中 Normal正常") 64 | private String status; 65 | 66 | @ApiModelProperty(value = "视频源文件大小(字节)") 67 | private Long size; 68 | 69 | @ApiModelProperty(value = "乐观锁") 70 | @Version 71 | private Long version; 72 | 73 | @ApiModelProperty(value = "创建时间") 74 | @TableField(fill = FieldFill.INSERT) 75 | private LocalDateTime gmtCreate; 76 | 77 | @ApiModelProperty(value = "更新时间") 78 | @TableField(fill = FieldFill.INSERT_UPDATE) 79 | private LocalDateTime gmtModified; 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /service/service_edu8001/src/main/java/com/github/eduservice/entity/chapter/Chapter.java: -------------------------------------------------------------------------------- 1 | package com.github.eduservice.entity.chapter; 2 | 3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author HAN 13 | * @version 1.0 14 | * @create 2021/4/10 15 | */ 16 | @Data 17 | @AllArgsConstructor 18 | @NoArgsConstructor 19 | public class Chapter { 20 | 21 | @JsonSerialize(using = ToStringSerializer.class) 22 | private Long id; 23 | 24 | private String title; 25 | 26 | private String videoSourceId; 27 | 28 | private Integer isFree; 29 | 30 | private List10 | * 课程 Mapper 接口 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-04-09 15 | */ 16 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 17 | public interface EduChapterMapper extends BaseMapper10 | * 评论 Mapper 接口 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-05-01 15 | */ 16 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 17 | public interface EduCommentMapper extends BaseMapper10 | * 课程简介 Mapper 接口 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-04-09 15 | */ 16 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 17 | public interface EduCourseDescriptionMapper extends BaseMapper12 | * 课程 Mapper 接口 13 | *
14 | * 15 | * @author HAN 16 | * @since 2021-04-09 17 | */ 18 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 19 | public interface EduCourseMapper extends BaseMapper10 | * 课程科目 Mapper 接口 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-04-08 15 | */ 16 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 17 | public interface EduSubjectMapper extends BaseMapper10 | * 讲师 Mapper 接口 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-04-04 15 | */ 16 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 17 | public interface EduTeacherMapper extends BaseMapper10 | * 课程视频 Mapper 接口 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-04-09 15 | */ 16 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 17 | public interface EduVideoMapper extends BaseMapper11 | * 课程 服务类 12 | *
13 | * 14 | * @author HAN 15 | * @since 2021-04-09 16 | */ 17 | public interface EduChapterService extends IService10 | * 评论 服务类 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-05-01 15 | */ 16 | public interface EduCommentService extends IService8 | * 课程简介 服务类 9 | *
10 | * 11 | * @author HAN 12 | * @since 2021-04-09 13 | */ 14 | public interface EduCourseDescriptionService extends IService16 | * 课程 服务类 17 | *
18 | * 19 | * @author HAN 20 | * @since 2021-04-09 21 | */ 22 | public interface EduCourseService extends IService12 | * 课程科目 服务类 13 | *
14 | * 15 | * @author HAN 16 | * @since 2021-04-08 17 | */ 18 | public interface EduSubjectService extends IService8 | * 讲师 服务类 9 | *
10 | * 11 | * @author HAN 12 | * @since 2021-04-04 13 | */ 14 | public interface EduTeacherService extends IService8 | * 课程视频 服务类 9 | *
10 | * 11 | * @author HAN 12 | * @since 2021-04-09 13 | */ 14 | public interface EduVideoService extends IService20 | * 课程 服务实现类 21 | *
22 | * 23 | * @author HAN 24 | * @since 2021-04-09 25 | */ 26 | @Service 27 | @Transactional 28 | public class EduChapterServiceImpl extends ServiceImpl17 | * 评论 服务实现类 18 | *
19 | * 20 | * @author HAN 21 | * @since 2021-05-01 22 | */ 23 | @Service 24 | public class EduCommentServiceImpl extends ServiceImpl11 | * 课程简介 服务实现类 12 | *
13 | * 14 | * @author HAN 15 | * @since 2021-04-09 16 | */ 17 | @Service 18 | public class EduCourseDescriptionServiceImpl extends ServiceImpl11 | * 讲师 服务实现类 12 | *
13 | * 14 | * @author HAN 15 | * @since 2021-04-04 16 | */ 17 | @Service 18 | public class EduTeacherServiceImpl extends ServiceImpl18 | * 课程视频 服务实现类 19 | *
20 | * 21 | * @author HAN 22 | * @since 2021-04-09 23 | */ 24 | @Service 25 | @Transactional 26 | public class EduVideoServiceImpl extends ServiceImpl17 | * 订单 前端控制器 18 | *
19 | * 20 | * @author HAN 21 | * @since 2021-04-19 22 | */ 23 | @RestController 24 | @RequestMapping("/order/order") 25 | //@CrossOrigin 26 | @Api("订单信息") 27 | public class OrderController { 28 | 29 | @Autowired 30 | private OrderService orderService; 31 | 32 | /** 33 | * 生成订单 34 | * @param courseId 课程id 35 | * @param request 原生request对象 36 | */ 37 | @PostMapping("{courseId}") 38 | @ApiOperation("生成订单") 39 | public ResultCommon saveOrder(@PathVariable("courseId") long courseId, 40 | HttpServletRequest request) { 41 | 42 | // 生成订单号 43 | String orderId = orderService.saveOrder(courseId, JwtUtils.getUserIdByJwtToken(request)); 44 | 45 | return ResultCommon.success().setData("orderId", orderId); 46 | } 47 | 48 | /** 49 | * 查询订单 50 | * @param id 订单号 51 | */ 52 | @GetMapping("{orderId}") 53 | @ApiOperation("订单id查询订单") 54 | public ResultCommon getOrder(@PathVariable("orderId") String id) { 55 | Order order = orderService.getOrder(id); 56 | return ResultCommon.success().setData("items", order); 57 | } 58 | 59 | /** 60 | * 查询订单是否存在 61 | * @param courseId 课程id 62 | */ 63 | @GetMapping("course-status/{courseId}") 64 | @ApiOperation("课程和用户id查询订单是否存在") 65 | public ResultCommon isBuyCourse(@PathVariable("courseId") Long courseId, 66 | HttpServletRequest request) { 67 | int count = orderService.isBuyCourse(courseId, JwtUtils.getUserIdByJwtToken(request)); 68 | return count <= 0 ? ResultCommon.fail() : ResultCommon.success(); 69 | } 70 | 71 | } 72 | 73 | -------------------------------------------------------------------------------- /service/service_order8006/src/main/java/com/github/order/controller/PayLogController.java: -------------------------------------------------------------------------------- 1 | package com.github.order.controller; 2 | 3 | 4 | import com.github.order.service.PayLogService; 5 | import com.github.utils.ResultCommon; 6 | import io.swagger.annotations.ApiOperation; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | /** 11 | *12 | * 支付日志表 前端控制器 13 | *
14 | * 15 | * @author HAN 16 | * @since 2021-04-19 17 | */ 18 | @RestController 19 | @RequestMapping("/order/pay-log") 20 | public class PayLogController { 21 | 22 | @Autowired 23 | private PayLogService payLogService; 24 | 25 | /** 26 | * 更新订单支付状态 27 | * @param id 订单id 28 | */ 29 | @PutMapping("{orderId}") 30 | @ApiOperation("更新订单支付状态") 31 | public ResultCommon getOrderStatus(@PathVariable("orderId") String id) { 32 | payLogService.savePayLog(id); 33 | return ResultCommon.success(); 34 | } 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /service/service_order8006/src/main/java/com/github/order/entity/Order.java: -------------------------------------------------------------------------------- 1 | package com.github.order.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | 11 | import java.io.Serializable; 12 | import java.math.BigDecimal; 13 | import java.time.LocalDateTime; 14 | 15 | /** 16 | *17 | * 订单 18 | *
19 | * 20 | * @author HAN 21 | * @since 2021-04-19 22 | */ 23 | @Data 24 | @EqualsAndHashCode(callSuper = false) 25 | @TableName("t_order") 26 | @ApiModel(value="Order对象", description="订单") 27 | public class Order implements Serializable { 28 | 29 | private static final long serialVersionUID = 1L; 30 | 31 | @TableId(value = "id", type = IdType.ASSIGN_ID) 32 | @JsonSerialize(using = ToStringSerializer.class) 33 | private Long id; 34 | 35 | @ApiModelProperty(value = "订单号") 36 | private String orderNo; 37 | 38 | @ApiModelProperty(value = "课程id") 39 | @JsonSerialize(using = ToStringSerializer.class) 40 | private Long courseId; 41 | 42 | @ApiModelProperty(value = "课程名称") 43 | private String courseTitle; 44 | 45 | @ApiModelProperty(value = "课程封面") 46 | private String courseCover; 47 | 48 | @ApiModelProperty(value = "讲师名称") 49 | private String teacherName; 50 | 51 | @ApiModelProperty(value = "会员id") 52 | private String memberId; 53 | 54 | @ApiModelProperty(value = "会员昵称") 55 | private String nickname; 56 | 57 | @ApiModelProperty(value = "会员邮箱") 58 | private String email; 59 | 60 | @ApiModelProperty(value = "订单金额(分)") 61 | private BigDecimal totalFee; 62 | 63 | @ApiModelProperty(value = "支付类型(1:微信 2:支付宝)") 64 | private Integer payType; 65 | 66 | @ApiModelProperty(value = "订单状态(0:未支付 1:已支付)") 67 | private Integer status; 68 | 69 | @ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除") 70 | @TableLogic 71 | private Integer isDeleted; 72 | 73 | @ApiModelProperty(value = "创建时间") 74 | @TableField(fill = FieldFill.INSERT) 75 | private LocalDateTime gmtCreate; 76 | 77 | @ApiModelProperty(value = "更新时间") 78 | @TableField(fill = FieldFill.INSERT_UPDATE) 79 | private LocalDateTime gmtModified; 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /service/service_order8006/src/main/java/com/github/order/entity/PayLog.java: -------------------------------------------------------------------------------- 1 | package com.github.order.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | 11 | import java.io.Serializable; 12 | import java.math.BigDecimal; 13 | import java.time.LocalDateTime; 14 | 15 | /** 16 | *17 | * 支付日志表 18 | *
19 | * 20 | * @author HAN 21 | * @since 2021-04-19 22 | */ 23 | @Data 24 | @EqualsAndHashCode(callSuper = false) 25 | @TableName("t_pay_log") 26 | @ApiModel(value="PayLog对象", description="支付日志表") 27 | public class PayLog implements Serializable { 28 | 29 | private static final long serialVersionUID = 1L; 30 | 31 | @TableId(value = "id", type = IdType.ASSIGN_ID) 32 | @JsonSerialize(using = ToStringSerializer.class) 33 | private Long id; 34 | 35 | @ApiModelProperty(value = "订单号") 36 | private String orderNo; 37 | 38 | @ApiModelProperty(value = "支付完成时间") 39 | private LocalDateTime payTime; 40 | 41 | @ApiModelProperty(value = "支付金额(分)") 42 | private BigDecimal totalFee; 43 | 44 | @ApiModelProperty(value = "交易流水号") 45 | private String transactionId; 46 | 47 | @ApiModelProperty(value = "交易状态") 48 | private String tradeState; 49 | 50 | @ApiModelProperty(value = "支付类型(1:微信 2:支付宝)") 51 | private Integer payType; 52 | 53 | @ApiModelProperty(value = "其他属性") 54 | private String attr; 55 | 56 | @ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除") 57 | @TableLogic 58 | private Integer isDeleted; 59 | 60 | @ApiModelProperty(value = "创建时间") 61 | @TableField(fill = FieldFill.INSERT) 62 | private LocalDateTime gmtCreate; 63 | 64 | @ApiModelProperty(value = "更新时间") 65 | @TableField(fill = FieldFill.INSERT_UPDATE) 66 | private LocalDateTime gmtModified; 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /service/service_order8006/src/main/java/com/github/order/feign/EduFeign.java: -------------------------------------------------------------------------------- 1 | package com.github.order.feign; 2 | 3 | import com.github.utils.ResultCommon; 4 | import org.springframework.cloud.openfeign.FeignClient; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | 8 | /** 9 | * @author HAN 10 | * @version 1.0 11 | * @create 04-19-2:40 12 | */ 13 | @FeignClient("service-edu") 14 | public interface EduFeign { 15 | 16 | /** 17 | * 查询课程信息 18 | * @param courseId 课程id 19 | */ 20 | @GetMapping("/eduservice/front-course/feign/{id}") 21 | ResultCommon getCourseInfoCommon(@PathVariable("id") Long courseId); 22 | } 23 | -------------------------------------------------------------------------------- /service/service_order8006/src/main/java/com/github/order/feign/UcenterFeign.java: -------------------------------------------------------------------------------- 1 | package com.github.order.feign; 2 | 3 | import com.github.utils.ResultCommon; 4 | import org.springframework.cloud.openfeign.FeignClient; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | 8 | /** 9 | * @author HAN 10 | * @version 1.0 11 | * @create 04-19-2:40 12 | */ 13 | @FeignClient("service-center") 14 | public interface UcenterFeign { 15 | 16 | /** 17 | * 根据id获取用户信息 18 | * @param id 用户id 19 | */ 20 | @GetMapping("/edu-center/user-info/{id}") 21 | ResultCommon infoUserById(@PathVariable("id") String id); 22 | } 23 | -------------------------------------------------------------------------------- /service/service_order8006/src/main/java/com/github/order/mapper/OrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.github.order.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.github.order.entity.Order; 5 | import com.github.servicebase.cache.MybatisRedisCacheConfig; 6 | import org.apache.ibatis.annotations.CacheNamespace; 7 | 8 | /** 9 | *10 | * 订单 Mapper 接口 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-04-19 15 | */ 16 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 17 | public interface OrderMapper extends BaseMapper10 | * 支付日志表 Mapper 接口 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-04-19 15 | */ 16 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 17 | public interface PayLogMapper extends BaseMapper17 | * 支付日志表 服务实现类 18 | *
19 | * 20 | * @author HAN 21 | * @since 2021-04-19 22 | */ 23 | @Service 24 | @Transactional 25 | public class PayLogService extends ServiceImpl14 | * 网站统计日数据 前端控制器 15 | *
16 | * 17 | * @author HAN 18 | * @since 2021-04-20 19 | */ 20 | @RestController 21 | @RequestMapping("/stat/statistics-daily") 22 | public class StatisticsDailyController { 23 | 24 | @Autowired 25 | private StatisticsDailyService statisticsDailyService; 26 | 27 | /** 28 | * 统计某一天信息 29 | * @param date 哪一天 30 | */ 31 | @PostMapping("{date}") 32 | @ApiOperation("统计某一天信息") 33 | public ResultCommon countStat(@PathVariable("date") String date) { 34 | statisticsDailyService.countStat(date); 35 | 36 | return ResultCommon.success(); 37 | } 38 | 39 | /** 40 | * 查询图表显示数据 41 | * @param begin 开始日期 42 | * @param end 结束日期 43 | */ 44 | @GetMapping("{begin}/{end}") 45 | @ApiOperation("查询图表显示数据") 46 | public ResultCommon showData(@PathVariable("begin") String begin, 47 | @PathVariable("end") String end) { 48 | Map19 | * 网站统计日数据 20 | *
21 | * 22 | * @author HAN 23 | * @since 2021-04-20 24 | */ 25 | @Data 26 | @EqualsAndHashCode(callSuper = false) 27 | @ApiModel(value="StatisticsDaily对象", description="网站统计日数据") 28 | public class StatisticsDaily implements Serializable { 29 | 30 | private static final long serialVersionUID = 1L; 31 | 32 | @ApiModelProperty(value = "主键") 33 | @TableId(value = "id", type = IdType.ASSIGN_ID) 34 | @JsonSerialize(using = ToStringSerializer.class) 35 | private Long id; 36 | 37 | @ApiModelProperty(value = "统计日期") 38 | private String dateCalculated; 39 | 40 | @ApiModelProperty(value = "注册人数") 41 | private Integer registerNum; 42 | 43 | @ApiModelProperty(value = "登录人数") 44 | private Integer loginNum; 45 | 46 | @ApiModelProperty(value = "每日播放视频数") 47 | private Integer videoViewNum; 48 | 49 | @ApiModelProperty(value = "每日新增课程数") 50 | private Integer courseNum; 51 | 52 | @ApiModelProperty(value = "创建时间") 53 | @TableField(fill = FieldFill.INSERT) 54 | private LocalDateTime gmtCreate; 55 | 56 | @ApiModelProperty(value = "更新时间") 57 | @TableField(fill = FieldFill.INSERT_UPDATE) 58 | private LocalDateTime gmtModified; 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /service/service_statistic8007/src/main/java/com/github/stat/feign/UcenterClient.java: -------------------------------------------------------------------------------- 1 | package com.github.stat.feign; 2 | 3 | import org.springframework.cloud.openfeign.FeignClient; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | 7 | /** 8 | * @author HAN 9 | * @version 1.0 10 | * @create 04-20-5:44 11 | */ 12 | @FeignClient("service-center") 13 | public interface UcenterClient { 14 | 15 | @GetMapping("/edu-center/stat-register/{date}") 16 | int statRegister(@PathVariable("date") String date); 17 | } 18 | -------------------------------------------------------------------------------- /service/service_statistic8007/src/main/java/com/github/stat/mapper/StatisticsDailyMapper.java: -------------------------------------------------------------------------------- 1 | package com.github.stat.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.github.servicebase.cache.MybatisRedisCacheConfig; 5 | import com.github.stat.entity.StatisticsDaily; 6 | import org.apache.ibatis.annotations.CacheNamespace; 7 | 8 | /** 9 | *10 | * 网站统计日数据 Mapper 接口 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-04-20 15 | */ 16 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 17 | public interface StatisticsDailyMapper extends BaseMapper