ty
8 months ago
8 changed files with 221 additions and 4 deletions
@ -0,0 +1,53 @@ |
|||||||
|
package com.hnac.hzims.operational.video.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||||
|
import com.hnac.hzims.common.invalid.Create; |
||||||
|
import com.hnac.hzims.common.invalid.Update; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.hibernate.validator.constraints.Length; |
||||||
|
import org.springblade.core.tenant.mp.TenantEntity; |
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank; |
||||||
|
import javax.validation.constraints.NotNull; |
||||||
|
import javax.validation.constraints.Size; |
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
@EqualsAndHashCode |
||||||
|
@Data |
||||||
|
@TableName("HZIMS_VIDEO_PLATFORM") |
||||||
|
@ApiModel(value = "视频平台实体类",description = "视频平台实体类") |
||||||
|
public class VideoPlatformEntity extends TenantEntity implements Serializable { |
||||||
|
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class) |
||||||
|
@ApiModelProperty(value = "主键id") |
||||||
|
@NotNull(groups = Update.class) |
||||||
|
private Long id; |
||||||
|
|
||||||
|
@ApiModelProperty("平台名称") |
||||||
|
@NotBlank |
||||||
|
@Size(min = 1,max = 50,groups = Create.class) |
||||||
|
private String name; |
||||||
|
|
||||||
|
@ApiModelProperty("代理API网关nginx服务器ip端口") |
||||||
|
@NotBlank |
||||||
|
@Size(min = 1,max = 50,groups = Create.class) |
||||||
|
private String videoHost; |
||||||
|
|
||||||
|
@ApiModelProperty("秘钥appKey") |
||||||
|
@NotBlank |
||||||
|
@Size(min = 1,max = 50,groups = Create.class) |
||||||
|
private String appKey; |
||||||
|
|
||||||
|
@ApiModelProperty("秘钥appSecret") |
||||||
|
@NotBlank |
||||||
|
@Size(min = 1,max = 100,groups = Create.class) |
||||||
|
private String appSecret; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,92 @@ |
|||||||
|
package com.hnac.hzims.operational.video.controller; |
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON; |
||||||
|
import com.alibaba.fastjson.JSONObject; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.hnac.hzims.common.invalid.Create; |
||||||
|
import com.hnac.hzims.common.invalid.Update; |
||||||
|
import com.hnac.hzims.common.logs.utils.StringUtils; |
||||||
|
import com.hnac.hzims.common.support.constants.Order; |
||||||
|
import com.hnac.hzims.common.support.utils.Condition; |
||||||
|
import com.hnac.hzims.operational.OperationalConstants; |
||||||
|
import com.hnac.hzims.operational.video.entity.VideoPlatformEntity; |
||||||
|
import com.hnac.hzims.operational.video.service.IVideoPlatformService; |
||||||
|
import com.hnac.hzinfo.log.annotation.Business; |
||||||
|
import com.hnac.hzinfo.log.annotation.Operate; |
||||||
|
import com.hnac.hzinfo.log.contants.BusinessType; |
||||||
|
import com.hnac.hzinfo.log.contants.Risk; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import io.swagger.annotations.ApiOperationSupport; |
||||||
|
import io.swagger.annotations.ApiParam; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import okhttp3.MediaType; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.log.exception.ServiceException; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.DateUtil; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springframework.validation.annotation.Validated; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets; |
||||||
|
import java.time.ZonedDateTime; |
||||||
|
import java.time.format.DateTimeFormatter; |
||||||
|
import java.util.*; |
||||||
|
|
||||||
|
@RestController |
||||||
|
@Api(value = "视频平台管理",tags = "视频平台管理") |
||||||
|
@RequestMapping("/video/platform") |
||||||
|
@AllArgsConstructor |
||||||
|
@Business(module = OperationalConstants.APP_NAME,value = "视频平台管理",ignore = false) |
||||||
|
public class VideoPlatformController extends BladeController { |
||||||
|
|
||||||
|
private final IVideoPlatformService videoPlatformService; |
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperation("新增海康视频平台") |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@Operate(label = "新增海康视频平台",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false) |
||||||
|
public R save(@Validated(Create.class) @RequestBody VideoPlatformEntity req) { |
||||||
|
return R.status(videoPlatformService.save(req)); |
||||||
|
} |
||||||
|
|
||||||
|
@PostMapping("/update") |
||||||
|
@ApiOperation("编辑海康视频平台") |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@Operate(label = "编辑海康视频平台",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false) |
||||||
|
public R update(@Validated(Update.class) @RequestBody VideoPlatformEntity req) { |
||||||
|
return R.status(videoPlatformService.updateById(req)); |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping("/detail") |
||||||
|
@ApiOperation("查看视频平台详情") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
@Operate(label = "查看视频平台详情",type = BusinessType.QUERY,ignore = false) |
||||||
|
public R<VideoPlatformEntity> detail(@RequestParam @ApiParam("主键ID") Long id) { |
||||||
|
return R.data(videoPlatformService.getById(id)); |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping("/list") |
||||||
|
@ApiOperation("查询视频平台列表") |
||||||
|
@ApiOperationSupport(order = 4) |
||||||
|
@Operate(label = "查询视频平台列表",type = BusinessType.QUERY,ignore = false) |
||||||
|
public R<List<VideoPlatformEntity>> list(VideoPlatformEntity req) { |
||||||
|
HashMap<String, Order> sort = new HashMap<String, Order>() {{ |
||||||
|
put("create_time", Order.DESC); |
||||||
|
}}; |
||||||
|
LambdaQueryWrapper<VideoPlatformEntity> queryWrapper = Condition.getQueryWrapper(req, VideoPlatformEntity.class, sort); |
||||||
|
return R.data(videoPlatformService.list(queryWrapper)); |
||||||
|
} |
||||||
|
|
||||||
|
@DeleteMapping("/remove") |
||||||
|
@ApiOperation("删除视频平台记录") |
||||||
|
@ApiOperationSupport(order = 5) |
||||||
|
@Operate(label = "删除视频平台记录",type = BusinessType.DELETE,risk = Risk.MEDIUM,ignore = false) |
||||||
|
public R remove(@RequestParam @ApiParam("ids,按逗号分隔") String ids) { |
||||||
|
return R.status(videoPlatformService.removeByIds(Func.toLongList(",",ids))); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
package com.hnac.hzims.operational.video.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.hnac.hzims.operational.video.entity.VideoPlatformEntity; |
||||||
|
|
||||||
|
public interface VideoPlatformMapper extends BaseMapper<VideoPlatformEntity> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,11 @@ |
|||||||
|
package com.hnac.hzims.operational.video.service; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: huangxing |
||||||
|
* @Date: 2024/04/09 16:21 |
||||||
|
*/ |
||||||
|
public interface IVideoConfigService { |
||||||
|
|
||||||
|
// void importVideoConfig(String stationCode,);
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
package com.hnac.hzims.operational.video.service; |
||||||
|
|
||||||
|
import com.hnac.hzims.operational.video.entity.VideoPlatformEntity; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
|
||||||
|
public interface IVideoPlatformService extends BaseService<VideoPlatformEntity> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
package com.hnac.hzims.operational.video.service.impl; |
||||||
|
|
||||||
|
import com.hnac.hzims.operational.station.service.IStationVideoTypeService; |
||||||
|
import com.hnac.hzims.operational.video.service.IVideoConfigService; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: huangxing |
||||||
|
* @Date: 2024/04/09 16:21 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
@AllArgsConstructor |
||||||
|
public class VideoConfigServiceImpl implements IVideoConfigService { |
||||||
|
|
||||||
|
private final IStationVideoTypeService videoService; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,12 @@ |
|||||||
|
package com.hnac.hzims.operational.video.service.impl; |
||||||
|
|
||||||
|
import com.hnac.hzims.operational.video.entity.VideoPlatformEntity; |
||||||
|
import com.hnac.hzims.operational.video.mapper.VideoPlatformMapper; |
||||||
|
import com.hnac.hzims.operational.video.service.IVideoPlatformService; |
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
@Service |
||||||
|
public class VideoPlatformServiceImpl extends BaseServiceImpl<VideoPlatformMapper, VideoPlatformEntity> implements IVideoPlatformService { |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue