Selaa lähdekoodia

Merge branch 'dev_v1.3.6_20221021' of http://git.dayaedu.com/yonge/cooleshow into dev_v1.3.6_20221021

liujunchi 2 vuotta sitten
vanhempi
commit
f9684ce8d5

+ 68 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/music/MusicCompareRecordStatController.java

@@ -0,0 +1,68 @@
+package com.yonge.cooleshow.admin.controller.music;
+
+
+import com.yonge.cooleshow.admin.io.request.music.MusicCompareVo;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
+import com.yonge.cooleshow.biz.dal.service.MusicCompareRecordStatService;
+import com.yonge.cooleshow.biz.dal.vo.MusicSheetDetailVo;
+import com.yonge.cooleshow.biz.dal.wrapper.music.MusicCompareWrapper;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 曲目练习统计表 前端控制器
+ * </p>
+ *
+ * @author Eric
+ * @since 2022-10-17
+ */
+@Controller
+@RequestMapping("/music/compare")
+@Api(tags = "曲目练习统计表 API接口")
+public class MusicCompareRecordStatController extends BaseController {
+
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private MusicCompareRecordStatService musicCompareRecordStatService;
+
+    /**
+     * 查询曲目统计汇总信息
+     */
+    @ApiOperation(value = "曲目统计汇总信息", notes = "传入id")
+    @PostMapping(value = "/record/stat", consumes="application/json", produces="application/json")
+    public HttpResponseResult<MusicCompareVo.RecordStat> detail(@RequestBody MusicCompareVo.StatQueryRequest info) {
+
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null  || sysUser.getId() == null) {
+            return failed("用户信息获取失败");
+        }
+
+        if (info.invalidParam()) {
+            return failed("无效的请求参数");
+        }
+
+        MusicCompareWrapper.RecordStat records = musicCompareRecordStatService.findMusicCompareRecordStatInfo(sysUser.getId(),
+                MusicCompareWrapper.StatQueryInfo.from(info.jsonString()));
+
+        return succeed(MusicCompareVo.RecordStat.from(records.jsonString()));
+    }
+
+}

+ 107 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/io/request/music/MusicCompareVo.java

@@ -0,0 +1,107 @@
+package com.yonge.cooleshow.admin.io.request.music;
+
+import com.alibaba.fastjson.JSON;
+import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
+import com.yonge.toolset.base.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * Created by Eric.Shang on 2022/10/17.
+ */
+public class MusicCompareVo implements Serializable {
+
+    /**
+     * 统计汇总查询条件
+     */
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class StatQueryRequest extends QueryInfo {
+
+        @ApiModelProperty("客户端类型 TEACHER(老师端) STUDENT(学生端)")
+        private ClientEnum clientType;
+
+
+        public boolean invalidParam() {
+
+            return Objects.isNull(getClientType())
+                    || ClientEnum.invalid(getClientType().getCode());
+        }
+
+        public String jsonString() {
+
+            return JSON.toJSONString(this);
+        }
+    }
+
+    /**
+     * 曲目统计汇总信息
+     */
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class RecordStat implements Serializable {
+
+        @ApiModelProperty("曲目总数")
+        private Long musicNums;
+
+        @ApiModelProperty("使用时长")
+        private Long trainDuration;
+
+        @ApiModelProperty("使用次数")
+        private Long trainFrequency;
+
+        @ApiModelProperty("评测时长")
+        private Long evaluateDuration;
+
+        @ApiModelProperty("评测次数")
+        private Long evaluateFrequency;
+
+        @ApiModelProperty("最近使用时间")
+        private Long recentTime;
+
+        private List<RecordInfo> recordInfos;
+
+        public static RecordStat from(String recv) {
+
+            return JSON.parseObject(recv, RecordStat.class);
+        }
+    }
+
+    /**
+     * 曲目统计信息
+     */
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class RecordInfo implements Serializable {
+
+        @ApiModelProperty("曲目ID")
+        private Long musicSheetId;
+
+        @ApiModelProperty("曲目名称")
+        private String musicName;
+
+        @ApiModelProperty("使用时长")
+        private Long trainDuration;
+
+        @ApiModelProperty("使用次数")
+        private Long trainFrequency;
+
+        @ApiModelProperty("评测时长")
+        private Long evaluateDuration;
+
+        @ApiModelProperty("评测次数")
+        private Long evaluateFrequency;
+
+        @ApiModelProperty("最近使用时间")
+        private Long recentTime;
+    }
+}

