添加api基础测试示例

This commit is contained in:
yangjun 2025-03-28 16:23:50 +08:00
parent 593ddc8dee
commit e0c501e144
17 changed files with 536 additions and 0 deletions

View File

@ -0,0 +1,68 @@
package com.nu.modules.nuApiServiceCategory.controller;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceCategory;
import com.nu.modules.nuApiServiceCategory.service.INuConfigServiceCategoryService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: nu_config_service_category
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
*/
@RestController
@RequestMapping("/nuIpadApi/nuConfigServiceCategory")
@Slf4j
public class NuConfigServiceCategoryController extends JeecgController<NuConfigServiceCategory, INuConfigServiceCategoryService> {
@Autowired
private INuConfigServiceCategoryService nuConfigServiceCategoryService;
/**
* 分页列表查询
*
* @param nuConfigServiceCategory
* @return
*/
//@AutoLog(value = "nu_config_service_category-分页列表查询")
@GetMapping(value = "/getServiceTree")
public Result<List<Map<String,Object>>> getServiceTree(NuConfigServiceCategory nuConfigServiceCategory) {
List<Map<String,Object>> treeList = nuConfigServiceCategoryService.getServiceTree(nuConfigServiceCategory);
return Result.OK(treeList);
}
}

View File

@ -0,0 +1,77 @@
package com.nu.modules.nuApiServiceCategory.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: nu_config_service_category
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
*/
@Data
@TableName("nu_config_service_category")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="nu_config_service_category对象", description="nu_config_service_category")
public class NuConfigServiceCategory implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**服务类别名称*/
@Excel(name = "服务类别名称", width = 15)
@ApiModelProperty(value = "服务类别名称")
private java.lang.String categoryName;
/**排序*/
@Excel(name = "排序", width = 15)
@ApiModelProperty(value = "排序")
private java.lang.Integer sort;
/**是否启用 0启用 1未启用*/
@Excel(name = "是否启用 0启用 1未启用", width = 15)
@ApiModelProperty(value = "是否启用 0启用 1未启用")
private java.lang.String izEnabled;
/**是否删除 0未删除 1删除*/
@Excel(name = "是否删除 0未删除 1删除", width = 15)
@ApiModelProperty(value = "是否删除 0未删除 1删除")
@TableLogic
private java.lang.String delFlag;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
}

View File

