店员头像框
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
package com.starry.admin.modules.clerk.controller;
|
||||
|
||||
import com.starry.admin.common.oss.service.IOssFileService;
|
||||
import com.starry.admin.modules.clerk.module.entity.PlayAvatarFrameInfoEntity;
|
||||
import com.starry.admin.modules.clerk.module.vo.PlayAvatarFrameInfoAddVo;
|
||||
import com.starry.admin.modules.clerk.module.vo.PlayAvatarFrameInfoQueryVo;
|
||||
import com.starry.admin.modules.clerk.service.IPlayAvatarFrameInfoService;
|
||||
import com.starry.admin.utils.SecurityUtils;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 店员头像框Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-06-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/clerk/avatarFrame")
|
||||
public class PlayAvatarFrameInfoController {
|
||||
@Resource
|
||||
private IPlayAvatarFrameInfoService playAvatarFrameInfoService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IOssFileService ossFileService;
|
||||
|
||||
|
||||
@PostMapping("/listByPage")
|
||||
public R listByPage(@Validated @RequestBody PlayAvatarFrameInfoQueryVo vo) {
|
||||
return R.ok(playAvatarFrameInfoService.selectByPage(vo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询店员头像框列表
|
||||
*/
|
||||
@GetMapping("/listAll")
|
||||
public R listAll() {
|
||||
return R.ok(playAvatarFrameInfoService.selectAll());
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/uploadFile")
|
||||
public R uploadFile(@RequestParam("file") MultipartFile file) throws IOException {
|
||||
String fileAddress = ossFileService.upload(file.getInputStream(), SecurityUtils.getTenantId(), file.getOriginalFilename());
|
||||
return R.ok(fileAddress);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增店员头像框
|
||||
*/
|
||||
@Log(title = "店员头像框", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@Validated @RequestBody PlayAvatarFrameInfoAddVo vo) {
|
||||
boolean success = playAvatarFrameInfoService.create(ConvertUtil.entityToVo(vo, PlayAvatarFrameInfoEntity.class));
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("添加失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店员头像框
|
||||
*/
|
||||
@Log(title = "店员头像框", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update/{id}")
|
||||
public R update(@PathVariable String id, @RequestBody PlayAvatarFrameInfoEntity playAvatarFrameInfo) {
|
||||
playAvatarFrameInfo.setId(id);
|
||||
boolean success = playAvatarFrameInfoService.update(playAvatarFrameInfo);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店员头像框
|
||||
*/
|
||||
@Log(title = "店员头像框", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
return R.ok(playAvatarFrameInfoService.deletePlayAvatarFrameInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.starry.admin.modules.clerk.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.clerk.module.entity.PlayAvatarFrameInfoEntity;
|
||||
|
||||
/**
|
||||
* 店员头像框Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-06-06
|
||||
*/
|
||||
public interface PlayAvatarFrameInfoMapper extends BaseMapper<PlayAvatarFrameInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.starry.admin.modules.clerk.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 店员头像框对象 play_avatar_frame_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-06-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_avatar_frame_info")
|
||||
public class PlayAvatarFrameInfoEntity extends BaseEntity<PlayAvatarFrameInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 头像框名称
|
||||
*/
|
||||
private String avatarFrameName;
|
||||
|
||||
/**
|
||||
* 头像框地址
|
||||
*/
|
||||
private String avatarFrameAddress;
|
||||
|
||||
/**
|
||||
* 获取方式(0:手动赠送;1:自动赠送)
|
||||
*/
|
||||
private String accessType;
|
||||
|
||||
/**
|
||||
* 获取条件名称
|
||||
*/
|
||||
private String accessName;
|
||||
|
||||
/**
|
||||
* 获取条件
|
||||
*/
|
||||
private String accessValue;
|
||||
|
||||
/**
|
||||
* 有效期(单位:天,-1:永久有效)
|
||||
*/
|
||||
private String periodValidity;
|
||||
|
||||
/**
|
||||
* 添加时间
|
||||
*/
|
||||
private LocalDateTime addTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.starry.admin.modules.clerk.module.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @since 2024/6/6 下午11:13
|
||||
**/
|
||||
@Data
|
||||
public class PlayAvatarFrameInfoAddVo {
|
||||
|
||||
/**
|
||||
* 添加时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private final LocalDateTime addTime = LocalDateTime.now();
|
||||
/**
|
||||
* 头像框名称
|
||||
*/
|
||||
@NotNull(message = "头像框名称不能为空")
|
||||
private String avatarFrameName;
|
||||
/**
|
||||
* 头像框地址
|
||||
*/
|
||||
@NotNull(message = "头像框图片不能为空")
|
||||
private String avatarFrameAddress;
|
||||
/**
|
||||
* 获取方式(0:手动赠送;1:自动赠送)
|
||||
*/
|
||||
@NotNull(message = "头像框获取方式不能为空")
|
||||
private String accessType;
|
||||
/**
|
||||
* 获取条件名称
|
||||
*/
|
||||
private String accessName;
|
||||
/**
|
||||
* 获取条件
|
||||
*/
|
||||
private String accessValue;
|
||||
/**
|
||||
* 有效期(单位:天,-1:永久有效)
|
||||
*/
|
||||
@NotNull(message = "有效期不能为空")
|
||||
private String periodValidity;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.starry.admin.modules.clerk.module.vo;
|
||||
|
||||
import com.starry.common.domain.BasePageEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @since 2024/6/6 下午11:13
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class PlayAvatarFrameInfoQueryVo extends BasePageEntity {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.starry.admin.modules.clerk.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.clerk.module.entity.PlayAvatarFrameInfoEntity;
|
||||
import com.starry.admin.modules.clerk.module.vo.PlayAvatarFrameInfoQueryVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店员头像框Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-06-06
|
||||
*/
|
||||
public interface IPlayAvatarFrameInfoService extends IService<PlayAvatarFrameInfoEntity> {
|
||||
/**
|
||||
* 查询店员头像框
|
||||
*
|
||||
* @param id 店员头像框主键
|
||||
* @return 店员头像框
|
||||
*/
|
||||
PlayAvatarFrameInfoEntity selectPlayAvatarFrameInfoById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询店员头像框列表
|
||||
*
|
||||
* @return 店员头像框集合
|
||||
*/
|
||||
List<PlayAvatarFrameInfoEntity> selectAll();
|
||||
|
||||
|
||||
/**
|
||||
* 查询店员头像框列表
|
||||
*
|
||||
* @param vo 店员头像框
|
||||
* @return 店员头像框集合
|
||||
*/
|
||||
IPage<PlayAvatarFrameInfoEntity> selectByPage(PlayAvatarFrameInfoQueryVo vo);
|
||||
|
||||
/**
|
||||
* 查询店员头像框列表
|
||||
*
|
||||
* @param playAvatarFrameInfo 店员头像框
|
||||
* @return 店员头像框集合
|
||||
*/
|
||||
IPage<PlayAvatarFrameInfoEntity> selectPlayAvatarFrameInfoByPage(PlayAvatarFrameInfoEntity playAvatarFrameInfo);
|
||||
|
||||
/**
|
||||
* 新增店员头像框
|
||||
*
|
||||
* @param playAvatarFrameInfo 店员头像框
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayAvatarFrameInfoEntity playAvatarFrameInfo);
|
||||
|
||||
/**
|
||||
* 修改店员头像框
|
||||
*
|
||||
* @param playAvatarFrameInfo 店员头像框
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayAvatarFrameInfoEntity playAvatarFrameInfo);
|
||||
|
||||
/**
|
||||
* 批量删除店员头像框
|
||||
*
|
||||
* @param ids 需要删除的店员头像框主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayAvatarFrameInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除店员头像框信息
|
||||
*
|
||||
* @param id 店员头像框主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayAvatarFrameInfoById(String id);
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.starry.admin.modules.clerk.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.modules.clerk.mapper.PlayAvatarFrameInfoMapper;
|
||||
import com.starry.admin.modules.clerk.module.entity.PlayAvatarFrameInfoEntity;
|
||||
import com.starry.admin.modules.clerk.module.vo.PlayAvatarFrameInfoQueryVo;
|
||||
import com.starry.admin.modules.clerk.service.IPlayAvatarFrameInfoService;
|
||||
import com.starry.common.utils.IdUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店员头像框Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-06-06
|
||||
*/
|
||||
@Service
|
||||
public class PlayAvatarFrameInfoServiceImpl extends ServiceImpl<PlayAvatarFrameInfoMapper, PlayAvatarFrameInfoEntity> implements IPlayAvatarFrameInfoService {
|
||||
@Resource
|
||||
private PlayAvatarFrameInfoMapper playAvatarFrameInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询店员头像框
|
||||
*
|
||||
* @param id 店员头像框主键
|
||||
* @return 店员头像框
|
||||
*/
|
||||
@Override
|
||||
public PlayAvatarFrameInfoEntity selectPlayAvatarFrameInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<PlayAvatarFrameInfoEntity> selectAll() {
|
||||
return this.baseMapper.selectList(new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<PlayAvatarFrameInfoEntity> selectByPage(PlayAvatarFrameInfoQueryVo vo) {
|
||||
return this.baseMapper.selectPage(new Page<>(vo.getPageNum(), vo.getPageSize()), new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询店员头像框列表
|
||||
*
|
||||
* @param playAvatarFrameInfo 店员头像框
|
||||
* @return 店员头像框
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayAvatarFrameInfoEntity> selectPlayAvatarFrameInfoByPage(PlayAvatarFrameInfoEntity playAvatarFrameInfo) {
|
||||
Page<PlayAvatarFrameInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增店员头像框
|
||||
*
|
||||
* @param playAvatarFrameInfo 店员头像框
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayAvatarFrameInfoEntity playAvatarFrameInfo) {
|
||||
if (StrUtil.isBlankIfStr(playAvatarFrameInfo.getId())) {
|
||||
playAvatarFrameInfo.setId(IdUtils.getUuid());
|
||||
}
|
||||
return save(playAvatarFrameInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店员头像框
|
||||
*
|
||||
* @param playAvatarFrameInfo 店员头像框
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayAvatarFrameInfoEntity playAvatarFrameInfo) {
|
||||
return updateById(playAvatarFrameInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除店员头像框
|
||||
*
|
||||
* @param ids 需要删除的店员头像框主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayAvatarFrameInfoByIds(String[] ids) {
|
||||
return playAvatarFrameInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店员头像框信息
|
||||
*
|
||||
* @param id 店员头像框主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayAvatarFrameInfoById(String id) {
|
||||
return playAvatarFrameInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.starry.admin.modules.gift.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomGiftInfoEntity;
|
||||
import com.starry.admin.modules.gift.module.entity.PlayClerkGiftInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomGiftInfoEntity;
|
||||
import com.starry.admin.modules.gift.mapper.PlayClerkGiftInfoMapper;
|
||||
import com.starry.admin.modules.gift.module.entity.PlayClerkGiftInfoEntity;
|
||||
import com.starry.admin.modules.gift.service.IPlayClerkGiftInfoService;
|
||||
@@ -69,7 +68,7 @@ public class PlayClerkGiftInfoServiceImpl extends ServiceImpl<PlayClerkGiftInfoM
|
||||
@Override
|
||||
public IPage<PlayClerkGiftInfoEntity> selectPlayClerkGiftInfoByPage(PlayClerkGiftInfoEntity playClerkGiftInfo) {
|
||||
Page<PlayClerkGiftInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<PlayClerkGiftInfoEntity>());
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user