8 | * 讲师 服务类 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 EduCourseDescriptionService extends IService10 | * 首页banner表 服务实现类 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-04-13 15 | */ 16 | @Service 17 | public class CrmBannerService extends ServiceImpl11 | * 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 UserMapper extends BaseMapper10 | * 评论 服务类 11 | *
12 | * 13 | * @author HAN 14 | * @since 2021-05-01 15 | */ 16 | public interface EduCommentService extends IService10 | * 订单 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 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 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 BaseMapper10 | * 首页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 | * 角色权限 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-09 15 | */ 16 | @CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class) 17 | public interface EduVideoMapper 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 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-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 BaseMapper8 | * 课程视频 服务类 9 | *
10 | * 11 | * @author HAN 12 | * @since 2021-04-09 13 | */ 14 | public interface EduVideoService extends IService11 | * 讲师 服务实现类 12 | *
13 | * 14 | * @author HAN 15 | * @since 2021-04-04 16 | */ 17 | @Service 18 | public class EduTeacherServiceImpl extends ServiceImpl10 | * 课程简介 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 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 BaseMapper11 | * 课程简介 服务实现类 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-09 16 | */ 17 | public interface EduChapterService extends IService12 | * 权限 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 BaseMapper12 | * 课程科目 服务类 13 | *
14 | * 15 | * @author HAN 16 | * @since 2021-04-08 17 | */ 18 | public interface EduSubjectService extends IService10 | * 网站统计日数据 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 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 BaseMapper12 | * 支付日志表 前端控制器 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_center8005/src/main/java/com/github/center/controller/EmailController.java: -------------------------------------------------------------------------------- 1 | package com.github.center.controller; 2 | 3 | import com.github.center.service.EmailService; 4 | import com.github.utils.ResultCommon; 5 | import io.swagger.annotations.Api; 6 | import io.swagger.annotations.ApiOperation; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | /** 11 | * @author HAN 12 | * @version 1.0 13 | * @create 2021/4/15 14 | */ 15 | @RestController 16 | @RequestMapping("/edu-center/email") 17 | //@CrossOrigin 18 | @Api("发送邮箱") 19 | public class EmailController { 20 | 21 | @Autowired 22 | private EmailService emailService; 23 | 24 | /** 25 | * 发送邮箱 26 | * @param email 邮箱地址 27 | * @return 返回成功与否信息 28 | */ 29 | @GetMapping("{email}") 30 | @ApiOperation("发送邮箱") 31 | public ResultCommon sendEmail(@PathVariable("email") String email) { 32 | return emailService.sendEmail(email); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /service/service_oss8002/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_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_edu8001/src/main/java/com/github/eduservice/vo/CourseInfo.java: -------------------------------------------------------------------------------- 1 | package com.github.eduservice.vo; 2 | 3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 5 | import io.swagger.annotations.Api; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.Data; 8 | 9 | import java.math.BigDecimal; 10 | 11 | /** 12 | * @author HAN 13 | * @version 1.0 14 | * @create 2021/4/9 15 | */ 16 | @Data 17 | @Api("接受前端返回的课程信息") 18 | public class CourseInfo { 19 | 20 | @ApiModelProperty(value = "课程ID") 21 | @JsonSerialize(using = ToStringSerializer.class) 22 | private Long id; 23 | 24 | @ApiModelProperty(value = "课程讲师ID") 25 | @JsonSerialize(using = ToStringSerializer.class) 26 | private Long teacherId; 27 | 28 | @ApiModelProperty(value = "课程专业ID") 29 | @JsonSerialize(using = ToStringSerializer.class) 30 | private Long subjectId; 31 | 32 | @ApiModelProperty(value = "课程专业父级ID") 33 | @JsonSerialize(using = ToStringSerializer.class) 34 | private Long subjectParentId; 35 | 36 | @ApiModelProperty(value = "课程标题") 37 | private String title; 38 | 39 | @ApiModelProperty(value = "课程销售价格,设置为0则可免费观看") 40 | private BigDecimal price; 41 | 42 | @ApiModelProperty(value = "总课时") 43 | private Integer lessonNum; 44 | 45 | @ApiModelProperty(value = "课程封面图片路径") 46 | private String cover; 47 | 48 | @ApiModelProperty(value = "课程简介") 49 | private String description; 50 | 51 | } 52 | -------------------------------------------------------------------------------- /service/service_acl8008/src/main/java/com/github/acl/security/UserDetailsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.github.acl.security; 2 | 3 | import com.github.acl.service.PermissionService; 4 | import com.github.acl.service.UserService; 5 | import com.github.security.entity.SecurityUser; 6 | import com.github.security.entity.User; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.security.core.userdetails.UserDetails; 9 | import org.springframework.security.core.userdetails.UserDetailsService; 10 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 11 | import org.springframework.stereotype.Component; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * @author HAN 17 | * @version 1.0 18 | * @create 04-24-3:30 19 | */ 20 | @Component("userDetailsService") 21 | public class UserDetailsServiceImpl implements UserDetailsService { 22 | 23 | @Autowired 24 | private UserService userService; 25 | 26 | @Autowired 27 | private PermissionService permissionService; 28 | 29 | @Override 30 | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { 31 | // 根据用户名查询数据 32 | User user = userService.getByUsername(username); 33 | if (user == null) { 34 | throw new UsernameNotFoundException("用户不存在"); 35 | } 36 | // 根据用户id查询权限表 37 | List14 | * 网站统计日数据 前端控制器 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 | Map16 | * 评论 前端控制器 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 | List16 | * 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 | -------------------------------------------------------------------------------- /common/service_base/src/main/java/com/github/servicebase/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.github.servicebase.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.service.ApiInfo; 8 | import springfox.documentation.service.Contact; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | import java.util.function.Predicate; 14 | 15 | /** 16 | * @author HAN 17 | * @version 1.0 18 | * @create 2021/4/4 19 | */ 20 | @Configuration 21 | @EnableSwagger2 // swagger注解 22 | public class SwaggerConfig { 23 | 24 | @Bean 25 | public Docket webApiConfig() { 26 | return new Docket(DocumentationType.SWAGGER_2) 27 | .groupName("webApi") 28 | .apiInfo(apiInfo()) 29 | .select() 30 | .paths(Predicate.not(PathSelectors.regex("/admin/.*"))) 31 | .paths(Predicate.not(PathSelectors.regex("/error.*"))) 32 | .build(); 33 | } 34 | 35 | public ApiInfo apiInfo() { 36 | return new ApiInfoBuilder() 37 | .title("课程中心Api文档") 38 | .description("本文档定义了课程中心微服务接口定义") 39 | .version("1.0") 40 | .contact(new Contact("HAN", null, "a1066079469@gmail.com")) 41 | .build(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /service/service_edu8001/src/main/java/com/github/eduservice/aspect/FrontCourseAspect.java: -------------------------------------------------------------------------------- 1 | package com.github.eduservice.aspect; 2 | 3 | import com.github.eduservice.service.EduCourseService; 4 | import org.aspectj.lang.JoinPoint; 5 | import org.aspectj.lang.annotation.After; 6 | import org.aspectj.lang.annotation.Aspect; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.cloud.stream.function.StreamBridge; 9 | import org.springframework.messaging.support.MessageBuilder; 10 | import org.springframework.stereotype.Component; 11 | 12 | import java.time.LocalDate; 13 | import java.util.concurrent.ThreadPoolExecutor; 14 | 15 | /** 16 | * @author HAN 17 | * @version 1.0 18 | * @create 04-30-1:33 19 | */ 20 | @Aspect 21 | @Component 22 | public class FrontCourseAspect { 23 | 24 | @Autowired 25 | private EduCourseService eduCourseService; 26 | 27 | @Autowired 28 | private ThreadPoolExecutor threadPoolExecutor; 29 | 30 | @Autowired 31 | private StreamBridge streamBridge; 32 | 33 | /** 34 | * 切面,切入课程信息之后,计算浏览数量 35 | */ 36 | @After("execution(* com.github.eduservice.controller.FrontCourseController.getCourseInfo(..))") 37 | public void buyCount(JoinPoint joinPoint) { 38 | threadPoolExecutor.execute(() -> { 39 | Object[] args = joinPoint.getArgs(); 40 | eduCourseService.viewCount((Long) args[0]); 41 | // 发送到消息队列统计数量 42 | streamBridge.send("courseViewCountStat-out-0", 43 | MessageBuilder.withPayload(LocalDate.now().toString()).build()); 44 | }); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /service/service_edu8001/src/main/java/com/github/eduservice/controller/EduSubjectController.java: -------------------------------------------------------------------------------- 1 | package com.github.eduservice.controller; 2 | 3 | 4 | import com.github.eduservice.entity.subject.Subject; 5 | import com.github.eduservice.service.EduSubjectService; 6 | import com.github.utils.ResultCommon; 7 | import io.swagger.annotations.Api; 8 | import io.swagger.annotations.ApiOperation; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.*; 11 | import org.springframework.web.multipart.MultipartFile; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | *17 | * 课程科目 前端控制器 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 | 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_acl8008/src/main/java/com/github/acl/entity/Role.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") 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_order8006/src/main/java/com/github/order/service/PayLogService.java: -------------------------------------------------------------------------------- 1 | package com.github.order.service; 2 | 3 | import cn.hutool.core.util.RandomUtil; 4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import com.github.order.entity.Order; 7 | import com.github.order.entity.PayLog; 8 | import com.github.order.mapper.PayLogMapper; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import java.time.LocalDateTime; 14 | 15 | /** 16 | *17 | * 支付日志表 服务实现类 18 | *
19 | * 20 | * @author HAN 21 | * @since 2021-04-19 22 | */ 23 | @Service 24 | @Transactional 25 | public class PayLogService extends ServiceImpl16 | * 首页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 | -------------------------------------------------------------------------------- /common/spring_security/src/main/java/com/github/security/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.github.security.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") 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 | -------------------------------------------------------------------------------- /service/service_edu8001/src/main/java/com/github/eduservice/service/impl/EduCommentServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.github.eduservice.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 5 | import com.github.eduservice.entity.EduComment; 6 | import com.github.eduservice.mapper.EduCommentMapper; 7 | import com.github.eduservice.service.EduCommentService; 8 | import org.springframework.stereotype.Service; 9 | import org.springframework.util.ObjectUtils; 10 | 11 | import java.util.List; 12 | import java.util.Objects; 13 | import java.util.stream.Collectors; 14 | 15 | /** 16 | *17 | * 评论 服务实现类 18 | *
19 | * 20 | * @author HAN 21 | * @since 2021-05-01 22 | */ 23 | @Service 24 | public class EduCommentServiceImpl extends ServiceImpl19 | * 课程 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 | -------------------------------------------------------------------------------- /common/service_base/src/main/java/com/github/servicebase/config/DateFormatConfig.java: -------------------------------------------------------------------------------- 1 | package com.github.servicebase.config; 2 | 3 | import com.fasterxml.jackson.databind.SerializationFeature; 4 | import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; 5 | import org.springframework.beans.factory.annotation.Value; 6 | import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; 7 | import org.springframework.boot.jackson.JsonComponent; 8 | import org.springframework.context.annotation.Bean; 9 | 10 | import java.text.DateFormat; 11 | import java.text.SimpleDateFormat; 12 | import java.time.LocalDateTime; 13 | import java.time.format.DateTimeFormatter; 14 | import java.util.TimeZone; 15 | 16 | /** 17 | * 全局格式化时间类 18 | * @author HAN 19 | * @version 1.0 20 | * @create 2021/4/9 21 | */ 22 | @JsonComponent 23 | public class DateFormatConfig { 24 | @Value("yyyy-MM-dd HH:mm:ss") 25 | private String pattern; 26 | 27 | @Bean 28 | public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilder() { 29 | return builder -> { 30 | TimeZone tz = TimeZone.getTimeZone("GMT+9"); 31 | DateFormat df = new SimpleDateFormat(pattern); 32 | df.setTimeZone(tz); 33 | builder.failOnEmptyBeans(false) 34 | .failOnUnknownProperties(false) 35 | .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS).dateFormat(df); 36 | }; 37 | } 38 | 39 | @Bean 40 | public LocalDateTimeSerializer localDateTimeDeserializer() { 41 | return new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(pattern)); 42 | } 43 | 44 | @Bean 45 | public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer(LocalDateTimeSerializer localDateTimeSerializer) { 46 | return builder -> builder.serializerByType(LocalDateTime.class, localDateTimeSerializer); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /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_statistic8007/src/main/java/com/github/stat/entity/StatisticsDaily.java: -------------------------------------------------------------------------------- 1 | package com.github.stat.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.databind.annotation.JsonSerialize; 8 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 9 | import io.swagger.annotations.ApiModel; 10 | import io.swagger.annotations.ApiModelProperty; 11 | import lombok.Data; 12 | import lombok.EqualsAndHashCode; 13 | 14 | import java.io.Serializable; 15 | import java.time.LocalDateTime; 16 | 17 | /** 18 | *19 | * 网站统计日数据 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_edu8001/src/main/java/com/github/eduservice/service/impl/EduVideoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.github.eduservice.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.github.eduservice.entity.EduVideo; 5 | import com.github.eduservice.feign.VodClient; 6 | import com.github.eduservice.mapper.EduVideoMapper; 7 | import com.github.eduservice.service.EduVideoService; 8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 9 | import io.seata.spring.annotation.GlobalTransactional; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | import org.springframework.transaction.annotation.Transactional; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | *18 | * 课程视频 服务实现类 19 | *
20 | * 21 | * @author HAN 22 | * @since 2021-04-09 23 | */ 24 | @Service 25 | @Transactional 26 | public class EduVideoServiceImpl extends ServiceImpl13 | * 课程视频 前端控制器 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_acl8008/src/main/java/com/github/acl/controller/LoginLogoutController.java: -------------------------------------------------------------------------------- 1 | package com.github.acl.controller; 2 | 3 | import com.github.acl.service.LoginLogoutService; 4 | import com.github.utils.ResultCommon; 5 | import io.swagger.annotations.Api; 6 | import io.swagger.annotations.ApiOperation; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.security.core.context.SecurityContextHolder; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import java.util.Map; 14 | 15 | /** 16 | * @author HAN 17 | * @version 1.0 18 | * @create 04-26-16:13 19 | */ 20 | @RestController 21 | @RequestMapping("acl/index") 22 | @Api("security控制器") 23 | public class LoginLogoutController { 24 | 25 | @Autowired 26 | private LoginLogoutService loginLogoutService; 27 | 28 | /** 29 | * 获取user数据 30 | */ 31 | @GetMapping("info") 32 | @ApiOperation("获取用户数据") 33 | public ResultCommon getUserInfo() { 34 | // 获取登陆的用户 35 | String username = SecurityContextHolder.getContext().getAuthentication().getName(); 36 | System.out.println(username); 37 | Map17 | * 支付日志表 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 | -------------------------------------------------------------------------------- /common/spring_security/src/main/java/com/github/security/entity/SecurityUser.java: -------------------------------------------------------------------------------- 1 | package com.github.security.entity; 2 | 3 | import lombok.Data; 4 | import org.springframework.security.core.GrantedAuthority; 5 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 6 | import org.springframework.security.core.userdetails.UserDetails; 7 | import org.springframework.util.ObjectUtils; 8 | 9 | import java.util.ArrayList; 10 | import java.util.Collection; 11 | import java.util.List; 12 | 13 | /** 14 | * @author HAN 15 | * @version 1.0 16 | * @create 04-24-1:25 17 | */ 18 | @Data 19 | public class SecurityUser implements UserDetails { 20 | 21 | private User user; 22 | 23 | // 当前权限 24 | private List17 | * 评论 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 List17 | * 讲师 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_statistic8007/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8007 3 | spring: 4 | application: 5 | name: service-statistic 6 | cloud: 7 | stream: 8 | bindings: 9 | statLoginCount-in-0: # input 10 | destination: login-stat-exchange # 表示要使用的Exchange名称定义 11 | content-type: application/json # 消息类型 12 | binder: defaultRabbit # 要绑定的消息服务的具体设置 13 | group: statistic 14 | courseViewCountStat-in-0: # input 15 | destination: course-view-stat-exchange # 表示要使用的Exchange名称定义 16 | content-type: application/json # 消息类型 17 | binder: defaultRabbit # 要绑定的消息服务的具体设置 18 | group: statistic 19 | videoViewCountStat-in-0: # input 20 | destination: video-view-count-exchange # 表示要使用的Exchange名称定义 21 | content-type: application/json # 消息类型 22 | binder: defaultRabbit # 要绑定的消息服务的具体设置 23 | group: statistic 24 | statRegisterCount-in-0: # input 25 | destination: register-stat-exchange # 表示要使用的Exchange名称定义 26 | content-type: application/json # 消息类型 27 | binder: defaultRabbit # 要绑定的消息服务的具体设置 28 | group: statistic 29 | rabbit: 30 | bindings: 31 | statLoginCount-in-0: 32 | consumer: 33 | autoBindDlq: true #启用死信队列,默认会生成一个DLX EXCHANGE,当消息重复消费失败后 34 | deadLetterExchange: dead-letter-exchange #绑定exchange 35 | courseViewCountStat-in-0: 36 | consumer: 37 | autoBindDlq: true #启用死信队列,默认会生成一个DLX EXCHANGE,当消息重复消费失败后 38 | deadLetterExchange: dead-letter-exchange #绑定exchange 39 | videoViewCountStat-in-0: 40 | consumer: 41 | autoBindDlq: true #启用死信队列,默认会生成一个DLX EXCHANGE,当消息重复消费失败后 42 | deadLetterExchange: dead-letter-exchange #绑定exchange 43 | statRegisterCount-in-0: 44 | consumer: 45 | autoBindDlq: true #启用死信队列,默认会生成一个DLX EXCHANGE,当消息重复消费失败后 46 | deadLetterExchange: dead-letter-exchange #绑定exchange 47 | function: 48 | definition: statLoginCount;courseViewCountStat;videoViewCountStat;statRegisterCount 49 | -------------------------------------------------------------------------------- /common/service_base/src/main/java/com/github/servicebase/entity/CourseWebInfoCommon.java: -------------------------------------------------------------------------------- 1 | package com.github.servicebase.entity; 2 | 3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | import java.math.BigDecimal; 11 | 12 | /** 13 | * @author HAN 14 | * @version 1.0 15 | * @create 04-17-21:54 16 | */ 17 | @Data 18 | @AllArgsConstructor 19 | @NoArgsConstructor 20 | public class CourseWebInfoCommon { 21 | @ApiModelProperty(value = "课程ID") 22 | @JsonSerialize(using = ToStringSerializer.class) 23 | private Long id; 24 | 25 | @ApiModelProperty(value = "课程标题") 26 | private String title; 27 | 28 | @ApiModelProperty(value = "课程销售价格,设置为0则可免费观看") 29 | private BigDecimal price; 30 | 31 | @ApiModelProperty(value = "总课时") 32 | private Integer lessonNum; 33 | 34 | @ApiModelProperty(value = "课程封面图片路径") 35 | private String cover; 36 | 37 | @ApiModelProperty(value = "销售数量") 38 | private Long buyCount; 39 | 40 | @ApiModelProperty(value = "浏览数量") 41 | private Long viewCount; 42 | 43 | @ApiModelProperty(value = "课程简介") 44 | private String description; 45 | 46 | @ApiModelProperty(value = "课程教师ID") 47 | @JsonSerialize(using = ToStringSerializer.class) 48 | private Long teacherId; 49 | 50 | @ApiModelProperty(value = "教师姓名") 51 | private String teacherName; 52 | 53 | @ApiModelProperty(value = "教师资历,一句话说明讲师") 54 | private String intro; 55 | 56 | @ApiModelProperty(value = "教师头像") 57 | private String avatar; 58 | 59 | @ApiModelProperty(value = "课程专业父级ID") 60 | @JsonSerialize(using = ToStringSerializer.class) 61 | private Long subjectParentId; 62 | 63 | @ApiModelProperty(value = "类别一级名称") 64 | private String subjectParentTitle; 65 | 66 | @ApiModelProperty(value = "课程专业ID") 67 | @JsonSerialize(using = ToStringSerializer.class) 68 | private Long subjectId; 69 | 70 | @ApiModelProperty(value = "类别二级名称") 71 | private String subjectTitle; 72 | } 73 | -------------------------------------------------------------------------------- /service/service_edu8001/src/main/java/com/github/eduservice/controller/EduFrontIndexController.java: -------------------------------------------------------------------------------- 1 | package com.github.eduservice.controller; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.github.eduservice.entity.EduCourse; 5 | import com.github.eduservice.entity.EduTeacher; 6 | import com.github.eduservice.service.EduCourseService; 7 | import com.github.eduservice.service.EduTeacherService; 8 | import com.github.utils.ResultCommon; 9 | import io.swagger.annotations.Api; 10 | import io.swagger.annotations.ApiOperation; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.cache.annotation.Cacheable; 13 | import org.springframework.web.bind.annotation.GetMapping; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | import org.springframework.web.bind.annotation.RestController; 16 | 17 | import java.util.List; 18 | 19 | /** 20 | * @author HAN 21 | * @version 1.0 22 | * @create 2021/4/13 23 | */ 24 | @RestController 25 | @RequestMapping("/eduservice/index") 26 | @Api("前台页面查询功能") 27 | //@CrossOrigin 28 | public class EduFrontIndexController { 29 | 30 | @Autowired 31 | private EduCourseService eduCourseService; 32 | 33 | @Autowired 34 | private EduTeacherService eduTeacherService; 35 | 36 | /** 37 | * 查询前8条热门课程,前4个热门教师 38 | */ 39 | @GetMapping 40 | @ApiOperation("查询前8条热门课程,前4个热门教师") 41 | @Cacheable(value = "banner", key = "'EduCourseTeacher'") 42 | public ResultCommon getTeacherCourse() { 43 | // 查询前8条热门课程 44 | QueryWrapper16 | * 会员表 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 | -------------------------------------------------------------------------------- /common/service_base/src/main/java/com/github/servicebase/entity/UcenterMemberCommon.java: -------------------------------------------------------------------------------- 1 | package com.github.servicebase.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-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 | -------------------------------------------------------------------------------- /service/service_edu8001/src/main/java/com/github/eduservice/service/EduCourseService.java: -------------------------------------------------------------------------------- 1 | package com.github.eduservice.service; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.github.eduservice.entity.EduCourse; 6 | import com.github.eduservice.vo.CourseFrontInfo; 7 | import com.github.eduservice.vo.CourseInfo; 8 | import com.github.eduservice.vo.CourseWebInfo; 9 | import com.github.eduservice.vo.PublishInfo; 10 | 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | /** 15 | *16 | * 课程 服务类 17 | *
18 | * 19 | * @author HAN 20 | * @since 2021-04-09 21 | */ 22 | public interface EduCourseService extends IService17 | * 订单 前端控制器 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_oss8002/src/main/java/com/github/oss/service/OssService.java: -------------------------------------------------------------------------------- 1 | package com.github.oss.service; 2 | 3 | import cn.hutool.core.util.IdUtil; 4 | import com.aliyun.oss.OSS; 5 | import com.aliyun.oss.OSSClientBuilder; 6 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 7 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 8 | import com.github.oss.mapper.OssMapper; 9 | import com.github.oss.properties.ConstantProperties; 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.web.multipart.MultipartFile; 12 | 13 | import java.io.IOException; 14 | import java.io.InputStream; 15 | import java.time.LocalDate; 16 | import java.time.format.DateTimeFormatter; 17 | 18 | /** 19 | * @author HAN 20 | * @version 1.0 21 | * @create 2021/4/8 22 | */ 23 | @Service 24 | public class OssService extends ServiceImpl17 | * 权限 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 List17 | * 订单 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_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/resources/mapper/EduCourseMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |20 | * 课程 服务实现类 21 | *
22 | * 23 | * @author HAN 24 | * @since 2021-04-09 25 | */ 26 | @Service 27 | @Transactional 28 | public class EduChapterServiceImpl extends ServiceImpl