+ 71 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/MusicCompareRecordStat.java

@@ -0,0 +1,71 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 曲目练习统计表
+ * </p>
+ *
+ * @author Eric
+ * @since 2022-10-17
+ */
+@Getter
+@Setter
+@TableName("music_compare_record_stat")
+@ApiModel(value = "MusicCompareRecordStat对象", description = "曲目练习统计表")
+public class MusicCompareRecordStat implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("主键ID")
+    @TableId(value = "id_", type = IdType.AUTO)
+    private Long id;
+
+    @ApiModelProperty("曲目编号")
+    @TableField("music_sheet_id_")
+    private Long musicSheetId;
+
+    @ApiModelProperty("客户端标识")
+    @TableField("client_id_")
+    private String clientId;
+
+    @ApiModelProperty("用户编号")
+    @TableField("user_id_")
+    private Long userId;
+
+    @ApiModelProperty("使用时长")
+    @TableField("train_duration_")
+    private Long trainDuration;
+
+    @ApiModelProperty("使用次数")
+    @TableField("train_frequency_")
+    private Long trainFrequency;
+
+    @ApiModelProperty("评测时长")
+    @TableField("evaluate_duration_")
+    private Long evaluateDuration;
+
+    @ApiModelProperty("评测次数")
+    @TableField("evaluate_frequency_")
+    private Long evaluateFrequency;
+
+    @ApiModelProperty("最近使用时间")
+    @TableField("recent_time_")
+    private Long recentTime;
+
+    @ApiModelProperty("创建时间")
+    @TableField("create_time_")
+    private Date createTime;
+
+
+}

+ 16 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/MusicCompareRecordStatMapper.java

@@ -0,0 +1,16 @@
+package com.yonge.cooleshow.biz.dal.mapper;
+
+import com.yonge.cooleshow.biz.dal.entity.MusicCompareRecordStat;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 曲目练习统计表 Mapper 接口
+ * </p>
+ *
+ * @author Eric
+ * @since 2022-10-17
+ */
+public interface MusicCompareRecordStatMapper extends BaseMapper<MusicCompareRecordStat> {
+
+}

+ 24 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/MusicCompareRecordStatService.java

@@ -0,0 +1,24 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+import com.yonge.cooleshow.biz.dal.entity.MusicCompareRecordStat;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.biz.dal.wrapper.music.MusicCompareWrapper;
+
+/**
+ * <p>
+ * 曲目练习统计表 服务类
+ * </p>
+ *
+ * @author Eric
+ * @since 2022-10-17
+ */
+public interface MusicCompareRecordStatService extends IService<MusicCompareRecordStat> {
+
+    /**
+     * 曲目统计汇总信息
+     * @param sysUserId 用户ID
+     * @param info MusicCompareWrapper.StatQueryInfo
+     * @return MusicCompareWrapper.RecordStat
+     */
+    MusicCompareWrapper.RecordStat findMusicCompareRecordStatInfo(Long sysUserId, MusicCompareWrapper.StatQueryInfo info);
+}

+ 32 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicCompareRecordStatServiceImp.java

@@ -0,0 +1,32 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import com.yonge.cooleshow.biz.dal.entity.MusicCompareRecordStat;
+import com.yonge.cooleshow.biz.dal.mapper.MusicCompareRecordStatMapper;
+import com.yonge.cooleshow.biz.dal.service.MusicCompareRecordStatService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yonge.cooleshow.biz.dal.wrapper.music.MusicCompareWrapper;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 曲目练习统计表 服务实现类
+ * </p>
+ *
+ * @author Eric
+ * @since 2022-10-17
+ */
+@Service
+public class MusicCompareRecordStatServiceImp extends ServiceImpl<MusicCompareRecordStatMapper, MusicCompareRecordStat> implements MusicCompareRecordStatService {
+
+    /**
+     * 曲目统计汇总信息
+     *
+     * @param sysUserId 用户ID
+     * @param info      MusicCompareWrapper.StatQueryInfo
+     * @return MusicCompareWrapper.RecordStat
+     */
+    @Override
+    public MusicCompareWrapper.RecordStat findMusicCompareRecordStatInfo(Long sysUserId, MusicCompareWrapper.StatQueryInfo info) {
+        return null;
+    }
+}

