Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
28ea39b6
提交
28ea39b6
authored
3月 14, 2024
作者:
chenshiqiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add base code
上级
306c8fde
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
692 行增加
和
0 行删除
+692
-0
EventCategoryController.java
...va/com/zzsn/event/controller/EventCategoryController.java
+121
-0
EventController.java
src/main/java/com/zzsn/event/controller/EventController.java
+120
-0
Event.java
src/main/java/com/zzsn/event/entity/Event.java
+99
-0
EventCategory.java
src/main/java/com/zzsn/event/entity/EventCategory.java
+83
-0
EventCategoryMapper.java
src/main/java/com/zzsn/event/mapper/EventCategoryMapper.java
+17
-0
EventMapper.java
src/main/java/com/zzsn/event/mapper/EventMapper.java
+17
-0
EventCategoryMapper.xml
...in/java/com/zzsn/event/mapper/xml/EventCategoryMapper.xml
+6
-0
EventMapper.xml
src/main/java/com/zzsn/event/mapper/xml/EventMapper.xml
+6
-0
IEventCategoryService.java
...in/java/com/zzsn/event/service/IEventCategoryService.java
+14
-0
IEventService.java
src/main/java/com/zzsn/event/service/IEventService.java
+14
-0
EventCategoryServiceImpl.java
...com/zzsn/event/service/impl/EventCategoryServiceImpl.java
+19
-0
EventServiceImpl.java
...in/java/com/zzsn/event/service/impl/EventServiceImpl.java
+19
-0
Result.java
src/main/java/com/zzsn/event/vo/Result.java
+157
-0
没有找到文件。
src/main/java/com/zzsn/event/controller/EventCategoryController.java
0 → 100644
浏览文件 @
28ea39b6
package
com
.
zzsn
.
event
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.zzsn.event.entity.EventCategory
;
import
com.zzsn.event.service.IEventCategoryService
;
import
com.zzsn.event.vo.Result
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Arrays
;
/**
* 事件分类
* @Author: jeecg-boot
* @Date: 2024-03-14
* @Version: V1.0
*/
@Slf4j
@Api
(
tags
=
"事件分类"
)
@RestController
@RequestMapping
(
"/event/eventCategory"
)
public
class
EventCategoryController
{
@Autowired
private
IEventCategoryService
eventCategoryService
;
/**
* 分页列表查询
*
* @param eventCategory
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@ApiOperation
(
value
=
"事件分类-分页列表查询"
,
notes
=
"事件分类-分页列表查询"
)
@GetMapping
(
value
=
"/list"
)
public
Result
<?>
queryPageList
(
EventCategory
eventCategory
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
,
HttpServletRequest
req
)
{
QueryWrapper
<
EventCategory
>
queryWrapper
=
new
QueryWrapper
<>();
Page
<
EventCategory
>
page
=
new
Page
<
EventCategory
>(
pageNo
,
pageSize
);
IPage
<
EventCategory
>
pageList
=
eventCategoryService
.
page
(
page
,
queryWrapper
);
return
Result
.
OK
(
pageList
);
}
/**
* 添加
*
* @param eventCategory
* @return
*/
@ApiOperation
(
value
=
"事件分类-添加"
,
notes
=
"事件分类-添加"
)
@PostMapping
(
value
=
"/add"
)
public
Result
<?>
add
(
@RequestBody
EventCategory
eventCategory
)
{
eventCategoryService
.
save
(
eventCategory
);
return
Result
.
OK
(
"添加成功!"
);
}
/**
* 编辑
*
* @param eventCategory
* @return
*/
@ApiOperation
(
value
=
"事件分类-编辑"
,
notes
=
"事件分类-编辑"
)
@PutMapping
(
value
=
"/edit"
)
public
Result
<?>
edit
(
@RequestBody
EventCategory
eventCategory
)
{
eventCategoryService
.
updateById
(
eventCategory
);
return
Result
.
OK
(
"编辑成功!"
);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@ApiOperation
(
value
=
"事件分类-通过id删除"
,
notes
=
"事件分类-通过id删除"
)
@DeleteMapping
(
value
=
"/delete"
)
public
Result
<?>
delete
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
eventCategoryService
.
removeById
(
id
);
return
Result
.
OK
(
"删除成功!"
);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@ApiOperation
(
value
=
"事件分类-批量删除"
,
notes
=
"事件分类-批量删除"
)
@DeleteMapping
(
value
=
"/deleteBatch"
)
public
Result
<?>
deleteBatch
(
@RequestParam
(
name
=
"ids"
,
required
=
true
)
String
ids
)
{
this
.
eventCategoryService
.
removeByIds
(
Arrays
.
asList
(
ids
.
split
(
","
)));
return
Result
.
OK
(
"批量删除成功!"
);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@ApiOperation
(
value
=
"事件分类-通过id查询"
,
notes
=
"事件分类-通过id查询"
)
@GetMapping
(
value
=
"/queryById"
)
public
Result
<?>
queryById
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
EventCategory
eventCategory
=
eventCategoryService
.
getById
(
id
);
return
Result
.
OK
(
eventCategory
);
}
}
src/main/java/com/zzsn/event/controller/EventController.java
0 → 100644
浏览文件 @
28ea39b6
package
com
.
zzsn
.
event
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.zzsn.event.entity.Event
;
import
com.zzsn.event.service.IEventService
;
import
com.zzsn.event.vo.Result
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Arrays
;
/**
* 事件
* @Author: jeecg-boot
* @Date: 2024-03-14
* @Version: V1.0
*/
@Slf4j
@Api
(
tags
=
"事件"
)
@RestController
@RequestMapping
(
"/event/event"
)
public
class
EventController
{
@Autowired
private
IEventService
eventService
;
/**
* 分页列表查询
*
* @param event
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@ApiOperation
(
value
=
"事件-分页列表查询"
,
notes
=
"事件-分页列表查询"
)
@GetMapping
(
value
=
"/list"
)
public
Result
<?>
queryPageList
(
Event
event
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
,
HttpServletRequest
req
)
{
QueryWrapper
<
Event
>
queryWrapper
=
new
QueryWrapper
<>();
Page
<
Event
>
page
=
new
Page
<
Event
>(
pageNo
,
pageSize
);
IPage
<
Event
>
pageList
=
eventService
.
page
(
page
,
queryWrapper
);
return
Result
.
OK
(
pageList
);
}
/**
* 添加
*
* @param event
* @return
*/
@ApiOperation
(
value
=
"事件-添加"
,
notes
=
"事件-添加"
)
@PostMapping
(
value
=
"/add"
)
public
Result
<?>
add
(
@RequestBody
Event
event
)
{
eventService
.
save
(
event
);
return
Result
.
OK
(
"添加成功!"
);
}
/**
* 编辑
*
* @param event
* @return
*/
@ApiOperation
(
value
=
"事件-编辑"
,
notes
=
"事件-编辑"
)
@PutMapping
(
value
=
"/edit"
)
public
Result
<?>
edit
(
@RequestBody
Event
event
)
{
eventService
.
updateById
(
event
);
return
Result
.
OK
(
"编辑成功!"
);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@ApiOperation
(
value
=
"事件-通过id删除"
,
notes
=
"事件-通过id删除"
)
@DeleteMapping
(
value
=
"/delete"
)
public
Result
<?>
delete
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
eventService
.
removeById
(
id
);
return
Result
.
OK
(
"删除成功!"
);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@ApiOperation
(
value
=
"事件-批量删除"
,
notes
=
"事件-批量删除"
)
@DeleteMapping
(
value
=
"/deleteBatch"
)
public
Result
<?>
deleteBatch
(
@RequestParam
(
name
=
"ids"
,
required
=
true
)
String
ids
)
{
this
.
eventService
.
removeByIds
(
Arrays
.
asList
(
ids
.
split
(
","
)));
return
Result
.
OK
(
"批量删除成功!"
);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@ApiOperation
(
value
=
"事件-通过id查询"
,
notes
=
"事件-通过id查询"
)
@GetMapping
(
value
=
"/queryById"
)
public
Result
<?>
queryById
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
Event
event
=
eventService
.
getById
(
id
);
return
Result
.
OK
(
event
);
}
}
src/main/java/com/zzsn/event/entity/Event.java
0 → 100644
浏览文件 @
28ea39b6
package
com
.
zzsn
.
event
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.jeecgframework.poi.excel.annotation.Excel
;
/**
* @Description: 事件
* @Author: jeecg-boot
* @Date: 2024-03-14
* @Version: V1.0
*/
@Data
@TableName
(
"event"
)
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"event对象"
,
description
=
"事件"
)
public
class
Event
{
/**ID*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ApiModelProperty
(
value
=
"ID"
)
private
String
id
;
/**名称*/
@Excel
(
name
=
"名称"
,
width
=
15
)
@ApiModelProperty
(
value
=
"名称"
)
private
String
eventName
;
/**图标*/
@Excel
(
name
=
"图标"
,
width
=
15
)
@ApiModelProperty
(
value
=
"图标"
)
private
String
eventIcon
;
/**事件类型*/
@Excel
(
name
=
"事件类型"
,
width
=
15
)
@ApiModelProperty
(
value
=
"事件类型"
)
private
Integer
eventType
;
/**开始时间*/
@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"
)
@ApiModelProperty
(
value
=
"开始时间"
)
private
Date
startTime
;
/**结束时间*/
@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"
)
@ApiModelProperty
(
value
=
"结束时间"
)
private
Date
endTime
;
/**事件地域*/
@Excel
(
name
=
"事件地域"
,
width
=
15
)
@ApiModelProperty
(
value
=
"事件地域"
)
private
String
eventArea
;
/**标签*/
@Excel
(
name
=
"标签"
,
width
=
15
)
@ApiModelProperty
(
value
=
"标签"
)
private
String
eventLabel
;
/**关键词*/
@Excel
(
name
=
"关键词"
,
width
=
15
)
@ApiModelProperty
(
value
=
"关键词"
)
private
String
eventKeywords
;
/**是否公开*/
@Excel
(
name
=
"是否公开"
,
width
=
15
)
@ApiModelProperty
(
value
=
"是否公开"
)
private
Integer
facePublic
;
/**事件描述*/
@Excel
(
name
=
"事件描述"
,
width
=
15
)
@ApiModelProperty
(
value
=
"事件描述"
)
private
String
eventDescribe
;
/**创建人id*/
@Excel
(
name
=
"创建人id"
,
width
=
15
)
@ApiModelProperty
(
value
=
"创建人id"
)
private
String
createBy
;
/**创建时间*/
@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"
)
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
/**修改时间*/
@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"
)
@ApiModelProperty
(
value
=
"修改时间"
)
private
Date
updateTime
;
/**修改人id*/
@Excel
(
name
=
"修改人id"
,
width
=
15
)
@ApiModelProperty
(
value
=
"修改人id"
)
private
String
updateBy
;
}
src/main/java/com/zzsn/event/entity/EventCategory.java
0 → 100644
浏览文件 @
28ea39b6
package
com
.
zzsn
.
event
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.jeecgframework.poi.excel.annotation.Excel
;
/**
* @Description: 事件分类
* @Author: jeecg-boot
* @Date: 2024-03-14
* @Version: V1.0
*/
@Data
@TableName
(
"event_category"
)
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"event_category对象"
,
description
=
"事件分类"
)
public
class
EventCategory
{
/**id*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
/**事件分类名称*/
@Excel
(
name
=
"事件分类名称"
,
width
=
15
)
@ApiModelProperty
(
value
=
"事件分类名称"
)
private
String
typeName
;
/**父级id*/
@Excel
(
name
=
"父级id"
,
width
=
15
)
@ApiModelProperty
(
value
=
"父级id"
)
private
String
pid
;
/**是否有子节点0,没有 1,有*/
@Excel
(
name
=
"是否有子节点0,没有 1,有"
,
width
=
15
)
@ApiModelProperty
(
value
=
"是否有子节点0,没有 1,有"
)
private
String
hasChild
;
/**状态*/
@Excel
(
name
=
"状态"
,
width
=
15
)
@ApiModelProperty
(
value
=
"状态"
)
private
Integer
status
;
/**节点绝对路径*/
@Excel
(
name
=
"节点绝对路径"
,
width
=
15
)
@ApiModelProperty
(
value
=
"节点绝对路径"
)
private
String
fullPath
;
/**序号*/
@Excel
(
name
=
"序号"
,
width
=
15
)
@ApiModelProperty
(
value
=
"序号"
)
private
Integer
orderNumber
;
/**层级*/
@Excel
(
name
=
"层级"
,
width
=
15
)
@ApiModelProperty
(
value
=
"层级"
)
private
Integer
level
;
/**创建人*/
@Excel
(
name
=
"创建人"
,
width
=
15
)
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createBy
;
/**创建时间*/
@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"
)
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
/**更新人*/
@Excel
(
name
=
"更新人"
,
width
=
15
)
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updateBy
;
/**更新时间*/
@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"
)
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateTime
;
}
src/main/java/com/zzsn/event/mapper/EventCategoryMapper.java
0 → 100644
浏览文件 @
28ea39b6
package
com
.
zzsn
.
event
.
mapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
com.zzsn.event.entity.EventCategory
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* @Description: 事件分类
* @Author: jeecg-boot
* @Date: 2024-03-14
* @Version: V1.0
*/
public
interface
EventCategoryMapper
extends
BaseMapper
<
EventCategory
>
{
}
src/main/java/com/zzsn/event/mapper/EventMapper.java
0 → 100644
浏览文件 @
28ea39b6
package
com
.
zzsn
.
event
.
mapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
com.zzsn.event.entity.Event
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* @Description: 事件
* @Author: jeecg-boot
* @Date: 2024-03-14
* @Version: V1.0
*/
public
interface
EventMapper
extends
BaseMapper
<
Event
>
{
}
src/main/java/com/zzsn/event/mapper/xml/EventCategoryMapper.xml
0 → 100644
浏览文件 @
28ea39b6
<?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.zzsn.event.mapper.EventCategoryMapper"
>
</mapper>
\ No newline at end of file
src/main/java/com/zzsn/event/mapper/xml/EventMapper.xml
0 → 100644
浏览文件 @
28ea39b6
<?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.zzsn.event.mapper.EventMapper"
>
</mapper>
\ No newline at end of file
src/main/java/com/zzsn/event/service/IEventCategoryService.java
0 → 100644
浏览文件 @
28ea39b6
package
com
.
zzsn
.
event
.
service
;
import
com.zzsn.event.entity.EventCategory
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* @Description: 事件分类
* @Author: jeecg-boot
* @Date: 2024-03-14
* @Version: V1.0
*/
public
interface
IEventCategoryService
extends
IService
<
EventCategory
>
{
}
src/main/java/com/zzsn/event/service/IEventService.java
0 → 100644
浏览文件 @
28ea39b6
package
com
.
zzsn
.
event
.
service
;
import
com.zzsn.event.entity.Event
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* @Description: 事件
* @Author: jeecg-boot
* @Date: 2024-03-14
* @Version: V1.0
*/
public
interface
IEventService
extends
IService
<
Event
>
{
}
src/main/java/com/zzsn/event/service/impl/EventCategoryServiceImpl.java
0 → 100644
浏览文件 @
28ea39b6
package
com
.
zzsn
.
event
.
service
.
impl
;
import
com.zzsn.event.entity.EventCategory
;
import
com.zzsn.event.mapper.EventCategoryMapper
;
import
com.zzsn.event.service.IEventCategoryService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
/**
* @Description: 事件分类
* @Author: jeecg-boot
* @Date: 2024-03-14
* @Version: V1.0
*/
@Service
public
class
EventCategoryServiceImpl
extends
ServiceImpl
<
EventCategoryMapper
,
EventCategory
>
implements
IEventCategoryService
{
}
src/main/java/com/zzsn/event/service/impl/EventServiceImpl.java
0 → 100644
浏览文件 @
28ea39b6
package
com
.
zzsn
.
event
.
service
.
impl
;
import
com.zzsn.event.entity.Event
;
import
com.zzsn.event.mapper.EventMapper
;
import
com.zzsn.event.service.IEventService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
/**
* @Description: 事件
* @Author: jeecg-boot
* @Date: 2024-03-14
* @Version: V1.0
*/
@Service
public
class
EventServiceImpl
extends
ServiceImpl
<
EventMapper
,
Event
>
implements
IEventService
{
}
src/main/java/com/zzsn/event/vo/Result.java
0 → 100644
浏览文件 @
28ea39b6
package
com
.
zzsn
.
event
.
vo
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.zzsn.event.constant.CommonConstant
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 接口返回数据格式
* @author scott
* @email jeecgos@163.com
* @date 2019年1月19日
*/
@Data
public
class
Result
<
T
>
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 成功标志
*/
private
boolean
success
=
true
;
/**
* 返回处理消息
*/
private
String
message
=
"操作成功!"
;
/**
* 返回代码
*/
private
Integer
code
=
0
;
/**
* 返回数据对象 data
*/
private
T
result
;
/**
* 时间戳
*/
private
long
timestamp
=
System
.
currentTimeMillis
();
/**
* python接口返回
*/
private
String
handleMsg
;
/**
* python接口返回状态
*/
private
boolean
isHandleSuccess
;
/**
* python接口返回状态
*/
private
String
logs
;
/**
* 返回数据对象 data
*/
private
T
resultData
;
public
Result
()
{
}
public
Result
<
T
>
success
(
String
message
)
{
this
.
message
=
message
;
this
.
code
=
CommonConstant
.
SC_OK_200
;
this
.
success
=
true
;
return
this
;
}
@Deprecated
public
static
Result
<
Object
>
ok
()
{
Result
<
Object
>
r
=
new
Result
<
Object
>();
r
.
setSuccess
(
true
);
r
.
setCode
(
CommonConstant
.
SC_OK_200
);
r
.
setMessage
(
"成功"
);
return
r
;
}
@Deprecated
public
static
Result
<
Object
>
ok
(
String
msg
)
{
Result
<
Object
>
r
=
new
Result
<
Object
>();
r
.
setSuccess
(
true
);
r
.
setCode
(
CommonConstant
.
SC_OK_200
);
r
.
setMessage
(
msg
);
return
r
;
}
@Deprecated
public
static
Result
<
Object
>
ok
(
Object
data
)
{
Result
<
Object
>
r
=
new
Result
<
Object
>();
r
.
setSuccess
(
true
);
r
.
setCode
(
CommonConstant
.
SC_OK_200
);
r
.
setResult
(
data
);
return
r
;
}
public
static
<
T
>
Result
<
T
>
OK
()
{
Result
<
T
>
r
=
new
Result
<
T
>();
r
.
setSuccess
(
true
);
r
.
setCode
(
CommonConstant
.
SC_OK_200
);
r
.
setMessage
(
"成功"
);
return
r
;
}
public
static
<
T
>
Result
<
T
>
OK
(
T
data
)
{
Result
<
T
>
r
=
new
Result
<
T
>();
r
.
setSuccess
(
true
);
r
.
setCode
(
CommonConstant
.
SC_OK_200
);
r
.
setResult
(
data
);
return
r
;
}
public
static
<
T
>
Result
<
T
>
OK
(
String
msg
,
T
data
)
{
Result
<
T
>
r
=
new
Result
<
T
>();
r
.
setSuccess
(
true
);
r
.
setCode
(
CommonConstant
.
SC_OK_200
);
r
.
setMessage
(
msg
);
r
.
setResult
(
data
);
return
r
;
}
public
static
Result
<
Object
>
error
(
String
msg
)
{
return
error
(
CommonConstant
.
SC_INTERNAL_SERVER_ERROR_500
,
msg
);
}
public
static
Result
<
Object
>
error
(
int
code
,
String
msg
)
{
Result
<
Object
>
r
=
new
Result
<
Object
>();
r
.
setCode
(
code
);
r
.
setMessage
(
msg
);
r
.
setSuccess
(
false
);
return
r
;
}
public
Result
<
T
>
error500
(
String
message
)
{
this
.
message
=
message
;
this
.
code
=
CommonConstant
.
SC_INTERNAL_SERVER_ERROR_500
;
this
.
success
=
false
;
return
this
;
}
/**
* 无权限访问返回结果
*/
public
static
Result
<
Object
>
noauth
(
String
msg
)
{
return
error
(
CommonConstant
.
SC_JEECG_NO_AUTHZ
,
msg
);
}
@JsonIgnore
private
String
onlTable
;
}
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论