feat:
1.stickers fix: 1.photo 2.api-auth
This commit is contained in:
10
doc/sql/menu/stickers.menu.sql
Normal file
10
doc/sql/menu/stickers.menu.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('1975626239078764546', '1123598815738675201', 'stickers', '自助终端贴纸表', 'menu', '/kiosk/stickers', NULL, 1, 1, 0, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('1975626239078764547', '1975626239078764546', 'stickers_add', '新增', 'add', '/kiosk/stickers/add', 'plus', 1, 2, 1, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('1975626239078764548', '1975626239078764546', 'stickers_edit', '修改', 'edit', '/kiosk/stickers/edit', 'form', 2, 2, 2, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('1975626239078764549', '1975626239078764546', 'stickers_delete', '删除', 'delete', '/api/kiosk/stickers/remove', 'delete', 3, 2, 3, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('1975626239078764550', '1975626239078764546', 'stickers_view', '查看', 'view', '/kiosk/stickers/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
@@ -1,23 +1,22 @@
|
||||
package org.springblade.modules.kiosk.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springblade.core.secure.annotation.PreAuth;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.kiosk.pojo.vo.CategoryApiVO;
|
||||
import org.springblade.modules.kiosk.pojo.vo.PhotoAttachmentApiVO;
|
||||
import org.springblade.modules.kiosk.pojo.vo.StickersApiVO;
|
||||
import org.springblade.modules.kiosk.service.IKioskApiService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@PreAuth("hasRole('kiosk')")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("kiosk")
|
||||
@Validated
|
||||
@RequestMapping("kiosk-api")
|
||||
public class KioskApiController {
|
||||
|
||||
private final IKioskApiService kioskApiService;
|
||||
@@ -39,7 +38,6 @@ public class KioskApiController {
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
@PreAuth("hasRole('kiosk')")
|
||||
@GetMapping("/generate-upload-url")
|
||||
@Operation(summary = "生成上传地址")
|
||||
public R<String> generateUploadUrl() {
|
||||
@@ -52,11 +50,22 @@ public class KioskApiController {
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
@PreAuth("hasRole('kiosk')")
|
||||
@GetMapping("/photo-list")
|
||||
@Operation(summary = "生成上传地址")
|
||||
public R<List<String>> photoList() {
|
||||
List<String> list = kioskApiService.photoList();
|
||||
@Operation(summary = "照片列表查询")
|
||||
public R<List<PhotoAttachmentApiVO>> photoList() {
|
||||
List<PhotoAttachmentApiVO> list = kioskApiService.photoList();
|
||||
return R.data(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 照片列表查询
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
@GetMapping("/stickers-list")
|
||||
@Operation(summary = "贴纸列表查询")
|
||||
public R<List<StickersApiVO>> stickersList() {
|
||||
List<StickersApiVO> list = kioskApiService.stickersList();
|
||||
return R.data(list);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.kiosk.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
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.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.kiosk.pojo.entity.StickersEntity;
|
||||
import org.springblade.modules.kiosk.pojo.vo.StickersVO;
|
||||
import org.springblade.modules.kiosk.wrapper.StickersWrapper;
|
||||
import org.springblade.modules.kiosk.service.IStickersService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 控制器
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2025-10-08
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("kiosk/stickers")
|
||||
@Tag(name = "自助终端贴纸表", description = "自助终端贴纸表接口")
|
||||
public class StickersController extends BladeController {
|
||||
|
||||
private final IStickersService stickersService;
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入stickers")
|
||||
public R<StickersVO> detail(StickersEntity stickers) {
|
||||
StickersEntity detail = stickersService.getOne(Condition.getQueryWrapper(stickers));
|
||||
return R.data(StickersWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 自助终端贴纸表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入stickers")
|
||||
public R<IPage<StickersVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> stickers, Query query) {
|
||||
IPage<StickersEntity> pages = stickersService.page(Condition.getPage(query), Condition.getQueryWrapper(stickers, StickersEntity.class));
|
||||
return R.data(StickersWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入stickers")
|
||||
public R<IPage<StickersVO>> page(StickersVO stickers, Query query) {
|
||||
IPage<StickersVO> pages = stickersService.selectStickersPage(Condition.getPage(query), stickers);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入stickers")
|
||||
public R save(@Valid @RequestBody StickersEntity stickers) {
|
||||
return R.status(stickersService.save(stickers));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入stickers")
|
||||
public R update(@Valid @RequestBody StickersEntity stickers) {
|
||||
return R.status(stickersService.updateById(stickers));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入stickers")
|
||||
public R submit(@Valid @RequestBody StickersEntity stickers) {
|
||||
return R.status(stickersService.saveOrUpdate(stickers));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(stickersService.removeByIds(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.kiosk.mapper;
|
||||
|
||||
import org.springblade.modules.kiosk.pojo.entity.StickersEntity;
|
||||
import org.springblade.modules.kiosk.pojo.vo.StickersVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 Mapper 接口
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2025-10-08
|
||||
*/
|
||||
public interface StickersMapper extends BaseMapper<StickersEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param stickers 查询参数
|
||||
* @return List<StickersVO>
|
||||
*/
|
||||
List<StickersVO> selectStickersPage(IPage page, StickersVO stickers);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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.kiosk.mapper.StickersMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="stickersResultMap" type="org.springblade.modules.kiosk.pojo.entity.StickersEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="tenant_id" property="tenantId"/>
|
||||
<result column="link" property="link"/>
|
||||
<result column="domain_url" property="domainUrl"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="original_name" property="originalName"/>
|
||||
<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="selectStickersPage" resultMap="stickersResultMap">
|
||||
select * from kiosk_stickers where is_deleted = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.kiosk.pojo.dto;
|
||||
|
||||
import org.springblade.modules.kiosk.pojo.entity.StickersEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 数据传输对象实体类
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2025-10-08
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class StickersDTO extends StickersEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.kiosk.pojo.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 实体类
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2025-10-08
|
||||
*/
|
||||
@Data
|
||||
@TableName("kiosk_stickers")
|
||||
@Schema(description = "Stickers对象")
|
||||
public class StickersEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Schema(description = "主键")
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private String tenantId;
|
||||
/**
|
||||
* 贴纸地址
|
||||
*/
|
||||
@Schema(description = "贴纸地址")
|
||||
private String link;
|
||||
/**
|
||||
* 贴纸域名
|
||||
*/
|
||||
@Schema(description = "贴纸域名")
|
||||
private String domainUrl;
|
||||
/**
|
||||
* 贴纸名称
|
||||
*/
|
||||
@Schema(description = "贴纸名称")
|
||||
private String name;
|
||||
/**
|
||||
* 贴纸原名
|
||||
*/
|
||||
@Schema(description = "贴纸原名")
|
||||
private String originalName;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
private Long createUser;
|
||||
/**
|
||||
* 创建部门
|
||||
*/
|
||||
@Schema(description = "创建部门")
|
||||
private Long createDept;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@Schema(description = "修改人")
|
||||
private Long updateUser;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@Schema(description = "是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.springblade.modules.kiosk.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class PhotoAttachmentApiVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private String link;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.kiosk.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.modules.kiosk.pojo.entity.StickersEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 视图实体类
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2025-10-08
|
||||
*/
|
||||
@Data
|
||||
public class StickersApiVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private String link;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.kiosk.pojo.vo;
|
||||
|
||||
import org.springblade.modules.kiosk.pojo.entity.StickersEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 视图实体类
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2025-10-08
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class StickersVO extends StickersEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.springblade.modules.kiosk.service;
|
||||
|
||||
import org.springblade.modules.kiosk.pojo.vo.CategoryApiVO;
|
||||
import org.springblade.modules.kiosk.pojo.vo.PhotoAttachmentApiVO;
|
||||
import org.springblade.modules.kiosk.pojo.vo.StickersApiVO;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
@@ -14,6 +16,8 @@ public interface IKioskApiService {
|
||||
|
||||
String generateUploadUrl();
|
||||
|
||||
List<String> photoList();
|
||||
List<PhotoAttachmentApiVO> photoList();
|
||||
|
||||
List<StickersApiVO> stickersList();
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.kiosk.service;
|
||||
|
||||
import org.springblade.modules.kiosk.pojo.entity.StickersEntity;
|
||||
import org.springblade.modules.kiosk.pojo.vo.StickersVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 服务类
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2025-10-08
|
||||
*/
|
||||
public interface IStickersService extends IService<StickersEntity> {
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param stickers 查询参数
|
||||
* @return IPage<StickersVO>
|
||||
*/
|
||||
IPage<StickersVO> selectStickersPage(IPage<StickersVO> page, StickersVO stickers);
|
||||
|
||||
}
|
||||
@@ -10,9 +10,13 @@ import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.core.tool.utils.*;
|
||||
import org.springblade.modules.kiosk.pojo.entity.PhotoAttachmentEntity;
|
||||
import org.springblade.modules.kiosk.pojo.entity.StickersEntity;
|
||||
import org.springblade.modules.kiosk.pojo.vo.CategoryApiVO;
|
||||
import org.springblade.modules.kiosk.pojo.vo.PhotoAttachmentApiVO;
|
||||
import org.springblade.modules.kiosk.pojo.vo.StickersApiVO;
|
||||
import org.springblade.modules.kiosk.service.IKioskApiService;
|
||||
import org.springblade.modules.kiosk.service.IPhotoAttachmentService;
|
||||
import org.springblade.modules.kiosk.service.IStickersService;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -33,6 +37,8 @@ public class KioskServiceImpl implements IKioskApiService {
|
||||
|
||||
private final IPhotoAttachmentService photoAttachmentService;
|
||||
|
||||
private final IStickersService stickersService;
|
||||
|
||||
private static final String codePrefix = "kiosk:code:";
|
||||
|
||||
@Override
|
||||
@@ -85,13 +91,25 @@ public class KioskServiceImpl implements IKioskApiService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> photoList() {
|
||||
public List<PhotoAttachmentApiVO> photoList() {
|
||||
BladeUser user = AuthUtil.getUser();
|
||||
List<PhotoAttachmentEntity> list = photoAttachmentService.list(Wrappers
|
||||
.<PhotoAttachmentEntity>query()
|
||||
.lambda()
|
||||
.eq(PhotoAttachmentEntity::getCreateUser, user.getUserId())
|
||||
.eq(PhotoAttachmentEntity::getStatus, 1));
|
||||
return list.stream().map(PhotoAttachmentEntity::getLink).collect(Collectors.toList());
|
||||
List<PhotoAttachmentEntity> list = photoAttachmentService.list(Wrappers.<PhotoAttachmentEntity>query().lambda().eq(PhotoAttachmentEntity::getCreateUser, user.getUserId()).eq(PhotoAttachmentEntity::getStatus, 1));
|
||||
return list.stream().map(photo -> {
|
||||
PhotoAttachmentApiVO vo = new PhotoAttachmentApiVO();
|
||||
vo.setLink(photo.getLink());
|
||||
vo.setId(photo.getId());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StickersApiVO> stickersList() {
|
||||
List<StickersEntity> list = stickersService.list();
|
||||
return list.stream().map(stickers -> {
|
||||
StickersApiVO vo = new StickersApiVO();
|
||||
vo.setLink(stickers.getLink());
|
||||
vo.setId(stickers.getId());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.kiosk.service.impl;
|
||||
|
||||
import org.springblade.modules.kiosk.pojo.entity.StickersEntity;
|
||||
import org.springblade.modules.kiosk.pojo.vo.StickersVO;
|
||||
import org.springblade.modules.kiosk.mapper.StickersMapper;
|
||||
import org.springblade.modules.kiosk.service.IStickersService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 服务实现类
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2025-10-08
|
||||
*/
|
||||
@Service
|
||||
public class StickersServiceImpl extends ServiceImpl<StickersMapper, StickersEntity> implements IStickersService {
|
||||
|
||||
@Override
|
||||
public IPage<StickersVO> selectStickersPage(IPage<StickersVO> page, StickersVO stickers) {
|
||||
return page.setRecords(baseMapper.selectStickersPage(page, stickers));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.kiosk.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.modules.kiosk.pojo.entity.StickersEntity;
|
||||
import org.springblade.modules.kiosk.pojo.vo.StickersVO;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 自助终端贴纸表 包装类,返回视图层所需的字段
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2025-10-08
|
||||
*/
|
||||
public class StickersWrapper extends BaseEntityWrapper<StickersEntity, StickersVO> {
|
||||
|
||||
public static StickersWrapper build() {
|
||||
return new StickersWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public StickersVO entityVO(StickersEntity stickers) {
|
||||
StickersVO stickersVO = Objects.requireNonNull(BeanUtil.copyProperties(stickers, StickersVO.class));
|
||||
|
||||
//User createUser = UserCache.getUser(stickers.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(stickers.getUpdateUser());
|
||||
//stickersVO.setCreateUserName(createUser.getName());
|
||||
//stickersVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return stickersVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -256,7 +256,7 @@ blade:
|
||||
- /blade-saber/**
|
||||
- client-id: kiosk
|
||||
path-patterns:
|
||||
- /kiosk/**
|
||||
- /kiosk-api/**
|
||||
#多租户配置
|
||||
tenant:
|
||||
#多租户增强
|
||||
|
||||
Reference in New Issue
Block a user