Skip to content

Commit

Permalink
knife4j升级4.3.0注解改造
Browse files Browse the repository at this point in the history
  • Loading branch information
EightMonth committed Dec 27, 2023
1 parent 82a2a67 commit 21b031c
Show file tree
Hide file tree
Showing 91 changed files with 865 additions and 893 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package org.jeecg.common.api.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.jeecg.common.constant.CommonConstant;

Expand All @@ -15,39 +14,39 @@
* @date 2019年1月19日
*/
@Data
@ApiModel(value="接口返回对象", description="接口返回对象")
@Schema(description="接口返回对象")
public class Result<T> implements Serializable {

private static final long serialVersionUID = 1L;

/**
* 成功标志
*/
@ApiModelProperty(value = "成功标志")
@Schema(description = "成功标志")
private boolean success = true;

/**
* 返回处理消息
*/
@ApiModelProperty(value = "返回处理消息")
@Schema(description = "返回处理消息")
private String message = "";

/**
* 返回代码
*/
@ApiModelProperty(value = "返回代码")
@Schema(description = "返回代码")
private Integer code = 0;

/**
* 返回数据对象 data
*/
@ApiModelProperty(value = "返回数据对象")
@Schema(description = "返回数据对象")
private T result;

/**
* 时间戳
*/
@ApiModelProperty(value = "时间戳")
@Schema(description = "时间戳")
private long timestamp = System.currentTimeMillis();

public Result() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import java.io.Serializable;

import io.swagger.v3.oas.annotations.media.Schema;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
Expand All @@ -30,20 +30,20 @@ public class JeecgEntity implements Serializable {
* ID
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "ID")
@Schema(description = "ID")
private java.lang.String id;

/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
@Schema(description = "创建人")
@Excel(name = "创建人", width = 15)
private java.lang.String createBy;

/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@Schema(description = "创建时间")
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
Expand All @@ -52,14 +52,14 @@ public class JeecgEntity implements Serializable {
/**
* 更新人
*/
@ApiModelProperty(value = "更新人")
@Schema(description = "更新人")
@Excel(name = "更新人", width = 15)
private java.lang.String updateBy;

/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
@Schema(description = "更新时间")
@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public static boolean isJsonArrayIn(JSONArray childArray, String[] all) {
return false;
}

String[] childs = childArray.toArray(new String[]{});
String[] childs = (String[]) childArray.toArray();
for (String v : childs) {
if (!isIn(v, all)) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.mgt.DefaultSecurityManager;
Expand Down Expand Up @@ -44,7 +44,7 @@
* @Version:V2.0
*/
@Slf4j
@Api(tags = "单表DEMO")
@Tag(name = "单表DEMO")
@RestController
@RequestMapping("/test/jeecgDemo")
public class JeecgDemoController extends JeecgController<JeecgDemo, IJeecgDemoService> {
Expand All @@ -63,7 +63,7 @@ public class JeecgDemoController extends JeecgController<JeecgDemo, IJeecgDemoSe
* @param req
* @return
*/
@ApiOperation(value = "获取Demo数据列表", notes = "获取所有Demo数据列表")
@Operation(summary = "获取所有Demo数据列表")
@GetMapping(value = "/list")
@PermissionData(pageComponent = "jeecg/JeecgDemoList")
public Result<?> list(JeecgDemo jeecgDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
Expand All @@ -88,7 +88,7 @@ public Result<?> list(JeecgDemo jeecgDemo, @RequestParam(name = "pageNo", defaul
*/
@PostMapping(value = "/add")
@AutoLog(value = "添加测试DEMO")
@ApiOperation(value = "添加DEMO", notes = "添加DEMO")
@Operation(summary = "添加DEMO")
public Result<?> add(@RequestBody JeecgDemo jeecgDemo) {
jeecgDemoService.save(jeecgDemo);
return Result.OK("添加成功!");
Expand All @@ -101,7 +101,7 @@ public Result<?> add(@RequestBody JeecgDemo jeecgDemo) {
* @return
*/
@AutoLog(value = "编辑DEMO", operateType = CommonConstant.OPERATE_TYPE_3)
@ApiOperation(value = "编辑DEMO", notes = "编辑DEMO")
@Operation(summary = "编辑DEMO")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<?> edit(@RequestBody JeecgDemo jeecgDemo) {
jeecgDemoService.updateById(jeecgDemo);
Expand All @@ -116,7 +116,7 @@ public Result<?> edit(@RequestBody JeecgDemo jeecgDemo) {
*/
@AutoLog(value = "删除测试DEMO")
@DeleteMapping(value = "/delete")
@ApiOperation(value = "通过ID删除DEMO", notes = "通过ID删除DEMO")
@Operation(summary = "通过ID删除DEMO")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
jeecgDemoService.removeById(id);
return Result.OK("删除成功!");
Expand All @@ -129,7 +129,7 @@ public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
* @return
*/
@DeleteMapping(value = "/deleteBatch")
@ApiOperation(value = "批量删除DEMO", notes = "批量删除DEMO")
@Operation(summary = "批量删除DEMO")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.jeecgDemoService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
Expand All @@ -142,8 +142,8 @@ public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String
* @return
*/
@GetMapping(value = "/queryById")
@ApiOperation(value = "通过ID查询DEMO", notes = "通过ID查询DEMO")
public Result<?> queryById(@ApiParam(name = "id", value = "示例id", required = true) @RequestParam(name = "id", required = true) String id) {
@Operation(summary = "通过ID查询DEMO")
public Result<?> queryById(@Parameter(name = "id", description = "示例id", required = true) @RequestParam(name = "id", required = true) String id) {
JeecgDemo jeecgDemo = jeecgDemoService.getById(id);
return Result.OK(jeecgDemo);
}
Expand Down Expand Up @@ -475,7 +475,7 @@ public Result<?> groupList() {
* 测试Mono对象
* @return
*/
@ApiOperation("Mono测试")
@Operation(summary = "Mono测试")
@GetMapping(value ="/test")
public Mono<String> test() {
//解决shiro报错No SecurityManager accessible to the calling code, either bound to the org.apache.shiro
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package org.jeecg.modules.demo.test.controller;

import io.lettuce.core.dynamic.annotation.Param;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
Expand All @@ -21,7 +20,7 @@
* @Date:2020-04-21
*/
@Slf4j
@Api(tags = "动态数据源测试")
@Tag(name = "动态数据源测试")
@RestController
@RequestMapping("/test/dynamic")
public class JeecgDynamicDataController extends JeecgController<JeecgDemo, IJeecgDemoService> {
Expand All @@ -37,7 +36,7 @@ public class JeecgDynamicDataController extends JeecgController<JeecgDemo, IJeec
*/
@PostMapping(value = "/test1")
@AutoLog(value = "动态切换数据源")
@ApiOperation(value = "动态切换数据源", notes = "动态切换数据源")
@Operation(summary = "动态切换数据源")
public Result<List<JeecgDemo>> selectSpelByKey(@RequestParam(required = false) String dsName) {
List<JeecgDemo> list = jeecgDynamicDataService.selectSpelByKey(dsName);
return Result.OK(list);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.Version;
import io.swagger.v3.oas.annotations.media.Schema;
import org.jeecg.common.system.base.entity.JeecgEntity;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
Expand All @@ -25,59 +24,59 @@
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="测试DEMO对象", description="测试DEMO")
@Schema(description="测试DEMO")
@TableName("demo")
public class JeecgDemo extends JeecgEntity implements Serializable {
private static final long serialVersionUID = 1L;
/** 姓名 */
@Excel(name="姓名",width=25)
@ApiModelProperty(value = "姓名")
@Schema(description = "姓名")
private java.lang.String name;
/** 关键词 */
@ApiModelProperty(value = "关键词")
@Schema(description = "关键词")
@Excel(name="关键词",width=15)
private java.lang.String keyWord;
/** 打卡时间 */
@ApiModelProperty(value = "打卡时间")
@Schema(description = "打卡时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name="打卡时间",width=20,format="yyyy-MM-dd HH:mm:ss")
private java.util.Date punchTime;
/** 工资 */
@ApiModelProperty(value = "工资",example = "0")
@Schema(description = "工资",example = "0")
@Excel(name="工资",width=15)
private java.math.BigDecimal salaryMoney;
/** 奖金 */
@ApiModelProperty(value = "奖金",example = "0")
@Schema(description = "奖金",example = "0")
@Excel(name="奖金",width=15)
private java.lang.Double bonusMoney;
/** 性别 {男:1,女:2} */
@ApiModelProperty(value = "性别")
@Schema(description = "性别")
@Excel(name = "性别", width = 15, dicCode = "sex")
private java.lang.String sex;
/** 年龄 */
@ApiModelProperty(value = "年龄",example = "0")
@Schema(description = "年龄",example = "0")
@Excel(name="年龄",width=15)
private java.lang.Integer age;
/** 生日 */
@ApiModelProperty(value = "生日")
@Schema(description = "生日")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name="生日",format="yyyy-MM-dd")
private java.util.Date birthday;
/** 邮箱 */
@ApiModelProperty(value = "邮箱")
@Schema(description = "邮箱")
@Excel(name="邮箱",width=30)
private java.lang.String email;
/** 个人简介 */
@ApiModelProperty(value = "个人简介")
@Schema(description = "个人简介")
private java.lang.String content;
/** 部门编码 */
@Excel(name="部门编码",width=25)
@ApiModelProperty(value = "部门编码")
@Schema(description = "部门编码")
private java.lang.String sysOrgCode;

@ApiModelProperty(value = "租户ID")
@Schema(description = "租户ID")
private java.lang.Integer tenantId;
/** 乐观锁字段 */
@Version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
Expand Down Expand Up @@ -47,7 +47,7 @@
@RestController
@RequestMapping("/sys/quartzJob")
@Slf4j
@Api(tags = "定时任务接口")
@Tag(name = "定时任务接口")
public class QuartzJobController {
@Autowired
private IQuartzJobService quartzJobService;
Expand Down Expand Up @@ -154,7 +154,7 @@ public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String
//@RequiresRoles("admin")
@RequiresPermissions("system:quartzJob:pause")
@GetMapping(value = "/pause")
@ApiOperation(value = "停止定时任务")
@Operation(summary = "停止定时任务")
public Result<Object> pauseJob(@RequestParam(name = "id") String id) {
QuartzJob job = quartzJobService.getById(id);
if (job == null) {
Expand All @@ -173,7 +173,7 @@ public Result<Object> pauseJob(@RequestParam(name = "id") String id) {
//@RequiresRoles("admin")
@RequiresPermissions("system:quartzJob:resume")
@GetMapping(value = "/resume")
@ApiOperation(value = "启动定时任务")
@Operation(summary = "启动定时任务")
public Result<Object> resumeJob(@RequestParam(name = "id") String id) {
QuartzJob job = quartzJobService.getById(id);
if (job == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.jeecg.modules.system.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.api.vo.Result;
Expand All @@ -24,7 +24,7 @@
@Slf4j
@RestController
@RequestMapping("/sys/duplicate")
@Api(tags="重复校验")
@Tag(name="重复校验")
public class DuplicateCheckController {

@Autowired
Expand All @@ -36,7 +36,7 @@ public class DuplicateCheckController {
* @return
*/
@RequestMapping(value = "/check", method = RequestMethod.GET)
@ApiOperation("重复校验接口")
@Operation(summary ="重复校验接口")
public Result<String> doDuplicateCheck(DuplicateCheckVo duplicateCheckVo, HttpServletRequest request) {
log.debug("----duplicate check------:"+ duplicateCheckVo.toString());

Expand Down
Loading

0 comments on commit 21b031c

Please sign in to comment.