@ -0,0 +1,129 @@
package com.nu.modules.nuApiServiceCategory.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: nu_config_service_directive
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
*/
@Data
@TableName("nu_config_service_directive")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="nu_config_service_directive对象", description="nu_config_service_directive")
public class NuConfigServiceDirective implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**服务类别id*/
@Excel(name = "服务类别id", width = 15)
@ApiModelProperty(value = "服务类别id")
private java.lang.String categoryId;
/**服务类型id*/
@Excel(name = "服务类型id", width = 15)
@ApiModelProperty(value = "服务类型id")
private java.lang.String typeId;
/**指令标签id*/
@Excel(name = "指令标签id", width = 15)
@ApiModelProperty(value = "指令标签id")
private java.lang.String instructionTagId;
/**服务指令名称*/
@Excel(name = "服务指令名称", width = 15)
@ApiModelProperty(value = "服务指令名称")
private java.lang.String directiveName;
/**收费价格*/
@Excel(name = "收费价格", width = 15)
@ApiModelProperty(value = "收费价格")
private java.math.BigDecimal tollPrice;
/**提成价格*/
@Excel(name = "提成价格", width = 15)
@ApiModelProperty(value = "提成价格")
private java.math.BigDecimal comPrice;
/**是否参与医保报销 0不报销 1报销*/
@Excel(name = "是否参与医保报销 0不报销 1报销", width = 15)
@ApiModelProperty(value = "是否参与医保报销 0不报销 1报销")
private java.lang.String izReimbursement;
/**是否参与机构优惠 0不参与 1参与*/
@Excel(name = "是否参与机构优惠 0不参与 1参与", width = 15)
@ApiModelProperty(value = "是否参与机构优惠 0不参与 1参与")
private java.lang.String izPreferential;
/**收费频次 1按次收费 2按天收费*/
@Excel(name = "收费频次 1按次收费 2按天收费", width = 15)
@ApiModelProperty(value = "收费频次 1按次收费 2按天收费")
private java.lang.String chargingFrequency;
/**周期类型 1日常护理 2周期护理 3即时护理*/
@Excel(name = "周期类型 1日常护理 2周期护理 3即时护理", width = 15)
@ApiModelProperty(value = "周期类型 1日常护理 2周期护理 3即时护理")
private java.lang.String cycleType;
/**排序*/
@Excel(name = "排序", width = 15)
@ApiModelProperty(value = "排序")
private java.lang.Integer sort;
/**服务说明*/
@Excel(name = "服务说明", width = 15)
@ApiModelProperty(value = "服务说明")
private java.lang.String serviceContent;
/**服务时长(分钟)*/
@Excel(name = "服务时长(分钟)", width = 15)
@ApiModelProperty(value = "服务时长(分钟)")
private java.lang.String serviceDuration;
/**是否启用 0启用 1未启用*/
@Excel(name = "是否启用 0启用 1未启用", width = 15)
@ApiModelProperty(value = "是否启用 0启用 1未启用")
private java.lang.String izEnabled;
/**是否删除 0未删除 1删除*/
@Excel(name = "是否删除 0未删除 1删除", width = 15)
@ApiModelProperty(value = "是否删除 0未删除 1删除")
@TableLogic
private java.lang.String delFlag;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**语音文件*/
@Excel(name = "语音文件", width = 15)
@ApiModelProperty(value = "语音文件")
private java.lang.String mp3File;
/**视频文件*/
@Excel(name = "视频文件", width = 15)
@ApiModelProperty(value = "视频文件")
private java.lang.String mp4File;
}

View File

@ -0,0 +1,81 @@
package com.nu.modules.nuApiServiceCategory.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: nu_config_service_type
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
*/
@Data
@TableName("nu_config_service_type")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="nu_config_service_type对象", description="nu_config_service_type")
public class NuConfigServiceType implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**服务类别id*/
@Excel(name = "服务类别id", width = 15)
@ApiModelProperty(value = "服务类别id")
private java.lang.String categoryId;
/**服务类型名称*/
@Excel(name = "服务类型名称", width = 15)
@ApiModelProperty(value = "服务类型名称")
private java.lang.String typeName;
/**排序*/
@Excel(name = "排序", width = 15)
@ApiModelProperty(value = "排序")
private java.lang.Integer sort;
/**是否启用 0启用 1未启用*/
@Excel(name = "是否启用 0启用 1未启用", width = 15)
@ApiModelProperty(value = "是否启用 0启用 1未启用")
private java.lang.String izEnabled;
/**是否删除 0未删除 1删除*/
@Excel(name = "是否删除 0未删除 1删除", width = 15)
@ApiModelProperty(value = "是否删除 0未删除 1删除")
@TableLogic
private java.lang.String delFlag;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
}

View File

@ -0,0 +1,17 @@
package com.nu.modules.nuApiServiceCategory.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: nu_config_service_category
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
*/
public interface NuConfigServiceCategoryMapper extends BaseMapper<NuConfigServiceCategory> {
}

View File

@ -0,0 +1,17 @@
package com.nu.modules.nuApiServiceCategory.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceDirective;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: nu_config_service_directive
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
*/
public interface NuConfigServiceDirectiveMapper extends BaseMapper<NuConfigServiceDirective> {
}

View File

