Merge pull request #11746 from dataease/pr@dev-v2@fixDS
Pr@dev v2@fix ds
This commit is contained in:
commit
42da563c00
@ -273,6 +273,9 @@ public class CalciteProvider extends Provider {
|
||||
}
|
||||
|
||||
private boolean isDorisCatalog(DatasourceRequest datasourceRequest) {
|
||||
if (!datasourceRequest.getDatasource().getType().equalsIgnoreCase("doris")) {
|
||||
return false;
|
||||
}
|
||||
DatasourceConfiguration configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), Mysql.class);
|
||||
String database = "";
|
||||
if (StringUtils.isEmpty(configuration.getUrlType()) || configuration.getUrlType().equalsIgnoreCase("hostName")) {
|
||||
@ -284,7 +287,7 @@ public class CalciteProvider extends Provider {
|
||||
String[] databasePrams = matcher.group(3).split("\\?");
|
||||
database = databasePrams[0];
|
||||
}
|
||||
return datasourceRequest.getDatasource().getType().equalsIgnoreCase("doris") && database.contains(".");
|
||||
return database.contains(".");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -311,9 +311,6 @@ public class ExcelUtils {
|
||||
if (StringUtils.isEmpty(value) || value.length() > 19) {
|
||||
return "TEXT";
|
||||
}
|
||||
if (value.length() > 1 && value.startsWith("0")) {
|
||||
return "TEXT";
|
||||
}
|
||||
String regex = "^\\d+(\\.\\d+)?$";
|
||||
if (!value.matches(regex)) {
|
||||
return "TEXT";
|
||||
@ -322,6 +319,9 @@ public class ExcelUtils {
|
||||
Double d = Double.valueOf(value);
|
||||
double eps = 1e-10;
|
||||
if (d - Math.floor(d) < eps) {
|
||||
if (value.length() > 1 && value.startsWith("0")) {
|
||||
return "TEXT";
|
||||
}
|
||||
return "LONG";
|
||||
} else {
|
||||
return "DOUBLE";
|
||||
|
||||
@ -863,16 +863,18 @@ public class DatasourceServer implements DatasourceApi {
|
||||
for (ExcelSheetData sheet : excelFileData.getSheets()) {
|
||||
for (DatasetTableDTO datasetTableDTO : datasetTableDTOS) {
|
||||
if (excelDataTableName(datasetTableDTO.getTableName()).equals(sheet.getTableName()) || isCsv(file.getOriginalFilename())) {
|
||||
List<String> fieldNames = sheet.getFields().stream().map(TableField::getName).collect(Collectors.toList());
|
||||
List<String> fieldTypes = sheet.getFields().stream().map(TableField::getFieldType).collect(Collectors.toList());
|
||||
Collections.sort(fieldNames);
|
||||
Collections.sort(fieldTypes);
|
||||
List<TableField> newTableFields = sheet.getFields();
|
||||
newTableFields.sort((o1, o2) -> {
|
||||
return o1.getName().compareTo(o2.getName());
|
||||
});
|
||||
|
||||
datasourceRequest.setTable(datasetTableDTO.getTableName());
|
||||
List<String> oldFieldNames = ExcelUtils.getTableFields(datasourceRequest).stream().map(TableField::getName).collect(Collectors.toList());
|
||||
List<String> oldFieldTypes = ExcelUtils.getTableFields(datasourceRequest).stream().map(TableField::getFieldType).collect(Collectors.toList());
|
||||
Collections.sort(oldFieldNames);
|
||||
Collections.sort(oldFieldTypes);
|
||||
if (fieldNames.equals(oldFieldNames) && fieldTypes.equals(oldFieldTypes)) {
|
||||
List<TableField> oldTableFields = ExcelUtils.getTableFields(datasourceRequest);
|
||||
oldTableFields.sort((o1, o2) -> {
|
||||
return o1.getName().compareTo(o2.getName());
|
||||
});
|
||||
|
||||
if (isEqual(newTableFields, oldTableFields)) {
|
||||
sheet.setDeTableName(datasetTableDTO.getTableName());
|
||||
excelSheetDataList.add(sheet);
|
||||
}
|
||||
@ -898,6 +900,34 @@ public class DatasourceServer implements DatasourceApi {
|
||||
return excelFileData;
|
||||
}
|
||||
|
||||
private boolean isEqual(List<TableField> newTableFields, List<TableField> oldTableFields) {
|
||||
boolean isEqual = true;
|
||||
if (CollectionUtils.isEmpty(newTableFields) || CollectionUtils.isEmpty(oldTableFields)) {
|
||||
isEqual = false;
|
||||
}
|
||||
for (int i = 0; i < newTableFields.size(); i++) {
|
||||
if (!newTableFields.get(i).getName().equals(oldTableFields.get(i).getName())) {
|
||||
isEqual = false;
|
||||
break;
|
||||
}
|
||||
if (!newTableFields.get(i).getFieldType().equals(oldTableFields.get(i).getFieldType())) {
|
||||
if (oldTableFields.get(i).getFieldType().equals("TEXT")) {
|
||||
continue;
|
||||
}
|
||||
if (oldTableFields.get(i).getFieldType().equals("DOUBLE")) {
|
||||
if (newTableFields.get(i).getFieldType().equals("LONG")) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
isEqual = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return isEqual;
|
||||
|
||||
}
|
||||
|
||||
private boolean isCsv(String fileName) {
|
||||
String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||
return suffix.equalsIgnoreCase("csv");
|
||||
|
||||
@ -0,0 +1,108 @@
|
||||
package io.dataease.font.dao.auto.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2024-08-23
|
||||
*/
|
||||
@TableName("core_font")
|
||||
public class CoreFont implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 字体名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件转换名称
|
||||
*/
|
||||
private String fileTransName;
|
||||
|
||||
/**
|
||||
* 是否默认
|
||||
*/
|
||||
private Boolean isDefault;
|
||||
|
||||
/**
|
||||
* 是否内置
|
||||
*/
|
||||
private Boolean isBuiltin;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getFileTransName() {
|
||||
return fileTransName;
|
||||
}
|
||||
|
||||
public void setFileTransName(String fileTransName) {
|
||||
this.fileTransName = fileTransName;
|
||||
}
|
||||
|
||||
public Boolean getIsDefault() {
|
||||
return isDefault;
|
||||
}
|
||||
|
||||
public void setIsDefault(Boolean isDefault) {
|
||||
this.isDefault = isDefault;
|
||||
}
|
||||
|
||||
public Boolean getIsBuiltin() {
|
||||
return isBuiltin;
|
||||
}
|
||||
|
||||
public void setIsBuiltin(Boolean isBuiltin) {
|
||||
this.isBuiltin = isBuiltin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CoreFont{" +
|
||||
"id = " + id +
|
||||
", name = " + name +
|
||||
", fileName = " + fileName +
|
||||
", fileTransName = " + fileTransName +
|
||||
", isDefault = " + isDefault +
|
||||
", isBuiltin = " + isBuiltin +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package io.dataease.font.dao.auto.mapper;
|
||||
|
||||
import io.dataease.font.dao.auto.entity.CoreFont;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2024-08-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface CoreFontMapper extends BaseMapper<CoreFont> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package io.dataease.font.manage;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.dataease.api.font.dto.FontDto;
|
||||
import io.dataease.exception.DEException;
|
||||
import io.dataease.font.dao.auto.entity.CoreFont;
|
||||
import io.dataease.font.dao.auto.mapper.CoreFontMapper;
|
||||
import io.dataease.utils.BeanUtils;
|
||||
import io.dataease.utils.IDUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Component
|
||||
public class FontManage {
|
||||
|
||||
private static String path = "/opt/dataease2.0/data/font/";
|
||||
@Resource
|
||||
private CoreFontMapper coreFontMapper;
|
||||
|
||||
public List<FontDto> list(FontDto fontDto) {
|
||||
QueryWrapper<CoreFont> queryWrapper = new QueryWrapper<>();
|
||||
List<CoreFont> coreFonts = coreFontMapper.selectList(queryWrapper);
|
||||
List<FontDto> fontDtos = new ArrayList<>();
|
||||
for (CoreFont coreFont : coreFonts) {
|
||||
FontDto dto = new FontDto();
|
||||
BeanUtils.copyBean(dto, coreFont);
|
||||
fontDtos.add(dto);
|
||||
}
|
||||
|
||||
return fontDtos;
|
||||
}
|
||||
|
||||
public FontDto create(FontDto fontDto) {
|
||||
fontDto.setId(IDUtils.snowID());
|
||||
CoreFont coreFont = new CoreFont();
|
||||
BeanUtils.copyBean(coreFont, fontDto);
|
||||
coreFontMapper.insert(coreFont);
|
||||
return fontDto;
|
||||
}
|
||||
|
||||
|
||||
public FontDto edit(FontDto fontDto) {
|
||||
fontDto.setId(IDUtils.snowID());
|
||||
CoreFont coreFont = new CoreFont();
|
||||
BeanUtils.copyBean(coreFont, fontDto);
|
||||
coreFontMapper.updateById(coreFont);
|
||||
return fontDto;
|
||||
}
|
||||
|
||||
public void delete(Long id) {
|
||||
coreFontMapper.deleteById(id);
|
||||
//TODO delete file
|
||||
}
|
||||
|
||||
public void changeDefault(FontDto fontDto) {
|
||||
QueryWrapper<CoreFont> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("id", fontDto.getId());
|
||||
CoreFont record = new CoreFont();
|
||||
record.setIsDefault(fontDto.getIsDefault());
|
||||
coreFontMapper.update(record, queryWrapper);
|
||||
}
|
||||
|
||||
public void upload(MultipartFile file, long fontID) {
|
||||
String filename = file.getOriginalFilename();
|
||||
QueryWrapper<CoreFont> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("id", fontID);
|
||||
CoreFont record = new CoreFont();
|
||||
record.setFileName(filename);
|
||||
record.setFileTransName(filename);
|
||||
coreFontMapper.update(record, queryWrapper);
|
||||
String fileUuid = UUID.randomUUID().toString();
|
||||
saveFile(file, fileUuid);
|
||||
}
|
||||
|
||||
private static String saveFile(MultipartFile file, String fileNameUUID) throws DEException {
|
||||
String fileTransName = "";
|
||||
try {
|
||||
String filename = file.getOriginalFilename();
|
||||
String suffix = filename.substring(filename.lastIndexOf(".") + 1);
|
||||
String filePath = path + fileNameUUID + "." + suffix;
|
||||
File f = new File(filePath);
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(f);
|
||||
fileOutputStream.write(file.getBytes());
|
||||
fileOutputStream.flush();
|
||||
fileOutputStream.close();
|
||||
fileTransName = fileNameUUID + "." + suffix;
|
||||
} catch (Exception e) {
|
||||
DEException.throwException(e);
|
||||
}
|
||||
return fileTransName;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package io.dataease.font.server;
|
||||
|
||||
import io.dataease.api.font.api.FontApi;
|
||||
import io.dataease.api.font.dto.FontDto;
|
||||
import io.dataease.exception.DEException;
|
||||
import jakarta.annotation.Resource;
|
||||
import io.dataease.font.manage.FontManage;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/typeface")
|
||||
public class FontServer implements FontApi {
|
||||
|
||||
@Resource
|
||||
private FontManage fontManage;
|
||||
|
||||
@Override
|
||||
public List<FontDto> list(FontDto fontDto) {
|
||||
return fontManage.list(fontDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontDto create(FontDto fontDto) {
|
||||
return fontManage.create(fontDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontDto edit(FontDto fontDto) {
|
||||
return fontManage.edit(fontDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Long id) {
|
||||
fontManage.delete(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeDefault(FontDto fontDto) {
|
||||
fontManage.changeDefault(fontDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upload(MultipartFile file, long fontID) throws DEException {
|
||||
fontManage.upload(file, fontID);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package io.dataease.system.dao.auto.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2024-08-08
|
||||
*/
|
||||
@TableName("core_typeface")
|
||||
public class CoreTypeface implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 字体名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件转换名称
|
||||
*/
|
||||
private String fileTransName;
|
||||
|
||||
/**
|
||||
* 是否默认
|
||||
*/
|
||||
private Boolean isDefault;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getFileTransName() {
|
||||
return fileTransName;
|
||||
}
|
||||
|
||||
public void setFileTransName(String fileTransName) {
|
||||
this.fileTransName = fileTransName;
|
||||
}
|
||||
|
||||
public Boolean getIsDefault() {
|
||||
return isDefault;
|
||||
}
|
||||
|
||||
public void setIsDefault(Boolean isDefault) {
|
||||
this.isDefault = isDefault;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CoreTypeface{" +
|
||||
"id = " + id +
|
||||
", name = " + name +
|
||||
", fileName = " + fileName +
|
||||
", fileTransName = " + fileTransName +
|
||||
", isDefault = " + isDefault +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package io.dataease.system.dao.auto.mapper;
|
||||
|
||||
import io.dataease.system.dao.auto.entity.CoreTypeface;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2024-08-08
|
||||
*/
|
||||
@Mapper
|
||||
public interface CoreTypefaceMapper extends BaseMapper<CoreTypeface> {
|
||||
|
||||
}
|
||||
@ -70,3 +70,16 @@ alter table `core_chart_view`
|
||||
|
||||
update visualization_outer_params_target_view_info tvi INNER JOIN core_chart_view ccv on tvi.target_view_id = ccv.id
|
||||
set tvi.target_ds_id = ccv.table_id
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `core_font`;
|
||||
CREATE TABLE `core_font`
|
||||
(
|
||||
`id` bigint NOT NULL COMMENT 'ID',
|
||||
`name` varchar(255) NOT NULL COMMENT '字体名称',
|
||||
`file_name` varchar(255) NOT NULL COMMENT '文件名称',
|
||||
`file_trans_name` varchar(255) NOT NULL COMMENT '文件转换名称',
|
||||
`is_default` tinyint(1) NOT NULL COMMENT '是否默认',
|
||||
`is_BuiltIn` tinyint(1) NOT NULL COMMENT '是否内置',
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
|
||||
39
core/core-frontend/src/api/font.ts
Normal file
39
core/core-frontend/src/api/font.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface Font {
|
||||
id: string
|
||||
name: string
|
||||
fileName: string
|
||||
isDefault: boolean
|
||||
isBuiltin?: boolean
|
||||
}
|
||||
|
||||
export const list = (data = {}) => {
|
||||
return request.post({ url: '/typeface/listFont', data }).then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
|
||||
export const create = (data = {}) => {
|
||||
return request.post({ url: '/typeface/create', data }).then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
|
||||
export const edit = (data = {}) => {
|
||||
return request.post({ url: '/typeface/edit', data }).then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
|
||||
export const changeDefault = (data = {}) => {
|
||||
return request.post({ url: '/typeface/changeDefault', data }).then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteById = id => {
|
||||
return request.post({ url: '/typeface/delete/' + id, data: {} }).then(res => {
|
||||
return res?.data
|
||||
})
|
||||
}
|
||||
@ -1,12 +1,39 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
|
||||
import UploadDetail from './UploadDetail.vue'
|
||||
import { changeDefault, deleteById, list } from '@/api/font'
|
||||
const fontKeyword = ref('')
|
||||
const fontList = ref([1, 2, 3, 4, 5])
|
||||
const fontList = ref([])
|
||||
|
||||
// const fontList = ref([1, 2, 3, 4, 5])
|
||||
const uploadDetail = ref()
|
||||
const uploadFont = (title, isRename?: boolean) => {
|
||||
uploadDetail.value.init(title, isRename)
|
||||
}
|
||||
|
||||
const listFont = () => {
|
||||
list({}).then(res => {
|
||||
fontList.value = res
|
||||
})
|
||||
}
|
||||
|
||||
const deleteFont = item => {
|
||||
deleteById(item.id).then(res => {
|
||||
listFont()
|
||||
})
|
||||
}
|
||||
|
||||
const setToDefault = item => {
|
||||
item.isDefault = 1
|
||||
changeDefault(item).then(res => {
|
||||
fontList.value = res
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
listFont()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -39,9 +66,9 @@ const uploadFont = (title, isRename?: boolean) => {
|
||||
</div>
|
||||
<div class="font-upload_btn">
|
||||
<el-button @click="uploadFont('添加字体')" secondary>上传字库文件</el-button>
|
||||
<el-button secondary>设为默认字体</el-button>
|
||||
<el-button @click="setToDefault(ele)" secondary>设为默认字体</el-button>
|
||||
<el-button @click="uploadFont('重命名', true)" secondary>重命名</el-button>
|
||||
<el-button secondary>删除</el-button>
|
||||
<el-button @click="deleteFont(ele)" secondary>删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,49 @@
|
||||
package io.dataease.api.font.api;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
|
||||
import io.dataease.api.ds.vo.ExcelFileData;
|
||||
import io.dataease.api.font.dto.FontDto;
|
||||
import io.dataease.exception.DEException;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Author Junjun
|
||||
*/
|
||||
@Tag(name = "数据集管理:数据")
|
||||
@ApiSupport(order = 972)
|
||||
public interface FontApi {
|
||||
|
||||
@Operation(summary = "预览数据")
|
||||
@PostMapping("listFont")
|
||||
public List<FontDto> list(@RequestBody FontDto fontDto) throws Exception;
|
||||
|
||||
@Operation(summary = "创建")
|
||||
@PostMapping("/create")
|
||||
public FontDto create(@RequestBody FontDto fontDto);
|
||||
|
||||
@Operation(summary = "编辑")
|
||||
@PostMapping("/edit")
|
||||
public FontDto edit(@RequestBody FontDto fontDto);
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@PostMapping("/delete/{id}")
|
||||
public void delete(@PathVariable("id") Long id);
|
||||
|
||||
@Operation(summary = "变更默认设置")
|
||||
@PostMapping("/changeDefault/")
|
||||
public void changeDefault(@RequestBody FontDto fontDto);
|
||||
|
||||
@PostMapping("/uploadFile")
|
||||
void upload(@RequestParam("file") MultipartFile file, @RequestParam("id") long fontID) throws DEException;
|
||||
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
package io.dataease.api.typeface.dto;
|
||||
package io.dataease.api.font.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SysTypefaceDto {
|
||||
public class FontDto {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
@ -28,5 +28,7 @@ public class SysTypefaceDto {
|
||||
* 是否默认
|
||||
*/
|
||||
private Boolean isDefault;
|
||||
|
||||
private Boolean isBuiltin;
|
||||
}
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
package io.dataease.api.typeface.api;
|
||||
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
|
||||
import io.dataease.api.typeface.dto.SysTypefaceDto;
|
||||
import io.dataease.auth.DeApiPath;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static io.dataease.constant.AuthResourceEnum.SYSTEM;
|
||||
|
||||
@Tag(name = "字体管理")
|
||||
@ApiSupport(order = 881, author = "fit2cloud-someone")
|
||||
@DeApiPath(value = "/sysTypeface", rt = SYSTEM)
|
||||
public interface SysTypefaceApi {
|
||||
|
||||
@Operation(summary = "创建")
|
||||
@PostMapping("/create")
|
||||
SysTypefaceDto create(@RequestBody SysTypefaceDto sysVariableDto);
|
||||
|
||||
@Operation(summary = "编辑")
|
||||
@PostMapping("/edit")
|
||||
SysTypefaceDto edit(@RequestBody SysTypefaceDto sysVariableDto);
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@PostMapping("/delete/{id}")
|
||||
void delete(@PathVariable("id") Long id);
|
||||
|
||||
@Operation(summary = "变更默认设置")
|
||||
@PostMapping("/changeDefault/")
|
||||
void changeDefault(@RequestBody SysTypefaceDto sysVariableDto);
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user