8 | * Mapper 接口 9 | *
10 | * 11 | * @author testjava 12 | * @since 2020-01-12 13 | */ 14 | public interface RoleMapper extends BaseMapper8 | * 订单 Mapper 接口 9 | *
10 | * 11 | * @author zzyt 12 | * @since 2021-08-17 13 | */ 14 | public interface OrderMapper extends BaseMapper8 | * 用户表 Mapper 接口 9 | *
10 | * 11 | * @author testjava 12 | * @since 2020-01-12 13 | */ 14 | public interface UserMapper extends BaseMapper8 | * 支付日志表 Mapper 接口 9 | *
10 | * 11 | * @author zzyt 12 | * @since 2021-08-17 13 | */ 14 | public interface PayLogMapper extends BaseMapper8 | * 首页banner表 Mapper 接口 9 | *
10 | * 11 | * @author zzyt 12 | * @since 2021-08-13 13 | */ 14 | public interface CrmBannerMapper extends BaseMapper8 | * Mapper 接口 9 | *
10 | * 11 | * @author testjava 12 | * @since 2020-01-12 13 | */ 14 | public interface UserRoleMapper extends BaseMapper8 | * 服务类 9 | *
10 | * 11 | * @author testjava 12 | * @since 2020-01-12 13 | */ 14 | public interface UserRoleService extends IService8 | * 课程视频 Mapper 接口 9 | *
10 | * 11 | * @author zzyt 12 | * @since 2021-08-09 13 | */ 14 | public interface EduVideoMapper extends BaseMapper8 | * 课程 Mapper 接口 9 | *
10 | * 11 | * @author zzyt 12 | * @since 2021-08-09 13 | */ 14 | public interface EduChapterMapper extends BaseMapper8 | * 评论 Mapper 接口 9 | *
10 | * 11 | * @author zzyt 12 | * @since 2021-08-17 13 | */ 14 | public interface EduCommentMapper extends BaseMapper8 | * 课程科目 Mapper 接口 9 | *
10 | * 11 | * @author zzyt 12 | * @since 2021-08-09 13 | */ 14 | public interface EduSubjectMapper extends BaseMapper8 | * 讲师 Mapper 接口 9 | *
10 | * 11 | * @author zzyt 12 | * @since 2021-08-06 13 | */ 14 | public interface EduTeacherMapper extends BaseMapper8 | * 角色权限 Mapper 接口 9 | *
10 | * 11 | * @author testjava 12 | * @since 2020-01-12 13 | */ 14 | public interface RolePermissionMapper extends BaseMapper8 | * 角色权限 服务类 9 | *
10 | * 11 | * @author testjava 12 | * @since 2020-01-12 13 | */ 14 | public interface RolePermissionService extends IService8 | * 网站统计日数据 Mapper 接口 9 | *
10 | * 11 | * @author zzyt 12 | * @since 2021-08-19 13 | */ 14 | public interface StatisticsDailyMapper extends BaseMapper8 | * 课程简介 Mapper 接口 9 | *
10 | * 11 | * @author zzyt 12 | * @since 2021-08-09 13 | */ 14 | public interface EduCourseDescriptionMapper extends BaseMapper8 | * 课程简介 服务类 9 | *
10 | * 11 | * @author zzyt 12 | * @since 2021-08-09 13 | */ 14 | public interface EduCourseDescriptionService extends IService8 | * 订单 服务类 9 | *
10 | * 11 | * @author zzyt 12 | * @since 2021-08-17 13 | */ 14 | public interface OrderService extends IService8 | * 课程视频 服务类 9 | *
10 | * 11 | * @author zzyt 12 | * @since 2021-08-09 13 | */ 14 | public interface EduVideoService extends IService8 | * 用户表 服务类 9 | *
10 | * 11 | * @author testjava 12 | * @since 2020-01-12 13 | */ 14 | public interface UserService extends IService8 | * 会员表 Mapper 接口 9 | *
10 | * 11 | * @author zzyt 12 | * @since 2021-08-14 13 | */ 14 | public interface UcenterMemberMapper extends BaseMapper10 | * 首页banner表 服务类 11 | *
12 | * 13 | * @author zzyt 14 | * @since 2021-08-13 15 | */ 16 | public interface CrmBannerService extends IService10 | * 网站统计日数据 服务类 11 | *
12 | * 13 | * @author zzyt 14 | * @since 2021-08-19 15 | */ 16 | public interface StatisticsDailyService extends IService10 | * 权限 Mapper 接口 11 | *
12 | * 13 | * @author testjava 14 | * @since 2020-01-12 15 | */ 16 | public interface PermissionMapper extends BaseMapper11 | * 服务实现类 12 | *
13 | * 14 | * @author testjava 15 | * @since 2020-01-12 16 | */ 17 | @Service 18 | public class UserRoleServiceImpl extends ServiceImpl10 | * 支付日志表 服务类 11 | *
12 | * 13 | * @author zzyt 14 | * @since 2021-08-17 15 | */ 16 | public interface PayLogService extends IService10 | * 课程 Mapper 接口 11 | *
12 | * 13 | * @author zzyt 14 | * @since 2021-08-09 15 | */ 16 | 17 | public interface EduCourseMapper extends BaseMapper12 | * 讲师 服务类 13 | *
14 | * 15 | * @author zzyt 16 | * @since 2021-08-06 17 | */ 18 | public interface EduTeacherService extends IService11 | * 服务类 12 | *
13 | * 14 | * @author testjava 15 | * @since 2020-01-12 16 | */ 17 | public interface RoleService extends IService11 | * 课程 服务类 12 | *
13 | * 14 | * @author zzyt 15 | * @since 2021-08-09 16 | */ 17 | public interface EduChapterService extends IService9 | * 会员表 服务类 10 | *
11 | * 12 | * @author zzyt 13 | * @since 2021-08-14 14 | */ 15 | public interface UcenterMemberService extends IService11 | * 角色权限 服务实现类 12 | *
13 | * 14 | * @author testjava 15 | * @since 2020-01-12 16 | */ 17 | @Service 18 | public class RolePermissionServiceImpl extends ServiceImpl12 | * 课程科目 服务类 13 | *
14 | * 15 | * @author zzyt 16 | * @since 2021-08-09 17 | */ 18 | public interface EduSubjectService extends IService11 | * 课程简介 服务实现类 12 | *
13 | * 14 | * @author zzyt 15 | * @since 2021-08-09 16 | */ 17 | @Service 18 | public class EduCourseDescriptionServiceImpl extends ServiceImpl14 | * 评论 服务类 15 | *
16 | * 17 | * @author zzyt 18 | * @since 2021-08-17 19 | */ 20 | public interface EduCommentService extends IService12 | * 用户表 服务实现类 13 | *
14 | * 15 | * @author testjava 16 | * @since 2020-01-12 17 | */ 18 | @Service 19 | public class UserServiceImpl extends ServiceImpl11 | * 用户实体类 12 | *
13 | * 14 | * @author qy 15 | * @since 2019-11-08 16 | */ 17 | @Data 18 | @ApiModel(description = "用户实体类") 19 | public class User implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | @ApiModelProperty(value = "微信openid") 24 | private String username; 25 | 26 | @ApiModelProperty(value = "密码") 27 | private String password; 28 | 29 | @ApiModelProperty(value = "昵称") 30 | private String nickName; 31 | 32 | @ApiModelProperty(value = "用户头像") 33 | private String salt; 34 | 35 | @ApiModelProperty(value = "用户签名") 36 | private String token; 37 | 38 | } 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /service/service_statistics/pom.xml: -------------------------------------------------------------------------------- 1 | 2 |15 | * 未授权的统一处理方式 16 | *
17 | * 18 | * @author qy 19 | * @since 2019-11-08 20 | */ 21 | public class UnauthorizedEntryPoint implements AuthenticationEntryPoint { 22 | 23 | @Override 24 | public void commence(HttpServletRequest request, HttpServletResponse response, 25 | AuthenticationException authException) throws IOException, ServletException { 26 | 27 | ResponseUtil.out(response, R.error()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /service/service_edu/src/main/java/com/atguigu/eduservice/entity/vo/CourseInfo.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.eduservice.entity.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.math.BigDecimal; 7 | 8 | @Data 9 | public class CourseInfo { 10 | @ApiModelProperty(value = "课程ID") 11 | private String id; 12 | 13 | @ApiModelProperty(value = "课程讲师ID") 14 | private String teacherId; 15 | 16 | @ApiModelProperty(value = "课程专业ID") 17 | private String subjectId; 18 | 19 | @ApiModelProperty(value = "课程父ID") 20 | private String subjectParentId; 21 | 22 | @ApiModelProperty(value = "课程标题") 23 | private String title; 24 | 25 | @ApiModelProperty(value = "课程销售价格,设置为0则可免费观看") 26 | private BigDecimal price; 27 | 28 | @ApiModelProperty(value = "总课时") 29 | private Integer lessonNum; 30 | 31 | @ApiModelProperty(value = "课程封面图片路径") 32 | private String cover; 33 | 34 | @ApiModelProperty(value = "课程简介") 35 | private String description; 36 | } 37 | -------------------------------------------------------------------------------- /common/spring_security/src/main/java/com/atguigu/serurity/security/DefaultPasswordEncoder.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.serurity.security; 2 | 3 | import com.atguigu.commonutils.MD5; 4 | import org.springframework.security.crypto.password.PasswordEncoder; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | *9 | * t密码的处理方法类型 10 | *
11 | * 12 | * @author qy 13 | * @since 2019-11-08 14 | */ 15 | @Component 16 | public class DefaultPasswordEncoder implements PasswordEncoder { 17 | 18 | public DefaultPasswordEncoder() { 19 | this(-1); 20 | } 21 | 22 | /** 23 | * @param strength the log rounds to use, between 4 and 31 24 | */ 25 | public DefaultPasswordEncoder(int strength) { 26 | 27 | } 28 | 29 | public String encode(CharSequence rawPassword) { 30 | return MD5.encrypt(rawPassword.toString()); 31 | } 32 | 33 | public boolean matches(CharSequence rawPassword, String encodedPassword) { 34 | return encodedPassword.equals(MD5.encrypt(rawPassword.toString())); 35 | } 36 | } -------------------------------------------------------------------------------- /common/common_utils/src/main/java/com/atguigu/commonutils/MD5.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.commonutils; 2 | 3 | import java.security.MessageDigest; 4 | 5 | public class MD5 { 6 | public static String encrypt(String s) { 7 | char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; 8 | 9 | try { 10 | byte[] btInput = s.getBytes(); 11 | 12 | MessageDigest mdInst = MessageDigest.getInstance("MD5"); 13 | mdInst.update(btInput); 14 | byte[] md = mdInst.digest(); 15 | int j = md.length; 16 | char[] str = new char[j * 2]; 17 | int k = 0; 18 | for (int i = 0; i < j; i++) { 19 | byte byte0 = md[i]; 20 | str[k++] = hexDigits[byte0 >>> 4 & 0xf]; 21 | str[k++] = hexDigits[byte0 & 0xf]; 22 | } 23 | return new String(str); 24 | } catch (Exception e) { 25 | e.printStackTrace(); 26 | return null; 27 | } 28 | 29 | } 30 | } -------------------------------------------------------------------------------- /service/service_edu/src/test/java/TestEasyExcel.java: -------------------------------------------------------------------------------- 1 | import com.alibaba.excel.EasyExcel; 2 | import excel.DemoData; 3 | import org.junit.Test; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | 9 | public class TestEasyExcel 10 | { 11 | @Test 12 | public static void main(String[] args) 13 | { 14 | //easyexcel写入操作 15 | //String fileName = "E:\\easyExcel.xlsx"; 16 | //EasyExcel.write(fileName, DemoData.class).sheet("学生列表").doWrite(data()); 17 | 18 | //easyexcel读取操作 读取第一个sheet之后会自动关闭 19 | String fileName = "E:/easyExcel.xlsx"; 20 | EasyExcel.read(fileName,DemoData.class,new EasyExcelListener()).sheet("学生列表").doRead(); 21 | } 22 | 23 | private static List16 | * 首页banner表 前端控制器 17 | *
18 | * 19 | * @author zzyt 20 | * @since 2021-08-13 21 | */ 22 | @RestController 23 | @RequestMapping("/educms/bannerfront") 24 | //@CrossOrigin 25 | public class BannerFrontController { 26 | @Autowired 27 | private CrmBannerService bannerService; 28 | 29 | //获取首页的海报图 相当于获取所有的banner 30 | @GetMapping("getAllBanner") 31 | public R getAllbanner() { 32 | List12 | * token管理 13 | *
14 | * 15 | * @author qy 16 | * @since 2019-11-08 17 | */ 18 | @Component 19 | public class TokenManager { 20 | 21 | private final String tokenSignKey = "123456"; 22 | 23 | public String createToken(String username) { 24 | long tokenExpiration = 24 * 60 * 60 * 1000; 25 | return Jwts.builder().setSubject(username) 26 | .setExpiration(new Date(System.currentTimeMillis() + tokenExpiration)) 27 | .signWith(SignatureAlgorithm.HS512, tokenSignKey).compressWith(CompressionCodecs.GZIP).compact(); 28 | } 29 | 30 | public String getUserFromToken(String token) { 31 | return Jwts.parser().setSigningKey(tokenSignKey).parseClaimsJws(token).getBody().getSubject(); 32 | } 33 | 34 | public void removeToken(String token) { 35 | //jwttoken无需删除,客户端扔掉即可。 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /infrastructure/api_gateway/src/main/java/com/atguigu/gateway/config/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.gateway.config; 2 | 3 | 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.web.cors.CorsConfiguration; 7 | import org.springframework.web.cors.reactive.CorsWebFilter; 8 | import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource; 9 | import org.springframework.web.util.pattern.PathPatternParser; 10 | 11 | /** 12 | * description: 13 | * 14 | * @author wangpeng 15 | * @date 2019/01/02 16 | */ 17 | 18 | 19 | //这个方法是解决跨域问题的 20 | @Configuration 21 | public class CorsConfig { 22 | @Bean 23 | public CorsWebFilter corsFilter() { 24 | CorsConfiguration config = new CorsConfiguration(); 25 | config.addAllowedMethod("*"); 26 | config.addAllowedOrigin("*"); 27 | config.addAllowedHeader("*"); 28 | 29 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(new PathPatternParser()); 30 | source.registerCorsConfiguration("/**", config); 31 | 32 | return new CorsWebFilter(source); 33 | } 34 | } 35 | 36 | /*这个方法是用来解决跨域的 兄弟们*/ 37 | 38 | -------------------------------------------------------------------------------- /service/service_acl/src/main/java/com/atguigu/aclservice/service/PermissionService.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.aclservice.service; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.atguigu.aclservice.entity.Permission; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *11 | * 权限 服务类 12 | *
13 | * 14 | * @author testjava 15 | * @since 2020-01-12 16 | */ 17 | public interface PermissionService extends IService15 | * 首页banner表 服务实现类 16 | *
17 | * 18 | * @author zzyt 19 | * @since 2021-08-13 20 | */ 21 | @Service 22 | public class CrmBannerServiceImpl extends ServiceImpl16 | * 课程 服务类 17 | *
18 | * 19 | * @author zzyt 20 | * @since 2021-08-09 21 | */ 22 | public interface EduCourseService extends IService15 | * 角色权限 16 | *
17 | * 18 | * @author testjava 19 | * @since 2020-01-12 20 | */ 21 | @Data 22 | @EqualsAndHashCode(callSuper = false) 23 | @Accessors(chain = true) 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.ID_WORKER_STR) 31 | private String id; 32 | 33 | private String roleId; 34 | 35 | private String permissionId; 36 | 37 | @ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除") 38 | private Boolean isDeleted; 39 | 40 | @TableField(fill = FieldFill.INSERT) 41 | @ApiModelProperty(value = "创建时间") 42 | private Date gmtCreate; 43 | 44 | @TableField(fill = FieldFill.INSERT_UPDATE) 45 | @ApiModelProperty(value = "更新时间") 46 | private Date gmtModified; 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /service/service_edu/pom.xml: -------------------------------------------------------------------------------- 1 | 2 |18 | * 课程科目 前端控制器 19 | *
20 | * 21 | * @author zzyt 22 | * @since 2021-08-09 23 | */ 24 | @RestController 25 | @RequestMapping("/eduservice/subject") 26 | //@CrossOrigin 27 | public class EduSubjectController { 28 | 29 | @Resource 30 | private EduSubjectService subjectService; 31 | 32 | //添加课程分类 33 | @PostMapping("addSubject") 34 | public R addSubject(MultipartFile file) { 35 | subjectService.saveSubject(file, subjectService); 36 | 37 | return R.ok(); 38 | } 39 | 40 | //课程分类列表(树形) 41 | @GetMapping("getAllSubject") 42 | public R getAllSubject() { 43 | List14 | * 网站统计日数据 前端控制器 15 | *
16 | * 17 | * @author zzyt 18 | * @since 2021-08-19 19 | */ 20 | @RestController 21 | @RequestMapping("/staservice/sta") 22 | //@CrossOrigin 23 | public class StatisticsDailyController { 24 | 25 | @Autowired 26 | private StatisticsDailyService statisticsDailyService; 27 | 28 | //查询某天注册人数 然后在数据库中添加 29 | @PostMapping("registerCount/{day}") 30 | public R registerCount(@PathVariable("day") String day) { 31 | statisticsDailyService.registerCount(day); 32 | return R.ok(); 33 | } 34 | 35 | 36 | //图标显示,返回两部分数据,日期json数组,数量json数组 37 | @GetMapping("getShowData/{type}/{begin}/{end}") 38 | public R getShowData(@PathVariable("type") String type, @PathVariable("begin") String begin, 39 | @PathVariable("end") String end) { 40 | Map15 | * 16 | *
17 | * 18 | * @author testjava 19 | * @since 2020-01-12 20 | */ 21 | @Data 22 | @EqualsAndHashCode(callSuper = false) 23 | @Accessors(chain = true) 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.ID_WORKER_STR) 32 | private String id; 33 | 34 | @ApiModelProperty(value = "角色id") 35 | private String roleId; 36 | 37 | @ApiModelProperty(value = "用户id") 38 | private String userId; 39 | 40 | @ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除") 41 | private Boolean isDeleted; 42 | 43 | @TableField(fill = FieldFill.INSERT) 44 | @ApiModelProperty(value = "创建时间") 45 | private Date gmtCreate; 46 | 47 | @TableField(fill = FieldFill.INSERT_UPDATE) 48 | @ApiModelProperty(value = "更新时间") 49 | private Date gmtModified; 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /service/service_edu/src/main/java/com/atguigu/eduservice/entity/EduCourseDescription.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.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 io.swagger.annotations.ApiModel; 8 | import io.swagger.annotations.ApiModelProperty; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | import java.io.Serializable; 14 | import java.util.Date; 15 | 16 | /** 17 | *18 | * 课程简介 19 | *
20 | * 21 | * @author zzyt 22 | * @since 2021-08-09 23 | */ 24 | @Data 25 | @EqualsAndHashCode(callSuper = false) 26 | @Accessors(chain = true) 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.ID_WORKER_STR) 34 | private String id; 35 | 36 | @ApiModelProperty(value = "课程简介") 37 | private String description; 38 | 39 | @TableField(fill = FieldFill.INSERT) 40 | @ApiModelProperty(value = "创建时间") 41 | private Date gmtCreate; 42 | 43 | @TableField(fill = FieldFill.INSERT_UPDATE) 44 | @ApiModelProperty(value = "更新时间") 45 | private Date gmtModified; 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /common/spring_security/src/main/java/com/atguigu/serurity/security/TokenLogoutHandler.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.serurity.security; 2 | 3 | import com.atguigu.commonutils.R; 4 | import com.atguigu.commonutils.ResponseUtil; 5 | import org.springframework.data.redis.core.RedisTemplate; 6 | import org.springframework.security.core.Authentication; 7 | import org.springframework.security.web.authentication.logout.LogoutHandler; 8 | 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | 12 | /** 13 | *14 | * 登出业务逻辑类 15 | *
16 | * 17 | * @author qy 18 | * @since 2019-11-08 19 | */ 20 | public class TokenLogoutHandler implements LogoutHandler { 21 | 22 | private TokenManager tokenManager; 23 | private RedisTemplate redisTemplate; 24 | 25 | public TokenLogoutHandler(TokenManager tokenManager, RedisTemplate redisTemplate) { 26 | this.tokenManager = tokenManager; 27 | this.redisTemplate = redisTemplate; 28 | } 29 | 30 | @Override 31 | public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { 32 | String token = request.getHeader("token"); 33 | if (token != null) { 34 | tokenManager.removeToken(token); 35 | 36 | //清空当前用户缓存中的权限数据 37 | String userName = tokenManager.getUserFromToken(token); 38 | redisTemplate.delete(userName); 39 | } 40 | ResponseUtil.out(response, R.ok()); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /service/service_acl/src/main/java/com/atguigu/aclservice/entity/Role.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.aclservice.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | import lombok.experimental.Accessors; 9 | 10 | import java.io.Serializable; 11 | import java.util.Date; 12 | 13 | /** 14 | *15 | * 16 | *
17 | * 18 | * @author testjava 19 | * @since 2020-01-12 20 | */ 21 | @Data 22 | @EqualsAndHashCode(callSuper = false) 23 | @Accessors(chain = true) 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.ID_WORKER_STR) 32 | private String id; 33 | 34 | @ApiModelProperty(value = "角色名称") 35 | private String roleName; 36 | 37 | @ApiModelProperty(value = "角色编码") 38 | private String roleCode; 39 | 40 | @ApiModelProperty(value = "备注") 41 | private String remark; 42 | 43 | @ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除") 44 | private Boolean isDeleted; 45 | 46 | @TableField(fill = FieldFill.INSERT) 47 | @ApiModelProperty(value = "创建时间") 48 | private Date gmtCreate; 49 | 50 | @TableField(fill = FieldFill.INSERT) 51 | @ApiModelProperty(value = "更新时间") 52 | private Date gmtModified; 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /common/common_utils/src/main/java/com/atguigu/commonvo/CourseOrderVo.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.commonvo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.math.BigDecimal; 7 | 8 | @Data 9 | public class CourseOrderVo { 10 | private String id; 11 | 12 | @ApiModelProperty(value = "课程标题") 13 | private String title; 14 | 15 | @ApiModelProperty(value = "课程销售价格,设置为0则可免费观看") 16 | private BigDecimal price; 17 | 18 | @ApiModelProperty(value = "总课时") 19 | private Integer lessonNum; 20 | 21 | @ApiModelProperty(value = "课程封面图片路径") 22 | private String cover; 23 | 24 | @ApiModelProperty(value = "销售数量") 25 | private Long buyCount; 26 | 27 | @ApiModelProperty(value = "浏览数量") 28 | private Long viewCount; 29 | 30 | @ApiModelProperty(value = "课程简介") 31 | private String description; 32 | 33 | @ApiModelProperty(value = "讲师ID") 34 | private String teacherId; 35 | 36 | @ApiModelProperty(value = "讲师姓名") 37 | private String teacherName; 38 | 39 | @ApiModelProperty(value = "讲师资历,一句话说明讲师") 40 | private String intro; 41 | 42 | @ApiModelProperty(value = "讲师头像") 43 | private String avatar; 44 | 45 | @ApiModelProperty(value = "课程一级类别ID") 46 | private String subjectLevelOneId; 47 | 48 | @ApiModelProperty(value = "类别一级名称") 49 | private String subjectLevelOne; 50 | 51 | @ApiModelProperty(value = "课程二级类别ID") 52 | private String subjectLevelTwoId; 53 | 54 | @ApiModelProperty(value = "类别二级名称") 55 | private String subjectLevelTwo; 56 | } 57 | -------------------------------------------------------------------------------- /common/service_base/src/main/java/com/atguigu/servicebase/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.servicebase.config; 2 | 3 | import com.google.common.base.Predicates; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import springfox.documentation.builders.ApiInfoBuilder; 7 | import springfox.documentation.builders.PathSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.service.Contact; 10 | import springfox.documentation.spi.DocumentationType; 11 | import springfox.documentation.spring.web.plugins.Docket; 12 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 13 | 14 | @Configuration 15 | @EnableSwagger2 16 | public class SwaggerConfig { 17 | @Bean 18 | public Docket webApiConfig() { 19 | return new Docket(DocumentationType.SWAGGER_2) 20 | .groupName("webApi") 21 | .apiInfo(webApiInfo()) 22 | .select() 23 | //.paths(Predicates.not(PathSelectors.regex("/admin/.*"))) 24 | .paths(Predicates.not(PathSelectors.regex("/error.*"))) 25 | .build(); 26 | } 27 | 28 | private ApiInfo webApiInfo() { 29 | return new ApiInfoBuilder() 30 | .title("网站-课程中心API文档") 31 | .description("本文档描述了课程中心微服务接口定义") 32 | .version("1.0") 33 | .contact(new Contact("Helen", "http://atguigu.com", 34 | "55317332@qq.com")) 35 | .build(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /service/service_cms/src/main/java/com/atguigu/educms/entity/CrmBanner.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.educms.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import io.swagger.annotations.ApiModel; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.experimental.Accessors; 10 | 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | 14 | /** 15 | *16 | * 首页banner表 轮播图 17 | *
18 | * 19 | * @author zzyt 20 | * @since 2021-08-13 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @Accessors(chain = true) 25 | @ApiModel(value = "CrmBanner对象", description = "首页banner表") 26 | public class CrmBanner implements Serializable { 27 | 28 | private static final long serialVersionUID = 1L; 29 | 30 | @ApiModelProperty(value = "ID") 31 | @TableId(value = "id", type = IdType.ID_WORKER) 32 | private String 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 | private Boolean isDeleted; 48 | 49 | @ApiModelProperty(value = "创建时间") 50 | private Date gmtCreate; 51 | 52 | @ApiModelProperty(value = "更新时间") 53 | private Date gmtModified; 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /service/service_edu/src/main/java/com/atguigu/eduservice/entity/frontvo/CourseWebVo.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.eduservice.entity.frontvo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.math.BigDecimal; 7 | 8 | @Data 9 | public class CourseWebVo { 10 | private String id; 11 | 12 | @ApiModelProperty(value = "课程标题") 13 | private String title; 14 | 15 | @ApiModelProperty(value = "课程销售价格,设置为0则可免费观看") 16 | private BigDecimal price; 17 | 18 | @ApiModelProperty(value = "总课时") 19 | private Integer lessonNum; 20 | 21 | @ApiModelProperty(value = "课程封面图片路径") 22 | private String cover; 23 | 24 | @ApiModelProperty(value = "销售数量") 25 | private Long buyCount; 26 | 27 | @ApiModelProperty(value = "浏览数量") 28 | private Long viewCount; 29 | 30 | @ApiModelProperty(value = "课程简介") 31 | private String description; 32 | 33 | @ApiModelProperty(value = "讲师ID") 34 | private String teacherId; 35 | 36 | @ApiModelProperty(value = "讲师姓名") 37 | private String teacherName; 38 | 39 | @ApiModelProperty(value = "讲师资历,一句话说明讲师") 40 | private String intro; 41 | 42 | @ApiModelProperty(value = "讲师头像") 43 | private String avatar; 44 | 45 | @ApiModelProperty(value = "课程一级类别ID") 46 | private String subjectLevelOneId; 47 | 48 | @ApiModelProperty(value = "类别一级名称") 49 | private String subjectLevelOne; 50 | 51 | @ApiModelProperty(value = "课程二级类别ID") 52 | private String subjectLevelTwoId; 53 | 54 | @ApiModelProperty(value = "类别二级名称") 55 | private String subjectLevelTwo; 56 | } 57 | -------------------------------------------------------------------------------- /service/service_edu/src/main/java/com/atguigu/eduservice/entity/EduChapter.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.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 io.swagger.annotations.ApiModel; 8 | import io.swagger.annotations.ApiModelProperty; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | import java.io.Serializable; 14 | import java.util.Date; 15 | 16 | /** 17 | *18 | * 课程 19 | *
20 | * 21 | * @author zzyt 22 | * @since 2021-08-09 23 | */ 24 | @Data 25 | @EqualsAndHashCode(callSuper = false) 26 | @Accessors(chain = true) 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.ID_WORKER_STR) 34 | private String id; 35 | 36 | @ApiModelProperty(value = "课程ID") 37 | private String courseId; 38 | 39 | @ApiModelProperty(value = "章节名称") 40 | private String title; 41 | 42 | @ApiModelProperty(value = "显示排序") 43 | private Integer sort; 44 | 45 | @ApiModelProperty(value = "创建时间") 46 | @TableField(fill = FieldFill.INSERT) 47 | private Date gmtCreate; 48 | 49 | @TableField(fill = FieldFill.INSERT_UPDATE) 50 | @ApiModelProperty(value = "更新时间") 51 | private Date gmtModified; 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /service/service_edu/src/main/java/com/atguigu/eduservice/entity/EduSubject.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.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 io.swagger.annotations.ApiModel; 8 | import io.swagger.annotations.ApiModelProperty; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | import java.io.Serializable; 14 | import java.util.Date; 15 | 16 | /** 17 | *18 | * 课程科目 19 | *
20 | * 21 | * @author zzyt 22 | * @since 2021-08-09 23 | */ 24 | @Data 25 | @EqualsAndHashCode(callSuper = false) 26 | @Accessors(chain = true) 27 | @ApiModel(value = "EduSubject对象", description = "课程科目") 28 | public class EduSubject implements Serializable { 29 | 30 | private static final long serialVersionUID = 1L; 31 | 32 | @ApiModelProperty(value = "课程类别ID") 33 | @TableId(value = "id", type = IdType.ID_WORKER_STR) 34 | private String id; 35 | 36 | @ApiModelProperty(value = "类别名称") 37 | private String title; 38 | 39 | @ApiModelProperty(value = "父ID") 40 | private String parentId; 41 | 42 | @ApiModelProperty(value = "排序字段") 43 | private Integer sort; 44 | 45 | @TableField(fill = FieldFill.INSERT) 46 | @ApiModelProperty(value = "创建时间") 47 | private Date gmtCreate; 48 | 49 | @TableField(fill = FieldFill.INSERT_UPDATE) 50 | @ApiModelProperty(value = "更新时间") 51 | private Date gmtModified; 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /canal_clientedu/pom.xml: -------------------------------------------------------------------------------- 1 | 2 |