This commit is contained in:
2025-10-15 12:29:04 +08:00
parent 17ed7f6a92
commit c4b788ab9d
18 changed files with 984 additions and 0 deletions

View File

@@ -0,0 +1,133 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.modules.aiaudio.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.aiaudio.entity.AiAudioEntity;
import org.springblade.modules.aiaudio.service.IAiAudioService;
import org.springblade.modules.aiaudio.vo.AiAudioVO;
import org.springblade.modules.aiaudio.wrapper.AiAudioWrapper;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* ai语音解说音频表 控制器
*
* @author jinghan
* @since 2024-04-10
*/
@RestController
@AllArgsConstructor
@RequestMapping("/aiAudio")
@Api(value = "ai语音解说音频表", tags = "ai语音解说音频表接口")
public class AiAudioController extends BladeController {
private final IAiAudioService aiAudioService;
/**
* ai语音解说音频表 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入aiAudio")
public R<AiAudioVO> detail(AiAudioEntity aiAudio) {
AiAudioEntity detail = aiAudioService.getOne(Condition.getQueryWrapper(aiAudio));
return R.data(AiAudioWrapper.build().entityVO(detail));
}
/**
* ai语音解说音频表 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入aiAudio")
public R<IPage<AiAudioVO>> list(AiAudioEntity aiAudio, Query query) {
LambdaQueryWrapper<AiAudioEntity> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.like(aiAudio.getAudioName() != null, AiAudioEntity::getAudioName, aiAudio.getAudioName());
queryWrapper.eq(aiAudio.getId() != null, AiAudioEntity::getId, aiAudio.getId());
queryWrapper.eq(aiAudio.getScenicId() != null, AiAudioEntity::getScenicId, aiAudio.getScenicId());
queryWrapper.eq(aiAudio.getAudioIsShow() != null, AiAudioEntity::getAudioIsShow, aiAudio.getAudioIsShow());
queryWrapper.eq(aiAudio.getCurrentState() != null, AiAudioEntity::getCurrentState, aiAudio.getCurrentState());
IPage<AiAudioEntity> pages = aiAudioService.page(Condition.getPage(query), queryWrapper);
return R.data(AiAudioWrapper.build().pageVO(pages));
}
/**
* ai语音解说音频表 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入aiAudio")
public R<IPage<AiAudioVO>> page(AiAudioVO aiAudio, Query query) {
IPage<AiAudioVO> pages = aiAudioService.selectAiAudioPage(Condition.getPage(query), aiAudio);
return R.data(pages);
}
/**
* ai语音解说音频表 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入aiAudio")
public R save(@Valid @RequestBody AiAudioEntity aiAudio) {
return R.status(aiAudioService.save(aiAudio));
}
/**
* ai语音解说音频表 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入aiAudio")
public R update(@Valid @RequestBody AiAudioEntity aiAudio) {
return R.status(aiAudioService.updateById(aiAudio));
}
/**
* ai语音解说音频表 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入aiAudio")
public R submit(@Valid @RequestBody AiAudioEntity aiAudio) {
return R.status(aiAudioService.saveOrUpdate(aiAudio));
}
/**
* ai语音解说音频表 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(aiAudioService.deleteLogic(Func.toLongList(ids)));
}
}

View File

@@ -0,0 +1,134 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.modules.aiaudio.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.aiaudio.entity.AiScenicEntity;
import org.springblade.modules.aiaudio.service.IAiScenicService;
import org.springblade.modules.aiaudio.vo.AiScenicReqVO;
import org.springblade.modules.aiaudio.vo.AiScenicVO;
import org.springblade.modules.aiaudio.wrapper.AiScenicWrapper;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* ai语音解说景区景点表 控制器
*
* @author jinghan
* @since 2024-04-10
*/
@RestController
@AllArgsConstructor
@RequestMapping("/aiScenic")
@Api(value = "ai语音解说景区景点表", tags = "ai语音解说景区景点表接口")
public class AiScenicController extends BladeController {
private final IAiScenicService aiScenicService;
/**
* ai语音解说景区景点表 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入aiScenic")
public R<AiScenicVO> detail(AiScenicEntity aiScenic) {
AiScenicEntity detail = aiScenicService.getOne(Condition.getQueryWrapper(aiScenic));
return R.data(AiScenicWrapper.build().entityVO(detail));
}
/**
* ai语音解说景区景点表 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入aiScenic")
public R<IPage<AiScenicVO>> list(AiScenicReqVO aiScenic, Query query) {
LambdaQueryWrapper<AiScenicEntity> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.like(aiScenic.getSname() != null, AiScenicEntity::getSName, aiScenic.getSname());
queryWrapper.eq(aiScenic.getStype() != null, AiScenicEntity::getSType, aiScenic.getStype());
queryWrapper.eq(aiScenic.getId() != null, AiScenicEntity::getId, aiScenic.getId());
queryWrapper.eq(aiScenic.getPid() != null, AiScenicEntity::getPid, aiScenic.getPid());
queryWrapper.eq(aiScenic.getIsShow() != null, AiScenicEntity::getIsShow, aiScenic.getIsShow());
queryWrapper.eq(aiScenic.getCnAreaId() != null, AiScenicEntity::getCnAreaId, aiScenic.getCnAreaId());
IPage<AiScenicEntity> pages = aiScenicService.page(Condition.getPage(query), queryWrapper);
return R.data(AiScenicWrapper.build().pageVO(pages));
}
/**
* ai语音解说景区景点表 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入aiScenic")
public R<IPage<AiScenicVO>> page(AiScenicVO aiScenic, Query query) {
IPage<AiScenicVO> pages = aiScenicService.selectAiScenicPage(Condition.getPage(query), aiScenic);
return R.data(pages);
}
/**
* ai语音解说景区景点表 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入aiScenic")
public R save(@Valid @RequestBody AiScenicEntity aiScenic) {
return R.status(aiScenicService.save(aiScenic));
}
/**
* ai语音解说景区景点表 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入aiScenic")
public R update(@Valid @RequestBody AiScenicEntity aiScenic) {
return R.status(aiScenicService.updateById(aiScenic));
}
/**
* ai语音解说景区景点表 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入aiScenic")
public R submit(@Valid @RequestBody AiScenicEntity aiScenic) {
return R.status(aiScenicService.saveOrUpdate(aiScenic));
}
/**
* ai语音解说景区景点表 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(aiScenicService.deleteLogic(Func.toLongList(ids)));
}
}

View File

@@ -0,0 +1,29 @@
package org.springblade.modules.aiaudio.convert;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import org.springblade.modules.aiaudio.entity.AiAudioEntity;
import org.springblade.modules.aiaudio.entity.AiScenicEntity;
import org.springblade.modules.aiaudio.entity.AiSysareaEntity;
import org.springblade.modules.aiaudio.vo.AiAudioVO;
import org.springblade.modules.aiaudio.vo.AiScenicVO;
import org.springblade.modules.aiaudio.vo.AiSysareaVO;
import java.util.List;
/**
* mapstruct 转换
*/
@Mapper
public interface AiConverter {
AiConverter INSTANCE = Mappers.getMapper(AiConverter.class);
AiSysareaVO convertToVO(AiSysareaEntity entity);
AiScenicVO convertToVO(AiScenicEntity aiScenic);
AiAudioVO convertToVO(AiAudioEntity entity);
List<AiSysareaVO> convertToVOList(List<AiSysareaEntity> list);
}

View File

@@ -0,0 +1,34 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.modules.aiaudio.dto;
import org.springblade.modules.aiaudio.entity.AiAudioEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* ai语音解说音频表 数据传输对象实体类
*
* @author jinghan
* @since 2024-04-10
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class AiAudioDTO extends AiAudioEntity {
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,34 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.modules.aiaudio.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.aiaudio.entity.AiScenicEntity;
/**
* ai语音解说景区景点表 数据传输对象实体类
*
* @author jinghan
* @since 2024-04-10
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class AiScenicDTO extends AiScenicEntity {
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,156 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.modules.aiaudio.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.util.Date;
/**
* ai语音解说音频表 实体类
*
* @author jinghan
* @since 2024-04-10
*/
@Data
@TableName("ai_audio")
@ApiModel(value = "AiAudio对象", description = "ai语音解说音频表")
@EqualsAndHashCode(callSuper = true)
public class AiAudioEntity extends BaseEntity {
/**
* 音频名称
*/
@ApiModelProperty(value = "音频名称")
private String audioName;
/**
* 音频地址
*/
@ApiModelProperty(value = "音频地址")
private String audioUrl;
/**
* 音频大小
*/
@ApiModelProperty(value = "音频大小")
private Integer audioSize;
/**
* 音频图片
*/
@ApiModelProperty(value = "音频图片")
private String audioImage;
/**
* 用户ID
*/
@ApiModelProperty(value = "用户ID")
private Long userId;
/**
* 音频价格
*/
@ApiModelProperty(value = "音频价格")
private Integer audioPrice;
/**
* 音频语种【1中文 2英文 3日语(部分)】
*/
@ApiModelProperty(value = "音频语种【1中文 2英文 3日语(部分)】")
private Long audioLanguage;
/**
* 0:隐藏 1:显示 审核 另一张表 前端只需判断该字段
*/
@ApiModelProperty(value = " 0:隐藏 1:显示 审核 另一张表 前端只需判断该字段")
private Integer audioIsShow;
/**
* 音频时长
*/
@ApiModelProperty(value = "音频时长")
private Integer audioLong;
/**
* 景点id
*/
@ApiModelProperty(value = "景点id")
private Long scenicId;
/**
* 专辑id (如果后台上传音频默认值 0 )
*/
@ApiModelProperty(value = "专辑id (如果后台上传音频默认值 0 )")
private Integer albumId;
/**
* 表示 官方排序字段 用话创建 默认值 官方创建值为 999
*/
@ApiModelProperty(value = "表示 官方排序字段 用话创建 默认值 官方创建值为 999")
private Integer audioType;
/**
*
*/
@ApiModelProperty(value = "")
private Date operatorTime;
/**
*
*/
@ApiModelProperty(value = "")
private String createName;
/**
*
*/
@ApiModelProperty(value = "")
private String operatorName;
/**
* 排序因子,每天跑服务复制
*/
@ApiModelProperty(value = "排序因子,每天跑服务复制")
private Integer sortingFactor;
/**
* 音频来源:5巡洋舰启航待录制音频(语音待录制收费的) 4 注册用户 (UGC)3 起航用户 2采集人 1 链景主播
*/
@ApiModelProperty(value = "音频来源:5巡洋舰启航待录制音频(语音待录制收费的) 4 注册用户 (UGC)3 起航用户 2采集人 1 链景主播 ")
private Integer audioSource;
/**
* 排序字段
*/
@ApiModelProperty(value = "排序字段")
private Integer audioOrder;
/**
* 上一状态(1.待审核 2.已上架 3.已下架 4.修改上传)默认1 0代表空
*/
@ApiModelProperty(value = "上一状态(1.待审核 2.已上架 3.已下架 4.修改上传)默认1 0代表空")
private Integer previousStatus;
/**
* 当前状态(1.待审核 2.已上架 3.已下架 4.修改上传)默认1
*/
@ApiModelProperty(value = "当前状态(1.待审核 2.已上架 3.已下架 4.修改上传)默认1")
private Integer currentState;
/**
* 是否可试听(1.可试听 2.不可试听) 默认2
*/
@ApiModelProperty(value = "是否可试听(1.可试听 2.不可试听) 默认2")
private Integer isAudition;
/**
* 背景音乐表ID 默认0 0代表空
*/
@ApiModelProperty(value = "背景音乐表ID 默认0 0代表空")
private Integer backgroundMusicId;
/**
* 下架原因
*/
@ApiModelProperty(value = "下架原因")
private String reasonUndercarriage;
}

View File

@@ -0,0 +1,43 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.modules.aiaudio.mapper;
import org.springblade.modules.aiaudio.entity.AiAudioEntity;
import org.springblade.modules.aiaudio.vo.AiAudioVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* ai语音解说音频表 Mapper 接口
*
* @author jinghan
* @since 2024-04-10
*/
public interface AiAudioMapper extends BaseMapper<AiAudioEntity> {
/**
* 自定义分页
*
* @param page
* @param aiAudio
* @return
*/
List<AiAudioVO> selectAiAudioPage(IPage page, AiAudioVO aiAudio);
}

View File

@@ -0,0 +1,15 @@
<?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="org.springblade.modules.aiaudio.mapper.AiAudioMapper">
<!-- 通用查询映射结果 -->
<resultMap id="aiAudioResultMap" type="org.springblade.modules.aiaudio.entity.AiAudioEntity">
</resultMap>
<select id="selectAiAudioPage" resultMap="aiAudioResultMap">
select * from ai_audio where is_deleted = 0
</select>
</mapper>

View File

@@ -0,0 +1,42 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.modules.aiaudio.service.impl;
import org.springblade.modules.aiaudio.entity.AiAudioEntity;
import org.springblade.modules.aiaudio.vo.AiAudioVO;
import org.springblade.modules.aiaudio.mapper.AiAudioMapper;
import org.springblade.modules.aiaudio.service.IAiAudioService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
* ai语音解说音频表 服务实现类
*
* @author jinghan
* @since 2024-04-10
*/
@Service
public class AiAudioServiceImpl extends BaseServiceImpl<AiAudioMapper, AiAudioEntity> implements IAiAudioService {
@Override
public IPage<AiAudioVO> selectAiAudioPage(IPage<AiAudioVO> page, AiAudioVO aiAudio) {
return page.setRecords(baseMapper.selectAiAudioPage(page, aiAudio));
}
}

View File

@@ -0,0 +1,35 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.modules.aiaudio.vo;
import org.springblade.modules.aiaudio.entity.AiAudioEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* ai语音解说音频表 视图实体类
*
* @author jinghan
* @since 2024-04-10
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class AiAudioVO extends AiAudioEntity {
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,49 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.modules.aiaudio.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.modules.aiaudio.convert.AiConverter;
import org.springblade.modules.aiaudio.entity.AiAudioEntity;
import org.springblade.modules.aiaudio.vo.AiAudioVO;
/**
* ai语音解说音频表 包装类,返回视图层所需的字段
*
* @author jinghan
* @since 2024-04-10
*/
public class AiAudioWrapper extends BaseEntityWrapper<AiAudioEntity, AiAudioVO> {
public static AiAudioWrapper build() {
return new AiAudioWrapper();
}
@Override
public AiAudioVO entityVO(AiAudioEntity aiAudio) {
AiAudioVO aiAudioVO = AiConverter.INSTANCE.convertToVO(aiAudio);
//User createUser = UserCache.getUser(aiAudio.getCreateUser());
//User updateUser = UserCache.getUser(aiAudio.getUpdateUser());
//aiAudioVO.setCreateUserName(createUser.getName());
//aiAudioVO.setUpdateUserName(updateUser.getName());
return aiAudioVO;
}
}

View File

@@ -0,0 +1,109 @@
package org.springblade.modules.order.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.order.entity.AfterServiceOrder;
import org.springblade.modules.order.service.IAfterServiceOrderService;
import org.springblade.modules.order.vo.AfterServiceOrderVO;
import org.springblade.modules.order.wrapper.AfterServiceOrderWrapper;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* 售后订单 控制器
*
* @author 刘玮杰
* @since 2023-05-17
*/
@RestController
@AllArgsConstructor
@RequestMapping("/order/after-service")
@Api(value = "售后订单", tags = "售后订单接口")
public class AfterServiceOrderController extends BladeController {
private final IAfterServiceOrderService afterServiceOrderService;
/**
* 售后订单 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入afterServiceOrder")
public R<AfterServiceOrderVO> detail(AfterServiceOrder afterServiceOrder) {
AfterServiceOrder detail = afterServiceOrderService.getOne(Condition.getQueryWrapper(afterServiceOrder));
return R.data(AfterServiceOrderWrapper.build().entityVO(detail));
}
/**
* 售后订单 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入afterServiceOrder")
public R<IPage<AfterServiceOrderVO>> list(AfterServiceOrder afterServiceOrder, Query query) {
IPage<AfterServiceOrder> pages = afterServiceOrderService.page(Condition.getPage(query), Condition.getQueryWrapper(afterServiceOrder).orderByDesc("id"));
return R.data(AfterServiceOrderWrapper.build().pageVO(pages));
}
/**
* 售后订单 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入afterServiceOrder")
public R<IPage<AfterServiceOrderVO>> page(AfterServiceOrderVO afterServiceOrder, Query query) {
IPage<AfterServiceOrderVO> pages = afterServiceOrderService.selectAfterServiceOrderPage(Condition.getPage(query), afterServiceOrder);
return R.data(pages);
}
/**
* 售后订单 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入afterServiceOrder")
public R save(@Valid @RequestBody AfterServiceOrder afterServiceOrder) {
return R.status(afterServiceOrderService.save(afterServiceOrder));
}
/**
* 售后订单 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入afterServiceOrder")
public R update(@Valid @RequestBody AfterServiceOrder afterServiceOrder) {
return R.status(afterServiceOrderService.updateById(afterServiceOrder));
}
/**
* 售后订单 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入afterServiceOrder")
public R submit(@Valid @RequestBody AfterServiceOrder afterServiceOrder) {
return R.status(afterServiceOrderService.saveOrUpdate(afterServiceOrder));
}
/**
* 售后订单 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(afterServiceOrderService.deleteLogic(Func.toLongList(ids)));
}
}

View File

@@ -0,0 +1,18 @@
package org.springblade.modules.order.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.order.entity.AfterServiceOrder;
/**
* 售后订单 数据传输对象实体类
*
* @author 刘玮杰
* @since 2023-05-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class AfterServiceOrderDTO extends AfterServiceOrder {
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,29 @@
package org.springblade.modules.order.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.order.entity.AfterServiceOrder;
import org.springblade.modules.order.vo.AfterServiceOrderVO;
import java.util.List;
/**
* 售后订单 Mapper 接口
*
* @author 刘玮杰
* @since 2023-05-17
*/
public interface AfterServiceOrderMapper extends BaseMapper<AfterServiceOrder> {
/**
* 自定义分页
*
* @param page
* @param afterServiceOrder
* @return
*/
List<AfterServiceOrderVO> selectAfterServiceOrderPage(IPage page, AfterServiceOrderVO afterServiceOrder);
}

View File

@@ -0,0 +1,32 @@
<?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="org.springblade.modules.order.mapper.AfterServiceOrderMapper">
<!-- 通用查询映射结果 -->
<resultMap id="afterServiceOrderResultMap" type="org.springblade.modules.order.entity.AfterServiceOrder">
<result column="id" property="id"/>
<result column="order_id" property="orderId"/>
<result column="user_id" property="userId"/>
<result column="supplier_order_sn" property="supplierOrderSn"/>
<result column="sku_sn" property="skuSn"/>
<result column="supplier_after_service_sn" property="supplierAfterServiceSn"/>
<result column="reason" property="reason"/>
<result column="quantity" property="quantity"/>
<result column="after_service_type" property="afterServiceType"/>
<result column="order_status" property="orderStatus"/>
<result column="create_user" property="createUser"/>
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
</resultMap>
<select id="selectAfterServiceOrderPage" resultMap="afterServiceOrderResultMap">
select * from after_service_order where is_deleted = 0
</select>
</mapper>

View File

@@ -0,0 +1,38 @@
package org.springblade.modules.order.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.modules.order.entity.AfterServiceOrder;
import org.springblade.modules.order.mapper.AfterServiceOrderMapper;
import org.springblade.modules.order.service.IAfterServiceOrderService;
import org.springblade.modules.order.vo.AfterServiceOrderVO;
import org.springblade.modules.order.wrapper.AfterServiceOrderWrapper;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* 售后订单 服务实现类
*
* @author 刘玮杰
* @since 2023-05-17
*/
@Service
public class AfterServiceOrderServiceImpl extends BaseServiceImpl<AfterServiceOrderMapper, AfterServiceOrder> implements IAfterServiceOrderService {
@Override
public IPage<AfterServiceOrderVO> selectAfterServiceOrderPage(IPage<AfterServiceOrderVO> page, AfterServiceOrderVO afterServiceOrder) {
return page.setRecords(baseMapper.selectAfterServiceOrderPage(page, afterServiceOrder));
}
@Override
public IPage<AfterServiceOrderVO> selectAfterServiceOrderPage(IPage<AfterServiceOrderVO> page, List<Long> orderIds) {
Page<AfterServiceOrder> resultPage = page(new Page<>(page.getCurrent(), page.getSize()), Wrappers.<AfterServiceOrder>lambdaQuery().in(AfterServiceOrder::getOrderId, orderIds));
return AfterServiceOrderWrapper.build().pageVO(resultPage);
}
}

View File

@@ -0,0 +1,18 @@
package org.springblade.modules.order.vo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.order.entity.AfterServiceOrder;
/**
* 售后订单 视图实体类
*
* @author 刘玮杰
* @since 2023-05-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class AfterServiceOrderVO extends AfterServiceOrder {
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,36 @@
package org.springblade.modules.order.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.order.entity.AfterServiceOrder;
import org.springblade.modules.order.vo.AfterServiceOrderVO;
import java.util.Objects;
/**
* 售后订单 包装类,返回视图层所需的字段
*
* @author 刘玮杰
* @since 2023-05-17
*/
public class AfterServiceOrderWrapper extends BaseEntityWrapper<AfterServiceOrder, AfterServiceOrderVO> {
public static AfterServiceOrderWrapper build() {
return new AfterServiceOrderWrapper();
}
@Override
public AfterServiceOrderVO entityVO(AfterServiceOrder afterServiceOrder) {
AfterServiceOrderVO afterServiceOrderVO = Objects.requireNonNull(BeanUtil.copy(afterServiceOrder, AfterServiceOrderVO.class));
//User createUser = UserCache.getUser(afterServiceOrder.getCreateUser());
//User updateUser = UserCache.getUser(afterServiceOrder.getUpdateUser());
//afterServiceOrderVO.setCreateUserName(createUser.getName());
//afterServiceOrderVO.setUpdateUserName(updateUser.getName());
return afterServiceOrderVO;
}
}