@ -0,0 +1,17 @@
package com.nu.modules.nuApiServiceCategory.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: nu_config_service_type
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
*/
public interface NuConfigServiceTypeMapper extends BaseMapper<NuConfigServiceType> {
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nu.modules.nuApiServiceCategory.mapper.NuConfigServiceCategoryMapper">
</mapper>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nu.modules.nuApiServiceCategory.mapper.NuConfigServiceDirectiveMapper">
</mapper>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nu.modules.nuApiServiceCategory.mapper.NuConfigServiceTypeMapper">
</mapper>

View File

@ -0,0 +1,18 @@
package com.nu.modules.nuApiServiceCategory.service;
import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceCategory;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
/**
* @Description: nu_config_service_category
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
*/
public interface INuConfigServiceCategoryService extends IService<NuConfigServiceCategory> {
List<Map<String, Object>> getServiceTree(NuConfigServiceCategory nuConfigServiceCategory);
}

View File

@ -0,0 +1,14 @@
package com.nu.modules.nuApiServiceCategory.service;
import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceDirective;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: nu_config_service_directive
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
*/
public interface INuConfigServiceDirectiveService extends IService<NuConfigServiceDirective> {
}

View File

@ -0,0 +1,14 @@
package com.nu.modules.nuApiServiceCategory.service;
import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceType;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: nu_config_service_type
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
*/
public interface INuConfigServiceTypeService extends IService<NuConfigServiceType> {
}

View File

@ -0,0 +1,29 @@
package com.nu.modules.nuApiServiceCategory.service.impl;
import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceCategory;
import com.nu.modules.nuApiServiceCategory.mapper.NuConfigServiceCategoryMapper;
import com.nu.modules.nuApiServiceCategory.service.INuConfigServiceCategoryService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.*;
/**
* @Description: nu_config_service_category
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
*/
@Service
public class NuConfigServiceCategoryServiceImpl extends ServiceImpl<NuConfigServiceCategoryMapper, NuConfigServiceCategory> implements INuConfigServiceCategoryService {
@Override
public List<Map<String, Object>> getServiceTree(NuConfigServiceCategory nuConfigServiceCategory) {
List<Map<String, Object>> treeList = new ArrayList<>();
Map<String, Object> map = new HashMap<>();
map.put("key","123");
treeList.add(map);
return treeList;
}
}

View File

@ -0,0 +1,19 @@
package com.nu.modules.nuApiServiceCategory.service.impl;
import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceDirective;
import com.nu.modules.nuApiServiceCategory.mapper.NuConfigServiceDirectiveMapper;
import com.nu.modules.nuApiServiceCategory.service.INuConfigServiceDirectiveService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: nu_config_service_directive
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
*/
@Service
public class NuConfigServiceDirectiveServiceImpl extends ServiceImpl<NuConfigServiceDirectiveMapper, NuConfigServiceDirective> implements INuConfigServiceDirectiveService {
}

View File

@ -0,0 +1,19 @@
package com.nu.modules.nuApiServiceCategory.service.impl;
import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceType;
import com.nu.modules.nuApiServiceCategory.mapper.NuConfigServiceTypeMapper;
import com.nu.modules.nuApiServiceCategory.service.INuConfigServiceTypeService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: nu_config_service_type
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
*/
@Service
public class NuConfigServiceTypeServiceImpl extends ServiceImpl<NuConfigServiceTypeMapper, NuConfigServiceType> implements INuConfigServiceTypeService {
}

View File

@ -104,6 +104,8 @@ public class ShiroConfig {
//filterChainDefinitionMap.put("/sys/common/view/**", "anon");//图片预览不限制token //filterChainDefinitionMap.put("/sys/common/view/**", "anon");//图片预览不限制token
//filterChainDefinitionMap.put("/sys/common/download/**", "anon");//文件下载不限制token //filterChainDefinitionMap.put("/sys/common/download/**", "anon");//文件下载不限制token
filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文件 filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文件
filterChainDefinitionMap.put("/ConfigMaterial/configMaterialCategory/**", "anon");//pdf预览需要文件
filterChainDefinitionMap.put("/nuIpadApi/**", "anon");//pdf预览需要文件
filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //登录二维码 filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //登录二维码
filterChainDefinitionMap.put("/sys/getQrcodeToken/**", "anon"); //监听扫码 filterChainDefinitionMap.put("/sys/getQrcodeToken/**", "anon"); //监听扫码