init:视频课件维护代码初始化
parent
50da0e47ea
commit
1d8565f97e
|
|
@ -0,0 +1,85 @@
|
|||
package com.zcloud.edu.web;
|
||||
|
||||
|
||||
import com.zcloud.edu.api.QuestionServiceI;
|
||||
import com.zcloud.edu.dto.QuestionAddCmd;
|
||||
import com.zcloud.edu.dto.QuestionPageQry;
|
||||
import com.zcloud.edu.dto.QuestionListQry;
|
||||
import com.zcloud.edu.dto.QuestionUpdateCmd;
|
||||
import com.zcloud.edu.dto.QuestionRemoveCmd;
|
||||
import com.zcloud.edu.dto.clientobject.QuestionCO;
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* web-adapter
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:10
|
||||
*/
|
||||
@Api(tags = "课件习题信息")
|
||||
@RequestMapping("/${application.gateway}/question")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class QuestionController {
|
||||
private final QuestionServiceI questionService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping("/save")
|
||||
public SingleResponse<QuestionCO> add(@Validated @RequestBody QuestionAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
return questionService.add(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping("/edit")
|
||||
public SingleResponse edit(@Validated @RequestBody QuestionUpdateCmd cmd) {
|
||||
questionService.edit(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<QuestionCO> page(@RequestBody QuestionPageQry qry) {
|
||||
return questionService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("所有数据")
|
||||
@PostMapping("/listAll")
|
||||
public MultiResponse<QuestionCO> listAll(@RequestBody QuestionListQry qry) {
|
||||
return questionService.list(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@GetMapping("/getInfoById")
|
||||
public SingleResponse<QuestionCO> getInfoById(@RequestParam(value = "id") Long id) {
|
||||
return questionService.getInfoById(id);
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@PutMapping("/remove")
|
||||
public Response remove(@RequestParam(value = "id") Long id) {
|
||||
questionService.remove(id);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("删除多个")
|
||||
@PutMapping("/removeBatch")
|
||||
public Response removeBatch(@Validated @RequestBody QuestionRemoveCmd cmd) {
|
||||
questionService.removeBatch(cmd.getIds());
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
package com.zcloud.edu.web;
|
||||
|
||||
|
||||
import com.zcloud.edu.api.VideoCoursewareServiceI;
|
||||
import com.zcloud.edu.dto.VideoCoursewareAddCmd;
|
||||
import com.zcloud.edu.dto.VideoCoursewarePageQry;
|
||||
import com.zcloud.edu.dto.VideoCoursewareListQry;
|
||||
import com.zcloud.edu.dto.VideoCoursewareUpdateCmd;
|
||||
import com.zcloud.edu.dto.VideoCoursewareRemoveCmd;
|
||||
import com.zcloud.edu.dto.clientobject.VideoCoursewareCO;
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* web-adapter
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
@Api(tags = "视频课件信息")
|
||||
@RequestMapping("/${application.gateway}/videoCourseware")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class VideoCoursewareController {
|
||||
private final VideoCoursewareServiceI videoCoursewareService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping("/save")
|
||||
public SingleResponse<VideoCoursewareCO> add(@Validated @RequestBody VideoCoursewareAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
return videoCoursewareService.add(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping("/edit")
|
||||
public SingleResponse edit(@Validated @RequestBody VideoCoursewareUpdateCmd cmd) {
|
||||
videoCoursewareService.edit(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<VideoCoursewareCO> page(@RequestBody VideoCoursewarePageQry qry) {
|
||||
return videoCoursewareService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("所有数据")
|
||||
@PostMapping("/listAll")
|
||||
public MultiResponse<VideoCoursewareCO> listAll(@RequestBody VideoCoursewareListQry qry) {
|
||||
return videoCoursewareService.list(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@GetMapping("/getInfoById")
|
||||
public SingleResponse<VideoCoursewareCO> getInfoById(@RequestParam(value = "id") Long id) {
|
||||
return videoCoursewareService.getInfoById(id);
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@PutMapping("/remove")
|
||||
public Response remove(@RequestParam(value = "id") Long id) {
|
||||
videoCoursewareService.remove(id);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("删除多个")
|
||||
@PutMapping("/removeBatch")
|
||||
public Response removeBatch(@Validated @RequestBody VideoCoursewareRemoveCmd cmd) {
|
||||
videoCoursewareService.removeBatch(cmd.getIds());
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.zcloud.edu.command;
|
||||
|
||||
import com.zcloud.edu.domain.gateway.QuestionGateway;
|
||||
import com.zcloud.edu.domain.model.QuestionE;
|
||||
import com.zcloud.edu.dto.QuestionAddCmd;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:10
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class QuestionAddExe {
|
||||
private final QuestionGateway questionGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(QuestionAddCmd cmd) {
|
||||
QuestionE questionE = new QuestionE();
|
||||
BeanUtils.copyProperties(cmd, questionE);
|
||||
boolean res = false;
|
||||
try {
|
||||
res = questionGateway.add(questionE);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (!res) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.zcloud.edu.command;
|
||||
|
||||
import com.zcloud.edu.domain.gateway.QuestionGateway;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:11
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class QuestionRemoveExe {
|
||||
private final QuestionGateway questionGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
boolean res = questionGateway.deletedQuestionById(id);
|
||||
if (!res) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long[] ids) {
|
||||
boolean res = questionGateway.deletedQuestionByIds(ids);
|
||||
if (!res) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.zcloud.edu.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.edu.domain.gateway.QuestionGateway;
|
||||
import com.zcloud.edu.domain.model.QuestionE;
|
||||
import com.zcloud.edu.dto.QuestionUpdateCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:11
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class QuestionUpdateExe {
|
||||
private final QuestionGateway questionGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(QuestionUpdateCmd cmd) {
|
||||
QuestionE questionE = new QuestionE();
|
||||
BeanUtils.copyProperties(cmd, questionE);
|
||||
boolean res = questionGateway.update(questionE);
|
||||
if (!res) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.zcloud.edu.command;
|
||||
|
||||
import com.zcloud.edu.domain.gateway.VideoCoursewareGateway;
|
||||
import com.zcloud.edu.domain.model.VideoCoursewareE;
|
||||
import com.zcloud.edu.dto.VideoCoursewareAddCmd;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:31
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class VideoCoursewareAddExe {
|
||||
private final VideoCoursewareGateway videoCoursewareGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(VideoCoursewareAddCmd cmd) {
|
||||
VideoCoursewareE videoCoursewareE = new VideoCoursewareE();
|
||||
BeanUtils.copyProperties(cmd, videoCoursewareE);
|
||||
boolean res = false;
|
||||
try {
|
||||
res = videoCoursewareGateway.add(videoCoursewareE);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (!res) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.zcloud.edu.command;
|
||||
|
||||
import com.zcloud.edu.domain.gateway.VideoCoursewareGateway;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class VideoCoursewareRemoveExe {
|
||||
private final VideoCoursewareGateway videoCoursewareGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
boolean res = videoCoursewareGateway.deletedVideoCoursewareById(id);
|
||||
if (!res) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long[] ids) {
|
||||
boolean res = videoCoursewareGateway.deletedVideoCoursewareByIds(ids);
|
||||
if (!res) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.zcloud.edu.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.edu.domain.gateway.VideoCoursewareGateway;
|
||||
import com.zcloud.edu.domain.model.VideoCoursewareE;
|
||||
import com.zcloud.edu.dto.VideoCoursewareUpdateCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:33
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class VideoCoursewareUpdateExe {
|
||||
private final VideoCoursewareGateway videoCoursewareGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(VideoCoursewareUpdateCmd cmd) {
|
||||
VideoCoursewareE videoCoursewareE = new VideoCoursewareE();
|
||||
BeanUtils.copyProperties(cmd, videoCoursewareE);
|
||||
boolean res = videoCoursewareGateway.update(videoCoursewareE);
|
||||
if (!res) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.zcloud.edu.command.convertor;
|
||||
|
||||
import com.zcloud.edu.dto.clientobject.QuestionCO;
|
||||
import com.zcloud.edu.persistence.dataobject.QuestionDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:10
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface QuestionCoConvertor {
|
||||
/**
|
||||
* @param questionDOs
|
||||
* @return
|
||||
*/
|
||||
List<QuestionCO> converDOsToCOs(List<QuestionDO> questionDOs);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.zcloud.edu.command.convertor;
|
||||
|
||||
import com.zcloud.edu.dto.clientobject.VideoCoursewareCO;
|
||||
import com.zcloud.edu.persistence.dataobject.VideoCoursewareDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface VideoCoursewareCoConvertor {
|
||||
/**
|
||||
* @param videoCoursewareDOs
|
||||
* @return
|
||||
*/
|
||||
List<VideoCoursewareCO> converDOsToCOs(List<VideoCoursewareDO> videoCoursewareDOs);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.zcloud.edu.command.query;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.zcloud.edu.command.convertor.QuestionCoConvertor;
|
||||
import com.zcloud.edu.dto.QuestionPageQry;
|
||||
import com.zcloud.edu.dto.QuestionListQry;
|
||||
import com.zcloud.edu.dto.clientobject.QuestionCO;
|
||||
import com.zcloud.edu.persistence.dataobject.QuestionDO;
|
||||
import com.zcloud.edu.persistence.repository.QuestionRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:11
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class QuestionQueryExe {
|
||||
private final QuestionRepository questionRepository;
|
||||
private final QuestionCoConvertor questionCoConvertor;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public PageResponse<QuestionCO> execute(QuestionPageQry qry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
PageResponse<QuestionDO> pageResponse = questionRepository.listPage(params);
|
||||
List<QuestionCO> examCenterCOS = questionCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
public MultiResponse<QuestionCO> execute(QuestionListQry qry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
List<QuestionDO> list = questionRepository.list(params);
|
||||
List<QuestionCO> examCenterCOS = questionCoConvertor.converDOsToCOs(list);
|
||||
return MultiResponse.of(examCenterCOS);
|
||||
}
|
||||
|
||||
public SingleResponse<QuestionCO> execute(Long id) {
|
||||
SingleResponse<QuestionDO> questionDO = questionRepository.getInfoById(id);
|
||||
QuestionCO co = new QuestionCO();
|
||||
BeanUtils.copyProperties(questionDO.getData(), co);
|
||||
return SingleResponse.of(co);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.zcloud.edu.command.query;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.zcloud.edu.command.convertor.VideoCoursewareCoConvertor;
|
||||
import com.zcloud.edu.dto.VideoCoursewarePageQry;
|
||||
import com.zcloud.edu.dto.VideoCoursewareListQry;
|
||||
import com.zcloud.edu.dto.clientobject.VideoCoursewareCO;
|
||||
import com.zcloud.edu.persistence.dataobject.VideoCoursewareDO;
|
||||
import com.zcloud.edu.persistence.repository.VideoCoursewareRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class VideoCoursewareQueryExe {
|
||||
private final VideoCoursewareRepository videoCoursewareRepository;
|
||||
private final VideoCoursewareCoConvertor videoCoursewareCoConvertor;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public PageResponse<VideoCoursewareCO> execute(VideoCoursewarePageQry qry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
PageResponse<VideoCoursewareDO> pageResponse = videoCoursewareRepository.listPage(params);
|
||||
List<VideoCoursewareCO> examCenterCOS = videoCoursewareCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
public MultiResponse<VideoCoursewareCO> execute(VideoCoursewareListQry qry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
List<VideoCoursewareDO> list = videoCoursewareRepository.list(params);
|
||||
List<VideoCoursewareCO> examCenterCOS = videoCoursewareCoConvertor.converDOsToCOs(list);
|
||||
return MultiResponse.of(examCenterCOS);
|
||||
}
|
||||
|
||||
public SingleResponse<VideoCoursewareCO> execute(Long id) {
|
||||
SingleResponse<VideoCoursewareDO> videoCoursewareDO = videoCoursewareRepository.getInfoById(id);
|
||||
VideoCoursewareCO co = new VideoCoursewareCO();
|
||||
BeanUtils.copyProperties(videoCoursewareDO.getData(), co);
|
||||
return SingleResponse.of(co);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.zcloud.edu.service;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.zcloud.edu.api.QuestionServiceI;
|
||||
import com.zcloud.edu.command.QuestionAddExe;
|
||||
import com.zcloud.edu.command.QuestionRemoveExe;
|
||||
import com.zcloud.edu.command.QuestionUpdateExe;
|
||||
import com.zcloud.edu.command.query.QuestionQueryExe;
|
||||
import com.zcloud.edu.dto.QuestionAddCmd;
|
||||
import com.zcloud.edu.dto.QuestionPageQry;
|
||||
import com.zcloud.edu.dto.QuestionListQry;
|
||||
import com.zcloud.edu.dto.QuestionUpdateCmd;
|
||||
import com.zcloud.edu.dto.clientobject.QuestionCO;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:11
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QuestionServiceImpl implements QuestionServiceI {
|
||||
private final QuestionAddExe questionAddExe;
|
||||
private final QuestionUpdateExe questionUpdateExe;
|
||||
private final QuestionRemoveExe questionRemoveExe;
|
||||
private final QuestionQueryExe questionQueryExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<QuestionCO> listPage(QuestionPageQry qry) {
|
||||
return questionQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiResponse<QuestionCO> list(QuestionListQry qry) {
|
||||
return questionQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<QuestionCO> getInfoById(Long id) {
|
||||
return questionQueryExe.execute(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse add(QuestionAddCmd cmd) {
|
||||
questionAddExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(QuestionUpdateCmd cmd) {
|
||||
questionUpdateExe.execute(cmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Long id) {
|
||||
questionRemoveExe.execute(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBatch(Long[] ids) {
|
||||
questionRemoveExe.execute(ids);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.zcloud.edu.service;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.zcloud.edu.api.VideoCoursewareServiceI;
|
||||
import com.zcloud.edu.command.VideoCoursewareAddExe;
|
||||
import com.zcloud.edu.command.VideoCoursewareRemoveExe;
|
||||
import com.zcloud.edu.command.VideoCoursewareUpdateExe;
|
||||
import com.zcloud.edu.command.query.VideoCoursewareQueryExe;
|
||||
import com.zcloud.edu.dto.VideoCoursewareAddCmd;
|
||||
import com.zcloud.edu.dto.VideoCoursewarePageQry;
|
||||
import com.zcloud.edu.dto.VideoCoursewareListQry;
|
||||
import com.zcloud.edu.dto.VideoCoursewareUpdateCmd;
|
||||
import com.zcloud.edu.dto.clientobject.VideoCoursewareCO;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class VideoCoursewareServiceImpl implements VideoCoursewareServiceI {
|
||||
private final VideoCoursewareAddExe videoCoursewareAddExe;
|
||||
private final VideoCoursewareUpdateExe videoCoursewareUpdateExe;
|
||||
private final VideoCoursewareRemoveExe videoCoursewareRemoveExe;
|
||||
private final VideoCoursewareQueryExe videoCoursewareQueryExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<VideoCoursewareCO> listPage(VideoCoursewarePageQry qry) {
|
||||
return videoCoursewareQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiResponse<VideoCoursewareCO> list(VideoCoursewareListQry qry) {
|
||||
return videoCoursewareQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<VideoCoursewareCO> getInfoById(Long id) {
|
||||
return videoCoursewareQueryExe.execute(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse add(VideoCoursewareAddCmd cmd) {
|
||||
videoCoursewareAddExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(VideoCoursewareUpdateCmd cmd) {
|
||||
videoCoursewareUpdateExe.execute(cmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Long id) {
|
||||
videoCoursewareRemoveExe.execute(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBatch(Long[] ids) {
|
||||
videoCoursewareRemoveExe.execute(ids);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.zcloud.edu.api;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.zcloud.edu.dto.QuestionAddCmd;
|
||||
import com.zcloud.edu.dto.QuestionPageQry;
|
||||
import com.zcloud.edu.dto.QuestionListQry;
|
||||
import com.zcloud.edu.dto.QuestionUpdateCmd;
|
||||
import com.zcloud.edu.dto.clientobject.QuestionCO;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:11
|
||||
*/
|
||||
public interface QuestionServiceI {
|
||||
PageResponse<QuestionCO> listPage(QuestionPageQry qry);
|
||||
|
||||
MultiResponse<QuestionCO> list(QuestionListQry qry);
|
||||
|
||||
SingleResponse<QuestionCO> getInfoById(Long id);
|
||||
|
||||
SingleResponse<QuestionCO> add(QuestionAddCmd cmd);
|
||||
|
||||
void edit(QuestionUpdateCmd cmd);
|
||||
|
||||
void remove(Long id);
|
||||
|
||||
void removeBatch(Long[] ids);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.zcloud.edu.api;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.zcloud.edu.dto.VideoCoursewareAddCmd;
|
||||
import com.zcloud.edu.dto.VideoCoursewarePageQry;
|
||||
import com.zcloud.edu.dto.VideoCoursewareListQry;
|
||||
import com.zcloud.edu.dto.VideoCoursewareUpdateCmd;
|
||||
import com.zcloud.edu.dto.clientobject.VideoCoursewareCO;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
public interface VideoCoursewareServiceI {
|
||||
PageResponse<VideoCoursewareCO> listPage(VideoCoursewarePageQry qry);
|
||||
|
||||
MultiResponse<VideoCoursewareCO> list(VideoCoursewareListQry qry);
|
||||
|
||||
SingleResponse<VideoCoursewareCO> getInfoById(Long id);
|
||||
|
||||
SingleResponse<VideoCoursewareCO> add(VideoCoursewareAddCmd cmd);
|
||||
|
||||
void edit(VideoCoursewareUpdateCmd cmd);
|
||||
|
||||
void remove(Long id);
|
||||
|
||||
void removeBatch(Long[] ids);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.zcloud.edu.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:10
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionAddCmd extends Command {
|
||||
@ApiModelProperty(value = "课件id", name = "videoCoursewareId", required = true)
|
||||
@NotEmpty(message = "课件id不能为空")
|
||||
private String videoCoursewareId;
|
||||
|
||||
@ApiModelProperty(value = "试卷id", name = "examPaperId", required = true)
|
||||
@NotEmpty(message = "试卷id不能为空")
|
||||
private String examPaperId;
|
||||
|
||||
@ApiModelProperty(value = "题号", name = "questionNumber", required = true)
|
||||
@NotNull(message = "题号不能为空")
|
||||
private Integer questionNumber;
|
||||
|
||||
@ApiModelProperty(value = "试题类型(单选题、多选题、判断题、填空题)", name = "questionType", required = true)
|
||||
@NotEmpty(message = "试题类型(单选题、多选题、判断题、填空题)不能为空")
|
||||
private String questionType;
|
||||
|
||||
@ApiModelProperty(value = "试题类型名称", name = "questionTypeName", required = true)
|
||||
@NotEmpty(message = "试题类型名称不能为空")
|
||||
private String questionTypeName;
|
||||
|
||||
@ApiModelProperty(value = "题干", name = "questionDry", required = true)
|
||||
@NotEmpty(message = "题干不能为空")
|
||||
private String questionDry;
|
||||
|
||||
@ApiModelProperty(value = "选项A", name = "optionA", required = true)
|
||||
@NotEmpty(message = "选项A不能为空")
|
||||
private String optionA;
|
||||
|
||||
@ApiModelProperty(value = "选项B", name = "optionB", required = true)
|
||||
@NotEmpty(message = "选项B不能为空")
|
||||
private String optionB;
|
||||
|
||||
@ApiModelProperty(value = "选项C", name = "optionC", required = true)
|
||||
@NotEmpty(message = "选项C不能为空")
|
||||
private String optionC;
|
||||
|
||||
@ApiModelProperty(value = "选项D", name = "optionD", required = true)
|
||||
@NotEmpty(message = "选项D不能为空")
|
||||
private String optionD;
|
||||
|
||||
@ApiModelProperty(value = "答案", name = "answer", required = true)
|
||||
@NotEmpty(message = "答案不能为空")
|
||||
private String answer;
|
||||
|
||||
@ApiModelProperty(value = "课件类型(1:视频课件、2:试卷习题)", name = "coursewareType", required = true)
|
||||
@NotNull(message = "课件类型(1:视频课件、2:试卷习题)不能为空")
|
||||
private Integer coursewareType;
|
||||
|
||||
@ApiModelProperty(value = "答案解析", name = "descr", required = true)
|
||||
@NotEmpty(message = "答案解析不能为空")
|
||||
private String descr;
|
||||
|
||||
@ApiModelProperty(value = "分值", name = "score", required = true)
|
||||
@NotEmpty(message = "分值不能为空")
|
||||
private String score;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.zcloud.edu.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:11
|
||||
*/
|
||||
@Data
|
||||
public class QuestionListQry extends PageQuery {
|
||||
|
||||
/**
|
||||
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||
* - `eq`: 等值查询,对应SQL的=操作符
|
||||
* - `gt`: 大于比较查询
|
||||
* - `lt`: 小于比较查询
|
||||
* - `ge`: 大于等于比较查询
|
||||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likeQuestionId;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.zcloud.edu.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:10
|
||||
*/
|
||||
@Data
|
||||
public class QuestionPageQry extends PageQuery {
|
||||
|
||||
/**
|
||||
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||
* - `eq`: 等值查询,对应SQL的=操作符
|
||||
* - `gt`: 大于比较查询
|
||||
* - `lt`: 小于比较查询
|
||||
* - `ge`: 大于等于比较查询
|
||||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likeQuestionId;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.zcloud.edu.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:11
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionRemoveCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "主键", name = "ids", required = true)
|
||||
@NotNull(message = "主键不能为空")
|
||||
@Size(min = 1, message = "请选择数据")
|
||||
private Long[] ids;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.zcloud.edu.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:11
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionUpdateCmd extends Command {
|
||||
@ApiModelProperty(value = "${column.comment}", name = "id", required = true)
|
||||
@NotNull(message = "${column.comment}不能为空")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "业务主键id", name = "questionId", required = true)
|
||||
@NotEmpty(message = "业务主键id不能为空")
|
||||
private String questionId;
|
||||
@ApiModelProperty(value = "课件id", name = "videoCoursewareId", required = true)
|
||||
@NotEmpty(message = "课件id不能为空")
|
||||
private String videoCoursewareId;
|
||||
@ApiModelProperty(value = "试卷id", name = "examPaperId", required = true)
|
||||
@NotEmpty(message = "试卷id不能为空")
|
||||
private String examPaperId;
|
||||
@ApiModelProperty(value = "题号", name = "questionNumber", required = true)
|
||||
@NotNull(message = "题号不能为空")
|
||||
private Integer questionNumber;
|
||||
@ApiModelProperty(value = "试题类型(单选题、多选题、判断题、填空题)", name = "questionType", required = true)
|
||||
@NotEmpty(message = "试题类型(单选题、多选题、判断题、填空题)不能为空")
|
||||
private String questionType;
|
||||
@ApiModelProperty(value = "试题类型名称", name = "questionTypeName", required = true)
|
||||
@NotEmpty(message = "试题类型名称不能为空")
|
||||
private String questionTypeName;
|
||||
@ApiModelProperty(value = "题干", name = "questionDry", required = true)
|
||||
@NotEmpty(message = "题干不能为空")
|
||||
private String questionDry;
|
||||
@ApiModelProperty(value = "选项A", name = "optionA", required = true)
|
||||
@NotEmpty(message = "选项A不能为空")
|
||||
private String optionA;
|
||||
@ApiModelProperty(value = "选项B", name = "optionB", required = true)
|
||||
@NotEmpty(message = "选项B不能为空")
|
||||
private String optionB;
|
||||
@ApiModelProperty(value = "选项C", name = "optionC", required = true)
|
||||
@NotEmpty(message = "选项C不能为空")
|
||||
private String optionC;
|
||||
@ApiModelProperty(value = "选项D", name = "optionD", required = true)
|
||||
@NotEmpty(message = "选项D不能为空")
|
||||
private String optionD;
|
||||
@ApiModelProperty(value = "答案", name = "answer", required = true)
|
||||
@NotEmpty(message = "答案不能为空")
|
||||
private String answer;
|
||||
@ApiModelProperty(value = "课件类型(1:视频课件、2:试卷习题)", name = "coursewareType", required = true)
|
||||
@NotNull(message = "课件类型(1:视频课件、2:试卷习题)不能为空")
|
||||
private Integer coursewareType;
|
||||
@ApiModelProperty(value = "答案解析", name = "descr", required = true)
|
||||
@NotEmpty(message = "答案解析不能为空")
|
||||
private String descr;
|
||||
@ApiModelProperty(value = "分值", name = "score", required = true)
|
||||
@NotEmpty(message = "分值不能为空")
|
||||
private String score;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.zcloud.edu.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:31
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VideoCoursewareAddCmd extends Command {
|
||||
@ApiModelProperty(value = "企业ID", name = "corpinfoId", required = true)
|
||||
@NotNull(message = "企业ID不能为空")
|
||||
private Long corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "课件名称", name = "coursewareName", required = true)
|
||||
@NotEmpty(message = "课件名称不能为空")
|
||||
private String coursewareName;
|
||||
|
||||
@ApiModelProperty(value = "培训类型id", name = "trainingTypeId", required = true)
|
||||
@NotEmpty(message = "培训类型id不能为空")
|
||||
private String trainingTypeId;
|
||||
|
||||
@ApiModelProperty(value = "教师id", name = "teacherId", required = true)
|
||||
@NotEmpty(message = "教师id不能为空")
|
||||
private String teacherId;
|
||||
|
||||
@ApiModelProperty(value = "课件文件路径", name = "videoFiles", required = true)
|
||||
@NotEmpty(message = "课件文件路径不能为空")
|
||||
private String videoFiles;
|
||||
|
||||
@ApiModelProperty(value = "课件描述", name = "coursewareIntroduce", required = true)
|
||||
@NotEmpty(message = "课件描述不能为空")
|
||||
private String coursewareIntroduce;
|
||||
|
||||
@ApiModelProperty(value = "课件状态 0未启用, 1-启用", name = "state", required = true)
|
||||
@NotNull(message = "课件状态 0未启用, 1-启用不能为空")
|
||||
private Integer state;
|
||||
|
||||
@ApiModelProperty(value = "学时,单位分钟", name = "classHour", required = true)
|
||||
@NotEmpty(message = "学时,单位分钟不能为空")
|
||||
private String classHour;
|
||||
|
||||
@ApiModelProperty(value = "课件时长(视频时间)-分钟", name = "videoTime", required = true)
|
||||
@NotEmpty(message = "课件时长(视频时间)-分钟不能为空")
|
||||
private String videoTime;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.zcloud.edu.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
@Data
|
||||
public class VideoCoursewareListQry extends PageQuery {
|
||||
|
||||
/**
|
||||
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||
* - `eq`: 等值查询,对应SQL的=操作符
|
||||
* - `gt`: 大于比较查询
|
||||
* - `lt`: 小于比较查询
|
||||
* - `ge`: 大于等于比较查询
|
||||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likeVideoCoursewareId;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.zcloud.edu.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
@Data
|
||||
public class VideoCoursewarePageQry extends PageQuery {
|
||||
|
||||
/**
|
||||
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||
* - `eq`: 等值查询,对应SQL的=操作符
|
||||
* - `gt`: 大于比较查询
|
||||
* - `lt`: 小于比较查询
|
||||
* - `ge`: 大于等于比较查询
|
||||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likeVideoCoursewareId;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.zcloud.edu.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:33
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VideoCoursewareRemoveCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "主键", name = "ids", required = true)
|
||||
@NotNull(message = "主键不能为空")
|
||||
@Size(min = 1, message = "请选择数据")
|
||||
private Long[] ids;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.zcloud.edu.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VideoCoursewareUpdateCmd extends Command {
|
||||
@ApiModelProperty(value = "id", name = "id", required = true)
|
||||
@NotNull(message = "id不能为空")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "业务主键id", name = "videoCoursewareId", required = true)
|
||||
@NotEmpty(message = "业务主键id不能为空")
|
||||
private String videoCoursewareId;
|
||||
@ApiModelProperty(value = "企业ID", name = "corpinfoId", required = true)
|
||||
@NotNull(message = "企业ID不能为空")
|
||||
private Long corpinfoId;
|
||||
@ApiModelProperty(value = "课件名称", name = "coursewareName", required = true)
|
||||
@NotEmpty(message = "课件名称不能为空")
|
||||
private String coursewareName;
|
||||
@ApiModelProperty(value = "培训类型id", name = "trainingTypeId", required = true)
|
||||
@NotEmpty(message = "培训类型id不能为空")
|
||||
private String trainingTypeId;
|
||||
@ApiModelProperty(value = "教师id", name = "teacherId", required = true)
|
||||
@NotEmpty(message = "教师id不能为空")
|
||||
private String teacherId;
|
||||
@ApiModelProperty(value = "课件文件路径", name = "videoFiles", required = true)
|
||||
@NotEmpty(message = "课件文件路径不能为空")
|
||||
private String videoFiles;
|
||||
@ApiModelProperty(value = "课件描述", name = "coursewareIntroduce", required = true)
|
||||
@NotEmpty(message = "课件描述不能为空")
|
||||
private String coursewareIntroduce;
|
||||
@ApiModelProperty(value = "课件状态 0未启用, 1-启用", name = "state", required = true)
|
||||
@NotNull(message = "课件状态 0未启用, 1-启用不能为空")
|
||||
private Integer state;
|
||||
@ApiModelProperty(value = "学时,单位分钟", name = "classHour", required = true)
|
||||
@NotEmpty(message = "学时,单位分钟不能为空")
|
||||
private String classHour;
|
||||
@ApiModelProperty(value = "课件时长(视频时间)-分钟", name = "videoTime", required = true)
|
||||
@NotEmpty(message = "课件时长(视频时间)-分钟不能为空")
|
||||
private String videoTime;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.zcloud.edu.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:10
|
||||
*/
|
||||
@Data
|
||||
public class QuestionCO extends ClientObject {
|
||||
|
||||
private Long id;
|
||||
//业务主键id
|
||||
@ApiModelProperty(value = "业务主键id")
|
||||
|
||||
private String questionId;
|
||||
//课件id
|
||||
@ApiModelProperty(value = "课件id")
|
||||
|
||||
private String videoCoursewareId;
|
||||
//试卷id
|
||||
@ApiModelProperty(value = "试卷id")
|
||||
|
||||
private String examPaperId;
|
||||
//题号
|
||||
@ApiModelProperty(value = "题号")
|
||||
|
||||
private Integer questionNumber;
|
||||
//试题类型(单选题、多选题、判断题、填空题)
|
||||
@ApiModelProperty(value = "试题类型(单选题、多选题、判断题、填空题)")
|
||||
|
||||
private String questionType;
|
||||
//试题类型名称
|
||||
@ApiModelProperty(value = "试题类型名称")
|
||||
|
||||
private String questionTypeName;
|
||||
//题干
|
||||
@ApiModelProperty(value = "题干")
|
||||
|
||||
private String questionDry;
|
||||
//选项A
|
||||
@ApiModelProperty(value = "选项A")
|
||||
|
||||
private String optionA;
|
||||
//选项B
|
||||
@ApiModelProperty(value = "选项B")
|
||||
|
||||
private String optionB;
|
||||
//选项C
|
||||
@ApiModelProperty(value = "选项C")
|
||||
|
||||
private String optionC;
|
||||
//选项D
|
||||
@ApiModelProperty(value = "选项D")
|
||||
|
||||
private String optionD;
|
||||
//答案
|
||||
@ApiModelProperty(value = "答案")
|
||||
|
||||
private String answer;
|
||||
//课件类型(1:视频课件、2:试卷习题)
|
||||
@ApiModelProperty(value = "课件类型(1:视频课件、2:试卷习题)")
|
||||
|
||||
private Integer coursewareType;
|
||||
//答案解析
|
||||
@ApiModelProperty(value = "答案解析")
|
||||
|
||||
private String descr;
|
||||
//分值
|
||||
@ApiModelProperty(value = "分值")
|
||||
|
||||
private String score;
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.zcloud.edu.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:31
|
||||
*/
|
||||
@Data
|
||||
public class VideoCoursewareCO extends ClientObject {
|
||||
//id
|
||||
@ApiModelProperty(value = "id")
|
||||
|
||||
private Long id;
|
||||
//业务主键id
|
||||
@ApiModelProperty(value = "业务主键id")
|
||||
|
||||
private String videoCoursewareId;
|
||||
//企业ID
|
||||
@ApiModelProperty(value = "企业ID")
|
||||
|
||||
private Long corpinfoId;
|
||||
//课件名称
|
||||
@ApiModelProperty(value = "课件名称")
|
||||
|
||||
private String coursewareName;
|
||||
//培训类型id
|
||||
@ApiModelProperty(value = "培训类型id")
|
||||
|
||||
private String trainingTypeId;
|
||||
//教师id
|
||||
@ApiModelProperty(value = "教师id")
|
||||
|
||||
private String teacherId;
|
||||
//课件文件路径
|
||||
@ApiModelProperty(value = "课件文件路径")
|
||||
|
||||
private String videoFiles;
|
||||
//课件描述
|
||||
@ApiModelProperty(value = "课件描述")
|
||||
|
||||
private String coursewareIntroduce;
|
||||
//课件状态 0未启用, 1-启用
|
||||
@ApiModelProperty(value = "课件状态 0未启用, 1-启用")
|
||||
|
||||
private Integer state;
|
||||
//学时,单位分钟
|
||||
@ApiModelProperty(value = "学时,单位分钟")
|
||||
|
||||
private String classHour;
|
||||
//课件时长(视频时间)-分钟
|
||||
@ApiModelProperty(value = "课件时长(视频时间)-分钟")
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime videoTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.zcloud.edu.domain.gateway;
|
||||
|
||||
import com.zcloud.edu.domain.model.QuestionE;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:10
|
||||
*/
|
||||
public interface QuestionGateway {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
Boolean add(QuestionE questionE);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
Boolean update(QuestionE questionE);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
Boolean deletedQuestionById(Long id);
|
||||
|
||||
Boolean deletedQuestionByIds(Long[] id);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.zcloud.edu.domain.gateway;
|
||||
|
||||
import com.zcloud.edu.domain.model.VideoCoursewareE;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
public interface VideoCoursewareGateway {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
Boolean add(VideoCoursewareE videoCoursewareE);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
Boolean update(VideoCoursewareE videoCoursewareE);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
Boolean deletedVideoCoursewareById(Long id);
|
||||
|
||||
Boolean deletedVideoCoursewareByIds(Long[] id);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.zcloud.edu.domain.model;
|
||||
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:10
|
||||
*/
|
||||
@Data
|
||||
public class QuestionE extends BaseE {
|
||||
private Long id;
|
||||
//业务主键id
|
||||
private String questionId;
|
||||
//课件id
|
||||
private String videoCoursewareId;
|
||||
//试卷id
|
||||
private String examPaperId;
|
||||
//题号
|
||||
private Integer questionNumber;
|
||||
//试题类型(单选题、多选题、判断题、填空题)
|
||||
private String questionType;
|
||||
//试题类型名称
|
||||
private String questionTypeName;
|
||||
//题干
|
||||
private String questionDry;
|
||||
//选项A
|
||||
private String optionA;
|
||||
//选项B
|
||||
private String optionB;
|
||||
//选项C
|
||||
private String optionC;
|
||||
//选项D
|
||||
private String optionD;
|
||||
//答案
|
||||
private String answer;
|
||||
//课件类型(1:视频课件、2:试卷习题)
|
||||
private Integer coursewareType;
|
||||
//答案解析
|
||||
private String descr;
|
||||
//分值
|
||||
private String score;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.zcloud.edu.domain.model;
|
||||
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
@Data
|
||||
public class VideoCoursewareE extends BaseE {
|
||||
//id
|
||||
private Long id;
|
||||
//业务主键id
|
||||
private String videoCoursewareId;
|
||||
//企业ID
|
||||
private Long corpinfoId;
|
||||
//课件名称
|
||||
private String coursewareName;
|
||||
//培训类型id
|
||||
private String trainingTypeId;
|
||||
//教师id
|
||||
private String teacherId;
|
||||
//课件文件路径
|
||||
private String videoFiles;
|
||||
//课件描述
|
||||
private String coursewareIntroduce;
|
||||
//课件状态 0未启用, 1-启用
|
||||
private Integer state;
|
||||
//学时,单位分钟
|
||||
private String classHour;
|
||||
//课件时长(视频时间)-分钟
|
||||
private String videoTime;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.zcloud.edu.gatewayimpl;
|
||||
|
||||
import com.zcloud.edu.domain.gateway.QuestionGateway;
|
||||
import com.zcloud.edu.domain.model.QuestionE;
|
||||
import com.zcloud.edu.persistence.dataobject.QuestionDO;
|
||||
import com.zcloud.edu.persistence.repository.QuestionRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:10
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QuestionGatewayImpl implements QuestionGateway {
|
||||
private final QuestionRepository questionRepository;
|
||||
|
||||
@Override
|
||||
public Boolean add(QuestionE questionE) {
|
||||
QuestionDO d = new QuestionDO();
|
||||
BeanUtils.copyProperties(questionE, d);
|
||||
questionRepository.save(d);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(QuestionE questionE) {
|
||||
QuestionDO d = new QuestionDO();
|
||||
BeanUtils.copyProperties(questionE, d);
|
||||
questionRepository.updateById(d);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedQuestionById(Long id) {
|
||||
return questionRepository.removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedQuestionByIds(Long[] ids) {
|
||||
return questionRepository.removeByIds(Collections.singletonList(ids));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.zcloud.edu.gatewayimpl;
|
||||
|
||||
import com.zcloud.edu.domain.gateway.VideoCoursewareGateway;
|
||||
import com.zcloud.edu.domain.model.VideoCoursewareE;
|
||||
import com.zcloud.edu.persistence.dataobject.VideoCoursewareDO;
|
||||
import com.zcloud.edu.persistence.repository.VideoCoursewareRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class VideoCoursewareGatewayImpl implements VideoCoursewareGateway {
|
||||
private final VideoCoursewareRepository videoCoursewareRepository;
|
||||
|
||||
@Override
|
||||
public Boolean add(VideoCoursewareE videoCoursewareE) {
|
||||
VideoCoursewareDO d = new VideoCoursewareDO();
|
||||
BeanUtils.copyProperties(videoCoursewareE, d);
|
||||
videoCoursewareRepository.save(d);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(VideoCoursewareE videoCoursewareE) {
|
||||
VideoCoursewareDO d = new VideoCoursewareDO();
|
||||
BeanUtils.copyProperties(videoCoursewareE, d);
|
||||
videoCoursewareRepository.updateById(d);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedVideoCoursewareById(Long id) {
|
||||
return videoCoursewareRepository.removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedVideoCoursewareByIds(Long[] ids) {
|
||||
return videoCoursewareRepository.removeByIds(Collections.singletonList(ids));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.zcloud.edu.persistence.dataobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import lombok.Data;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:10
|
||||
*/
|
||||
@Data
|
||||
@TableName("question")
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class QuestionDO extends BaseDO {
|
||||
//业务主键id
|
||||
@ApiModelProperty(value = "业务主键id")
|
||||
private String questionId;
|
||||
//课件id
|
||||
@ApiModelProperty(value = "课件id")
|
||||
private String videoCoursewareId;
|
||||
//试卷id
|
||||
@ApiModelProperty(value = "试卷id")
|
||||
private String examPaperId;
|
||||
//题号
|
||||
@ApiModelProperty(value = "题号")
|
||||
private Integer questionNumber;
|
||||
//试题类型(单选题、多选题、判断题、填空题)
|
||||
@ApiModelProperty(value = "试题类型(单选题、多选题、判断题、填空题)")
|
||||
private String questionType;
|
||||
//试题类型名称
|
||||
@ApiModelProperty(value = "试题类型名称")
|
||||
private String questionTypeName;
|
||||
//题干
|
||||
@ApiModelProperty(value = "题干")
|
||||
private String questionDry;
|
||||
//选项A
|
||||
@ApiModelProperty(value = "选项A")
|
||||
private String optionA;
|
||||
//选项B
|
||||
@ApiModelProperty(value = "选项B")
|
||||
private String optionB;
|
||||
//选项C
|
||||
@ApiModelProperty(value = "选项C")
|
||||
private String optionC;
|
||||
//选项D
|
||||
@ApiModelProperty(value = "选项D")
|
||||
private String optionD;
|
||||
//答案
|
||||
@ApiModelProperty(value = "答案")
|
||||
private String answer;
|
||||
//课件类型(1:视频课件、2:试卷习题)
|
||||
@ApiModelProperty(value = "课件类型(1:视频课件、2:试卷习题)")
|
||||
private Integer coursewareType;
|
||||
//答案解析
|
||||
@ApiModelProperty(value = "答案解析")
|
||||
private String descr;
|
||||
//分值
|
||||
@ApiModelProperty(value = "分值")
|
||||
private String score;
|
||||
|
||||
public QuestionDO(String questionId) {
|
||||
this.questionId = questionId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.zcloud.edu.persistence.dataobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import lombok.Data;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
@Data
|
||||
@TableName("video_courseware")
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class VideoCoursewareDO extends BaseDO {
|
||||
//业务主键id
|
||||
@ApiModelProperty(value = "业务主键id")
|
||||
private String videoCoursewareId;
|
||||
//企业ID
|
||||
@ApiModelProperty(value = "企业ID")
|
||||
private Long corpinfoId;
|
||||
//课件名称
|
||||
@ApiModelProperty(value = "课件名称")
|
||||
private String coursewareName;
|
||||
//培训类型id
|
||||
@ApiModelProperty(value = "培训类型id")
|
||||
private String trainingTypeId;
|
||||
//教师id
|
||||
@ApiModelProperty(value = "教师id")
|
||||
private String teacherId;
|
||||
//课件文件路径
|
||||
@ApiModelProperty(value = "课件文件路径")
|
||||
private String videoFiles;
|
||||
//课件描述
|
||||
@ApiModelProperty(value = "课件描述")
|
||||
private String coursewareIntroduce;
|
||||
//课件状态 0未启用, 1-启用
|
||||
@ApiModelProperty(value = "课件状态 0未启用, 1-启用")
|
||||
private Integer state;
|
||||
//学时,单位分钟
|
||||
@ApiModelProperty(value = "学时,单位分钟")
|
||||
private String classHour;
|
||||
//课件时长(视频时间)-分钟
|
||||
@ApiModelProperty(value = "课件时长(视频时间)-分钟")
|
||||
private String videoTime;
|
||||
|
||||
public VideoCoursewareDO(String videoCoursewareId) {
|
||||
this.videoCoursewareId = videoCoursewareId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.zcloud.edu.persistence.mapper;
|
||||
|
||||
import com.zcloud.edu.persistence.dataobject.QuestionDO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:10
|
||||
*/
|
||||
@Mapper
|
||||
public interface QuestionMapper extends BaseMapper<QuestionDO> {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.zcloud.edu.persistence.mapper;
|
||||
|
||||
import com.zcloud.edu.persistence.dataobject.VideoCoursewareDO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
@Mapper
|
||||
public interface VideoCoursewareMapper extends BaseMapper<VideoCoursewareDO> {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.zcloud.edu.persistence.repository;
|
||||
|
||||
import com.zcloud.edu.persistence.dataobject.QuestionDO;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:11
|
||||
*/
|
||||
public interface QuestionRepository extends BaseRepository<QuestionDO> {
|
||||
|
||||
PageResponse<QuestionDO> listPage(Map<String, Object> params);
|
||||
|
||||
List<QuestionDO> list(Map<String, Object> params);
|
||||
|
||||
SingleResponse<QuestionDO> getInfoById(Long id);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.zcloud.edu.persistence.repository;
|
||||
|
||||
import com.zcloud.edu.persistence.dataobject.VideoCoursewareDO;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
public interface VideoCoursewareRepository extends BaseRepository<VideoCoursewareDO> {
|
||||
|
||||
PageResponse<VideoCoursewareDO> listPage(Map<String, Object> params);
|
||||
|
||||
List<VideoCoursewareDO> list(Map<String, Object> params);
|
||||
|
||||
SingleResponse<VideoCoursewareDO> getInfoById(Long id);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.zcloud.edu.persistence.repository.impl;
|
||||
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.zcloud.edu.persistence.dataobject.QuestionDO;
|
||||
import com.zcloud.edu.persistence.mapper.QuestionMapper;
|
||||
import com.zcloud.edu.persistence.repository.QuestionRepository;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.gbscommon.utils.Query;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:06:11
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class QuestionRepositoryImpl extends BaseRepositoryImpl<QuestionMapper, QuestionDO> implements QuestionRepository {
|
||||
private final QuestionMapper questionMapper;
|
||||
|
||||
@Override
|
||||
public PageResponse<QuestionDO> listPage(Map<String, Object> params) {
|
||||
IPage<QuestionDO> iPage = new Query<QuestionDO>().getPage(params);
|
||||
QueryWrapper<QuestionDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<QuestionDO> result = questionMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuestionDO> list(Map<String, Object> params) {
|
||||
QueryWrapper<QuestionDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
List<QuestionDO> result = questionMapper.selectList(queryWrapper);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<QuestionDO> getInfoById(Long id) {
|
||||
return SingleResponse.of(questionMapper.selectById(id));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.zcloud.edu.persistence.repository.impl;
|
||||
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.zcloud.edu.persistence.dataobject.VideoCoursewareDO;
|
||||
import com.zcloud.edu.persistence.mapper.VideoCoursewareMapper;
|
||||
import com.zcloud.edu.persistence.repository.VideoCoursewareRepository;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.gbscommon.utils.Query;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-11-27 14:05:32
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class VideoCoursewareRepositoryImpl extends BaseRepositoryImpl<VideoCoursewareMapper, VideoCoursewareDO> implements VideoCoursewareRepository {
|
||||
private final VideoCoursewareMapper videoCoursewareMapper;
|
||||
|
||||
@Override
|
||||
public PageResponse<VideoCoursewareDO> listPage(Map<String, Object> params) {
|
||||
IPage<VideoCoursewareDO> iPage = new Query<VideoCoursewareDO>().getPage(params);
|
||||
QueryWrapper<VideoCoursewareDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<VideoCoursewareDO> result = videoCoursewareMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VideoCoursewareDO> list(Map<String, Object> params) {
|
||||
QueryWrapper<VideoCoursewareDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
List<VideoCoursewareDO> result = videoCoursewareMapper.selectList(queryWrapper);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<VideoCoursewareDO> getInfoById(Long id) {
|
||||
return SingleResponse.of(videoCoursewareMapper.selectById(id));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?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.zcloud.edu.persistence.mapper.QuestionMapper">
|
||||
</mapper>
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?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.zcloud.edu.persistence.mapper.VideoCoursewareMapper">
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue