【新增】获取公共固件类型接口
This commit is contained in:
@@ -38,6 +38,8 @@ public class SaTokenConfig implements WebMvcConfigurer {
|
|||||||
.excludePathPatterns("/privacy_policy", "/privacy_policy/**")
|
.excludePathPatterns("/privacy_policy", "/privacy_policy/**")
|
||||||
// 排除固件查询接口(不需要登录)
|
// 排除固件查询接口(不需要登录)
|
||||||
.excludePathPatterns("/firmware/**")
|
.excludePathPatterns("/firmware/**")
|
||||||
|
// 排除公共固件
|
||||||
|
.excludePathPatterns("/public_firmware/**")
|
||||||
// 排除系统登录页(不需要登录)
|
// 排除系统登录页(不需要登录)
|
||||||
// .excludePathPatterns("/loading.html", "/admin/login.html")
|
// .excludePathPatterns("/loading.html", "/admin/login.html")
|
||||||
// 排除静态资源
|
// 排除静态资源
|
||||||
|
|||||||
50
src/main/java/com/corewing/app/entity/BizDict.java
Normal file
50
src/main/java/com/corewing/app/entity/BizDict.java
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
package com.corewing.app.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.corewing.app.common.base.CommonEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典实体
|
||||||
|
*
|
||||||
|
* @author xuyuxiang
|
||||||
|
* @date 2022/2/23 18:27
|
||||||
|
**/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("DEV_DICT")
|
||||||
|
public class BizDict extends CommonEntity {
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 父id */
|
||||||
|
@ApiModelProperty("父级id")
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
|
/** 字典文字 */
|
||||||
|
@ApiModelProperty("字典文字")
|
||||||
|
private String dictLabel;
|
||||||
|
|
||||||
|
/** 字典值 */
|
||||||
|
@ApiModelProperty("字典值")
|
||||||
|
private String dictValue;
|
||||||
|
|
||||||
|
/** 分类 */
|
||||||
|
@ApiModelProperty("分类")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
/** 排序码 */
|
||||||
|
@ApiModelProperty("排序码")
|
||||||
|
private Integer sortCode;
|
||||||
|
|
||||||
|
/** 扩展信息 */
|
||||||
|
@ApiModelProperty("扩展信息")
|
||||||
|
@TableField(insertStrategy = FieldStrategy.ALWAYS, updateStrategy = FieldStrategy.ALWAYS)
|
||||||
|
private String extJson;
|
||||||
|
}
|
||||||
9
src/main/java/com/corewing/app/mapper/BizDictMapper.java
Normal file
9
src/main/java/com/corewing/app/mapper/BizDictMapper.java
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
package com.corewing.app.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.corewing.app.entity.BizDict;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface BizDictMapper extends BaseMapper<BizDict> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.corewing.app.modules.app;
|
||||||
|
|
||||||
|
import com.corewing.app.common.Result;
|
||||||
|
import com.corewing.app.entity.BizDict;
|
||||||
|
import com.corewing.app.service.BizDictService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags = "公共固件接口")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/public_firmware")
|
||||||
|
public class AppPublicFirmwareController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BizDictService bizDictService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取固件类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取固件类型集合")
|
||||||
|
@GetMapping("/getFirmwareTypeAll")
|
||||||
|
public Result<List<BizDict>> getFirmwareTypeAll() {
|
||||||
|
return Result.success(bizDictService.getDataListByKey());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
11
src/main/java/com/corewing/app/service/BizDictService.java
Normal file
11
src/main/java/com/corewing/app/service/BizDictService.java
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package com.corewing.app.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.corewing.app.entity.BizDict;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
public interface BizDictService extends IService<BizDict> {
|
||||||
|
List<BizDict> getDataListByKey();
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.corewing.app.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.corewing.app.entity.BizDict;
|
||||||
|
import com.corewing.app.mapper.BizDictMapper;
|
||||||
|
import com.corewing.app.service.BizDictService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BizDictServiceImpl extends ServiceImpl<BizDictMapper, BizDict> implements BizDictService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BizDict> getDataListByKey() {
|
||||||
|
LambdaQueryWrapper<BizDict> parentQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
parentQueryWrapper.eq(BizDict::getDictValue, "PUBLIC_FIRMWARE_TYPE");
|
||||||
|
BizDict parentDict = getOne(parentQueryWrapper);
|
||||||
|
LambdaQueryWrapper<BizDict> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(BizDict::getParentId, parentDict.getId());
|
||||||
|
return list(queryWrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user