diff --git a/module-file-media/src/main/java/ink/wgink/module/file/media/controller/api/rtmp/RtmpClientController.java b/module-file-media/src/main/java/ink/wgink/module/file/media/controller/api/rtmp/RtmpClientController.java new file mode 100644 index 00000000..657a8ec5 --- /dev/null +++ b/module-file-media/src/main/java/ink/wgink/module/file/media/controller/api/rtmp/RtmpClientController.java @@ -0,0 +1,111 @@ +package ink.wgink.module.file.media.controller.api.rtmp; + +import ink.wgink.annotation.CheckRequestBodyAnnotation; +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.pojo.result.SuccessResultList; +import ink.wgink.module.file.media.pojo.dtos.rtmp.RtmpClientDTO; +import ink.wgink.module.file.media.pojo.vos.rtmp.RtmpClientVO; +import ink.wgink.module.file.media.service.rtmp.IRtmpClientService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: ClientController + * @Description: rtmp客户端 + * @Author: CodeFactory + * @Date: 2022-04-26 22:03:44 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "rtmp客户端接口") +@RestController +@RequestMapping(ISystemConstant.API_PREFIX + "/rtmp-client") +public class RtmpClientController extends DefaultBaseController { + + @Autowired + private IRtmpClientService clientService; + + @ApiOperation(value = "新增rtmp客户端", notes = "新增rtmp客户端接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public SuccessResult save(@RequestBody RtmpClientVO rtmpClientVO) { + clientService.save(rtmpClientVO); + return new SuccessResult(); + } + + @ApiOperation(value = "删除rtmp客户端", notes = "删除rtmp客户端接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("remove/{ids}") + public SuccessResult remove(@PathVariable("ids") String ids) { + clientService.remove(Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改rtmp客户端", notes = "修改rtmp客户端接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "clientId", value = "rtmp客户端ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("update/{clientId}") + @CheckRequestBodyAnnotation + public SuccessResult update(@PathVariable("clientId") String clientId, @RequestBody RtmpClientVO rtmpClientVO) { + clientService.update(clientId, rtmpClientVO); + return new SuccessResult(); + } + + @ApiOperation(value = "rtmp客户端详情", notes = "rtmp客户端详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "clientId", value = "rtmp客户端ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{clientId}") + public RtmpClientDTO get(@PathVariable("clientId") String clientId) { + return clientService.get(clientId); + } + + @ApiOperation(value = "rtmp客户端列表", notes = "rtmp客户端列表接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list() { + Map params = requestParams(); + return clientService.list(params); + } + + @ApiOperation(value = "rtmp客户端分页列表", notes = "rtmp客户端分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage") + public SuccessResultList> listPage(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return clientService.listPage(page); + } + + @ApiOperation(value = "rtmp客户端统计", notes = "rtmp客户端统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(clientService.count(params)); + } + +} \ No newline at end of file diff --git a/module-file-media/src/main/java/ink/wgink/module/file/media/controller/app/api/rtmp/RtmpClientAppController.java b/module-file-media/src/main/java/ink/wgink/module/file/media/controller/app/api/rtmp/RtmpClientAppController.java new file mode 100644 index 00000000..f364122b --- /dev/null +++ b/module-file-media/src/main/java/ink/wgink/module/file/media/controller/app/api/rtmp/RtmpClientAppController.java @@ -0,0 +1,80 @@ +package ink.wgink.module.file.media.controller.app.api.rtmp; + +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.module.file.media.pojo.dtos.rtmp.RtmpClientDTO; +import ink.wgink.module.file.media.service.rtmp.IRtmpClientService; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.pojo.result.SuccessResultList; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: ClientAppController + * @Description: rtmp客户端 + * @Author: CodeFactory + * @Date: 2022-04-26 22:03:44 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "rtmp客户端接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/rtmp-client") +public class RtmpClientAppController extends DefaultBaseController { + + @Autowired + private IRtmpClientService clientService; + + @ApiOperation(value = "rtmp客户端详情(通过ID)", notes = "rtmp客户端详情(通过ID)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "clientId", value = "rtmp客户端ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{clientId}") + public RtmpClientDTO get(@RequestHeader("token") String token, @PathVariable("clientId") String clientId) { + return clientService.get(clientId); + } + + @ApiOperation(value = "rtmp客户端列表", notes = "rtmp客户端列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list(@RequestHeader("token") String token) { + Map params = requestParams(); + return clientService.list(params); + } + + @ApiOperation(value = "rtmp客户端分页列表", notes = "rtmp客户端分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage") + public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page) { + Map params = requestParams(); + page.setParams(params); + return clientService.listPage(page); + } + + @ApiOperation(value = "rtmp客户端统计", notes = "rtmp客户端统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(clientService.count(params)); + } + +} \ No newline at end of file diff --git a/module-file-media/src/main/java/ink/wgink/module/file/media/controller/resource/client/RtmpClientResourceController.java b/module-file-media/src/main/java/ink/wgink/module/file/media/controller/resource/client/RtmpClientResourceController.java new file mode 100644 index 00000000..78b536b2 --- /dev/null +++ b/module-file-media/src/main/java/ink/wgink/module/file/media/controller/resource/client/RtmpClientResourceController.java @@ -0,0 +1,83 @@ +package ink.wgink.module.file.media.controller.resource.client; + +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.module.file.media.pojo.dtos.rtmp.RtmpClientDTO; +import ink.wgink.module.file.media.service.rtmp.IRtmpClientService; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.pojo.result.SuccessResultList; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: ClientResourceController + * @Description: rtmp客户端 + * @Author: CodeFactory + * @Date: 2022-04-26 22:03:44 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "rtmp客户端接口") +@RestController +@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/client") +public class RtmpClientResourceController extends DefaultBaseController { + + @Autowired + private IRtmpClientService clientService; + + @ApiOperation(value = "rtmp客户端详情", notes = "rtmp客户端详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "clientId", value = "rtmp客户端ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{clientId}") + public RtmpClientDTO get(@PathVariable("clientId") String clientId) { + return clientService.get(clientId); + } + + @ApiOperation(value = "rtmp客户端列表", notes = "rtmp客户端列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list() { + Map params = requestParams(); + return clientService.list(params); + } + + @ApiOperation(value = "rtmp客户端分页列表", notes = "rtmp客户端分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage") + public SuccessResultList> listPage(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return clientService.listPage(page); + } + + @ApiOperation(value = "rtmp客户端统计", notes = "rtmp客户端统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(clientService.count(params)); + } + +} \ No newline at end of file diff --git a/module-file-media/src/main/java/ink/wgink/module/file/media/controller/route/rtmp/RtmpClientRouteController.java b/module-file-media/src/main/java/ink/wgink/module/file/media/controller/route/rtmp/RtmpClientRouteController.java new file mode 100644 index 00000000..840c0a81 --- /dev/null +++ b/module-file-media/src/main/java/ink/wgink/module/file/media/controller/route/rtmp/RtmpClientRouteController.java @@ -0,0 +1,36 @@ +package ink.wgink.module.file.media.controller.route.rtmp; + +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import io.swagger.annotations.*; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +/** + * @ClassName: ClientController + * @Description: rtmp客户端 + * @Author: CodeFactory + * @Date: 2022-04-26 22:03:44 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "rtmp客户端路由") +@RestController +@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/rtmp-client") +public class RtmpClientRouteController extends DefaultBaseController { + + @GetMapping("save") + public ModelAndView save() { + return new ModelAndView("rtmp/client/save"); + } + + @GetMapping("update") + public ModelAndView update() { + return new ModelAndView("rtmp/client/update"); + } + + @GetMapping("list") + public ModelAndView list() { + return new ModelAndView("rtmp/client/list"); + } + +} \ No newline at end of file diff --git a/module-file-media/src/main/java/ink/wgink/module/file/media/dao/rtmp/IRtmpClientDao.java b/module-file-media/src/main/java/ink/wgink/module/file/media/dao/rtmp/IRtmpClientDao.java new file mode 100644 index 00000000..11532a72 --- /dev/null +++ b/module-file-media/src/main/java/ink/wgink/module/file/media/dao/rtmp/IRtmpClientDao.java @@ -0,0 +1,130 @@ +package ink.wgink.module.file.media.dao.rtmp; + +import ink.wgink.exceptions.RemoveException; +import ink.wgink.exceptions.SaveException; +import ink.wgink.exceptions.SearchException; +import ink.wgink.exceptions.UpdateException; +import ink.wgink.interfaces.init.IInitBaseTable; +import ink.wgink.module.file.media.pojo.bos.rtmp.RtmpClientBO; +import ink.wgink.module.file.media.pojo.pos.rtmp.RtmpClientPO; +import ink.wgink.module.file.media.pojo.dtos.rtmp.RtmpClientDTO; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IClientDao + * @Description: rtmp客户端 + * @Author: CodeFactory + * @Date: 2022-04-26 22:03:44 + * @Version: 3.0 + **/ +@Repository +public interface IRtmpClientDao extends IInitBaseTable { + + /** + * 新增rtmp客户端 + * + * @param params + * @throws SaveException + */ + void save(Map params) throws SaveException; + + /** + * 删除rtmp客户端 + * + * @param params + * @throws RemoveException + */ + void remove(Map params) throws RemoveException; + + /** + * 删除rtmp客户端(物理) + * + * @param params + * @throws RemoveException + */ + void delete(Map params) throws RemoveException; + + /** + * 修改rtmp客户端 + * + * @param params + * @throws UpdateException + */ + void update(Map params) throws UpdateException; + + /** + * rtmp客户端详情 + * + * @param params + * @return + * @throws SearchException + */ + RtmpClientDTO get(Map params) throws SearchException; + + /** + * rtmp客户端详情 + * + * @param params + * @return + * @throws SearchException + */ + RtmpClientBO getBO(Map params) throws SearchException; + + /** + * rtmp客户端详情 + * + * @param params + * @return + * @throws SearchException + */ + RtmpClientPO getPO(Map params) throws SearchException; + + /** + * rtmp客户端列表 + * + * @param params + * @return + * @throws SearchException + */ + List list(Map params) throws SearchException; + + /** + * rtmp客户端列表 + * + * @param params + * @return + * @throws SearchException + */ + List listBO(Map params) throws SearchException; + + /** + * rtmp客户端列表 + * + * @param params + * @return + * @throws SearchException + */ + List listPO(Map params) throws SearchException; + + /** + * rtmp客户端统计 + * + * @param params + * @return + * @throws SearchException + */ + Integer count(Map params) throws SearchException; + + /** + * 最新的客户端编码 + * + * @param datetime + * @return + * @throws SearchException + */ + String latestClientCode(String datetime) throws SearchException; + +} \ No newline at end of file diff --git a/module-file-media/src/main/java/ink/wgink/module/file/media/pojo/bos/rtmp/RtmpClientBO.java b/module-file-media/src/main/java/ink/wgink/module/file/media/pojo/bos/rtmp/RtmpClientBO.java new file mode 100644 index 00000000..297b3926 --- /dev/null +++ b/module-file-media/src/main/java/ink/wgink/module/file/media/pojo/bos/rtmp/RtmpClientBO.java @@ -0,0 +1,141 @@ +package ink.wgink.module.file.media.pojo.bos.rtmp; + +/** + * + * @ClassName: ClientBO + * @Description: rtmp客户端 + * @Author: CodeFactory + * @Date: 2022-04-26 22:03:44 + * @Version: 3.0 + **/ +public class RtmpClientBO { + + private String clientId; + private String clientCode; + private String clientName; + private String clientSummary; + private String clientKey; + private String clientSecret; + private String clientStatus; + private String clientUrl; + private String expireTime; + private String creator; + private String gmtCreate; + private String modifier; + private String gmtModified; + private Integer isDelete; + + public String getClientId() { + return clientId == null ? "" : clientId.trim(); + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getClientCode() { + return clientCode; + } + + public void setClientCode(String clientCode) { + this.clientCode = clientCode; + } + + public String getClientName() { + return clientName == null ? "" : clientName.trim(); + } + + public void setClientName(String clientName) { + this.clientName = clientName; + } + + public String getClientSummary() { + return clientSummary == null ? "" : clientSummary.trim(); + } + + public void setClientSummary(String clientSummary) { + this.clientSummary = clientSummary; + } + + public String getClientKey() { + return clientKey == null ? "" : clientKey.trim(); + } + + public void setClientKey(String clientKey) { + this.clientKey = clientKey; + } + + public String getClientSecret() { + return clientSecret == null ? "" : clientSecret.trim(); + } + + public void setClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + } + + public String getClientStatus() { + return clientStatus == null ? "" : clientStatus.trim(); + } + + public void setClientStatus(String clientStatus) { + this.clientStatus = clientStatus; + } + + public String getClientUrl() { + return clientUrl == null ? "" : clientUrl.trim(); + } + + public void setClientUrl(String clientUrl) { + this.clientUrl = clientUrl; + } + + public String getExpireTime() { + return expireTime == null ? "" : expireTime.trim(); + } + + public void setExpireTime(String expireTime) { + this.expireTime = expireTime; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/module-file-media/src/main/java/ink/wgink/module/file/media/pojo/dtos/rtmp/RtmpClientDTO.java b/module-file-media/src/main/java/ink/wgink/module/file/media/pojo/dtos/rtmp/RtmpClientDTO.java new file mode 100644 index 00000000..673af43b --- /dev/null +++ b/module-file-media/src/main/java/ink/wgink/module/file/media/pojo/dtos/rtmp/RtmpClientDTO.java @@ -0,0 +1,199 @@ +package ink.wgink.module.file.media.pojo.dtos.rtmp; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: ClientDTO + * @Description: rtmp客户端 + * @Author: CodeFactory + * @Date: 2022-04-26 22:03:44 + * @Version: 3.0 + **/ +@ApiModel +public class RtmpClientDTO { + + @ApiModelProperty(name = "clientId", value = "主键") + private String clientId; + @ApiModelProperty(name = "clientCode", value = "客户端编码") + private String clientCode; + @ApiModelProperty(name = "clientName", value = "客户端名称") + private String clientName; + @ApiModelProperty(name = "clientSummary", value = "客户端描述") + private String clientSummary; + @ApiModelProperty(name = "clientKey", value = "客户端用户名") + private String clientKey; + @ApiModelProperty(name = "clientSecret", value = "客户端密码") + private String clientSecret; + @ApiModelProperty(name = "clientStatus", value = "设备状态") + private String clientStatus; + @ApiModelProperty(name = "clientUrl", value = "客户端地址") + private String clientUrl; + @ApiModelProperty(name = "expireTime", value = "过期时间") + private String expireTime; + @ApiModelProperty(name = "areaCode", value = "地区编码") + private String areaCode; + @ApiModelProperty(name = "areaName", value = "地区名称") + private String areaName; + @ApiModelProperty(name = "positionLng", value = "位置经度") + private String positionLng; + @ApiModelProperty(name = "positionLat", value = "位置纬度") + private String positionLat; + @ApiModelProperty(name = "positionAddress", value = "位置地址") + private String positionAddress; + @ApiModelProperty(name = "creator", value = "创建人") + private String creator; + @ApiModelProperty(name = "gmtCreate", value = "创建时间") + private String gmtCreate; + @ApiModelProperty(name = "modifier", value = "修改人") + private String modifier; + @ApiModelProperty(name = "gmtModified", value = "修改时间") + private String gmtModified; + + public String getClientId() { + return clientId == null ? "" : clientId.trim(); + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getClientCode() { + return clientCode; + } + + public void setClientCode(String clientCode) { + this.clientCode = clientCode; + } + + public String getClientName() { + return clientName == null ? "" : clientName.trim(); + } + + public void setClientName(String clientName) { + this.clientName = clientName; + } + + public String getClientSummary() { + return clientSummary == null ? "" : clientSummary.trim(); + } + + public void setClientSummary(String clientSummary) { + this.clientSummary = clientSummary; + } + + public String getClientKey() { + return clientKey == null ? "" : clientKey.trim(); + } + + public void setClientKey(String clientKey) { + this.clientKey = clientKey; + } + + public String getClientSecret() { + return clientSecret == null ? "" : clientSecret.trim(); + } + + public void setClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + } + + public String getClientStatus() { + return clientStatus == null ? "" : clientStatus.trim(); + } + + public void setClientStatus(String clientStatus) { + this.clientStatus = clientStatus; + } + + public String getClientUrl() { + return clientUrl == null ? "" : clientUrl.trim(); + } + + public void setClientUrl(String clientUrl) { + this.clientUrl = clientUrl; + } + + public String getExpireTime() { + return expireTime == null ? "" : expireTime.trim(); + } + + public void setExpireTime(String expireTime) { + this.expireTime = expireTime; + } + + public String getAreaCode() { + return areaCode; + } + + public void setAreaCode(String areaCode) { + this.areaCode = areaCode; + } + + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public String getPositionLng() { + return positionLng; + } + + public void setPositionLng(String positionLng) { + this.positionLng = positionLng; + } + + public String getPositionLat() { + return positionLat; + } + + public void setPositionLat(String positionLat) { + this.positionLat = positionLat; + } + + public String getPositionAddress() { + return positionAddress; + } + + public void setPositionAddress(String positionAddress) { + this.positionAddress = positionAddress; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + +} diff --git a/module-file-media/src/main/java/ink/wgink/module/file/media/pojo/pos/rtmp/RtmpClientPO.java b/module-file-media/src/main/java/ink/wgink/module/file/media/pojo/pos/rtmp/RtmpClientPO.java new file mode 100644 index 00000000..1f1e6a09 --- /dev/null +++ b/module-file-media/src/main/java/ink/wgink/module/file/media/pojo/pos/rtmp/RtmpClientPO.java @@ -0,0 +1,186 @@ +package ink.wgink.module.file.media.pojo.pos.rtmp; + +/** + * + * @ClassName: ClientPO + * @Description: rtmp客户端 + * @Author: CodeFactory + * @Date: 2022-04-26 22:03:44 + * @Version: 3.0 + **/ +public class RtmpClientPO { + + private String clientId; + private String clientCode; + private String clientName; + private String clientSummary; + private String clientKey; + private String clientSecret; + private String clientStatus; + private String clientUrl; + private String expireTime; + private String areaCode; + private String areaName; + private String positionLng; + private String positionLat; + private String positionAddress; + private String creator; + private String gmtCreate; + private String modifier; + private String gmtModified; + private Integer isDelete; + + public String getClientId() { + return clientId == null ? "" : clientId.trim(); + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getClientCode() { + return clientCode; + } + + public void setClientCode(String clientCode) { + this.clientCode = clientCode; + } + + public String getClientName() { + return clientName == null ? "" : clientName.trim(); + } + + public void setClientName(String clientName) { + this.clientName = clientName; + } + + public String getClientSummary() { + return clientSummary == null ? "" : clientSummary.trim(); + } + + public void setClientSummary(String clientSummary) { + this.clientSummary = clientSummary; + } + + public String getClientKey() { + return clientKey == null ? "" : clientKey.trim(); + } + + public void setClientKey(String clientKey) { + this.clientKey = clientKey; + } + + public String getClientSecret() { + return clientSecret == null ? "" : clientSecret.trim(); + } + + public void setClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + } + + public String getClientStatus() { + return clientStatus == null ? "" : clientStatus.trim(); + } + + public void setClientStatus(String clientStatus) { + this.clientStatus = clientStatus; + } + + public String getClientUrl() { + return clientUrl == null ? "" : clientUrl.trim(); + } + + public void setClientUrl(String clientUrl) { + this.clientUrl = clientUrl; + } + + public String getExpireTime() { + return expireTime == null ? "" : expireTime.trim(); + } + + public void setExpireTime(String expireTime) { + this.expireTime = expireTime; + } + + public String getAreaCode() { + return areaCode; + } + + public void setAreaCode(String areaCode) { + this.areaCode = areaCode; + } + + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public String getPositionLng() { + return positionLng; + } + + public void setPositionLng(String positionLng) { + this.positionLng = positionLng; + } + + public String getPositionLat() { + return positionLat; + } + + public void setPositionLat(String positionLat) { + this.positionLat = positionLat; + } + + public String getPositionAddress() { + return positionAddress; + } + + public void setPositionAddress(String positionAddress) { + this.positionAddress = positionAddress; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/module-file-media/src/main/java/ink/wgink/module/file/media/pojo/vos/rtmp/RtmpClientVO.java b/module-file-media/src/main/java/ink/wgink/module/file/media/pojo/vos/rtmp/RtmpClientVO.java new file mode 100644 index 00000000..2e2d41ce --- /dev/null +++ b/module-file-media/src/main/java/ink/wgink/module/file/media/pojo/vos/rtmp/RtmpClientVO.java @@ -0,0 +1,105 @@ +package ink.wgink.module.file.media.pojo.vos.rtmp; + +import ink.wgink.annotation.CheckEmptyAnnotation; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @ClassName: ClientVO + * @Description: rtmp客户端 + * @Author: CodeFactory + * @Date: 2022-04-26 22:03:44 + * @Version: 3.0 + **/ +@ApiModel +public class RtmpClientVO { + + @ApiModelProperty(name = "clientName", value = "客户端名称") + @CheckEmptyAnnotation(name = "客户端名称") + private String clientName; + @ApiModelProperty(name = "clientSummary", value = "客户端描述") + private String clientSummary; + @ApiModelProperty(name = "clientKey", value = "客户端用户名") + @CheckEmptyAnnotation(name = "客户端用户名", verifyType = "letterOrNumber") + private String clientKey; + @ApiModelProperty(name = "clientSecret", value = "客户端密码") + @CheckEmptyAnnotation(name = "客户端密码") + private String clientSecret; + @ApiModelProperty(name = "clientStatus", value = "设备状态") + @CheckEmptyAnnotation(name = "设备状态") + private String clientStatus; + @ApiModelProperty(name = "clientUrl", value = "客户端地址") + @CheckEmptyAnnotation(name = "客户端地址") + private String clientUrl; + @ApiModelProperty(name = "expireTime", value = "过期时间") + @CheckEmptyAnnotation(name = "过期时间") + private String expireTime; + @ApiModelProperty(name = "areaCode", value = "地区编码") + private String areaCode; + @ApiModelProperty(name = "areaName", value = "地区名称") + private String areaName; + @ApiModelProperty(name = "positionLng", value = "位置经度") + private String positionLng; + @ApiModelProperty(name = "positionLat", value = "位置纬度") + private String positionLat; + @ApiModelProperty(name = "positionAddress", value = "位置地址") + private String positionAddress; + + public String getClientName() { + return clientName == null ? "" : clientName.trim(); + } + + public void setClientName(String clientName) { + this.clientName = clientName; + } + + public String getClientSummary() { + return clientSummary == null ? "" : clientSummary.trim(); + } + + public void setClientSummary(String clientSummary) { + this.clientSummary = clientSummary; + } + + public String getClientKey() { + return clientKey == null ? "" : clientKey.trim(); + } + + public void setClientKey(String clientKey) { + this.clientKey = clientKey; + } + + public String getClientSecret() { + return clientSecret == null ? "" : clientSecret.trim(); + } + + public void setClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + } + + public String getClientStatus() { + return clientStatus == null ? "" : clientStatus.trim(); + } + + public void setClientStatus(String clientStatus) { + this.clientStatus = clientStatus; + } + + public String getClientUrl() { + return clientUrl == null ? "" : clientUrl.trim(); + } + + public void setClientUrl(String clientUrl) { + this.clientUrl = clientUrl; + } + + public String getExpireTime() { + return expireTime == null ? "" : expireTime.trim(); + } + + public void setExpireTime(String expireTime) { + this.expireTime = expireTime; + } + + +} diff --git a/module-file-media/src/main/java/ink/wgink/module/file/media/service/rtmp/IRtmpClientService.java b/module-file-media/src/main/java/ink/wgink/module/file/media/service/rtmp/IRtmpClientService.java new file mode 100644 index 00000000..0b74ee80 --- /dev/null +++ b/module-file-media/src/main/java/ink/wgink/module/file/media/service/rtmp/IRtmpClientService.java @@ -0,0 +1,188 @@ +package ink.wgink.module.file.media.service.rtmp; + +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.SuccessResultList; +import ink.wgink.module.file.media.pojo.dtos.rtmp.RtmpClientDTO; +import ink.wgink.module.file.media.pojo.vos.rtmp.RtmpClientVO; +import ink.wgink.module.file.media.pojo.bos.rtmp.RtmpClientBO; +import ink.wgink.module.file.media.pojo.pos.rtmp.RtmpClientPO; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IClientService + * @Description: rtmp客户端 + * @Author: CodeFactory + * @Date: 2022-04-26 22:03:44 + * @Version: 3.0 + **/ +public interface IRtmpClientService { + + /** + * 新增rtmp客户端 + * + * @param rtmpClientVO + * @return + */ + void save(RtmpClientVO rtmpClientVO); + + /** + * 新增rtmp客户端 + * + * @param token + * @param rtmpClientVO + * @return + */ + void save(String token, RtmpClientVO rtmpClientVO); + + /** + * 新增rtmp客户端 + * + * @param rtmpClientVO + * @return clientId + */ + String saveReturnId(RtmpClientVO rtmpClientVO); + + /** + * 新增rtmp客户端 + * + * @param token + * @param rtmpClientVO + * @return clientId + */ + String saveReturnId(String token, RtmpClientVO rtmpClientVO); + + /** + * 删除rtmp客户端 + * + * @param ids id列表 + * @return + */ + void remove(List ids); + + + /** + * 删除rtmp客户端 + * + * @param token + * @param ids id列表 + * @return + */ + void remove(String token, List ids); + + /** + * 删除rtmp客户端(物理删除) + * + * @param ids id列表 + */ + void delete(List ids); + + /** + * 修改rtmp客户端 + * + * @param clientId + * @param rtmpClientVO + * @return + */ + void update(String clientId, RtmpClientVO rtmpClientVO); + + /** + * 修改rtmp客户端 + * + * @param token + * @param clientId + * @param rtmpClientVO + * @return + */ + void update(String token, String clientId, RtmpClientVO rtmpClientVO); + + /** + * rtmp客户端详情 + * + * @param params 参数Map + * @return + */ + RtmpClientDTO get(Map params); + + /** + * rtmp客户端详情 + * + * @param clientId + * @return + */ + RtmpClientDTO get(String clientId); + + /** + * rtmp客户端详情 + * + * @param params 参数Map + * @return + */ + RtmpClientBO getBO(Map params); + + /** + * rtmp客户端详情 + * + * @param clientId + * @return + */ + RtmpClientBO getBO(String clientId); + + /** + * rtmp客户端详情 + * + * @param params 参数Map + * @return + */ + RtmpClientPO getPO(Map params); + + /** + * rtmp客户端详情 + * + * @param clientId + * @return + */ + RtmpClientPO getPO(String clientId); + + /** + * rtmp客户端列表 + * + * @param params + * @return + */ + List list(Map params); + + /** + * rtmp客户端列表 + * + * @param params + * @return + */ + List listBO(Map params); + + /** + * rtmp客户端列表 + * + * @param params + * @return + */ + List listPO(Map params); + + /** + * rtmp客户端分页列表 + * + * @param page + * @return + */ + SuccessResultList> listPage(ListPage page); + + /** + * rtmp客户端统计 + * + * @param params + * @return + */ + Integer count(Map params); + +} \ No newline at end of file diff --git a/module-file-media/src/main/java/ink/wgink/module/file/media/service/rtmp/impl/RtmpClientServiceImpl.java b/module-file-media/src/main/java/ink/wgink/module/file/media/service/rtmp/impl/RtmpClientServiceImpl.java new file mode 100644 index 00000000..635021d5 --- /dev/null +++ b/module-file-media/src/main/java/ink/wgink/module/file/media/service/rtmp/impl/RtmpClientServiceImpl.java @@ -0,0 +1,187 @@ +package ink.wgink.module.file.media.service.rtmp.impl; + +import ink.wgink.common.base.DefaultBaseService; +import ink.wgink.module.file.media.dao.rtmp.IRtmpClientDao; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.SuccessResultList; +import ink.wgink.util.date.DateUtil; +import ink.wgink.util.map.HashMapUtil; +import ink.wgink.util.UUIDUtil; +import ink.wgink.module.file.media.pojo.dtos.rtmp.RtmpClientDTO; +import ink.wgink.module.file.media.pojo.vos.rtmp.RtmpClientVO; +import ink.wgink.module.file.media.pojo.bos.rtmp.RtmpClientBO; +import ink.wgink.module.file.media.pojo.pos.rtmp.RtmpClientPO; +import ink.wgink.module.file.media.service.rtmp.IRtmpClientService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * @ClassName: ClientServiceImpl + * @Description: rtmp客户端 + * @Author: CodeFactory + * @Date: 2022-04-26 22:03:44 + * @Version: 3.0 + **/ +@Service +public class RtmpClientServiceImpl extends DefaultBaseService implements IRtmpClientService { + + @Autowired + private IRtmpClientDao clientDao; + + @Override + public void save(RtmpClientVO rtmpClientVO) { + saveReturnId(rtmpClientVO); + } + + @Override + public void save(String token, RtmpClientVO rtmpClientVO) { + saveReturnId(token, rtmpClientVO); + } + + @Override + public String saveReturnId(RtmpClientVO rtmpClientVO) { + return saveReturnId(null, rtmpClientVO); + } + + @Override + public String saveReturnId(String token, RtmpClientVO rtmpClientVO) { + String clientId = UUIDUtil.getUUID(); + Map params = HashMapUtil.beanToMap(rtmpClientVO); + params.put("clientId", clientId); + params.put("clientCode", getLatestClientCode()); + if (StringUtils.isBlank(token)) { + setSaveInfo(params); + } else { + setAppSaveInfo(token, params); + } + clientDao.save(params); + return clientId; + } + + @Override + public void remove(List ids) { + remove(null, ids); + } + + @Override + public void remove(String token, List ids) { + Map params = getHashMap(2); + params.put("clientIds", ids); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setAppUpdateInfo(token, params); + } + clientDao.remove(params); + } + + @Override + public void delete(List ids) { + Map params = getHashMap(2); + params.put("clientIds", ids); + clientDao.delete(params); + } + + @Override + public void update(String clientId, RtmpClientVO rtmpClientVO) { + update(null, clientId, rtmpClientVO); + } + + @Override + public void update(String token, String clientId, RtmpClientVO rtmpClientVO) { + Map params = HashMapUtil.beanToMap(rtmpClientVO); + params.put("clientId", clientId); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setAppUpdateInfo(token, params); + } + clientDao.update(params); + } + + @Override + public RtmpClientDTO get(Map params) { + return clientDao.get(params); + } + + @Override + public RtmpClientDTO get(String clientId) { + Map params = super.getHashMap(2); + params.put("clientId", clientId); + return get(params); + } + + @Override + public RtmpClientBO getBO(Map params) { + return clientDao.getBO(params); + } + + @Override + public RtmpClientBO getBO(String clientId) { + Map params = super.getHashMap(2); + params.put("clientId", clientId); + return getBO(params); + } + + @Override + public RtmpClientPO getPO(Map params) { + return clientDao.getPO(params); + } + + @Override + public RtmpClientPO getPO(String clientId) { + Map params = super.getHashMap(2); + params.put("clientId", clientId); + return getPO(params); + } + + @Override + public List list(Map params) { + return clientDao.list(params); + } + + @Override + public List listBO(Map params) { + return clientDao.listBO(params); + } + + @Override + public List listPO(Map params) { + return clientDao.listPO(params); + } + + @Override + public SuccessResultList> listPage(ListPage page) { + PageHelper.startPage(page.getPage(), page.getRows()); + List rtmpClientDTOS = list(page.getParams()); + PageInfo pageInfo = new PageInfo<>(rtmpClientDTOS); + return new SuccessResultList<>(rtmpClientDTOS, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Integer count(Map params) { + Integer count = clientDao.count(params); + return count == null ? 0 : count; + } + + /** + * 获取最新的客户端编码 + * + * @return + */ + private String getLatestClientCode() { + String datetime = DateUtil.getDays(); + String latestClientCode = clientDao.latestClientCode(datetime); + int todayLatestIndex = 0; + if (!StringUtils.isBlank(latestClientCode)) { + todayLatestIndex = Integer.parseInt(latestClientCode.replace(datetime, "")); + } + return String.format("%s%06d", datetime, todayLatestIndex + 1); + } + +} \ No newline at end of file diff --git a/module-file-media/src/main/resources/templates/rtmp/client/list.html b/module-file-media/src/main/resources/templates/rtmp/client/list.html new file mode 100644 index 00000000..47147dcb --- /dev/null +++ b/module-file-media/src/main/resources/templates/rtmp/client/list.html @@ -0,0 +1,335 @@ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+ 新增时间 +
+ +
+
+ +
+ +
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/module-file-media/src/main/resources/templates/rtmp/client/save.html b/module-file-media/src/main/resources/templates/rtmp/client/save.html new file mode 100644 index 00000000..b9a9d82a --- /dev/null +++ b/module-file-media/src/main/resources/templates/rtmp/client/save.html @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/module-file-media/src/main/resources/templates/rtmp/client/update.html b/module-file-media/src/main/resources/templates/rtmp/client/update.html new file mode 100644 index 00000000..7f894953 --- /dev/null +++ b/module-file-media/src/main/resources/templates/rtmp/client/update.html @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ + + + \ No newline at end of file