+ 101 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/music/MusicCompareWrapper.java

@@ -0,0 +1,101 @@
+package com.yonge.cooleshow.biz.dal.wrapper.music;
+
+import com.alibaba.fastjson.JSON;
+import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
+import com.yonge.toolset.base.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Created by Eric.Shang on 2022/10/17.
+ */
+public class MusicCompareWrapper {
+
+    /**
+     * 统计汇总查询条件
+     */
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class StatQueryInfo extends QueryInfo {
+
+        @ApiModelProperty("客户端类型 TEACHER(老师端) STUDENT(学生端)")
+        private ClientEnum clientType;
+
+
+        public static StatQueryInfo from(String recv) {
+
+            return JSON.parseObject(recv, StatQueryInfo.class);
+        }
+
+    }
+
+    /**
+     * 曲目统计汇总信息
+     */
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class RecordStat implements Serializable {
+
+        @ApiModelProperty("曲目总数")
+        private Long musicNums;
+
+        @ApiModelProperty("使用时长")
+        private Long trainDuration;
+
+        @ApiModelProperty("使用次数")
+        private Long trainFrequency;
+
+        @ApiModelProperty("评测时长")
+        private Long evaluateDuration;
+
+        @ApiModelProperty("评测次数")
+        private Long evaluateFrequency;
+
+        @ApiModelProperty("最近使用时间")
+        private Long recentTime;
+
+        private List<RecordInfo> recordInfos;
+
+        public String jsonString() {
+
+            return JSON.toJSONString(this);
+        }
+    }
+
+    /**
+     * 曲目统计信息
+     */
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class RecordInfo implements Serializable {
+
+        @ApiModelProperty("曲目ID")
+        private Long musicSheetId;
+
+        @ApiModelProperty("曲目名称")
+        private String musicName;
+
+        @ApiModelProperty("使用时长")
+        private Long trainDuration;
+
+        @ApiModelProperty("使用次数")
+        private Long trainFrequency;
+
+        @ApiModelProperty("评测时长")
+        private Long evaluateDuration;
+
+        @ApiModelProperty("评测次数")
+        private Long evaluateFrequency;
+
+        @ApiModelProperty("最近使用时间")
+        private Long recentTime;
+    }
+}

+ 24 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicCompareRecordStatMapper.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yonge.cooleshow.biz.dal.mapper.MusicCompareRecordStatMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.MusicCompareRecordStat">
+        <id column="id_" property="id" />
+        <result column="music_sheet_id_" property="musicSheetId" />
+        <result column="client_id_" property="clientId" />
+        <result column="user_id_" property="userId" />
+        <result column="train_duration_" property="trainDuration" />
+        <result column="train_frequency_" property="trainFrequency" />
+        <result column="evaluate_duration_" property="evaluateDuration" />
+        <result column="evaluate_frequency_" property="evaluateFrequency" />
+        <result column="recent_time_" property="recentTime" />
+        <result column="create_time_" property="createTime" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id_, music_sheet_id_, client_id_, user_id_, train_duration_, train_frequency_, evaluate_duration_, evaluate_frequency_, recent_time_, create_time_
+    </sql>
+
+</mapper>

+ 15 - 0
service.md

@@ -0,0 +1,15 @@
+- [ ] gateway-server
+- [ ] auth-server
+- [x] admin-server
+- [ ] teacher-server
+- [ ] student-server
+- [ ] website-server
+- [ ] task-server
+- [ ] websocket-server
+- [ ] audio-analysis
+- [ ] bbs-server
+- [ ] classroom-server
+- [ ] cms-server
+- [ ] mall-admin
+- [ ] mall-server
+- [ ] EOF