feat() 规则级别
parent
af247c3d7b
commit
9a59b495b4
|
@ -0,0 +1,48 @@
|
|||
package com.etl.rule.version.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.etl.common.core.annotation.Excel;
|
||||
import com.etl.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 选择代码
|
||||
*
|
||||
* @author Chao
|
||||
* @ClassName: VersionCode 选择代码
|
||||
* @CreateTime: 2024/5/12 下午8:29
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("version_code")
|
||||
public class VersionCode extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 代码
|
||||
*/
|
||||
@Excel(name = "代码")
|
||||
private String code;
|
||||
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package com.etl.rule.version.controller;
|
||||
|
||||
import com.etl.common.core.domain.Result;
|
||||
import com.etl.common.core.web.controller.BaseController;
|
||||
import com.etl.common.security.annotation.RequiresPermissions;
|
||||
import com.etl.rule.version.service.IVersionCodeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 选择代码
|
||||
*
|
||||
* @author Chao
|
||||
* @ClassName: VersionCode 代码
|
||||
* @CreateTime: 2024/5/12 下午8:33
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/versionCode")
|
||||
public class VersionCodeController extends BaseController {
|
||||
@Autowired
|
||||
private IVersionCodeService versionCodeService;
|
||||
|
||||
/**
|
||||
* 代码列表
|
||||
*
|
||||
* @return versionCode集合
|
||||
*/
|
||||
@RequiresPermissions("rule:versionCode:list")
|
||||
@PostMapping("/list")
|
||||
public Result list() {
|
||||
return success(versionCodeService.versionCodeList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id获取当前代码
|
||||
*
|
||||
* @param id 代码
|
||||
* @return versionCod对象
|
||||
*/
|
||||
@RequiresPermissions("rule:versionCode:getVersionCode")
|
||||
@GetMapping("getVersionCode/{id}")
|
||||
public Result getVersionCode(@PathVariable("id") Long id) {
|
||||
return success(versionCodeService.getVersionCode(id));
|
||||
}
|
||||
|
||||
@RequiresPermissions("rule:versionCode:add")
|
||||
@PostMapping("/add")
|
||||
public Result add(@RequestBody)
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.etl.rule.version.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.etl.rule.version.domain.VersionCode;
|
||||
|
||||
/**
|
||||
* 选择代码mapper接口
|
||||
*
|
||||
* @author Chao
|
||||
* @ClassName: VersionCodeMapper 选择代码mapper接口
|
||||
* @CreateTime: 2024/5/12 下午8:39
|
||||
*/
|
||||
public interface VersionCodeMapper extends BaseMapper<VersionCode> {
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.etl.rule.version.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.etl.rule.version.domain.VersionCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 选择代码Service接口
|
||||
*
|
||||
* @author Chao
|
||||
* @ClassName: IVersionCodeService 选择代码Service接口
|
||||
* @CreateTime: 2024/5/12 下午8:37
|
||||
*/
|
||||
public interface IVersionCodeService extends IService<VersionCode> {
|
||||
/**
|
||||
* 查询代码选择列表
|
||||
*
|
||||
* @return List<VersionCode>
|
||||
*/
|
||||
List<VersionCode> versionCodeList();
|
||||
|
||||
/**
|
||||
* 根据id获取versionCode对象
|
||||
*
|
||||
* @param id id
|
||||
* @return VersionCode
|
||||
*/
|
||||
VersionCode getVersionCode(Long id);
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.etl.rule.version.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.etl.rule.version.domain.VersionCode;
|
||||
import com.etl.rule.version.mapper.VersionCodeMapper;
|
||||
import com.etl.rule.version.service.IVersionCodeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 选择代码Service业务实现层
|
||||
*
|
||||
* @author Chao
|
||||
* @ClassName: VersionCodeService 选择代码Service业务实现层
|
||||
* @CreateTime: 2024/5/12 下午8:38
|
||||
*/
|
||||
@Service
|
||||
public class VersionCodeServiceImpl extends ServiceImpl<VersionCodeMapper, VersionCode> implements IVersionCodeService {
|
||||
|
||||
/**
|
||||
* 查询选择代码列表
|
||||
*
|
||||
* @return List<VersionCode>
|
||||
*/
|
||||
@Override
|
||||
public List<VersionCode> versionCodeList() {
|
||||
return this.list();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id获取VersionCode对象
|
||||
*
|
||||
* @param id id
|
||||
* @return VersionCode
|
||||
*/
|
||||
@Override
|
||||
public VersionCode getVersionCode(Long id) {
|
||||
return this.getOne(
|
||||
new LambdaQueryWrapper<VersionCode>()
|
||||
.eq(VersionCode::getId, id)
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue