| @@ -12,10 +12,10 @@ | |||
| <modules> | |||
| <module>yqzj-mybatis</module> | |||
| <module>yqzjVideo</module> | |||
| <module>yqzjService</module> | |||
| <module>yqzjAdmin</module> | |||
| <module>yqzjCApi</module> | |||
| <module>yqzjSchedule</module> | |||
| <module>yqzj-swagger</module> | |||
| </modules> | |||
| @@ -23,6 +23,11 @@ | |||
| <artifactId>yqzjService</artifactId> | |||
| <version>1.0</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.iformall</groupId> | |||
| <artifactId>yqzjVideo</artifactId> | |||
| <version>1.0</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>commons-fileupload</groupId> | |||
| <artifactId>commons-fileupload</artifactId> | |||
| @@ -0,0 +1,165 @@ | |||
| package com.iformall.controller.basic; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillProperty; | |||
| import com.iformall.domain.po.WxMallBuilding; | |||
| import com.iformall.domain.po.WxMallFloor; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.base.BaseEntity.SortField; | |||
| import com.iformall.enums.EnumContractOperationType; | |||
| import com.iformall.enums.EnumContractType; | |||
| import com.iformall.enums.EnumFlowContractType; | |||
| import com.iformall.enums.EnumFlowKey; | |||
| import com.iformall.enums.EnumIsPreview; | |||
| import com.iformall.enums.EnumRentContractAppStatus; | |||
| import com.iformall.enums.EnumRentContractStatus; | |||
| import com.iformall.enums.EnumRentShopType; | |||
| import com.iformall.enums.EnumRentStartType; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxPropertyContractMapper; | |||
| import com.iformall.service.WxBillPropertyService; | |||
| import com.iformall.service.WxMallBuildingService; | |||
| import com.iformall.service.WxMallFloorService; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import com.iformall.service.WxRentPropertyContractService; | |||
| import com.iformall.service.WxShopService; | |||
| import com.iformall.video.VideoFactory; | |||
| import com.iformall.video.entity.VideUploadResult; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @RestController | |||
| @RequestMapping("video") | |||
| public class VideoController extends BaseController { | |||
| private Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| VideoFactory videoFactory; | |||
| @Autowired | |||
| String videoType; | |||
| /** | |||
| * 上传视频 | |||
| * | |||
| * @param multiReq | |||
| * @return | |||
| * @throws Exception | |||
| */ | |||
| @PostMapping(value = "/upload", consumes = "multipart/*", headers = "content-type=multipart/form-data") | |||
| @ApiOperation("上传视频") | |||
| public ResultData upload(@RequestParam("file") MultipartFile multiReq,@RequestParam Map<String, String> param) { | |||
| try { | |||
| long size = multiReq.getSize(); | |||
| String title = param.get("title"); | |||
| int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | |||
| String fileFormat = ""; | |||
| if (dot >= 0) { | |||
| fileFormat = multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | |||
| if(StringUtils.isBlank(title)){ | |||
| title = multiReq.getOriginalFilename().substring(0,dot); | |||
| } | |||
| } | |||
| if(!fileFormat.endsWith("mp4") && !fileFormat.endsWith("mp3")){ | |||
| return new ResultData(ErrorCode.PICTURE_ENDWIDTH_ERROR); | |||
| } | |||
| VideUploadResult result = videoFactory.getExcutor(videoType).uploadVideoStream(title, multiReq.getInputStream(),fileFormat); | |||
| result.setSize(size); | |||
| return new ResultData(result); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR); | |||
| } | |||
| } | |||
| /** | |||
| * 上传视频 | |||
| * | |||
| * @param | |||
| * @return | |||
| * @throws Exception | |||
| */ | |||
| @GetMapping(value = "/uploadProgress") | |||
| @ApiOperation("上传视频进度") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "videoId", value = "视频编号", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData uploadProgress(String videoId) { | |||
| try { | |||
| String result = videoFactory.getExcutor(videoType).getVedioUploadProgress(videoId); | |||
| return new ResultData(result); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR); | |||
| } | |||
| } | |||
| /** | |||
| * 上传视频 | |||
| * | |||
| * @param | |||
| * @return | |||
| * @throws Exception | |||
| */ | |||
| @GetMapping(value = "/videoContentLength") | |||
| @ApiOperation("上传视频进度") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "videoId", value = "视频编号", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData videoContentLength(String videoId) { | |||
| try { | |||
| String result = videoFactory.getExcutor(videoType).getVedioContentLength(videoId); | |||
| return new ResultData(result); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR); | |||
| } | |||
| } | |||
| @GetMapping(value = "/videoDetial") | |||
| @ApiOperation("视频详情") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "videoId", value = "视频编号", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData videoDetial(String videoId) { | |||
| try { | |||
| VideUploadResult videoDetail = videoFactory.getExcutor(videoType).getVideoDetailWithCache(videoId,true); | |||
| return new ResultData(videoDetail); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR); | |||
| } | |||
| } | |||
| } | |||
| @@ -18,7 +18,6 @@ import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.service.*; | |||
| import com.iformall.shiro.UserSession; | |||
| import com.iformall.shiro.UseriFormallToken; | |||
| import com.iformall.sm.AiVideoHelper; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.RedisCacheUtils; | |||
| import com.iformall.utils.ShiroUtils; | |||
| @@ -131,9 +130,4 @@ public class HomeController extends MallUserInfoBaseController { | |||
| return new ResultData(version); | |||
| } | |||
| @ApiOperation("是否本地化部署") | |||
| @GetMapping("/localDeploy") | |||
| public ResultData localDeploy() { | |||
| return new ResultData(AiVideoHelper.localDeploy); | |||
| } | |||
| } | |||
| @@ -4,9 +4,9 @@ spring: | |||
| include: rabbitMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://182.92.151.30:3306/mallink_suimang_test?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true&allowMultiQueries=true | |||
| username: root | |||
| password: sm2023@ms | |||
| url: jdbc:mysql://rm-2zelxn28n1kr4093q.mysql.rds.aliyuncs.com/home?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true&allowMultiQueries=true | |||
| username: yqzjroot | |||
| password: yqzj@2023ABC | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -27,9 +27,9 @@ spring: | |||
| #date-format: yyyy-MM-dd HH:mm:ss | |||
| # REDIS | |||
| redis: | |||
| host: 101.200.130.134 | |||
| host: r-2zeb1syt5wyw757yf4.redis.rds.aliyuncs.com | |||
| port: 6379 | |||
| password: iF0rm@2l2ol9 | |||
| password: sm2023@rd | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 5 | |||
| @@ -44,26 +44,26 @@ spring: | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI5tQs4MBjzLFbiQLjsMYy | |||
| accessKeySecret: nYmnexFJxrsBu0AGVIOSbUaSaweJu7 | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| accessKeyId: ss | |||
| accessKeySecret: ss | |||
| product: ss | |||
| domain: ss.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI5tQs4MBjzLFbiQLjsMYy | |||
| keysecret: nYmnexFJxrsBu0AGVIOSbUaSaweJu7 | |||
| bucketname: suimang | |||
| filehost: admin | |||
| filedomain: https://suimang.oss-accelerate.aliyuncs.com | |||
| keyid: ss | |||
| keysecret: ss | |||
| bucketname: ss | |||
| filehost: ss | |||
| filedomain: https://ss.ss-ss.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: zhengfangyuan@iformall.com | |||
| password: 2hSeppFRaw7KZZyf # 授权密码 | |||
| username: ss@iformall.com | |||
| password: ss # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| @@ -88,16 +88,16 @@ spring: | |||
| rabbitmq: | |||
| host: 127.0.0.1 | |||
| port: 5672 | |||
| username: fumao | |||
| password: f9l98 | |||
| username: ss | |||
| password: ss | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| aliyunRocketmq: | |||
| accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" | |||
| accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| accessKeyId: "ss" | |||
| accessKeySecret: "ss" | |||
| groupId: "ss" | |||
| namesrvAddr: "http://MQ_Isssiyuncs.com:8080" | |||
| flyway: | |||
| enabled: false | |||
| @@ -107,45 +107,20 @@ aws: | |||
| access: ENC(3gx5ghDFBqGrEhO3Wf8aYmXsnwHO7Cj3HNKJGOeUj0o=) | |||
| secret: ENC(HVKIJwCJKVXLlUpGlQPwNqJOlnpxn4xYuy91SH0seTSm2uAttIQHvA49fXWWax90v5wloIk0QuU=) | |||
| #wechat: | |||
| # web: | |||
| # appId: "wxe31beafbfd8295ba" | |||
| # secret: "c689fabf3c4c9f5b6424ff2a36a26727" | |||
| # url: "https://mall.youlane.cn" | |||
| # open: | |||
| # componentAppId: "wx897e4673286c915d" | |||
| # componentSecret: "cdfdfda65c45689beb6766c4c427eed2" | |||
| # componentToken: "formall2018" | |||
| # componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| # redis: | |||
| # host: 202.165.179.86 | |||
| # port: 6379 | |||
| # password: iF0rm@2l2ol9 | |||
| # timeout: 3600 | |||
| # expire: 1800 #30分钟 | |||
| # database: 2 | |||
| # defaultExpiration: 2592000 # 默认生命周期30天 | |||
| # jedis: | |||
| # pool: | |||
| # max-active: 100 | |||
| # max-idle: 500 | |||
| # max-wait: -1 | |||
| # min-idle: 10 | |||
| wechat: | |||
| web: | |||
| appId: "wx091907dd0bfd3f6b" | |||
| secret: "2a2ca10738998b9ef92c1fe8a4d366a6" | |||
| url: "https://admintest.malls.iformall.com" | |||
| appId: "ss" | |||
| secret: "ss" | |||
| url: "https://ss.ss.ss.com" | |||
| open: | |||
| componentAppId: wxdfc8fb4e62d6b52b | |||
| componentSecret: 98daa62b316dd6feabaad708327ce233 | |||
| componentToken: formall2018 | |||
| componentAesKey: htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN | |||
| componentAppId: ss | |||
| componentSecret: ss | |||
| componentToken: ss | |||
| componentAesKey: ss | |||
| redis: | |||
| host: 101.200.130.134 | |||
| host: r-2zeb1syt5wyw757yf4.redis.rds.aliyuncs.com | |||
| port: 6379 | |||
| password: iF0rm@2l2ol9 | |||
| password: sm2023@rd | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -159,17 +134,17 @@ wechat: | |||
| alipay: | |||
| open: | |||
| appId: 2021002137663024 | |||
| appPrivateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCUfymV5J73QQMG52PVIGUbowkloYCO4B7TQoKbrTZf2YeYsg/To/o4PiXPMNwEUfEUU8NYQ6WwNhCd2fa1ei8WFXJUf3bfgswtBk1aOmHLeY9yoXFxIKMTQ9RcobnmBzKQZlaAPMTSr7t1QtKZKPuc2gEHGRFYKO/ZuL8gIpnsVidVtmi52yd7hzao/pI3ThLA0lreg4L3rYP5ESQZRytxIPgUQ4KI11pZxFgbe+uy28AGDYIQscSIb+SWOHPYKLvOEqqepIZ8M18w/U0lZzpzepzi/V/llekvXJ6UEf1lzl7x/4UIA3WPN1B40+NzbD/OxEGTuM0UctOG6ZTd4Te9AgMBAAECggEAPYksnHbvARspu/SrRCh2fatkIPn6Ijrxyy3mnch7neCw9i/jqxpqmF/4nxFqO0gRlRDZBHyT7p+Y5zDpsW5+kLI2fJmNkzXKkmXoLBnBaOZo8WHBdtXFfjg/iltig9Y7t+cQtXd5QK2eCwuz5dA75FXa0ywqKdRdAGY0nYZ5LpwrHVU8RXheUDCJyhKNj2+W6lIaSKDxLZU3laO1oBrv1agcy7Crd5E2ndb8O3Enga+z7wSz2h7A1BasC/Yl/Ro0Y21wLCH3s/R6qA0Paq12+WEF+xdodM7SrP43CCTVFGbC1TfEOdanJfixop8QuYsIp7pHrL925+vP4eY9RfckgQKBgQDQqLdpDzzU7Ot/L9Vc/r8d4iwXXbX8+HwVFV4oBuausgFyv8eJJpfrI+IlEoB1ubJcPpJBFqfmeYTW6/v6ioFljJAlWfFvesUVt/HszBMIOsU0Bzt7ex6WlwKOagb0q0ZPA4T0OY0K0lg0loaaaR8ZTr4ivDymaGBtTBYhslpc7QKBgQC2MBznGEc5r2dhyENvdPOR20PnXQcevGnPdqSus8m0VmDcHE72RVcckcZtwczsb3NaLSqmjAcWTn51/VFmlvhB3F34FcFTPZGq6sj7fWK8HuFq7l7mu5OzYuVr73zy9ggsUuaw10IqvvwIVxszNAF0hiRnSGH3z27CoRmz3s+8EQKBgQCK3o7atBJ3X4rIJiypbL4DhIB1uJ+jUjk6yvLUTut+fufp1+tTw0S+cS5UIAEw2Lr1G4u5F/v8rwmTBJG6SC4gSLGyui6uVBYRA1BWmedcxchzfRDAeMt9y9kesUAZ3Fe5xIzbAeZ1ulKMBVZmM+pHrJlsgr0Wv0bV1xqvqITtbQKBgBIsIGXopQoa9dvqBtfyOW1eCprkS5aEQqWf9vM6Ga90QjsSU8n6xqKh48IE57TZtQ7UnIF6TCasc66/MsRh4KdpHLJnMR5lcMc0nhF/wz5ychehaTPol+X3wlyOyc7OPah2KG6ROhdbb3ZBggQMduyxiKYIsUTvmuOtAAxR+DSRAoGADtuDzGQDOJYWiO2uuP6FpA5IJaiwlSfu3xncJVfhO8SVr6VBJFg88igbIB3w6nk/sv7j9VTXqXre9HMvp1flxaaLsdxM4HcTSALS9q6t/ajaveqte6S5kAtWx0WW8C6PtgWXHbxcD7LXARSsKLoEl2JXXyUVS/m2l/RzHBQ8GJI= | |||
| appPublicKeyCertPath: /opt/iformall/service/alipay/appCertPublicKey_2021002137663024.crt | |||
| alipayCertPath: /opt/iformall/service/alipay/alipayCertPublicKey_RSA2.crt | |||
| alipayRootCertPath: /opt/iformall/service/alipay/alipayRootCert.crt | |||
| callback: https://callbacktest.malls.iformall.com/api/alipay/notify/callback | |||
| appId: ss | |||
| appPrivateKey: ss/To/s/ZuL8gIpnsVidVtmi52yd7hzao/ss+uy28AGDYIQscSIb+SWOHPYKLvOEqqepIZ8M18w/U0lZzpzepzi/V/llekvXJ6UEf1lzl7x/4UIA3WPN1B40+NzbD/OxEGTuM0UctOG6ZTd4Te9AgMBAAECggEAPYksnHbvARspu/SrRCh2fatkIPn6Ijrxyy3mnch7neCw9i/jqxpqmF/4nxFqO0gRlRDZBHyT7p+Y5zDpsW5+kLI2fJmNkzXKkmXoLBnBaOZo8WHBdtXFfjg/iltig9Y7t+cQtXd5QK2eCwuz5dA75FXa0ywqKdRdAGY0nYZ5LpwrHVU8RXheUDCJyhKNj2+W6lIaSKDxLZU3laO1oBrv1agcy7Crd5E2ndb8O3Enga+z7wSz2h7A1BasC/Yl/Ro0Y21wLCH3s/R6qA0Paq12+WEF+xdodM7SrP43CCTVFGbC1TfEOdanJfixop8QuYsIp7pHrL925+vP4eY9RfckgQKBgQDQqLdpDzzU7Ot/L9Vc/r8d4iwXXbX8+HwVFV4oBuausgFyv8eJJpfrI+IlEoB1ubJcPpJBFqfmeYTW6/v6ioFljJAlWfFvesUVt/HszBMIOsU0Bzt7ex6WlwKOagb0q0ZPA4T0OY0K0lg0loaaaR8ZTr4ivDymaGBtTBYhslpc7QKBgQC2MBznGEc5r2dhyENvdPOR20PnXQcevGnPdqSus8m0VmDcHE72RVcckcZtwczsb3NaLSqmjAcWTn51/VFmlvhB3F34FcFTPZGq6sj7fWK8HuFq7l7mu5OzYuVr73zy9ggsUuaw10IqvvwIVxszNAF0hiRnSGH3z27CoRmz3s+8EQKBgQCK3o7atBJ3X4rIJiypbL4DhIB1uJ+jUjk6yvLUTut+fufp1+tTw0S+cS5UIAEw2Lr1G4u5F/v8rwmTBJG6SC4gSLGyui6uVBYRA1BWmedcxchzfRDAeMt9y9kesUAZ3Fe5xIzbAeZ1ulKMBVZmM+pHrJlsgr0Wv0bV1xqvqITtbQKBgBIsIGXopQoa9dvqBtfyOW1eCprkS5aEQqWf9vM6Ga90QjsSU8n6xqKh48IE57TZtQ7UnIF6TCasc66/MsRh4KdpHLJnMR5lcMc0nhF/wz5ychehaTPol+X3wlyOyc7OPah2KG6ROhdbb3ZBggQMduyxiKYIsUTvmuOtAAxR+DSRAoGADtuDzGQDOJYWiO2uuP6FpA5IJaiwlSfu3xncJVfhO8SVr6VBJFg88igbIB3w6nk/sv7j9VTXqXre9HMvp1flxaaLsdxM4HcTSALS9q6t/ajaveqte6S5kAtWx0WW8C6PtgWXHbxcD7LXARSsKLoEl2JXXyUVS/m2l/RzHBQ8GJI= | |||
| appPublicKeyCertPath: /opt/ss.crt | |||
| alipayCertPath: /opt/isss.crt | |||
| alipayRootCertPath: /optsss.crt | |||
| callback: https://ssssllback | |||
| video: | |||
| aliyun: | |||
| accessKeyId: LTAI5tQs4MBjzLFbiQLjsMYy | |||
| accessKeySecret: nYmnexFJxrsBu0AGVIOSbUaSaweJu7 | |||
| accessKeyId: ss | |||
| accessKeySecret: ss | |||
| regionId: cn-beijing | |||
| endPoint: https://oss-cn-beijing.aliyuncs.com | |||
| corePoolSize: 6 | |||
| @@ -183,8 +158,8 @@ jasypt: | |||
| password: oRqdnDbK5pj3eMmB | |||
| fm: | |||
| exception: true | |||
| exception_emails: xuxiaohu@iformall.com | |||
| exception: false | |||
| exception_emails: ss@iformall.com | |||
| deploy: 1 | |||
| open: true | |||
| upload_dir: /home/test/server/uploads/ | |||
| @@ -202,31 +177,19 @@ logging: | |||
| com.iformall: debug | |||
| path: ./logs/admin | |||
| suimang: | |||
| oral_broadcasting: http://nas.pucao.cn:50014 | |||
| video_path: http://nas.pucao.cn:50014 | |||
| callbackUrl: https://mtest.metavatar.cc/C | |||
| video_tts: http://111.198.0.15:22299 | |||
| huibo_tts_wav: http://111.198.0.15:22222 | |||
| photo_speak: http://nas.pucao.cn:50015 | |||
| photo_speak_hy: http://nas.pucao.cn:50013 | |||
| digital_avatar: http://nas.pucao.cn:2005 | |||
| digital_avatar_hy: http://nas.pucao.cn:2003 | |||
| local_deploy: true | |||
| token: fm2023 | |||
| sdk: | |||
| sm: | |||
| base-url: https://mtest.metavatar.cc/public | |||
| base-url: https://xxx/publicx | |||
| swagger: | |||
| base-package: com.iformall.controller | |||
| title: 遂芒_metavatar_接口文档 | |||
| description: 前后端联调 | |||
| version: 1.0 | |||
| license: Apache | |||
| license-url: https://mtest.metavatar.cc/ | |||
| terms-of-service-url: https://mtest.metavatar.cc/ | |||
| license-url: https://ss.ss.cc/ | |||
| terms-of-service-url: https://ss.ss.cc/ | |||
| host: localhost:8888 | |||
| contact: | |||
| name: 张三 | |||
| url: https://mtest.metavatar.cc/ | |||
| url: https://sss.sss.cc/ | |||
| email: zhangsan@163.com | |||
| @@ -3,9 +3,9 @@ spring: | |||
| include: aliyunRocketMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://182.92.151.30:3306/mallink_suimang?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true&allowMultiQueries=true | |||
| username: root | |||
| password: sm2023@ms | |||
| url: jdbc:mysql://rm-2zelxn28n1kr4093q.mysql.rds.aliyuncs.com/matavatar?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true&allowMultiQueries=true | |||
| username: yqzjroot | |||
| password: yqzj@2023ABC | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -24,7 +24,7 @@ spring: | |||
| connectionProperties: "druid.stat.mergeSql=true;druid.stat.slowSqlMillis=60000" | |||
| # REDIS | |||
| redis: | |||
| host: 182.92.151.30 | |||
| host: r-2zeb1syt5wyw757yf4.redis.rds.aliyuncs.com | |||
| port: 6379 | |||
| password: sm2023@rd | |||
| timeout: 3600 | |||
| @@ -41,20 +41,20 @@ spring: | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI5tQs4MBjzLFbiQLjsMYy | |||
| accessKeySecret: nYmnexFJxrsBu0AGVIOSbUaSaweJu7 | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| accessKeyId: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| accessKeySecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| product: dysmsapi.aliyuncs.com | |||
| domain: ss.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI5tQs4MBjzLFbiQLjsMYy | |||
| keysecret: nYmnexFJxrsBu0AGVIOSbUaSaweJu7 | |||
| bucketname: suimang | |||
| filehost: admin | |||
| filedomain: https://suimang.oss-accelerate.aliyuncs.com | |||
| keyid: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| keysecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| bucketname: yuanqizhijia | |||
| filehost: homea | |||
| filedomain: https://yuanqizhijia.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| @@ -80,8 +80,8 @@ spring: | |||
| virtual-host: / | |||
| # | |||
| aliyunRocketmq: | |||
| accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" | |||
| accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" | |||
| accessKeyId: "xx" | |||
| accessKeySecret: "xx" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| flyway: | |||
| @@ -95,16 +95,16 @@ aws: | |||
| wechat: | |||
| web: | |||
| appId: "wx9cc4ca09eb20fe03" | |||
| secret: "af1d7f7a1268022a73cb4ce0b9cf0985" | |||
| url: "https://admin.malls.iformall.com" | |||
| appId: "sss" | |||
| secret: "sss" | |||
| url: "https://sssll.com" | |||
| open: | |||
| componentAppId: ENC(b3JG0MUZgQfz5Zj+DC2ZM1zDeLOiGTmmeokfe2O8kaM=) | |||
| componentSecret: ENC(QVyc4BPGdnSjXGs2ivgpDBE1v8wPWHLLRMYI7Vv8uYwC0SiZHQz0QpyyQV/b48Pb) | |||
| componentToken: ENC(rkxj0733WxFFDLgA9x01m2s5Fi2L+0PC) | |||
| componentAesKey: ENC(EIbJUBpbYOrLb4YQ/HXLQmxlxgAqIp2ZmpnGICC8pu5xiTz3Cqfkbwd2S8raCcK/IvYcX2GmedI=) | |||
| redis: | |||
| host: 182.92.151.30 | |||
| host: r-2zeb1syt5wyw757yf4.redis.rds.aliyuncs.com | |||
| port: 6379 | |||
| password: sm2023@rd | |||
| timeout: 3600 | |||
| @@ -120,8 +120,8 @@ wechat: | |||
| alipay: | |||
| open: | |||
| appId: 2021002140616334 | |||
| appPrivateKey: MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCEJmHIlS0luIH7zJRRVlypCcgiSkqpSlnmgyCEM7nu8IerV8Yf7dMBitBklTpJB+4URV1bW+q6Ijzo8RsCyjm1Kx+EFiKf1PiJXlT0h1+bF3fYdDr6r5GK0/TtB8O80p774NcRD3HgbzUS8AEe/GcBvhiXbDRgJh7yAngW9vxl9u1o5UcaxOXVLWDrjlQGF6qyXUlycCNIdPXj3LduP3PBK5daVZwJm33Pr7kmSI0agZvV267HaTpSKaiXI7Zwo+nFMqx9g9kpzmYRfOgHx3DWpQUFI646IB8nEpLpQp3/0eDocuqiHXYgEpLpPoFKoVE228v74YSFh3Y4fFGX+qtjAgMBAAECggEAIJK9Y42xtSyHjaNdo7bf3CK3HAyn3pafFjyYFT4SxJyxNEDMay5Z5nVq7IAD/+BehMycOFqtvveVf+1+NO/XzZo1iH9URYVfRazkz+lWXYopVkdACm6gN1ILeymAy9g2q+s918ywyxteP668+ABK+5j5wsk/F7wNwKVvKGn0yMT7DP0FAL1e0KWndZCZlF79VnFpBLscDJq28GqRzqYop4CWqHHTA6DBvIqkfQV4U3IzqnzOsxNLEMBwhnbK08XfYZ3DxCPH0jQdA2Jj/aABrntq2EpWjzW5H9iZqrVo33rmsNHUSQvla/333RkbpwGyNhI6kcPBRq4cVSAa3y7dMQKBgQDVfyDUPWKXVwIJUgO1my8WIUu2p6nhuT7Mfnpk4X7ewdFaRVjb/r0KvhLgoz2/KOwkqtWTlEvNaCDDycpLXk+V5ZH833kYsDEmxY7ikOUjCcrfYJgT7P77//cZ4Kx8a5X45SiKAZT2GQv7BTtIfNhrfTUj6AQx/3MP3sa2QAWeNQKBgQCedWoF7t+qyck2hctqtTFC7fRkEk7RNJVph1ZOeTqOIAKhmhkwaOE3joxQ/VqHDy212YdW4hI0BWUzbEdMy0Idz2G3y9ERVD84hZehf5GGRdiSrY9EEQgHlcI6Qb8/AnDdpy1DlKUMwTYjVNzkDL3AzeWn61JS1XQaOzZBsJy2NwKBgFa+pJQXrOtYytcGn8M2Hlebh6vbS8cPAVkNOqWqiWXw0iMfcg9Q3XZz7C+hpAD7m5b6YnToGDSJTma+opck5qk88agRFJ7XV+Es+/VKcg9edzNzh9bwwFmbksbM5shW3kSWt3X7Vo73dkqzwXaeY0CpSuIf7zRxWkrkdVCvipjRAoGAMcJlPN+6VQNwsDJromKryXy31gT5wzBkCvN44sOm46KhsOWXK2CD+NJGtdgZaXgWvphEq7/qP3PCR9ekvDTH2lyZLwJN8Mcn4zPwXcKVjDi6vbTK3HEMuHUKvQiQadT2ZGRvDl3LRqoVuhqYEvT9UWJWz9hRzblB8ErPyukPDRkCgYB7bMv2iflpaGE1J3gkTlVJB+2QSfnAXaUDMLWsZN4gYjwEBVCEJ+mhWL1/GeEIBjSs5/qZIeRsYzlxGEcnsJzRfog6ITBF14AeZ+xNkHq83ja87OGVKMypiccGwRehijDhJi6tgMJ0u0w6PiqcJvh0SX4jBhDDPjuWzK2XD+lx8A== | |||
| appId: ss | |||
| appPrivateKey: ss+4URV1bW+q6Ijzo8RsCyjm1Kx+EFiKf1PiJXlT0h1+bF3fYdDr6r5GK0/TtB8O80p774NcRD3HgbzUS8AEe/GcBvhiXbDRgJh7yAngW9vxl9u1o5UcaxOXVLWDrjlQGF6qyXUlycCNIdPXj3LduP3PBK5daVZwJm33Pr7kmSI0agZvV267HaTpSKaiXI7Zwo+nFMqx9g9kpzmYRfOgHx3DWpQUFI646IB8nEpLpQp3/0eDocuqiHXYgEpLpPoFKoVE228v74YSFh3Y4fFGX+qtjAgMBAAECggEAIJK9Y42xtSyHjaNdo7bf3CK3HAyn3pafFjyYFT4SxJyxNEDMay5Z5nVq7IAD/+BehMycOFqtvveVf+1+NO/XzZo1iH9URYVfRazkz+lWXYopVkdACm6gN1ILeymAy9g2q+s918ywyxteP668+ABK+5j5wsk/F7wNwKVvKGn0yMT7DP0FAL1e0KWndZCZlF79VnFpBLscDJq28GqRzqYop4CWqHHTA6DBvIqkfQV4U3IzqnzOsxNLEMBwhnbK08XfYZ3DxCPH0jQdA2Jj/aABrntq2EpWjzW5H9iZqrVo33rmsNHUSQvla/333RkbpwGyNhI6kcPBRq4cVSAa3y7dMQKBgQDVfyDUPWKXVwIJUgO1my8WIUu2p6nhuT7Mfnpk4X7ewdFaRVjb/r0KvhLgoz2/KOwkqtWTlEvNaCDDycpLXk+V5ZH833kYsDEmxY7ikOUjCcrfYJgT7P77//cZ4Kx8a5X45SiKAZT2GQv7BTtIfNhrfTUj6AQx/3MP3sa2QAWeNQKBgQCedWoF7t+qyck2hctqtTFC7fRkEk7RNJVph1ZOeTqOIAKhmhkwaOE3joxQ/VqHDy212YdW4hI0BWUzbEdMy0Idz2G3y9ERVD84hZehf5GGRdiSrY9EEQgHlcI6Qb8/AnDdpy1DlKUMwTYjVNzkDL3AzeWn61JS1XQaOzZBsJy2NwKBgFa+pJQXrOtYytcGn8M2Hlebh6vbS8cPAVkNOqWqiWXw0iMfcg9Q3XZz7C+hpAD7m5b6YnToGDSJTma+opck5qk88agRFJ7XV+Es+/VKcg9edzNzh9bwwFmbksbM5shW3kSWt3X7Vo73dkqzwXaeY0CpSuIf7zRxWkrkdVCvipjRAoGAMcJlPN+6VQNwsDJromKryXy31gT5wzBkCvN44sOm46KhsOWXK2CD+NJGtdgZaXgWvphEq7/qP3PCR9ekvDTH2lyZLwJN8Mcn4zPwXcKVjDi6vbTK3HEMuHUKvQiQadT2ZGRvDl3LRqoVuhqYEvT9UWJWz9hRzblB8ErPyukPDRkCgYB7bMv2iflpaGE1J3gkTlVJB+2QSfnAXaUDMLWsZN4gYjwEBVCEJ+mhWL1/GeEIBjSs5/qZIeRsYzlxGEcnsJzRfog6ITBF14AeZ+xNkHq83ja87OGVKMypiccGwRehijDhJi6tgMJ0u0w6PiqcJvh0SX4jBhDDPjuWzK2XD+lx8A== | |||
| appPublicKeyCertPath: /opt/iformall/service/alipay/appCertPublicKey_2021002140616334.crt | |||
| alipayCertPath: /opt/iformall/service/alipay/alipayCertPublicKey_RSA2.crt | |||
| alipayRootCertPath: /opt/iformall/service/alipay/alipayRootCert.crt | |||
| @@ -129,8 +129,8 @@ alipay: | |||
| video: | |||
| aliyun: | |||
| accessKeyId: LTAI5tQs4MBjzLFbiQLjsMYy | |||
| accessKeySecret: nYmnexFJxrsBu0AGVIOSbUaSaweJu7 | |||
| accessKeyId: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| accessKeySecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| regionId: cn-beijing | |||
| endPoint: https://oss-cn-beijing.aliyuncs.com | |||
| corePoolSize: 6 | |||
| @@ -139,8 +139,8 @@ video: | |||
| namePrefix: aliyun-video-upload | |||
| fm: | |||
| exception: true | |||
| exception_emails: houtaikaifa@iformall.com | |||
| exception: false | |||
| exception_emails: xx@iformall.com | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /root/uploads/ | |||
| @@ -158,18 +158,6 @@ logging: | |||
| com.iformall.mapper: debug | |||
| path: ./logs/admin | |||
| suimang: | |||
| oral_broadcasting: http://111.198.0.15:22266 | |||
| video_path: http://111.198.0.15:22266 | |||
| callbackUrl: https://neuver.metavatar.cc/C | |||
| video_tts: http://111.198.0.15:22299 | |||
| huibo_tts_wav: http://111.198.0.15:22222 | |||
| photo_speak: http://111.198.0.15:22299 | |||
| photo_speak_hy: http://111.198.0.15:22288 | |||
| digital_avatar: http://111.198.0.15:22200 | |||
| digital_avatar_hy: http://*****:2003 | |||
| local_deploy: false | |||
| token: fm2023 | |||
| sdk: | |||
| sm: | |||
| base-url: https://openapi8.metavatar.cc/public | |||
| base-url: https://xxxxx/publicx | |||
| @@ -1,175 +0,0 @@ | |||
| spring: | |||
| profiles: | |||
| include: aliyunRocketMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://rm-2zelxn28n1kr4093q.mysql.rds.aliyuncs.com/matavatar?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true&allowMultiQueries=true | |||
| username: yqzjroot | |||
| password: yqzj@2023ABC | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| maxActive: 200 | |||
| initialSize: 1 | |||
| maxWait: 60000 | |||
| minIdle: 1 | |||
| timeBetweenEvictionRunsMillis: 28000 | |||
| minEvictableIdleTimeMillis: 28000 | |||
| validationQuery: select 'x' | |||
| testWhileIdle: true | |||
| testOnBorrow: false | |||
| testOnReturn: false | |||
| poolPreparedStatements: true | |||
| maxOpenPreparedStatements: 20 | |||
| connectionProperties: "druid.stat.mergeSql=true;druid.stat.slowSqlMillis=60000" | |||
| # REDIS | |||
| redis: | |||
| host: r-2zeb1syt5wyw757yf4.redis.rds.aliyuncs.com | |||
| port: 6379 | |||
| password: sm2023@rd | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 1 | |||
| defaultExpiration: 2592000 # 默认生命周期30天 | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 20 | |||
| max-wait: -1 | |||
| min-idle: 0 | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| accessKeySecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| keysecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| bucketname: yuanqizhijia | |||
| filehost: admin | |||
| filedomain: https://yuanqizhijia.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: system@metavatar.com.cn | |||
| password: 2bKGhFaKKjhQFeka # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| auth: true | |||
| starttls: | |||
| enable: true | |||
| socketFactory: | |||
| port: 465 | |||
| class: javax.net.ssl.SSLSocketFactory | |||
| # RABBITMQ | |||
| rabbitmq: | |||
| host: 127.0.0.1 | |||
| port: 5672 | |||
| username: ENC(lRmLd6EzgeY1RT5ktcHv9g==) | |||
| password: ENC(gBI8mCjr3OC0v57jcnSb660Ux7mW03K2oePgvohhg7w=) | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| # | |||
| aliyunRocketmq: | |||
| accessKeyId: "xxx" | |||
| accessKeySecret: "xxxx" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://xxxx2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| flyway: | |||
| enabled: false | |||
| aws: | |||
| clientRegion: cn-northwest-1 | |||
| bucketName: iformall-net | |||
| access: ENC(a6SN1sZ1enNL49ypiOXkg/pPPAnZD8H4buQFTTKN08s=) | |||
| secret: ENC(5P5ff4bTMJUbXVR4ZsM03UHzOKZ4+Zg5Iutcdkyp/Quny/oXg+A4KpfwEyGarlLu3vQMJahGP5M=) | |||
| wechat: | |||
| web: | |||
| appId: "xxxx" | |||
| secret: "xxxx" | |||
| url: "https://xxxx" | |||
| open: | |||
| componentAppId: ENC(b3JG0MUZgQfz5Zj+DC2ZM1zDeLOiGTmmeokfe2O8kaM=) | |||
| componentSecret: ENC(QVyc4BPGdnSjXGs2ivgpDBE1v8wPWHLLRMYI7Vv8uYwC0SiZHQz0QpyyQV/b48Pb) | |||
| componentToken: ENC(rkxj0733WxFFDLgA9x01m2s5Fi2L+0PC) | |||
| componentAesKey: ENC(EIbJUBpbYOrLb4YQ/HXLQmxlxgAqIp2ZmpnGICC8pu5xiTz3Cqfkbwd2S8raCcK/IvYcX2GmedI=) | |||
| redis: | |||
| host: r-2zeb1syt5wyw757yf4.redis.rds.aliyuncs.com | |||
| port: 6379 | |||
| password: sm2023@rd | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| defaultExpiration: 2592000 # 默认生命周期30天 | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| alipay: | |||
| open: | |||
| appId: 2021011111616334 | |||
| appPrivateKey: MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBxxxxRRVlypCcgiSkqpSlnmgyCEM7nu8IerV8Yf7dMBitBklTpJB+4URV1bW+q6Ijzo8RsCyjm1Kx+EFiKf1PiJXlT0h1+bF3fYdDr6r5GK0/TtB8O80p774NcRD3HgbzUS8AEe/GcBvhiXbDRgJh7yAngW9vxl9u1o5UcaxOXVLWDrjlQGF6qyXUlycCNIdPXj3LduP3PBK5daVZwJm33Pr7kmSI0agZvV267HaTpSKaiXI7Zwo+nFMqx9g9kpzmYRfOgHx3DWpQUFI646IB8nEpLpQp3/0eDocuqiHXYgEpLpPoFKoVE228v74YSFh3Y4fFGX+qtjAgMBAAECggEAIJK9Y42xtSyHjaNdo7bf3CK3HAyn3pafFjyYFT4SxJyxNEDMay5Z5nVq7IAD/+BehMycOFqtvveVf+1+NO/XzZo1iH9URYVfRazkz+lWXYopVkdACm6gN1ILeymAy9g2q+s918ywyxteP668+ABK+5j5wsk/F7wNwKVvKGn0yMT7DP0FAL1e0KWndZCZlF79VnFpBLscDJq28GqRzqYop4CWqHHTA6DBvIqkfQV4U3IzqnzOsxNLEMBwhnbK08XfYZ3DxCPH0jQdA2Jj/aABrntq2EpWjzW5H9iZqrVo33rmsNHUSQvla/333RkbpwGyNhI6kcPBRq4cVSAa3y7dMQKBgQDVfyDUPWKXVwIJUgO1my8WIUu2p6nhuT7Mfnpk4X7ewdFaRVjb/r0KvhLgoz2/KOwkqtWTlEvNaCDDycpLXk+V5ZH833kYsDEmxY7ikOUjCcrfYJgT7P77//cZ4Kx8a5X45SiKAZT2GQv7BTtIfNhrfTUj6AQx/3MP3sa2QAWeNQKBgQCedWoF7t+qyck2hctqtTFC7fRkEk7RNJVph1ZOeTqOIAKhmhkwaOE3joxQ/VqHDy212YdW4hI0BWUzbEdMy0Idz2G3y9ERVD84hZehf5GGRdiSrY9EEQgHlcI6Qb8/AnDdpy1DlKUMwTYjVNzkDL3AzeWn61JS1XQaOzZBsJy2NwKBgFa+pJQXrOtYytcGn8M2Hlebh6vbS8cPAVkNOqWqiWXw0iMfcg9Q3XZz7C+hpAD7m5b6YnToGDSJTma+opck5qk88agRFJ7XV+Es+/VKcg9edzNzh9bwwFmbksbM5shW3kSWt3X7Vo73dkqzwXaeY0CpSuIf7zRxWkrkdVCvipjRAoGAMcJlPN+6VQNwsDJromKryXy31gT5wzBkCvN44sOm46KhsOWXK2CD+NJGtdgZaXgWvphEq7/qP3PCR9ekvDTH2lyZLwJN8Mcn4zPwXcKVjDi6vbTK3HEMuHUKvQiQadT2ZGRvDl3LRqoVuhqYEvT9UWJWz9hRzblB8ErPyukPDRkCgYB7bMv2iflpaGE1J3gkTlVJB+2QSfnAXaUDMLWsZN4gYjwEBVCEJ+mhWL1/GeEIBjSs5/qZIeRsYzlxGEcnsJzRfog6ITBF14AeZ+xNkHq83ja87OGVKMypiccGwRehijDhJi6tgMJ0u0w6PiqcJvh0SX4jBhDDPjuWzK2XD+lx8A== | |||
| appPublicKeyCertPath: /opt/service/alipay/appCertPublicKey_2021002140616334.crt | |||
| alipayCertPath: /opt/service/alipay/alipayCertPublicKey_RSA2.crt | |||
| alipayRootCertPath: /opt/service/alipay/alipayRootCert.crt | |||
| callback: https://xx.com/api/alipay/notify/callback | |||
| video: | |||
| aliyun: | |||
| accessKeyId: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| accessKeySecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| regionId: cn-beijing | |||
| endPoint: https://oss-cn-beijing.aliyuncs.com | |||
| corePoolSize: 6 | |||
| maxPoolSize: 20 | |||
| queueCapacity: 1000 | |||
| namePrefix: aliyun-video-upload | |||
| fm: | |||
| exception: true | |||
| exception_emails: houtaikaifa@iformall.com | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /root/uploads/ | |||
| ocr_data: /root/ocr_data/ | |||
| videoType: aliyun | |||
| ueditor: | |||
| config: config.json | |||
| unified: true | |||
| upload-path: ./upload/ | |||
| url-prefix: "" | |||
| logging: | |||
| level: | |||
| com.iformall.mapper: debug | |||
| path: ./logs/admin | |||
| suimang: | |||
| oral_broadcasting: x.x.x.x | |||
| video_path: http://111.198.0.15:22266 | |||
| callbackUrl: https://neuver.meta-autotv.com/C/callback/oral/broadcasting | |||
| video_tts: x.x.x.x | |||
| huibo_tts_wav: x.x.x.x | |||
| photo_speak: x.x.x.x | |||
| photo_speak_hy: x.x.x.x | |||
| digital_avatar: x.x.x.x | |||
| digital_avatar_hy: x.x.x.x | |||
| local_deploy: true | |||
| token: x | |||
| sdk: | |||
| sm: | |||
| base-url: https://openapi8.metavatar.cc/public | |||
| @@ -17,7 +17,11 @@ | |||
| <artifactId>yqzjService</artifactId> | |||
| <version>1.0</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.iformall</groupId> | |||
| <artifactId>yqzjVideo</artifactId> | |||
| <version>1.0</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.github.axet</groupId> | |||
| <artifactId>kaptcha</artifactId> | |||
| @@ -4,8 +4,8 @@ spring: | |||
| include: rabbitMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://182.92.151.30:3306/mallink_suimang_test?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: root | |||
| url: jdbc:mysql://rm-2zelxn28n1kr4093q.mysql.rds.aliyuncs.com/matavatar?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: yqzjroot | |||
| password: sm2023@ms | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| @@ -27,9 +27,9 @@ spring: | |||
| # REDIS | |||
| redis: | |||
| host: 101.200.130.134 | |||
| host: r-2zeb1syt5wyw757yf4.redis.rds.aliyuncs.com | |||
| port: 6379 | |||
| password: iF0rm@2l2ol9 | |||
| password: sm2023@rd | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 5 | |||
| @@ -43,8 +43,8 @@ spring: | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI5tQs4MBjzLFbiQLjsMYy | |||
| accessKeySecret: nYmnexFJxrsBu0AGVIOSbUaSaweJu7 | |||
| accessKeyId: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| accessKeySecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| @@ -53,11 +53,11 @@ spring: | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI5tQs4MBjzLFbiQLjsMYy | |||
| keysecret: nYmnexFJxrsBu0AGVIOSbUaSaweJu7 | |||
| bucketname: suimang | |||
| filehost: capi | |||
| filedomain: https://suimang.oss-accelerate.aliyuncs.com | |||
| keyid: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| keysecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| bucketname: yuanqizhijia | |||
| filehost: homec | |||
| filedomain: https://yuanqizhijia.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| @@ -93,8 +93,8 @@ spring: | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| aliyunRocketmq: | |||
| accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" | |||
| accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" | |||
| accessKeyId: "ss" | |||
| accessKeySecret: "ss" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| @@ -104,37 +104,16 @@ aws: | |||
| access: ENC(3gx5ghDFBqGrEhO3Wf8aYmXsnwHO7Cj3HNKJGOeUj0o=) | |||
| secret: ENC(HVKIJwCJKVXLlUpGlQPwNqJOlnpxn4xYuy91SH0seTSm2uAttIQHvA49fXWWax90v5wloIk0QuU=) | |||
| #wechat: | |||
| # open: | |||
| # componentAppId: "wxdfc8fb4e62d6b52b" | |||
| # componentSecret: "98daa62b316dd6feabaad708327ce233" | |||
| # componentToken: "formall2018" | |||
| # componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| # redis: | |||
| # host: 101.201.103.81 | |||
| # port: 6379 | |||
| # password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| # timeout: 3600 | |||
| # expire: 1800 #30分钟 | |||
| # database: 2 | |||
| # defaultExpiration: 2592000 # 默认生命周期30天 | |||
| # jedis: | |||
| # pool: | |||
| # max-active: 100 | |||
| # max-idle: 500 | |||
| # max-wait: -1 | |||
| # min-idle: 10 | |||
| wechat: | |||
| web: | |||
| appId: "wx091907dd0bfd3f6b" | |||
| secret: "2a2ca10738998b9ef92c1fe8a4d366a6" | |||
| url: "https://admintest.malls.iformall.com" | |||
| appId: "ss" | |||
| secret: "ss" | |||
| url: "https://ss.ss.ss.com" | |||
| open: | |||
| componentAppId: wxdfc8fb4e62d6b52b | |||
| componentSecret: 98daa62b316dd6feabaad708327ce233 | |||
| componentToken: formall2018 | |||
| componentAesKey: htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN | |||
| componentAppId: ss | |||
| componentSecret: ss | |||
| componentToken: ss | |||
| componentAesKey: ss | |||
| redis: | |||
| host: 101.200.130.134 | |||
| port: 6379 | |||
| @@ -152,17 +131,17 @@ wechat: | |||
| alipay: | |||
| open: | |||
| appId: 2021002137663024 | |||
| appPrivateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCUfymV5J73QQMG52PVIGUbowkloYCO4B7TQoKbrTZf2YeYsg/To/o4PiXPMNwEUfEUU8NYQ6WwNhCd2fa1ei8WFXJUf3bfgswtBk1aOmHLeY9yoXFxIKMTQ9RcobnmBzKQZlaAPMTSr7t1QtKZKPuc2gEHGRFYKO/ZuL8gIpnsVidVtmi52yd7hzao/pI3ThLA0lreg4L3rYP5ESQZRytxIPgUQ4KI11pZxFgbe+uy28AGDYIQscSIb+SWOHPYKLvOEqqepIZ8M18w/U0lZzpzepzi/V/llekvXJ6UEf1lzl7x/4UIA3WPN1B40+NzbD/OxEGTuM0UctOG6ZTd4Te9AgMBAAECggEAPYksnHbvARspu/SrRCh2fatkIPn6Ijrxyy3mnch7neCw9i/jqxpqmF/4nxFqO0gRlRDZBHyT7p+Y5zDpsW5+kLI2fJmNkzXKkmXoLBnBaOZo8WHBdtXFfjg/iltig9Y7t+cQtXd5QK2eCwuz5dA75FXa0ywqKdRdAGY0nYZ5LpwrHVU8RXheUDCJyhKNj2+W6lIaSKDxLZU3laO1oBrv1agcy7Crd5E2ndb8O3Enga+z7wSz2h7A1BasC/Yl/Ro0Y21wLCH3s/R6qA0Paq12+WEF+xdodM7SrP43CCTVFGbC1TfEOdanJfixop8QuYsIp7pHrL925+vP4eY9RfckgQKBgQDQqLdpDzzU7Ot/L9Vc/r8d4iwXXbX8+HwVFV4oBuausgFyv8eJJpfrI+IlEoB1ubJcPpJBFqfmeYTW6/v6ioFljJAlWfFvesUVt/HszBMIOsU0Bzt7ex6WlwKOagb0q0ZPA4T0OY0K0lg0loaaaR8ZTr4ivDymaGBtTBYhslpc7QKBgQC2MBznGEc5r2dhyENvdPOR20PnXQcevGnPdqSus8m0VmDcHE72RVcckcZtwczsb3NaLSqmjAcWTn51/VFmlvhB3F34FcFTPZGq6sj7fWK8HuFq7l7mu5OzYuVr73zy9ggsUuaw10IqvvwIVxszNAF0hiRnSGH3z27CoRmz3s+8EQKBgQCK3o7atBJ3X4rIJiypbL4DhIB1uJ+jUjk6yvLUTut+fufp1+tTw0S+cS5UIAEw2Lr1G4u5F/v8rwmTBJG6SC4gSLGyui6uVBYRA1BWmedcxchzfRDAeMt9y9kesUAZ3Fe5xIzbAeZ1ulKMBVZmM+pHrJlsgr0Wv0bV1xqvqITtbQKBgBIsIGXopQoa9dvqBtfyOW1eCprkS5aEQqWf9vM6Ga90QjsSU8n6xqKh48IE57TZtQ7UnIF6TCasc66/MsRh4KdpHLJnMR5lcMc0nhF/wz5ychehaTPol+X3wlyOyc7OPah2KG6ROhdbb3ZBggQMduyxiKYIsUTvmuOtAAxR+DSRAoGADtuDzGQDOJYWiO2uuP6FpA5IJaiwlSfu3xncJVfhO8SVr6VBJFg88igbIB3w6nk/sv7j9VTXqXre9HMvp1flxaaLsdxM4HcTSALS9q6t/ajaveqte6S5kAtWx0WW8C6PtgWXHbxcD7LXARSsKLoEl2JXXyUVS/m2l/RzHBQ8GJI= | |||
| appPublicKeyCertPath: /opt/iformall/service/alipay/appCertPublicKey_2021002137663024.crt | |||
| alipayCertPath: /opt/iformall/service/alipay/alipayCertPublicKey_RSA2.crt | |||
| alipayRootCertPath: /opt/iformall/service/alipay/alipayRootCert.crt | |||
| callback: https://callbacktest.malls.iformall.com/api/alipay/notify/callback | |||
| appId: ss | |||
| appPrivateKey: ss/To/ss/ZuL8gIpnsVidVtmi52yd7hzao/pI3ThLA0lreg4L3rYP5ESQZRytxIPgUQ4KI11pZxFgbe+uy28AGDYIQscSIb+SWOHPYKLvOEqqepIZ8M18w/U0lZzpzepzi/V/llekvXJ6UEf1lzl7x/4UIA3WPN1B40+NzbD/OxEGTuM0UctOG6ZTd4Te9AgMBAAECggEAPYksnHbvARspu/SrRCh2fatkIPn6Ijrxyy3mnch7neCw9i/jqxpqmF/4nxFqO0gRlRDZBHyT7p+Y5zDpsW5+kLI2fJmNkzXKkmXoLBnBaOZo8WHBdtXFfjg/iltig9Y7t+cQtXd5QK2eCwuz5dA75FXa0ywqKdRdAGY0nYZ5LpwrHVU8RXheUDCJyhKNj2+W6lIaSKDxLZU3laO1oBrv1agcy7Crd5E2ndb8O3Enga+z7wSz2h7A1BasC/Yl/Ro0Y21wLCH3s/R6qA0Paq12+WEF+xdodM7SrP43CCTVFGbC1TfEOdanJfixop8QuYsIp7pHrL925+vP4eY9RfckgQKBgQDQqLdpDzzU7Ot/L9Vc/r8d4iwXXbX8+HwVFV4oBuausgFyv8eJJpfrI+IlEoB1ubJcPpJBFqfmeYTW6/v6ioFljJAlWfFvesUVt/HszBMIOsU0Bzt7ex6WlwKOagb0q0ZPA4T0OY0K0lg0loaaaR8ZTr4ivDymaGBtTBYhslpc7QKBgQC2MBznGEc5r2dhyENvdPOR20PnXQcevGnPdqSus8m0VmDcHE72RVcckcZtwczsb3NaLSqmjAcWTn51/VFmlvhB3F34FcFTPZGq6sj7fWK8HuFq7l7mu5OzYuVr73zy9ggsUuaw10IqvvwIVxszNAF0hiRnSGH3z27CoRmz3s+8EQKBgQCK3o7atBJ3X4rIJiypbL4DhIB1uJ+jUjk6yvLUTut+fufp1+tTw0S+cS5UIAEw2Lr1G4u5F/v8rwmTBJG6SC4gSLGyui6uVBYRA1BWmedcxchzfRDAeMt9y9kesUAZ3Fe5xIzbAeZ1ulKMBVZmM+pHrJlsgr0Wv0bV1xqvqITtbQKBgBIsIGXopQoa9dvqBtfyOW1eCprkS5aEQqWf9vM6Ga90QjsSU8n6xqKh48IE57TZtQ7UnIF6TCasc66/MsRh4KdpHLJnMR5lcMc0nhF/wz5ychehaTPol+X3wlyOyc7OPah2KG6ROhdbb3ZBggQMduyxiKYIsUTvmuOtAAxR+DSRAoGADtuDzGQDOJYWiO2uuP6FpA5IJaiwlSfu3xncJVfhO8SVr6VBJFg88igbIB3w6nk/sv7j9VTXqXre9HMvp1flxaaLsdxM4HcTSALS9q6t/ajaveqte6S5kAtWx0WW8C6PtgWXHbxcD7LXARSsKLoEl2JXXyUVS/m2l/RzHBQ8GJI= | |||
| appPublicKeyCertPath: /opss.crt | |||
| alipayCertPath: /opt/ss.crt | |||
| alipayRootCertPath: /opt/ss.crt | |||
| callback: https://ssssllback | |||
| video: | |||
| aliyun: | |||
| accessKeyId: LTAI5tQs4MBjzLFbiQLjsMYy | |||
| accessKeySecret: nYmnexFJxrsBu0AGVIOSbUaSaweJu7 | |||
| accessKeyId: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| accessKeySecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| regionId: cn-beijing | |||
| endPoint: https://oss-cn-beijing.aliyuncs.com | |||
| corePoolSize: 6 | |||
| @@ -175,8 +154,8 @@ jasypt: | |||
| password: oRqdnDbK5pj3eMmB | |||
| fm: | |||
| exception: true | |||
| exception_emails: xuxiaohu@iformall.com | |||
| exception: false | |||
| exception_emails: xx@iformall.com | |||
| deploy: 1 | |||
| open: false | |||
| upload_dir: /home/test/server/uploads/ | |||
| @@ -188,21 +167,9 @@ logging: | |||
| com.iformall: debug | |||
| path: ./logs/c | |||
| suimang: | |||
| oral_broadcasting: http://nas.pucao.cn:50014 | |||
| video_path: http://nas.pucao.cn:50014 | |||
| callbackUrl: https://mtest.metavatar.cc/C | |||
| video_tts: http://111.198.0.15:22299 | |||
| huibo_tts_wav: http://111.198.0.15:22222 | |||
| photo_speak: http://nas.pucao.cn:50015 | |||
| photo_speak_hy: http://nas.pucao.cn:50013 | |||
| digital_avatar: http://nas.pucao.cn:2005 | |||
| digital_avatar_hy: http://nas.pucao.cn:2003 | |||
| local_deploy: true | |||
| token: fm2023 | |||
| sdk: | |||
| sm: | |||
| base-url: https://mtest.metavatar.cc/public | |||
| base-url: https://xxxx/publicx | |||
| swagger: | |||
| base-package: com.iformall.controller | |||
| title: 遂芒_metavatar_接口文档 | |||
| @@ -3,9 +3,9 @@ spring: | |||
| include: aliyunRocketMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://182.92.151.30:3306/mallink_suimang?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: root | |||
| password: sm2023@ms | |||
| url: jdbc:mysql://rm-2zelxn28n1kr4093q.mysql.rds.aliyuncs.com/matavatar?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: yqzjroot | |||
| password: yqzj@2023ABC | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -23,7 +23,7 @@ spring: | |||
| maxOpenPreparedStatements: 20 | |||
| # REDIS | |||
| redis: | |||
| host: 182.92.151.30 | |||
| host: r-2zeb1syt5wyw757yf4.redis.rds.aliyuncs.com | |||
| port: 6379 | |||
| password: sm2023@rd | |||
| timeout: 3600 | |||
| @@ -39,8 +39,8 @@ spring: | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI5tQs4MBjzLFbiQLjsMYy | |||
| accessKeySecret: nYmnexFJxrsBu0AGVIOSbUaSaweJu7 | |||
| accessKeyId: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| accessKeySecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| @@ -48,11 +48,11 @@ spring: | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI5tQs4MBjzLFbiQLjsMYy | |||
| keysecret: nYmnexFJxrsBu0AGVIOSbUaSaweJu7 | |||
| bucketname: suimang | |||
| filehost: capi | |||
| filedomain: https://suimang.oss-accelerate.aliyuncs.com | |||
| keyid: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| keysecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| bucketname: yuanqizhijia | |||
| filehost: homec | |||
| filedomain: https://yuanqizhijia.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| @@ -78,8 +78,8 @@ spring: | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| aliyunRocketmq: | |||
| accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" | |||
| accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" | |||
| accessKeyId: "ss" | |||
| accessKeySecret: "ss" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| aws: | |||
| @@ -95,7 +95,7 @@ wechat: | |||
| componentToken: ENC(rkxj0733WxFFDLgA9x01m2s5Fi2L+0PC) | |||
| componentAesKey: ENC(EIbJUBpbYOrLb4YQ/HXLQmxlxgAqIp2ZmpnGICC8pu5xiTz3Cqfkbwd2S8raCcK/IvYcX2GmedI=) | |||
| redis: | |||
| host: 182.92.151.30 | |||
| host: r-2zeb1syt5wyw757yf4.redis.rds.aliyuncs.com | |||
| port: 6379 | |||
| password: sm2023@rd | |||
| timeout: 3600 | |||
| @@ -111,17 +111,17 @@ wechat: | |||
| alipay: | |||
| open: | |||
| appId: 2021002140616334 | |||
| appPrivateKey: MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCEJmHIlS0luIH7zJRRVlypCcgiSkqpSlnmgyCEM7nu8IerV8Yf7dMBitBklTpJB+4URV1bW+q6Ijzo8RsCyjm1Kx+EFiKf1PiJXlT0h1+bF3fYdDr6r5GK0/TtB8O80p774NcRD3HgbzUS8AEe/GcBvhiXbDRgJh7yAngW9vxl9u1o5UcaxOXVLWDrjlQGF6qyXUlycCNIdPXj3LduP3PBK5daVZwJm33Pr7kmSI0agZvV267HaTpSKaiXI7Zwo+nFMqx9g9kpzmYRfOgHx3DWpQUFI646IB8nEpLpQp3/0eDocuqiHXYgEpLpPoFKoVE228v74YSFh3Y4fFGX+qtjAgMBAAECggEAIJK9Y42xtSyHjaNdo7bf3CK3HAyn3pafFjyYFT4SxJyxNEDMay5Z5nVq7IAD/+BehMycOFqtvveVf+1+NO/XzZo1iH9URYVfRazkz+lWXYopVkdACm6gN1ILeymAy9g2q+s918ywyxteP668+ABK+5j5wsk/F7wNwKVvKGn0yMT7DP0FAL1e0KWndZCZlF79VnFpBLscDJq28GqRzqYop4CWqHHTA6DBvIqkfQV4U3IzqnzOsxNLEMBwhnbK08XfYZ3DxCPH0jQdA2Jj/aABrntq2EpWjzW5H9iZqrVo33rmsNHUSQvla/333RkbpwGyNhI6kcPBRq4cVSAa3y7dMQKBgQDVfyDUPWKXVwIJUgO1my8WIUu2p6nhuT7Mfnpk4X7ewdFaRVjb/r0KvhLgoz2/KOwkqtWTlEvNaCDDycpLXk+V5ZH833kYsDEmxY7ikOUjCcrfYJgT7P77//cZ4Kx8a5X45SiKAZT2GQv7BTtIfNhrfTUj6AQx/3MP3sa2QAWeNQKBgQCedWoF7t+qyck2hctqtTFC7fRkEk7RNJVph1ZOeTqOIAKhmhkwaOE3joxQ/VqHDy212YdW4hI0BWUzbEdMy0Idz2G3y9ERVD84hZehf5GGRdiSrY9EEQgHlcI6Qb8/AnDdpy1DlKUMwTYjVNzkDL3AzeWn61JS1XQaOzZBsJy2NwKBgFa+pJQXrOtYytcGn8M2Hlebh6vbS8cPAVkNOqWqiWXw0iMfcg9Q3XZz7C+hpAD7m5b6YnToGDSJTma+opck5qk88agRFJ7XV+Es+/VKcg9edzNzh9bwwFmbksbM5shW3kSWt3X7Vo73dkqzwXaeY0CpSuIf7zRxWkrkdVCvipjRAoGAMcJlPN+6VQNwsDJromKryXy31gT5wzBkCvN44sOm46KhsOWXK2CD+NJGtdgZaXgWvphEq7/qP3PCR9ekvDTH2lyZLwJN8Mcn4zPwXcKVjDi6vbTK3HEMuHUKvQiQadT2ZGRvDl3LRqoVuhqYEvT9UWJWz9hRzblB8ErPyukPDRkCgYB7bMv2iflpaGE1J3gkTlVJB+2QSfnAXaUDMLWsZN4gYjwEBVCEJ+mhWL1/GeEIBjSs5/qZIeRsYzlxGEcnsJzRfog6ITBF14AeZ+xNkHq83ja87OGVKMypiccGwRehijDhJi6tgMJ0u0w6PiqcJvh0SX4jBhDDPjuWzK2XD+lx8A== | |||
| appPublicKeyCertPath: /opt/iformall/service/alipay/appCertPublicKey_2021002140616334.crt | |||
| alipayCertPath: /opt/iformall/service/alipay/alipayCertPublicKey_RSA2.crt | |||
| appId: ss | |||
| appPrivateKey: ss+4URV1bW+q6Ijzo8RsCyjm1Kx+EFiKf1PiJXlT0h1+bF3fYdDr6r5GK0/TtB8O80p774NcRD3HgbzUS8AEe/GcBvhiXbDRgJh7yAngW9vxl9u1o5UcaxOXVLWDrjlQGF6qyXUlycCNIdPXj3LduP3PBK5daVZwJm33Pr7kmSI0agZvV267HaTpSKaiXI7Zwo+nFMqx9g9kpzmYRfOgHx3DWpQUFI646IB8nEpLpQp3/0eDocuqiHXYgEpLpPoFKoVE228v74YSFh3Y4fFGX+qtjAgMBAAECggEAIJK9Y42xtSyHjaNdo7bf3CK3HAyn3pafFjyYFT4SxJyxNEDMay5Z5nVq7IAD/+BehMycOFqtvveVf+1+NO/XzZo1iH9URYVfRazkz+lWXYopVkdACm6gN1ILeymAy9g2q+s918ywyxteP668+ABK+5j5wsk/F7wNwKVvKGn0yMT7DP0FAL1e0KWndZCZlF79VnFpBLscDJq28GqRzqYop4CWqHHTA6DBvIqkfQV4U3IzqnzOsxNLEMBwhnbK08XfYZ3DxCPH0jQdA2Jj/aABrntq2EpWjzW5H9iZqrVo33rmsNHUSQvla/333RkbpwGyNhI6kcPBRq4cVSAa3y7dMQKBgQDVfyDUPWKXVwIJUgO1my8WIUu2p6nhuT7Mfnpk4X7ewdFaRVjb/r0KvhLgoz2/KOwkqtWTlEvNaCDDycpLXk+V5ZH833kYsDEmxY7ikOUjCcrfYJgT7P77//cZ4Kx8a5X45SiKAZT2GQv7BTtIfNhrfTUj6AQx/3MP3sa2QAWeNQKBgQCedWoF7t+qyck2hctqtTFC7fRkEk7RNJVph1ZOeTqOIAKhmhkwaOE3joxQ/VqHDy212YdW4hI0BWUzbEdMy0Idz2G3y9ERVD84hZehf5GGRdiSrY9EEQgHlcI6Qb8/AnDdpy1DlKUMwTYjVNzkDL3AzeWn61JS1XQaOzZBsJy2NwKBgFa+pJQXrOtYytcGn8M2Hlebh6vbS8cPAVkNOqWqiWXw0iMfcg9Q3XZz7C+hpAD7m5b6YnToGDSJTma+opck5qk88agRFJ7XV+Es+/VKcg9edzNzh9bwwFmbksbM5shW3kSWt3X7Vo73dkqzwXaeY0CpSuIf7zRxWkrkdVCvipjRAoGAMcJlPN+6VQNwsDJromKryXy31gT5wzBkCvN44sOm46KhsOWXK2CD+NJGtdgZaXgWvphEq7/qP3PCR9ekvDTH2lyZLwJN8Mcn4zPwXcKVjDi6vbTK3HEMuHUKvQiQadT2ZGRvDl3LRqoVuhqYEvT9UWJWz9hRzblB8ErPyukPDRkCgYB7bMv2iflpaGE1J3gkTlVJB+2QSfnAXaUDMLWsZN4gYjwEBVCEJ+mhWL1/GeEIBjSs5/qZIeRsYzlxGEcnsJzRfog6ITBF14AeZ+xNkHq83ja87OGVKMypiccGwRehijDhJi6tgMJ0u0w6PiqcJvh0SX4jBhDDPjuWzK2XD+lx8A== | |||
| appPublicKeyCertPath: /oss.crt | |||
| alipayCertPath: /opt/ss.crt | |||
| alipayRootCertPath: /opt/iformall/service/alipay/alipayRootCert.crt | |||
| callback: https://callback.malls.iformall.com/api/alipay/notify/callback | |||
| video: | |||
| aliyun: | |||
| accessKeyId: LTAI5tQs4MBjzLFbiQLjsMYy | |||
| accessKeySecret: nYmnexFJxrsBu0AGVIOSbUaSaweJu7 | |||
| accessKeyId: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| accessKeySecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| regionId: cn-beijing | |||
| endPoint: https://oss-cn-beijing.aliyuncs.com | |||
| corePoolSize: 6 | |||
| @@ -130,8 +130,8 @@ video: | |||
| namePrefix: aliyun-video-upload | |||
| fm: | |||
| exception: true | |||
| exception_emails: houtaikaifa@iformall.com | |||
| exception: false | |||
| exception_emails: xx@iformall.com | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /root/uploads/ | |||
| @@ -143,18 +143,6 @@ logging: | |||
| com.iformall: debug | |||
| path: ./logs/c | |||
| suimang: | |||
| oral_broadcasting: http://111.198.0.15:22266 | |||
| video_path: http://111.198.0.15:22266 | |||
| callbackUrl: https://neuver.metavatar.cc/C | |||
| video_tts: http://111.198.0.15:22299 | |||
| huibo_tts_wav: http://111.198.0.15:22222 | |||
| photo_speak: http://111.198.0.15:22299 | |||
| photo_speak_hy: http://111.198.0.15:22288 | |||
| digital_avatar: http://111.198.0.15:22200 | |||
| digital_avatar_hy: http://****:2003 | |||
| local_deploy: false | |||
| token: fm2023 | |||
| sdk: | |||
| sm: | |||
| base-url: https://openapi8.metavatar.cc/public | |||
| base-url: https://xxxx/publicx | |||
| @@ -1,168 +0,0 @@ | |||
| spring: | |||
| profiles: | |||
| include: aliyunRocketMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://rm-2zelxn28n1kr4093q.mysql.rds.aliyuncs.com/matavatar?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: yqzjroot | |||
| password: yqzj@2023ABC | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| maxActive: 200 | |||
| initialSize: 1 | |||
| maxWait: 60000 | |||
| minIdle: 1 | |||
| timeBetweenEvictionRunsMillis: 28000 | |||
| minEvictableIdleTimeMillis: 28000 | |||
| validationQuery: select 'x' | |||
| testWhileIdle: true | |||
| testOnBorrow: false | |||
| testOnReturn: false | |||
| poolPreparedStatements: true | |||
| maxOpenPreparedStatements: 20 | |||
| # REDIS | |||
| redis: | |||
| host: r-2zeb1syt5wyw757yf4.redis.rds.aliyuncs.com | |||
| port: 6379 | |||
| password: sm2023@rd | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 1 | |||
| defaultExpiration: 2592000 # 默认生命周期30天 | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| accessKeySecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| keysecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| bucketname: yuanqizhijia | |||
| filehost: capi | |||
| filedomain: https://yuanqizhijia.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: system@metavatar.com.cn | |||
| password: 2bKGhFaKKjhQFeka # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| auth: true | |||
| starttls: | |||
| enable: true | |||
| socketFactory: | |||
| port: 465 | |||
| class: javax.net.ssl.SSLSocketFactory | |||
| # RABBITMQ | |||
| rabbitmq: | |||
| host: 127.0.0.1 | |||
| port: 5672 | |||
| username: ENC(lRmLd6EzgeY1RT5ktcHv9g==) | |||
| password: ENC(gBI8mCjr3OC0v57jcnSb660Ux7mW03K2oePgvohhg7w=) | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| # | |||
| aliyunRocketmq: | |||
| accessKeyId: "xxx" | |||
| accessKeySecret: "xxxx" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://xxxx2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| flyway: | |||
| enabled: false | |||
| aws: | |||
| clientRegion: cn-northwest-1 | |||
| bucketName: iformall-net | |||
| access: ENC(a6SN1sZ1enNL49ypiOXkg/pPPAnZD8H4buQFTTKN08s=) | |||
| secret: ENC(5P5ff4bTMJUbXVR4ZsM03UHzOKZ4+Zg5Iutcdkyp/Quny/oXg+A4KpfwEyGarlLu3vQMJahGP5M=) | |||
| wechat: | |||
| web: | |||
| appId: "xxxx" | |||
| secret: "xxxx" | |||
| url: "https://xxxx" | |||
| open: | |||
| componentAppId: ENC(b3JG0MUZgQfz5Zj+DC2ZM1zDeLOiGTmmeokfe2O8kaM=) | |||
| componentSecret: ENC(QVyc4BPGdnSjXGs2ivgpDBE1v8wPWHLLRMYI7Vv8uYwC0SiZHQz0QpyyQV/b48Pb) | |||
| componentToken: ENC(rkxj0733WxFFDLgA9x01m2s5Fi2L+0PC) | |||
| componentAesKey: ENC(EIbJUBpbYOrLb4YQ/HXLQmxlxgAqIp2ZmpnGICC8pu5xiTz3Cqfkbwd2S8raCcK/IvYcX2GmedI=) | |||
| redis: | |||
| host: r-2zeb1syt5wyw757yf4.redis.rds.aliyuncs.com | |||
| port: 6379 | |||
| password: sm2023@rd | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| defaultExpiration: 2592000 # 默认生命周期30天 | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| alipay: | |||
| open: | |||
| appId: 2021011111616334 | |||
| appPrivateKey: MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBxxxxRRVlypCcgiSkqpSlnmgyCEM7nu8IerV8Yf7dMBitBklTpJB+4URV1bW+q6Ijzo8RsCyjm1Kx+EFiKf1PiJXlT0h1+bF3fYdDr6r5GK0/TtB8O80p774NcRD3HgbzUS8AEe/GcBvhiXbDRgJh7yAngW9vxl9u1o5UcaxOXVLWDrjlQGF6qyXUlycCNIdPXj3LduP3PBK5daVZwJm33Pr7kmSI0agZvV267HaTpSKaiXI7Zwo+nFMqx9g9kpzmYRfOgHx3DWpQUFI646IB8nEpLpQp3/0eDocuqiHXYgEpLpPoFKoVE228v74YSFh3Y4fFGX+qtjAgMBAAECggEAIJK9Y42xtSyHjaNdo7bf3CK3HAyn3pafFjyYFT4SxJyxNEDMay5Z5nVq7IAD/+BehMycOFqtvveVf+1+NO/XzZo1iH9URYVfRazkz+lWXYopVkdACm6gN1ILeymAy9g2q+s918ywyxteP668+ABK+5j5wsk/F7wNwKVvKGn0yMT7DP0FAL1e0KWndZCZlF79VnFpBLscDJq28GqRzqYop4CWqHHTA6DBvIqkfQV4U3IzqnzOsxNLEMBwhnbK08XfYZ3DxCPH0jQdA2Jj/aABrntq2EpWjzW5H9iZqrVo33rmsNHUSQvla/333RkbpwGyNhI6kcPBRq4cVSAa3y7dMQKBgQDVfyDUPWKXVwIJUgO1my8WIUu2p6nhuT7Mfnpk4X7ewdFaRVjb/r0KvhLgoz2/KOwkqtWTlEvNaCDDycpLXk+V5ZH833kYsDEmxY7ikOUjCcrfYJgT7P77//cZ4Kx8a5X45SiKAZT2GQv7BTtIfNhrfTUj6AQx/3MP3sa2QAWeNQKBgQCedWoF7t+qyck2hctqtTFC7fRkEk7RNJVph1ZOeTqOIAKhmhkwaOE3joxQ/VqHDy212YdW4hI0BWUzbEdMy0Idz2G3y9ERVD84hZehf5GGRdiSrY9EEQgHlcI6Qb8/AnDdpy1DlKUMwTYjVNzkDL3AzeWn61JS1XQaOzZBsJy2NwKBgFa+pJQXrOtYytcGn8M2Hlebh6vbS8cPAVkNOqWqiWXw0iMfcg9Q3XZz7C+hpAD7m5b6YnToGDSJTma+opck5qk88agRFJ7XV+Es+/VKcg9edzNzh9bwwFmbksbM5shW3kSWt3X7Vo73dkqzwXaeY0CpSuIf7zRxWkrkdVCvipjRAoGAMcJlPN+6VQNwsDJromKryXy31gT5wzBkCvN44sOm46KhsOWXK2CD+NJGtdgZaXgWvphEq7/qP3PCR9ekvDTH2lyZLwJN8Mcn4zPwXcKVjDi6vbTK3HEMuHUKvQiQadT2ZGRvDl3LRqoVuhqYEvT9UWJWz9hRzblB8ErPyukPDRkCgYB7bMv2iflpaGE1J3gkTlVJB+2QSfnAXaUDMLWsZN4gYjwEBVCEJ+mhWL1/GeEIBjSs5/qZIeRsYzlxGEcnsJzRfog6ITBF14AeZ+xNkHq83ja87OGVKMypiccGwRehijDhJi6tgMJ0u0w6PiqcJvh0SX4jBhDDPjuWzK2XD+lx8A== | |||
| appPublicKeyCertPath: /opt/service/alipay/appCertPublicKey_2021002140616334.crt | |||
| alipayCertPath: /opt/service/alipay/alipayCertPublicKey_RSA2.crt | |||
| alipayRootCertPath: /opt/service/alipay/alipayRootCert.crt | |||
| callback: https://xx.com/api/alipay/notify/callback | |||
| video: | |||
| aliyun: | |||
| accessKeyId: LTAI5tNkUMtFoWH4L7vh7Tzp | |||
| accessKeySecret: 1oXCcfK8paG454VxO6VdsqyRQpgboW | |||
| regionId: cn-beijing | |||
| endPoint: https://oss-cn-beijing.aliyuncs.com | |||
| corePoolSize: 6 | |||
| maxPoolSize: 20 | |||
| queueCapacity: 1000 | |||
| namePrefix: aliyun-video-upload | |||
| fm: | |||
| exception: true | |||
| exception_emails: houtaikaifa@iformall.com | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /root/uploads/ | |||
| ocr_data: /root/ocr_data/ | |||
| videoType: aliyun | |||
| logging: | |||
| level: | |||
| com.iformall: debug | |||
| path: ./logs/c | |||
| suimang: | |||
| oral_broadcasting: x.x.x.x | |||
| video_path: http://111.198.0.15:22266 | |||
| callbackUrl: https://neuver.meta-autotv.com/C/callback/oral/broadcasting | |||
| video_tts: x.x.x.x | |||
| huibo_tts_wav: x.x.x.x | |||
| photo_speak: x.x.x.x | |||
| photo_speak_hy: x.x.x.x | |||
| digital_avatar: x.x.x.x | |||
| digital_avatar_hy: x.x.x.x | |||
| local_deploy: true | |||
| token: x | |||
| sdk: | |||
| sm: | |||
| base-url: https://openapi8.metavatar.cc/public | |||
| @@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumUserAdmin; | |||
| import com.iformall.enums.EnumUserWechat; | |||
| import com.iformall.sm.AiVideoHelper; | |||
| import com.iformall.utils.Constant; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -1,157 +0,0 @@ | |||
| package com.iformall.domain.po.sm; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumPersonType; | |||
| import com.iformall.enums.EnumSpeakType; | |||
| import com.iformall.sm.AiVideoHelper; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @TableName(value = "photo_speak_video") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class PhotoSpeakVideo extends TenantEntity { | |||
| protected Long id; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-创建起始时间",name="startDate") | |||
| private Date startDate; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-创建结束时间",name="endDate") | |||
| private Date endDate; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-生成视频起始时间",name="videoStartDate") | |||
| private Date videoStartDate; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-生成视频结束时间",name="videoEndDate") | |||
| private Date videoEndDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户Id",name="userId") | |||
| private Long userId; | |||
| @io.swagger.annotations.ApiModelProperty(value="照片ID",name="personPhotoId") | |||
| private Long personPhotoId; | |||
| @io.swagger.annotations.ApiModelProperty(value="照片",name="personPhotoUrl") | |||
| private String personPhotoUrl; | |||
| @TableField(exist = false) | |||
| private PersonPhoto personPhoto; | |||
| @io.swagger.annotations.ApiModelProperty(value="字幕开关",name="subtitleEnabled") | |||
| private Integer subtitleEnabled; | |||
| @io.swagger.annotations.ApiModelProperty(value="字幕参数",name="subtitleParams") | |||
| private String subtitleParams; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumVoiceFrom 声音来源",name="voiceFrom") | |||
| private Integer voiceFrom; | |||
| // @TableField(exist = false) | |||
| // private List<Long> voiceMouldIds; | |||
| @io.swagger.annotations.ApiModelProperty(value="声音模板ID",name="voiceMouldId") | |||
| private Long voiceMouldId; | |||
| @TableField(exist = false) | |||
| private String speakTypeStr; | |||
| /** | |||
| * { | |||
| * "title":, | |||
| * "languages":, | |||
| * "sex":, | |||
| * "mouldSmId":, | |||
| * "personId":, | |||
| * "personType":, | |||
| * "personTypeStr":, | |||
| * "speakId":, | |||
| * "speakType":, | |||
| * "speakTypeStr": | |||
| * } | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value="声音模板",name="voiceMouldSm") | |||
| private String voiceMouldSm; | |||
| @TableField(exist = false) | |||
| private VoiceInfo voiceInfo; | |||
| public String getSpeakTypeStr(){ | |||
| if(StringUtils.isBlank(this.speakTypeStr) && StringUtils.isNotBlank(this.voiceMouldSm)){ | |||
| try{ | |||
| JSONObject personMouldObject = JSONObject.parseObject(this.voiceMouldSm); | |||
| Integer speakType = personMouldObject.getInteger("speakType"); | |||
| this.speakTypeStr = EnumSpeakType.getEnum(speakType).getMessage(); | |||
| }catch(Exception e){} | |||
| } | |||
| return speakTypeStr; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value="文案",name="paperwork") | |||
| private String paperwork; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户上传的声音素材",name="voiceMaterialId") | |||
| private Long voiceMaterialId; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户上传的声音素材",name="voiceMaterialUrl") | |||
| private String voiceMaterialUrl; | |||
| @TableField(exist = false) | |||
| private VoiceMaterial voiceMaterial; | |||
| @io.swagger.annotations.ApiModelProperty(value="名称",name="title") | |||
| private String title; | |||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | |||
| private String coverImg; | |||
| @io.swagger.annotations.ApiModelProperty(value="备注",name="remark") | |||
| private String remark; | |||
| @io.swagger.annotations.ApiModelProperty(value="视频文件",name="videoId") | |||
| private String videoId; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="videoPath") | |||
| private String videoPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="播放地址",name="videoPlayUrl") | |||
| private String videoPlayUrl; | |||
| @io.swagger.annotations.ApiModelProperty(value="视频时长(秒)",name="videoTime") | |||
| private String videoTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="视频大小(byte)",name="videoSize") | |||
| private Long videoSize; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumVideoStatus 视频状态",name="videoStatus") | |||
| private Integer videoStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="生成视频信息",name="videoMsg") | |||
| private String videoMsg; | |||
| @io.swagger.annotations.ApiModelProperty(value="生成视频时间",name="createVideoDate") | |||
| private Date createVideoDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| @TableField(exist = false) | |||
| private List<Integer> videoStatuss; | |||
| private String audioPath; | |||
| private Long musicId; | |||
| private String saveDir; | |||
| private Integer videoHyStatus; | |||
| private Integer isHy;//是否超分(1、是,0、否) | |||
| } | |||
| @@ -1,216 +0,0 @@ | |||
| package com.iformall.domain.po.sm; | |||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.common.SortColumn; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumSpeakType; | |||
| import com.iformall.enums.EnumVideoStatus; | |||
| import com.iformall.sm.AiVideoHelper; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import java.math.BigDecimal; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @TableName(value = "user_mould_video") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class UserMouldVideo extends TenantEntity { | |||
| protected Long id; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-创建起始时间",name="startDate") | |||
| private Date startDate; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-创建结束时间",name="endDate") | |||
| private Date endDate; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-生成视频起始时间",name="videoStartDate") | |||
| private Date videoStartDate; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-生成视频结束时间",name="videoEndDate") | |||
| private Date videoEndDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户Id",name="userId") | |||
| private Long userId; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumVideoType",name="videoType") | |||
| private Integer videoType; | |||
| @io.swagger.annotations.ApiModelProperty(value="人物模板ID",name="personMouldId") | |||
| private Long personMouldId; | |||
| /** | |||
| * { | |||
| * "id":, | |||
| * "videoType":, | |||
| * "title":, | |||
| * "mouldSmId":, | |||
| * "material": | |||
| * } | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value="人物模板",name="personMouldSm") | |||
| private String personMouldSm; | |||
| /** | |||
| * { | |||
| * "id":, | |||
| * "type":, | |||
| * "material":, | |||
| * "x":, | |||
| * "y":, | |||
| * "z":, | |||
| * "w":, | |||
| * "h": | |||
| * } | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value="人物模板",name="personJson") | |||
| private String personJson; | |||
| @TableField(exist = false) | |||
| private PersonMould personMould; | |||
| @io.swagger.annotations.ApiModelProperty(value="字幕开关",name="subtitleEnabled") | |||
| private Integer subtitleEnabled; | |||
| @io.swagger.annotations.ApiModelProperty(value="字幕参数",name="subtitleParams") | |||
| private String subtitleParams; | |||
| // @TableField(exist = false) | |||
| // private List<Long> voiceMouldIds; | |||
| @io.swagger.annotations.ApiModelProperty(value="声音模板ID",name="voiceMouldId") | |||
| private Long voiceMouldId; | |||
| /** | |||
| * { | |||
| * "title":, | |||
| * "languages":, | |||
| * "mouldSmId":, | |||
| * "personId":, | |||
| * "personType":, | |||
| * "personTypeStr":, | |||
| * "speakId":, | |||
| * "speakType":, | |||
| * "speakTypeStr": | |||
| * } | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value="声音模板",name="voiceMouldSm") | |||
| private String voiceMouldSm; | |||
| @TableField(exist = false) | |||
| private String speakTypeStr; | |||
| // @TableField(exist = false) | |||
| // private VoiceMould voiceMould; | |||
| @TableField(exist = false) | |||
| private VoiceInfo voiceInfo; | |||
| public String getSpeakTypeStr(){ | |||
| if(StringUtils.isBlank(this.speakTypeStr) && StringUtils.isNotBlank(this.voiceMouldSm)){ | |||
| try{ | |||
| JSONObject personMouldObject = JSONObject.parseObject(this.voiceMouldSm); | |||
| Integer speakType = personMouldObject.getInteger("speakType"); | |||
| this.speakTypeStr = EnumSpeakType.getEnum(speakType).getMessage(); | |||
| }catch(Exception e){} | |||
| } | |||
| return speakTypeStr; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value="文案",name="paperwork") | |||
| private String paperwork; | |||
| /** | |||
| * 后期从表中获取 | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumLanguages",name="languages") | |||
| private Long languages; | |||
| @io.swagger.annotations.ApiModelProperty(value="背景模板ID",name="backgroundId") | |||
| private Long backgroundId; | |||
| /** | |||
| * { | |||
| * "id":, | |||
| * "title":, | |||
| * "material": | |||
| * } | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value="背景模板",name="backgroundSm") | |||
| private String backgroundSm; | |||
| @TableField(exist = false) | |||
| private MaterialMould backgroundMould; | |||
| /** | |||
| * List<Long> | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value="素材",name="materialIds") | |||
| private String materialIds; | |||
| /** | |||
| * [{ | |||
| * "id":, | |||
| * "type":, | |||
| * "material":, | |||
| * "x":, | |||
| * "y":, | |||
| * "z":, | |||
| * "w":, | |||
| * "h": | |||
| * },... | |||
| * ] | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value="素材层级",name="materialAllJson") | |||
| private String materialAllJson; | |||
| @io.swagger.annotations.ApiModelProperty(value="名称",name="title") | |||
| private String title; | |||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | |||
| private String coverImg; | |||
| @io.swagger.annotations.ApiModelProperty(value="备注",name="remark") | |||
| private String remark; | |||
| @io.swagger.annotations.ApiModelProperty(value="视频文件",name="videoId") | |||
| private String videoId; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="videoPath") | |||
| private String videoPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="播放地址",name="videoPlayUrl") | |||
| private String videoPlayUrl; | |||
| @io.swagger.annotations.ApiModelProperty(value="视频时长(秒)",name="videoTime") | |||
| private String videoTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="视频大小(byte)",name="videoSize") | |||
| private Long videoSize; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumVideoStatus 视频状态",name="videoStatus") | |||
| private Integer videoStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="生成视频信息",name="videoMsg") | |||
| private String videoMsg; | |||
| @io.swagger.annotations.ApiModelProperty(value="生成视频时间",name="createVideoDate") | |||
| private Date createVideoDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="消耗金币",name="costPoints") | |||
| private Integer costPoints; | |||
| @io.swagger.annotations.ApiModelProperty(value="消耗金币明细",name="costPointsDetail") | |||
| private String costPointsDetail; | |||
| @io.swagger.annotations.ApiModelProperty(value="isDel",name="isDel") | |||
| private Integer isDel; | |||
| @TableField(exist = false) | |||
| private List<Integer> videoStatuss; | |||
| @TableField(exist = false) | |||
| private String phone; | |||
| @TableField(exist = false) | |||
| private List<Long> cUserIds; | |||
| } | |||
| @@ -1,29 +0,0 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.sm.PhotoSpeakVideo; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| public interface PhotoSpeakVideoMapper extends CommonMapper<PhotoSpeakVideo, Long> { | |||
| List<PhotoSpeakVideo> findList(PhotoSpeakVideo record); | |||
| int deleteById(@Param("id")Long id); | |||
| /** | |||
| * c端列表查询,尽量减少字段 | |||
| * @param record | |||
| * @return | |||
| */ | |||
| List<PhotoSpeakVideo> findCList(PhotoSpeakVideo record); | |||
| PhotoSpeakVideo findVideo(@Param("id")Long id); | |||
| List<PhotoSpeakVideo> getSortList(PhotoSpeakVideo record); | |||
| Integer checkVideoStatus(@Param("userId") Long userId, @Param("list") List<Long> list); | |||
| List<PhotoSpeakVideo> getNotHaveUrl(PhotoSpeakVideo umVideoQ); | |||
| } | |||
| @@ -1,30 +0,0 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.sm.UserMouldVideo; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| public interface UserMouldVideoMapper extends CommonMapper<UserMouldVideo, Long> { | |||
| List<UserMouldVideo> findList(UserMouldVideo record); | |||
| int deleteById(@Param("id")Long id); | |||
| /** | |||
| * c端列表查询,尽量减少字段 | |||
| * @param record | |||
| * @return | |||
| */ | |||
| List<UserMouldVideo> findCList(UserMouldVideo record); | |||
| UserMouldVideo findVideo(@Param("id")Long id); | |||
| List<UserMouldVideo> getSortList(UserMouldVideo record); | |||
| List<UserMouldVideo> getNotHaveUrl(UserMouldVideo record); | |||
| Integer checkVideoStatus(@Param("userId") Long userId, @Param("list") List<Long> list); | |||
| } | |||
| @@ -1,169 +0,0 @@ | |||
| package com.iformall.service.impl; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
| import com.google.common.collect.Lists; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCVideoTable; | |||
| import com.iformall.domain.po.WxCVoiceTable; | |||
| import com.iformall.domain.po.sm.VoiceInfo; | |||
| import com.iformall.domain.vo.VoiceInfoVo; | |||
| import com.iformall.enums.EnumClassType; | |||
| import com.iformall.enums.EnumSpeakType; | |||
| import com.iformall.file.aliyun.bean.AliyunOSSConfig; | |||
| import com.iformall.mapper.VoiceMapper; | |||
| import com.iformall.mapper.WxCVoiceMapper; | |||
| import com.iformall.service.WxCVoiceService; | |||
| import com.iformall.sm.AiPreviewParam; | |||
| import com.iformall.sm.AiPreviewResult; | |||
| import com.iformall.sm.AiTtsHelper; | |||
| import com.iformall.sm.AiVideoHelper; | |||
| import com.iformall.utils.Constant; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.util.ObjectUtils; | |||
| import java.util.*; | |||
| @Service | |||
| public class WxCVoiceServiceImpl implements WxCVoiceService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxCVoiceMapper wxCVoiceMapper; | |||
| @Autowired | |||
| VoiceMapper voiceMapper; | |||
| @Autowired | |||
| private AliyunOSSConfig aliyunOSSConfig; | |||
| private final String demoDirectory = "/builtin/tts_all_sample/"; | |||
| private final String demoSuffix = ".wav"; | |||
| @Override | |||
| public Map<String, Object> getById(Long userId) { | |||
| HashMap<String, Object> data = new HashMap<>(); | |||
| List<WxCVoiceTable> resultList = wxCVoiceMapper.getById(userId); | |||
| data.put("current_time", new Date(System.currentTimeMillis() / 1000)); | |||
| // List audioList = new ArrayList(); | |||
| Map<Long,Map<String, Object>> audioList = new HashMap(); | |||
| for (WxCVoiceTable wxCVoiceTable : resultList) { | |||
| Map<String, Object> audio = audioList.get(wxCVoiceTable.getLanguageId()); | |||
| if(audio == null){ | |||
| audio = new HashMap<>(); | |||
| audio.put("LocaleName", wxCVoiceTable.getLocalelName()); | |||
| audio.put("displayname", wxCVoiceTable.getLocalDisPlayName()); | |||
| audio.put("TrialText", wxCVoiceTable.getTrialText()); | |||
| audioList.put(wxCVoiceTable.getLanguageId(),audio); | |||
| } | |||
| List<Map<String, Object>> voiceList = (List<Map<String, Object>>) audio.get("voiceList"); | |||
| if(voiceList == null){ | |||
| voiceList = new ArrayList<>(); | |||
| } | |||
| HashMap<String, Object> voice = new HashMap<>(); | |||
| voiceList.add(voice); | |||
| audio.put("voiceList", voiceList); | |||
| voice.put("voiceid", wxCVoiceTable.getVoiceId()); | |||
| voice.put("expire_time", wxCVoiceTable.getExpireTime().getTime() / 1000); | |||
| voice.put("voicename", wxCVoiceTable.getVoiceName()); | |||
| voice.put("voicetype", EnumClassType.SHARE.getCode()); | |||
| voice.put("displayname", wxCVoiceTable.getVoiceDisplayName()); | |||
| voice.put("gender", wxCVoiceTable.getGender()); | |||
| List styleList = new ArrayList(); | |||
| if(StringUtils.isBlank(wxCVoiceTable.getStyleList())){ | |||
| HashMap<String, Object> style = new HashMap<>(); | |||
| style.put("stylename", "default"); | |||
| style.put("displayname", EnumSpeakType.getEnum("default").getMessage()); | |||
| style.put("styledemo", aliyunOSSConfig.getFiledomain() + demoDirectory + wxCVoiceTable.getMouldSmId() + "_" + "default" + demoSuffix); | |||
| styleList.add(style); | |||
| voice.put("styleList", styleList); | |||
| }else{ | |||
| HashMap<String, Object> style = new HashMap<>(); | |||
| style.put("stylename", "default"); | |||
| style.put("displayname", EnumSpeakType.getEnum("default").getMessage()); | |||
| style.put("styledemo", aliyunOSSConfig.getFiledomain() + demoDirectory + wxCVoiceTable.getMouldSmId() + "_" + "default" + demoSuffix); | |||
| styleList.add(style); | |||
| List<String> strings = JSON.parseArray(wxCVoiceTable.getStyleList(), String.class); | |||
| for (String y : strings) { | |||
| style = new HashMap<>(); | |||
| style.put("stylename", y); | |||
| style.put("displayname", EnumSpeakType.getEnum(y).getMessage()); | |||
| style.put("styledemo", aliyunOSSConfig.getFiledomain() + demoDirectory + wxCVoiceTable.getMouldSmId() + "_" + y + demoSuffix); | |||
| styleList.add(style); | |||
| } | |||
| voice.put("styleList", styleList); | |||
| } | |||
| } | |||
| data.put("audioList", new ArrayList<>(audioList.values())); | |||
| return data; | |||
| } | |||
| @Override | |||
| public List<VoiceInfo> chooseType(Long id) { | |||
| List<VoiceInfo> voiceInfos = voiceMapper.selectList( | |||
| new LambdaQueryWrapper<VoiceInfo>().eq(VoiceInfo::getLanguageId, id).orderByAsc(VoiceInfo::getAgeType).orderByAsc(VoiceInfo::getDisplayName)); | |||
| voiceInfos.forEach(x -> { | |||
| if (StringUtils.isNotEmpty(x.getStyleList())) { | |||
| List<String> strings = JSON.parseArray(x.getStyleList(), String.class); | |||
| List<VoiceInfoVo> list = new ArrayList<>(); | |||
| strings.forEach(y -> { | |||
| VoiceInfoVo infoVo = new VoiceInfoVo(); | |||
| infoVo.setName(EnumSpeakType.getEnum(y).getMessage()); | |||
| infoVo.setEngName(y); | |||
| infoVo.setUrl(aliyunOSSConfig.getFiledomain() + demoDirectory + x.getMouldSmId() + "_" + y + demoSuffix); | |||
| list.add(infoVo); | |||
| }); | |||
| VoiceInfoVo infoVo = new VoiceInfoVo(); | |||
| infoVo.setName(EnumSpeakType.getEnum(0).getMessage()); | |||
| infoVo.setUrl(aliyunOSSConfig.getFiledomain() + demoDirectory + x.getMouldSmId() + "_" + "default" + demoSuffix); | |||
| infoVo.setEngName("default"); | |||
| list.add(infoVo); | |||
| x.setStyle(list); | |||
| } else { | |||
| List<VoiceInfoVo> list = Lists.newArrayList(); | |||
| VoiceInfoVo infoVo = new VoiceInfoVo(); | |||
| infoVo.setName(EnumSpeakType.getEnum(0).getMessage()); | |||
| infoVo.setEngName("default"); | |||
| infoVo.setUrl(aliyunOSSConfig.getFiledomain() + demoDirectory + x.getMouldSmId() + "_" + "default" + demoSuffix); | |||
| list.add(infoVo); | |||
| x.setStyle(list); | |||
| } | |||
| }); | |||
| return voiceInfos; | |||
| } | |||
| @Override | |||
| public Map<String, Object> voicePreview(Long voiceId, String voiceStyle, String text, Integer speed) { | |||
| VoiceInfo voiceInfo = voiceMapper.selectById(voiceId); | |||
| if(voiceInfo == null){ | |||
| logger.error("未查询到声音{}"+voiceId); | |||
| return null; | |||
| } | |||
| AiPreviewParam param = new AiPreviewParam(); | |||
| param.setVoice_id(voiceInfo.getMouldSmId()); | |||
| param.setVoice_style(StringUtils.isBlank(voiceStyle) ? EnumSpeakType.default_0.getMessage() : voiceStyle); | |||
| param.setGen_txt(text.replaceAll(Constant.text_pause, "[*]")); | |||
| param.setSpeed(speed==null?100:speed); | |||
| AiPreviewResult aiTtsResult = AiTtsHelper.voicePreview(param); | |||
| if(!aiTtsResult.isSuccess()){ | |||
| logger.error("tts 预览失败{}"+aiTtsResult.getMsg()); | |||
| return null; | |||
| } | |||
| Map<String, Object> data = new HashMap<>(); | |||
| data.put("ttsurl", aiTtsResult.getUrl()); | |||
| return data; | |||
| } | |||
| } | |||
| @@ -1,394 +0,0 @@ | |||
| package com.iformall.sm; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.douyin.pay.orderQuery.OrderQueryResult; | |||
| import com.iformall.douyin.pay.orderQuery.QueryMerchantResult; | |||
| import com.iformall.douyin.pay.orderQuery.QueryRefundResult; | |||
| import com.iformall.douyin.pay.orderQuery.QuerySettleResult; | |||
| import com.iformall.douyin.pay.preOrder.*; | |||
| import com.iformall.enums.EnumMouldPatchType; | |||
| import com.iformall.enums.EnumPayStatus; | |||
| import com.iformall.enums.EnumVideoType; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.utils.Base64Util; | |||
| import com.iformall.utils.HttpUtil; | |||
| import com.iformall.utils.sign.SignUtils; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.springframework.beans.factory.annotation.Value; | |||
| import org.springframework.stereotype.Component; | |||
| import sun.net.www.content.audio.wav; | |||
| import java.nio.charset.StandardCharsets; | |||
| import java.security.MessageDigest; | |||
| import java.security.NoSuchAlgorithmException; | |||
| import java.util.*; | |||
| @Slf4j | |||
| @Component | |||
| public class AiVideoHelper { | |||
| public static String oral_broadcasting; | |||
| @Value("${suimang.oral_broadcasting}") | |||
| public void setOralBroadcasting(String oral_broadcasting){ | |||
| this.oral_broadcasting = oral_broadcasting; | |||
| } | |||
| public static String video_path; | |||
| @Value("${suimang.video_path}") | |||
| public void setVideoPath(String video_path){ | |||
| this.video_path = video_path; | |||
| } | |||
| public static String video_tts; | |||
| @Value("${suimang.video_tts}") | |||
| public void setVideoTts(String video_tts) { | |||
| this.video_tts = video_tts; | |||
| } | |||
| public static String photo_speak; | |||
| @Value("${suimang.photo_speak}") | |||
| public void setPhotoSpeak(String photo_speak){ | |||
| this.photo_speak = photo_speak; | |||
| } | |||
| public static String photo_speak_hy; | |||
| @Value("${suimang.photo_speak_hy}") | |||
| public void setPhotoSpeakHy(String photo_speak_hy){ | |||
| this.photo_speak_hy = photo_speak_hy; | |||
| } | |||
| public static String callbackUrl; | |||
| @Value("${suimang.callbackUrl}") | |||
| public void setCallbackUrl(String callbackUrl){ | |||
| this.callbackUrl = callbackUrl; | |||
| } | |||
| public static boolean localDeploy;//是否是私有化部署 | |||
| @Value("${suimang.local_deploy}") | |||
| public void setLocalDeploy(boolean localDeploy) { | |||
| this.localDeploy = localDeploy; | |||
| } | |||
| public static String token;//跟遂芒唯一验证 | |||
| @Value("${suimang.token}") | |||
| public void setToken(String token) { | |||
| this.token = token; | |||
| } | |||
| public static String doPost(String url, String params) { | |||
| return HttpUtil.doAiVideoPost(url,params); | |||
| } | |||
| //慧影生成视频 | |||
| public static AiVideoResult createVideo(AiVideoParam videoParam) { | |||
| // videoParam.setTask_id(taskId); | |||
| if (StringUtils.isNotBlank(videoParam.getCallback_url())) { | |||
| videoParam.setCallback_url(videoParam.getCallback_url()); | |||
| } else { | |||
| videoParam.setCallback_url(callbackUrl + "/callback/oral/broadcasting"); | |||
| } | |||
| videoParam.setToken(token); | |||
| log.info("生成视频start request:" + videoParam.toSimpelJson()); | |||
| String response = doPost(oral_broadcasting+"/gen_dh_video", JSONObject.toJSONString(videoParam)); | |||
| log.info("生成视频end response:"+response); | |||
| AiVideoResult result = new AiVideoResult(); | |||
| if(StringUtils.isBlank(response)){ | |||
| result.setSuccess(false); | |||
| result.setMsg("请求生成视频异常,请稍后重试"); | |||
| return result; | |||
| } | |||
| JSONObject jsonObject = JSON.parseObject(response); | |||
| JSONObject status = jsonObject.getJSONObject("status"); | |||
| Integer code = status.getInteger("code"); | |||
| if(code == null){ | |||
| result.setSuccess(false); | |||
| result.setMsg("请求生成视频异常,请稍后重试"); | |||
| return result; | |||
| } | |||
| if(code.intValue() == 1000){ | |||
| JSONObject data = jsonObject.getJSONObject("data"); | |||
| JSONObject video = data.getJSONObject("video"); | |||
| result.setSuccess(true); | |||
| result.setMsg("success"); | |||
| result.setDuration(video.getFloatValue("duration")); | |||
| result.setUrl(video.getString("url")); | |||
| }else{ | |||
| result.setSuccess(false); | |||
| result.setMsg(status.getString("msg")); | |||
| } | |||
| return result; | |||
| // Integer code = jsonObject.getInteger("err_no"); | |||
| // if (null != code && code.intValue() == 0 ) { | |||
| // CreatePreOrderResult result = new CreatePreOrderResult(); | |||
| // result.setSuccess(true); | |||
| // result.setOutOrderNo(preOrder.getOutOrderNo()); | |||
| // JSONObject data = jsonObject.getJSONObject("data"); | |||
| // if (null != data ) { | |||
| // result.setOrderId(data.getString("order_id")); | |||
| // result.setToken(data.getString("order_token")); | |||
| // }else { | |||
| // log.error("createPreOrder reponse empity. request: "+JSON.toJSONString(preOrder.toRequestMap())+" response:"+response); | |||
| // result.setSuccess(false); | |||
| // result.setMsg("createPreOrder reponse empity."+response); | |||
| // } | |||
| // return result; | |||
| // }else { | |||
| // log.error("createPreOrder reponse error. request: "+JSON.toJSONString(preOrder.toRequestMap())+" response:"+response); | |||
| // CreatePreOrderResult result = new CreatePreOrderResult(); | |||
| // result.setSuccess(false); | |||
| // result.setMsg("createPreOrder reponse error."+response); | |||
| // return result; | |||
| // } | |||
| } | |||
| //慧语(照片说话)图片质量检查 | |||
| public static AiCheckPhotoResult checkPhoto(AiCheckPhotoParam param) { | |||
| // String response = doPost("http://111.198.0.15:22299" + "/image_qualit", JSONObject.toJSONString(param)); | |||
| param.setToken(token); | |||
| String response = doPost(photo_speak + "/image_qualit", JSONObject.toJSONString(param)); | |||
| log.info("图片质量审核 end response:" + response); | |||
| AiCheckPhotoResult result = new AiCheckPhotoResult(); | |||
| if (StringUtils.isBlank(response)) { | |||
| result.setSuccess(false); | |||
| result.setMsg("(MetaService)图片质量审核失败,请稍后重试"); | |||
| return result; | |||
| } | |||
| JSONObject jsonObject = JSON.parseObject(response); | |||
| JSONObject status = jsonObject.getJSONObject("status"); | |||
| Integer code = status.getInteger("code"); | |||
| String msg = status.getString("msg"); | |||
| if (code == null) { | |||
| result.setSuccess(false); | |||
| result.setMsg("(MetaService)请求图片质量检查失败,请稍后重试"); | |||
| return result; | |||
| } | |||
| if (code.intValue() == 2000) { | |||
| result.setCode(code); | |||
| result.setSuccess(true); | |||
| String resultMsg = result.getMsgInfo(code, msg); | |||
| result.setMsg(resultMsg); | |||
| } else { | |||
| result.setCode(code); | |||
| result.setSuccess(false); | |||
| String resultMsg = result.getMsgInfo(code, msg); | |||
| result.setMsg(resultMsg); | |||
| } | |||
| return result; | |||
| } | |||
| //慧语(照片说话)+慧影 预览 | |||
| public static AiPreviewResult voicePreview(AiPreviewParam param) { | |||
| param.setToken(token); | |||
| log.info("TTS音色预览 start request:" + JSONObject.toJSONString(param)); | |||
| String response = doPost(video_tts + "/tts_wav", JSONObject.toJSONString(param)); | |||
| log.info("TTS音色预览 end response:" + response); | |||
| AiPreviewResult result = new AiPreviewResult(); | |||
| if (StringUtils.isBlank(response)) { | |||
| result.setSuccess(false); | |||
| result.setMsg("(MetaService) no result"); | |||
| return result; | |||
| } | |||
| JSONObject jsonObject = JSON.parseObject(response); | |||
| JSONObject status = jsonObject.getJSONObject("status"); | |||
| JSONObject data = jsonObject.getJSONObject("data"); | |||
| String strURL = null; | |||
| String time = null; | |||
| if (data != null){ | |||
| strURL = data.getString("url"); | |||
| time = data.getString("time"); | |||
| } | |||
| Integer code = status.getInteger("code"); | |||
| String msg = status.getString("msg"); | |||
| if (code == null) { | |||
| result.setSuccess(false); | |||
| result.setMsg("(MetaService) error,"+msg); | |||
| return result; | |||
| } | |||
| if (code.intValue() == 3000) { | |||
| result.setCode(200); | |||
| result.setSuccess(true); | |||
| result.setUrl(video_tts + strURL); | |||
| result.setTime(Double.valueOf(time)); | |||
| result.setMsg("(MetaService) error,"+msg); | |||
| } else { | |||
| result.setCode(code); | |||
| result.setSuccess(false); | |||
| result.setMsg("(MetaService) error,"+msg); | |||
| } | |||
| return result; | |||
| } | |||
| //慧语(照片说话)生成 | |||
| public static AiPhotoSpeakResult createPhotoSpeakVideo(AiPhotoSpeakParam videoParam,Long taskId) { | |||
| videoParam.setTask_id(taskId); | |||
| videoParam.setCallback_url(callbackUrl + "/callback/photo/speak"); | |||
| log.info("生成视频start request:" + videoParam.neglectImgString()); | |||
| String response = doPost(photo_speak + "/img_talking", JSONObject.toJSONString(videoParam)); | |||
| log.info("生成视频end response:" + response); | |||
| AiPhotoSpeakResult result = new AiPhotoSpeakResult(); | |||
| if (StringUtils.isBlank(response)) { | |||
| result.setSuccess(false); | |||
| result.setMsg("(MetaService) not result"); | |||
| return result; | |||
| } | |||
| JSONObject jsonObject = JSON.parseObject(response); | |||
| JSONObject status = jsonObject.getJSONObject("status"); | |||
| Integer code = status.getInteger("code"); | |||
| String msg = status.getString("msg"); | |||
| if (code == null) { | |||
| result.setSuccess(false); | |||
| result.setMsg("(MetaService) error."+msg); | |||
| return result; | |||
| } | |||
| if (code.intValue() == 4000) { | |||
| JSONObject data = jsonObject.getJSONObject("data"); | |||
| String videoUrl = data.getString("url"); | |||
| String saveDir = data.getString("save_dir"); | |||
| String audioPath = data.getString("audio_path"); | |||
| result.setSuccess(true); | |||
| result.setUrl(videoUrl); | |||
| result.setSaveDir(saveDir); | |||
| result.setCode(code); | |||
| result.setAudioPath(audioPath); | |||
| result.setMsg("(MetaService) error."+msg); | |||
| } else { | |||
| result.setSuccess(false); | |||
| result.setCode(code); | |||
| result.setMsg("(MetaService) error."+msg); | |||
| } | |||
| return result; | |||
| } | |||
| //慧语(照片说话)超分生成 | |||
| public static AiVideoHqResult videoHq(AiVideoHqParam param,Long taskId) { | |||
| param.setTask_id(taskId); | |||
| param.setCallback_url(callbackUrl + "/callback/photo/speak"); | |||
| String response = doPost(photo_speak_hy + "/video_hq", JSONObject.toJSONString(param)); | |||
| log.info("视频超分 end response:" + response); | |||
| AiVideoHqResult result = new AiVideoHqResult(); | |||
| if (StringUtils.isBlank(response)) { | |||
| result.setSuccess(false); | |||
| result.setMsg("(MetaService)视频超分失败,请稍后重试"); | |||
| return result; | |||
| } | |||
| JSONObject jsonObject = JSON.parseObject(response); | |||
| JSONObject status = jsonObject.getJSONObject("status"); | |||
| JSONObject data = jsonObject.getJSONObject("data"); | |||
| String strURL = null; | |||
| if (data != null){ | |||
| strURL = data.getString("url"); | |||
| } | |||
| Integer code = status.getInteger("code"); | |||
| String msg = status.getString("msg"); | |||
| if (code == null) { | |||
| result.setSuccess(false); | |||
| result.setMsg("(MetaService)视频超分异常,请稍后重试"); | |||
| return result; | |||
| } | |||
| if (code.intValue() == 5000) { | |||
| result.setCode(200); | |||
| result.setSuccess(true); | |||
| result.setUrl(strURL); | |||
| String resultMsg = result.getMsgInfo(code, msg); | |||
| result.setMsg(resultMsg); | |||
| } else { | |||
| result.setCode(code); | |||
| result.setSuccess(false); | |||
| String resultMsg = result.getMsgInfo(code, msg); | |||
| result.setMsg(resultMsg); | |||
| } | |||
| return result; | |||
| } | |||
| public static void main(String[] args) { | |||
| // AiVideoParam videoParam = new AiVideoParam(); | |||
| // videoParam.setGen_txt("我写了一篇小说,你帮我看看。"); | |||
| // videoParam.setVideo_template_id("16776650495633934_PgNAW8Sm"); | |||
| // videoParam.setVoice_id("zh-CN-XiaohanNeural"); | |||
| // videoParam.setVoice_style("default"); | |||
| // AiVideoParam.VideoFiles videoFiles = new AiVideoParam.VideoFiles(); | |||
| // AiVideoParam.BackGround backGround = new AiVideoParam.BackGround(); | |||
| // backGround.setType("vertical"); | |||
| // backGround.setImage(Base64Util.imageUrlToBase64("https://suimang.oss-accelerate.aliyuncs.com/builtin/background/grace/1080.jpg")); | |||
| // videoFiles.setBack_ground(backGround); | |||
| // AiVideoParam.Material digitalHuman = new AiVideoParam.Material(); | |||
| // int[] digitalHumanCoord = new int[]{0,0}; | |||
| // digitalHuman.setCoord(digitalHumanCoord); | |||
| // digitalHuman.setLevel(0); | |||
| // digitalHuman.setRatio(1.0f); | |||
| // videoFiles.setDigital_human(digitalHuman); | |||
| // videoParam.setVideo_files(videoFiles); | |||
| // | |||
| // AiVideoResult video = AiVideoHelper.createVideo(videoParam); | |||
| // | |||
| // AiPhotoSpeakParam param = new AiPhotoSpeakParam(); | |||
| // param.setGen_txt("道可道,非常道。名可名,非常名。无名天地之始;有名万物之母。故常无欲,以观其妙;常有欲,以观其徼。此两者,同出而异名,同谓之玄。玄之又玄,众妙之门"); | |||
| // param.setImg(Base64Util.imageUrlToBase64("https://suimang.oss-accelerate.aliyuncs.com/builtin/personphoto/165640997370212321.png")); | |||
| // param.setGender("female"); | |||
| // param.setVoice_id("zh-CN-XiaoqiuNeural"); | |||
| // param.setCallback_url("https://phototest.metavatar.cc/C/callback/photo/speak"); | |||
| // param.setTask_id(837169827124269056L); | |||
| // param.setVoice_style("default"); | |||
| // param.setUrl("None"); | |||
| // AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param); | |||
| // AiPhotoSpeakParam param = new AiPhotoSpeakParam(); | |||
| // param.setCallback_url("https://phototest.metavatar.cc/C/callback/photo/speak"); | |||
| // param.setTask_id(836805079248850944L); | |||
| // param.setGen_txt("None"); | |||
| // param.setImg(Base64Util.imageUrlToBase64("https://suimang.oss-accelerate.aliyuncs.com/capi/2023-06-07/6da595fe12ef405bb6434f31e6bad4ec.png")); | |||
| // param.setGender("None"); | |||
| // param.setVoice_id("default"); | |||
| // param.setVoice_style("default"); | |||
| // param.setUrl("https://video.metavatar.cc/sv/262b03bd-18929af12fd/262b03bd-18929af12fd.mp3"); | |||
| // AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param); | |||
| AiCheckPhotoParam param = new AiCheckPhotoParam(); | |||
| String img = Base64Util.imageUrlToBase64("https://suimang.oss-accelerate.aliyuncs.com/builtin/personmould/16760216806604820_cSHoijDX_grace_1080.jpg"); | |||
| param.setImg(img); | |||
| AiCheckPhotoResult result = AiVideoHelper.checkPhoto(param); | |||
| System.out.println(result); | |||
| // | |||
| // AiPreviewParam param = new AiPreviewParam(); | |||
| // param.setGen_txt("今天是个好日子"); | |||
| // param.setVoice_id("ar-DZ-AminaNeural"); | |||
| // param.setVoice_style("default"); | |||
| // param.setGender("female"); | |||
| // AiPreviewResult result = AiVideoHelper.voicePreview(param); | |||
| // System.out.println(result); | |||
| // AiVideoHqParam param = new AiVideoHqParam(); | |||
| // param.setSave_dir("static/tts/2023-07-07/16886958135060428.wav.mp4"); | |||
| // param.setAudio_path("static/tts/2023-07-07/16886958135060428.wav"); | |||
| // param.setCallback_url("https://phototest.metavatar.cc/C/callback/photo/speak"); | |||
| // param.setTask_id(836541377936281600L); | |||
| // AiVideoHqResult result = AiVideoHelper.videoHq(param); | |||
| // System.out.println(result); | |||
| } | |||
| } | |||
| @@ -1,23 +0,0 @@ | |||
| package com.iformall.smsdk; | |||
| import com.iformall.domain.po.sm.UserMouldVideo; | |||
| import com.iformall.sm.AiVideoParam; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import lombok.Data; | |||
| @ApiModel(value = "生成视频请求参数") | |||
| @Data | |||
| public class SmGenerateVideoDTO { | |||
| @ApiModelProperty(value = "类型") | |||
| private Integer type; | |||
| @ApiModelProperty(value = "生成视频参数") | |||
| private AiVideoParam aiVideoParam; | |||
| public static SmGenerateVideoDTO build(AiVideoParam aiVideoParam, Integer type) { | |||
| SmGenerateVideoDTO dto = new SmGenerateVideoDTO(); | |||
| dto.setType(type); | |||
| dto.setAiVideoParam(aiVideoParam); | |||
| return dto; | |||
| } | |||
| } | |||
| @@ -0,0 +1,65 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | |||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
| <parent> | |||
| <artifactId>yqzj</artifactId> | |||
| <groupId>com.iformall</groupId> | |||
| <version>1.0</version> | |||
| </parent> | |||
| <modelVersion>4.0.0</modelVersion> | |||
| <artifactId>yqzjVideo</artifactId> | |||
| <repositories> | |||
| <repository> | |||
| <id>sonatype-nexus-staging</id> | |||
| <name>Sonatype Nexus Staging</name> | |||
| <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> | |||
| <releases> | |||
| <enabled>true</enabled> | |||
| </releases> | |||
| <snapshots> | |||
| <enabled>true</enabled> | |||
| </snapshots> | |||
| </repository> | |||
| </repositories> | |||
| <dependencies> | |||
| <dependency> | |||
| <groupId>com.aliyun</groupId> | |||
| <artifactId>aliyun-java-sdk-core</artifactId> | |||
| <version>4.5.1</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.aliyun</groupId> | |||
| <artifactId>aliyun-java-sdk-vod</artifactId> | |||
| <version>2.15.11</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.alibaba</groupId> | |||
| <artifactId>fastjson</artifactId> | |||
| <version>1.2.62</version> | |||
| </dependency> | |||
| <!-- <dependency>--> | |||
| <!-- <groupId>com.optimaize.languagedetector</groupId>--> | |||
| <!-- <artifactId>language-detector</artifactId>--> | |||
| <!-- <version>0.6</version>--> | |||
| <!-- </dependency>--> | |||
| <!-- https://mvnrepository.com/artifact/com.cybozu.labs/langdetect --> | |||
| <dependency> | |||
| <groupId>com.cybozu.labs</groupId> | |||
| <artifactId>langdetect</artifactId> | |||
| <version>1.1-20120112</version> | |||
| </dependency> | |||
| <!-- https://mvnrepository.com/artifact/net.arnx/jsonic --> | |||
| <dependency> | |||
| <groupId>net.arnx</groupId> | |||
| <artifactId>jsonic</artifactId> | |||
| <version>1.3.10</version> | |||
| </dependency> | |||
| </dependencies> | |||
| </project> | |||
| @@ -0,0 +1,52 @@ | |||
| package com.iformall.constant; | |||
| /** | |||
| * 地区语言列表(具体到地区语言) | |||
| * 主要用来做默认语言常量 | |||
| * | |||
| * @author xmzhao71 | |||
| * @date 2023-10-13 | |||
| */ | |||
| public enum LanguageEnums { | |||
| en_US("en", "US", "en-US", "英语(美国)"), | |||
| zh_CN("zh", "CN", "zh-CN", "中文(普通话,简体)"), | |||
| ; | |||
| LanguageEnums(String language, String country, String local, String desc) { | |||
| this.language = language; | |||
| this.country = country; | |||
| this.local = local; | |||
| this.desc = desc; | |||
| } | |||
| private String language; | |||
| private String country; | |||
| private String local; | |||
| private String desc; | |||
| public String getLanguage() { | |||
| return language; | |||
| } | |||
| public String getCountry() { | |||
| return country; | |||
| } | |||
| public String getLocal() { | |||
| return local; | |||
| } | |||
| public String getDesc() { | |||
| return desc; | |||
| } | |||
| public static LanguageEnums getEnum(String language) { | |||
| for (LanguageEnums value : values()) { | |||
| if (value.getLanguage().equals(language)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -0,0 +1,114 @@ | |||
| package com.iformall.language; | |||
| import com.cybozu.labs.langdetect.Detector; | |||
| import com.cybozu.labs.langdetect.DetectorFactory; | |||
| import com.cybozu.labs.langdetect.LangDetectException; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.commons.io.IOUtils; | |||
| import org.springframework.core.io.Resource; | |||
| import org.springframework.core.io.support.PathMatchingResourcePatternResolver; | |||
| import java.io.IOException; | |||
| import java.io.InputStream; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| @Slf4j | |||
| public class LanguageDetect { | |||
| private static Detector initDetector() { | |||
| try { | |||
| List<String> profile = new ArrayList<>(); | |||
| try { | |||
| PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); | |||
| Resource[] resources = resolver.getResources("classpath:profiles/*"); | |||
| for (Resource resource : resources) { | |||
| InputStream inputStream = resource.getInputStream(); | |||
| String str = new String(IOUtils.toByteArray(inputStream)); | |||
| profile.add(str); | |||
| } | |||
| } catch (IOException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| if (!profile.isEmpty()) { | |||
| DetectorFactory.clear(); | |||
| DetectorFactory.loadProfile(profile); | |||
| return DetectorFactory.create(); | |||
| } | |||
| } catch (LangDetectException e) { | |||
| e.printStackTrace(); | |||
| log.error("语言检测初始化错误。" + e.getMessage()); | |||
| } | |||
| return null; | |||
| } | |||
| public static String detect(String str) { | |||
| Detector detector = initDetector(); | |||
| if (detector == null) { | |||
| return null; | |||
| } | |||
| detector.append(str); | |||
| try { | |||
| String language = detector.detect(); | |||
| log.info("语种识别(" + str + ")-----" + language); | |||
| return language; | |||
| } catch (LangDetectException e) { | |||
| log.error("语言检测错误", e); | |||
| } | |||
| return null; | |||
| } | |||
| private static void test() { | |||
| // 测试用方法 | |||
| PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); | |||
| Resource[] resources = new Resource[0]; | |||
| try { | |||
| resources = resolver.getResources("classpath:profiles/*"); | |||
| } catch (IOException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| for (Resource resource : resources) { | |||
| System.out.println(resource.getFilename()); | |||
| try { | |||
| byte[] bytes = new byte[0]; | |||
| bytes = new byte[resource.getInputStream().available()]; | |||
| resource.getInputStream().read(bytes); | |||
| String str = new String(bytes); | |||
| System.out.println(str); | |||
| } catch (IOException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| } | |||
| System.out.println(detect("科技公司")); | |||
| System.out.println(detect("科技公司有哪几家做的还不错呢,其中就有我们这一家")); | |||
| System.out.println(detect("中国科技还行吧")); | |||
| System.out.println(detect("中国")); | |||
| System.out.println(detect("梦想")); | |||
| System.out.println(detect("I am a teacher")); | |||
| System.out.println(detect("I am a 老师")); | |||
| System.out.println(detect("行人從非機動車道變換車道到機動車道,激動的叫起來了")); | |||
| System.out.println(detect("おはよう")); | |||
| System.out.println("======================================="); | |||
| String regex = ".*[\u4e00-\u9fa5]+.*"; | |||
| // String regex2 = "\b.*[a-zA-Z]+.*\b"; | |||
| String regex3 = ".*-.*"; | |||
| System.out.println("I am a 老师".matches(regex)); | |||
| System.out.println("I am a teacher".matches(regex)); | |||
| System.out.println("I am a 我們".matches(regex)); | |||
| System.out.println("行人從非機動車道變換車道到機動車道,激動的叫起來了".matches(regex)); | |||
| System.out.println("======================================="); | |||
| // System.out.println("I am a 老师".matches(regex2)); | |||
| // System.out.println("I am a teacher".matches(regex2)); | |||
| // System.out.println("abcdefg".matches(regex2)); | |||
| // System.out.println("abc d e fg".matches(regex2)); | |||
| System.out.println("======================================="); | |||
| System.out.println("abc".matches(regex3)); | |||
| System.out.println("a-bc".matches(regex3)); | |||
| } | |||
| } | |||
| @@ -0,0 +1,60 @@ | |||
| //package com.iformall.language; | |||
| // | |||
| //import com.google.common.base.Optional; | |||
| //import com.optimaize.langdetect.LanguageDetector; | |||
| //import com.optimaize.langdetect.LanguageDetectorBuilder; | |||
| //import com.optimaize.langdetect.i18n.LdLocale; | |||
| //import com.optimaize.langdetect.ngram.NgramExtractors; | |||
| //import com.optimaize.langdetect.profiles.LanguageProfile; | |||
| //import com.optimaize.langdetect.profiles.LanguageProfileReader; | |||
| //import com.optimaize.langdetect.text.CommonTextObjectFactories; | |||
| //import com.optimaize.langdetect.text.TextObject; | |||
| //import com.optimaize.langdetect.text.TextObjectFactory; | |||
| //import lombok.extern.slf4j.Slf4j; | |||
| // | |||
| //import java.io.IOException; | |||
| //import java.util.List; | |||
| // | |||
| //@Slf4j | |||
| //public class LanguageExcutor { | |||
| // | |||
| // private static LanguageDetector languageDetector = null; | |||
| // | |||
| // private static void initLanguageDetector(){ | |||
| // List<LanguageProfile> languageProfiles = null; | |||
| // try { | |||
| // //加载所有内置语种 | |||
| // languageProfiles = new LanguageProfileReader().readAllBuiltIn(); | |||
| // // 创建识别器 | |||
| // languageDetector = LanguageDetectorBuilder.create(NgramExtractors.standard()).withProfiles(languageProfiles).build(); | |||
| // } catch (IOException e) { | |||
| // e.printStackTrace(); | |||
| // } | |||
| // } | |||
| // | |||
| // public static String detect(String str){ | |||
| // if(languageDetector == null){ | |||
| // initLanguageDetector(); | |||
| // } | |||
| // if(languageDetector == null){ | |||
| // return null; | |||
| // } | |||
| // // 创建文本对象工厂 | |||
| // TextObjectFactory textObjectFactory = CommonTextObjectFactories.forDetectingOnLargeText(); | |||
| // TextObject textObject = textObjectFactory.forText(str); | |||
| // Optional<LdLocale> lang = languageDetector.detect(textObject); | |||
| // if (!lang.isPresent()) { | |||
| // log.error("语种识别失败,可能文本太短或混合了多国语言"); | |||
| // } | |||
| // return lang.get().toString(); | |||
| // } | |||
| // | |||
| // | |||
| // | |||
| // public static void main(String[] args) { | |||
| // | |||
| // String res = detect("how old are you,think you"); | |||
| // | |||
| // System.out.println(res); | |||
| // } | |||
| //} | |||
| @@ -0,0 +1,45 @@ | |||
| package com.iformall.util; | |||
| import com.iformall.constant.LanguageEnums; | |||
| import java.util.regex.Matcher; | |||
| import java.util.regex.Pattern; | |||
| /** | |||
| * 语种检测类 | |||
| * | |||
| * @author xmzhao71 | |||
| * @date 2023-10-13 | |||
| */ | |||
| public class DetectUtils { | |||
| /** | |||
| * 检测语言是否包含指定语种 | |||
| * | |||
| * @param text 文案 | |||
| * @return {@link String} 指定地区语种 | |||
| */ | |||
| public static String detectLanguage(String text) { | |||
| String zhCNRegex = ".*[\u4e00-\u9fa5]+.*"; | |||
| if (text.matches(zhCNRegex)) { | |||
| return LanguageEnums.zh_CN.getLocal(); | |||
| } | |||
| return null; | |||
| } | |||
| /** | |||
| * 获取地区语言 | |||
| * | |||
| * @param detectLanguage 检测语言 | |||
| * @return {@link String} 指定地区语言 | |||
| */ | |||
| public static String getLocalLanguage(String detectLanguage) { | |||
| if (detectLanguage == null) { | |||
| return null; | |||
| } | |||
| if (detectLanguage.equalsIgnoreCase(LanguageEnums.en_US.getLanguage())) { | |||
| return LanguageEnums.en_US.getLocal(); | |||
| } | |||
| return detectLanguage; | |||
| } | |||
| } | |||
| @@ -0,0 +1,33 @@ | |||
| package com.iformall.video; | |||
| import java.io.InputStream; | |||
| import com.iformall.video.entity.VideTransResult; | |||
| import com.iformall.video.entity.VideUploadResult; | |||
| public interface VideoExcutor { | |||
| /** | |||
| * 上传视频 | |||
| * title:视频标题 | |||
| */ | |||
| public VideUploadResult uploadVideoStream(String title,InputStream inputStream,String ex); | |||
| /** | |||
| * 上传视频 | |||
| * title:视频标题 | |||
| */ | |||
| public VideUploadResult uploadVideoPath(String title, String url); | |||
| public String getVedioUploadProgress(String videoId); | |||
| public String getVedioContentLength(String videoId); | |||
| VideUploadResult getVideoDetailWithCache(String videoId,Boolean flag); | |||
| VideUploadResult getVideoDetailFromApi(String videoId); | |||
| public VideTransResult transVideo(String videoId,String transTemplateId); | |||
| public VideTransResult getTransVideoResult(String videoId, String taskId); | |||
| } | |||
| @@ -0,0 +1,35 @@ | |||
| package com.iformall.video; | |||
| import java.util.Map; | |||
| import java.util.concurrent.ConcurrentHashMap; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.beans.factory.annotation.Qualifier; | |||
| import org.springframework.data.redis.core.RedisTemplate; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.video.aliyun.AliyunVideoExcutor; | |||
| @Service | |||
| public class VideoFactory { | |||
| private Map<String,VideoExcutor> excutorMap = null; | |||
| @Autowired | |||
| AliyunVideoExcutor aliyunExcutor; | |||
| private Map<String,VideoExcutor> getExcutorMap() { | |||
| if (null == excutorMap) { | |||
| excutorMap = new ConcurrentHashMap<String,VideoExcutor>(); | |||
| excutorMap.put("aliyun", aliyunExcutor); | |||
| } | |||
| return excutorMap; | |||
| } | |||
| public VideoExcutor getExcutor(String type) { | |||
| VideoExcutor service = getExcutorMap().get(type); | |||
| return service; | |||
| } | |||
| } | |||
| @@ -0,0 +1,258 @@ | |||
| package com.iformall.video.aliyun; | |||
| import java.io.File; | |||
| import java.io.IOException; | |||
| import java.io.InputStream; | |||
| import java.net.URL; | |||
| import java.net.URLConnection; | |||
| import java.util.List; | |||
| import java.util.UUID; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.aliyuncs.vod.model.v20170321.CreateUploadVideoResponse; | |||
| import com.aliyuncs.vod.model.v20170321.GetPlayInfoResponse; | |||
| import com.aliyuncs.vod.model.v20170321.GetTranscodeTaskResponse; | |||
| import com.aliyuncs.vod.model.v20170321.SubmitTranscodeJobsResponse; | |||
| import com.baomidou.mybatisplus.core.toolkit.IdWorker; | |||
| import com.iformall.video.entity.VideTransResult; | |||
| import org.apache.commons.io.FileUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.beans.factory.annotation.Qualifier; | |||
| import org.springframework.data.redis.core.RedisTemplate; | |||
| import org.springframework.stereotype.Component; | |||
| import com.aliyuncs.DefaultAcsClient; | |||
| import com.aliyuncs.exceptions.ClientException; | |||
| import com.aliyuncs.profile.DefaultProfile; | |||
| import com.iformall.video.VideoExcutor; | |||
| import com.iformall.video.aliyun.config.AliyunVideoConfig; | |||
| import com.iformall.video.aliyun.sdk.server.AliyunVedioServer; | |||
| import com.iformall.video.aliyun.sdk.server.UploadCacheHelper; | |||
| import com.iformall.video.aliyun.thread.AliyunVideoUploadThread; | |||
| import com.iformall.video.entity.VideUploadResult; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| @Component | |||
| @Slf4j | |||
| public class AliyunVideoExcutor implements VideoExcutor { | |||
| private String videoStatus = "Normal";//正常的视频状态 | |||
| @Autowired | |||
| AliyunVideoConfig config; | |||
| @Autowired | |||
| AliyunVideoUploadThread thread; | |||
| @Autowired | |||
| @Qualifier("objectCommonRedisTemplate") | |||
| RedisTemplate<String, Object> redisTemplate; | |||
| private String getUrlByVeidoId(String videoId) { | |||
| try { | |||
| return AliyunVedioServer.getVedioUrl(config, videoId); | |||
| } catch (ClientException e) { | |||
| log.error("aliyun getUrlByVeidoId error",e); | |||
| } | |||
| return null; | |||
| } | |||
| public DefaultAcsClient initVodClient() throws ClientException { | |||
| String regionId = config.getRegionId(); // 点播服务接入区域 | |||
| DefaultProfile profile = DefaultProfile.getProfile(regionId, config.getAccessKeyId(), config.getAccessKeySecret()); | |||
| DefaultAcsClient client = new DefaultAcsClient(profile); | |||
| return client; | |||
| } | |||
| /** | |||
| * https://help.aliyun.com/document_detail/61063.html?spm=a2c4g.11186623.6.1036.2f81d418ydqsX8 | |||
| * https://help.aliyun.com/document_detail/55407.htm?spm=a2c4g.11186623.2.12.77aad4180Hg9y0#doc-api-vod-CreateUploadVideo | |||
| */ | |||
| @Override | |||
| public VideUploadResult uploadVideoStream(String title,InputStream inputStream,String ex) { | |||
| VideUploadResult result = new VideUploadResult(); | |||
| try { | |||
| //该接口不会真正上传视频文件,您需要获得上传地址和凭证后,对其进行Base64解码,再调用OSS SDK将视频文件上传至指定的bucket中。详细操作,请参见基于OSS原生SDK上传视频到点播 | |||
| File folder = new File ("/video/upload/temp/aliyun") ; | |||
| if (!folder.exists()) { | |||
| folder.mkdirs(); | |||
| } | |||
| String _tempfilepath = "/video/upload/temp/aliyun/"+IdWorker.get32UUID()+ex; | |||
| File targetFile = new File(_tempfilepath); | |||
| FileUtils.copyInputStreamToFile(inputStream, targetFile); | |||
| CreateUploadVideoResponse response =AliyunVedioServer.createUploadVideo(config, title, _tempfilepath); | |||
| result.setVideoId(response.getVideoId()); | |||
| if((!StringUtils.isBlank(config.getAutoTrans())) && ("Y".equals(config.getAutoTrans()) || "y".equals(config.getAutoTrans()))) { | |||
| result.setAutoTrans(true); | |||
| }else { | |||
| result.setAutoTrans(false); | |||
| } | |||
| //result.setVideoUrl(getUrlByVeidoId(response.getVideoId())); | |||
| result.setSuccess(true); | |||
| //TODO 线程池的方式 | |||
| thread.executeAysncTask(config,response, _tempfilepath,redisTemplate); | |||
| } catch (Exception e) { | |||
| log.error("aliyun uploadLocalVideo error",e); | |||
| result.setSuccess(false); | |||
| result.setMsg(e.getLocalizedMessage()); | |||
| } | |||
| return result; | |||
| } | |||
| @Override | |||
| public VideUploadResult uploadVideoPath(String title, String url) { | |||
| VideUploadResult result = new VideUploadResult(); | |||
| if(StringUtils.isBlank(title)){ | |||
| title = "无标题"; | |||
| } | |||
| try { | |||
| InputStream inputStream = new URL(url).openStream(); | |||
| return this.uploadVideoStream(title,inputStream,".mp4"); | |||
| } catch (Exception e) { | |||
| log.error("aliyun uploadLocalVideo error",e); | |||
| result.setSuccess(false); | |||
| result.setMsg(e.getLocalizedMessage()); | |||
| } | |||
| return result; | |||
| } | |||
| private void setVideUploadResult(VideUploadResult result,String videoId) throws ClientException { | |||
| result.setVideoId(videoId); | |||
| GetPlayInfoResponse response = AliyunVedioServer.getPlayInfoResponse(config, videoId); | |||
| if(response != null){ | |||
| List<GetPlayInfoResponse.PlayInfo> playInfoList = response.getPlayInfoList(); | |||
| //播放地址 | |||
| for (GetPlayInfoResponse.PlayInfo playInfo : playInfoList) { | |||
| result.setVideoUrl(playInfo.getPlayURL()); | |||
| break; | |||
| } | |||
| GetPlayInfoResponse.VideoBase videoBase = response.getVideoBase(); | |||
| result.setDuration(videoBase.getDuration()); | |||
| result.setCoverURL(videoBase.getCoverURL()); | |||
| result.setTitle(videoBase.getTitle()); | |||
| } | |||
| } | |||
| @Override | |||
| public String getVedioUploadProgress(String videoId) { | |||
| return UploadCacheHelper.getUploadProgress(redisTemplate, videoId); | |||
| } | |||
| @Override | |||
| public VideUploadResult getVideoDetailWithCache(String videoId,Boolean flag) { | |||
| VideUploadResult videoDetail = null; | |||
| if (flag){ | |||
| videoDetail = UploadCacheHelper.getVideoDetail(redisTemplate, videoId); | |||
| } | |||
| if(videoDetail != null){ | |||
| return videoDetail; | |||
| }else{ | |||
| VideUploadResult result = getVideoDetailFromApi(videoId); | |||
| if(this.videoStatus.equals(result.getStatus())){ | |||
| if(StringUtils.isNotBlank(result.getVideoUrl())){ | |||
| UploadCacheHelper.cacheVideoDetail(redisTemplate, videoId,result); | |||
| } | |||
| // if(StringUtils.isNotBlank(result.getDuration()) && !"0.0".equals(result.getDuration())){ | |||
| // UploadCacheHelper.cacheVideoDetail(redisTemplate, videoId,result); | |||
| // } | |||
| }else{ | |||
| //还不能播放 | |||
| result.setSuccess(false); | |||
| } | |||
| return result; | |||
| } | |||
| } | |||
| @Override | |||
| public VideUploadResult getVideoDetailFromApi(String videoId) { | |||
| VideUploadResult result = new VideUploadResult(); | |||
| result.setVideoId(videoId); | |||
| try { | |||
| GetPlayInfoResponse response = AliyunVedioServer.getPlayInfoResponse(config, videoId); | |||
| log.info("shipin---Detail{}"+JSON.toJSONString(response)); | |||
| if(response != null){ | |||
| List<GetPlayInfoResponse.PlayInfo> playInfoList = response.getPlayInfoList(); | |||
| //播放地址 | |||
| for (GetPlayInfoResponse.PlayInfo playInfo : playInfoList) { | |||
| result.setStatus(playInfo.getStatus()); | |||
| result.setVideoUrl(playInfo.getPlayURL()); | |||
| result.setHeight(playInfo.getHeight()); | |||
| result.setWidth(playInfo.getWidth()); | |||
| result.setSize(playInfo.getSize()); | |||
| break; | |||
| } | |||
| GetPlayInfoResponse.VideoBase videoBase = response.getVideoBase(); | |||
| result.setDuration(videoBase.getDuration()); | |||
| result.setCoverURL(videoBase.getCoverURL()); | |||
| result.setTitle(videoBase.getTitle()); | |||
| result.setSuccess(true); | |||
| }else{ | |||
| result.setSuccess(false); | |||
| result.setMsg("未获取到视频"); | |||
| } | |||
| } catch (ClientException e) { | |||
| result.setSuccess(false); | |||
| result.setMsg("获取视频请求异常"); | |||
| } | |||
| return result; | |||
| } | |||
| @Override | |||
| public String getVedioContentLength(String videoId) { | |||
| return UploadCacheHelper.getContentLength(redisTemplate, videoId); | |||
| } | |||
| @Override | |||
| public VideTransResult transVideo(String videoId,String transTemplateId) { | |||
| VideTransResult result = new VideTransResult(); | |||
| //解码 | |||
| if ((!StringUtils.isBlank(videoId)) && (!StringUtils.isBlank(transTemplateId))) { | |||
| result.setVideoId(videoId); | |||
| SubmitTranscodeJobsResponse transResponse = new SubmitTranscodeJobsResponse(); | |||
| try { | |||
| transResponse = AliyunVedioServer.submitTranscodeJobs(config, videoId, transTemplateId); | |||
| //任务ID | |||
| //System.out.println("JobId = " + transResponse.getTranscodeJobs().get(0).getJobId()); | |||
| result.setTaskId(transResponse.getTranscodeTaskId()); | |||
| result.setSuccess(true); | |||
| return result; | |||
| }catch(Exception e) { | |||
| log.error(" aliyun uploadVideo trans error."+ videoId,e); | |||
| result.setSuccess(false); | |||
| result.setMsg(e.getLocalizedMessage()); | |||
| return result; | |||
| } | |||
| }else { | |||
| result.setSuccess(false); | |||
| result.setMsg("videoId或者转码模板编号为空"); | |||
| return result; | |||
| } | |||
| } | |||
| @Override | |||
| public VideTransResult getTransVideoResult(String videoId,String taskId) { | |||
| VideTransResult result = new VideTransResult(); | |||
| try { | |||
| GetTranscodeTaskResponse response = AliyunVedioServer.getTransTask(config, taskId); | |||
| if (null != response && "CompleteAllSucc".equals(response.getTranscodeTask().getTaskStatus())) { | |||
| result.setSuccess(true); | |||
| result.setTaskId(taskId); | |||
| result.setVideoId(videoId); | |||
| }else { | |||
| result.setSuccess(false); | |||
| result.setTaskId(taskId); | |||
| result.setVideoId(videoId); | |||
| result.setMsg(response.getTranscodeTask().getTaskStatus()); | |||
| } | |||
| } catch (Exception e) { | |||
| log.error(" aliyun uploadVideo getTransVideoResult error."+ videoId,e); | |||
| result.setSuccess(false); | |||
| result.setMsg(e.getLocalizedMessage()); | |||
| return result; | |||
| } | |||
| return result; | |||
| } | |||
| } | |||
| @@ -0,0 +1,18 @@ | |||
| package com.iformall.video.aliyun.config; | |||
| import org.springframework.boot.context.properties.ConfigurationProperties; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import lombok.Data; | |||
| @Data | |||
| @Configuration | |||
| @ConfigurationProperties(prefix = "video.aliyun") | |||
| public class AliyunVideoConfig { | |||
| private String accessKeyId; | |||
| private String accessKeySecret; | |||
| private String regionId;//cn-shanghai 点播服务接入区域 | |||
| private String endPoint;//以华东1(杭州)为例,Endpoint填写为https://oss-cn-hangzhou.aliyuncs.com | |||
| // private String transTemplateId;//转码的模板编号 | |||
| private String autoTrans; | |||
| } | |||
| @@ -0,0 +1,260 @@ | |||
| package com.iformall.video.aliyun.sdk.server; | |||
| import java.io.File; | |||
| import java.io.IOException; | |||
| import java.io.InputStream; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.net.MalformedURLException; | |||
| import java.net.URL; | |||
| import java.util.Base64; | |||
| import java.util.List; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.springframework.data.redis.core.RedisTemplate; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.aliyun.oss.OSS; | |||
| import com.aliyun.oss.OSSClient; | |||
| import com.aliyun.oss.OSSClientBuilder; | |||
| import com.aliyun.oss.model.PutObjectRequest; | |||
| import com.aliyun.oss.model.PutObjectResult; | |||
| import com.aliyuncs.DefaultAcsClient; | |||
| import com.aliyuncs.profile.DefaultProfile; | |||
| import com.aliyuncs.vod.model.v20170321.CreateUploadVideoRequest; | |||
| import com.aliyuncs.vod.model.v20170321.CreateUploadVideoResponse; | |||
| import com.aliyuncs.vod.model.v20170321.GetPlayInfoRequest; | |||
| import com.aliyuncs.vod.model.v20170321.GetPlayInfoResponse; | |||
| import com.aliyuncs.vod.model.v20170321.GetTranscodeTaskRequest; | |||
| import com.aliyuncs.vod.model.v20170321.GetTranscodeTaskResponse; | |||
| import com.aliyuncs.vod.model.v20170321.RefreshUploadVideoRequest; | |||
| import com.aliyuncs.vod.model.v20170321.RefreshUploadVideoResponse; | |||
| import com.aliyuncs.vod.model.v20170321.SubmitTranscodeJobsRequest; | |||
| import com.aliyuncs.vod.model.v20170321.SubmitTranscodeJobsResponse; | |||
| import com.iformall.video.aliyun.config.AliyunVideoConfig; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import com.aliyuncs.exceptions.ClientException; | |||
| import com.aliyuncs.exceptions.ServerException; | |||
| import com.aliyuncs.http.FormatType; | |||
| @Slf4j | |||
| public class AliyunVedioServer { | |||
| private static DefaultAcsClient initVodClient(AliyunVideoConfig config) throws ClientException { | |||
| DefaultProfile profile = DefaultProfile.getProfile(config.getRegionId(), config.getAccessKeyId(), config.getAccessKeySecret()); | |||
| DefaultAcsClient client = new DefaultAcsClient(profile); | |||
| return client; | |||
| } | |||
| /** | |||
| * 获取视频上传地址和凭证 | |||
| * @param | |||
| * @return CreateUploadVideoResponse 获取视频上传地址和凭证响应数据 | |||
| * @throws Exception | |||
| */ | |||
| public static CreateUploadVideoResponse createUploadVideo(AliyunVideoConfig config,String title,String fileName) throws Exception { | |||
| DefaultAcsClient client = initVodClient(config); | |||
| CreateUploadVideoRequest request = new CreateUploadVideoRequest(); | |||
| request.setTitle(title); | |||
| request.setFileName(fileName); | |||
| //UserData,用户自定义设置参数,用户需要单独回调URL及数据透传时设置(非必须) | |||
| //JSONObject userData = new JSONObject(); | |||
| //UserData回调部分设置 | |||
| //JSONObject messageCallback = new JSONObject(); | |||
| //messageCallback.put("CallbackURL", "http://192.168.0.0/16"); | |||
| //messageCallback.put("CallbackType", "http"); | |||
| //userData.put("MessageCallback", messageCallback.toJSONString()); | |||
| //UserData透传数据部分设置 | |||
| //JSONObject extend = new JSONObject(); | |||
| //extend.put("MyId", "user-defined-id"); | |||
| //userData.put("Extend", extend.toJSONString()); | |||
| //request.setUserData(userData.toJSONString()); | |||
| return client.getAcsResponse(request); | |||
| } | |||
| private static String toLanEndpoint(String bucket) { | |||
| // return bucket; | |||
| return bucket.replace(".aliyuncs.com", "-internal.aliyuncs.com"); | |||
| } | |||
| private static OssUploadClient initOssClient(CreateUploadVideoResponse response) throws UnsupportedEncodingException { | |||
| final Base64.Decoder decoder = Base64.getDecoder(); | |||
| String uploadAddressStr = new String(decoder.decode(response.getUploadAddress().getBytes("UTF-8"))); | |||
| String uploadAuthStr = new String(decoder.decode(response.getUploadAuth().getBytes("UTF-8"))); | |||
| JSONObject uploadAuth = JSON.parseObject(uploadAuthStr); | |||
| JSONObject uploadAddress = JSON.parseObject(uploadAddressStr); | |||
| String bucket = uploadAddress.getString("Bucket"); | |||
| String endpoint = uploadAddress.getString("Endpoint"); | |||
| String fileName = uploadAddress.getString("FileName"); | |||
| String accessKeyId = uploadAuth.getString("AccessKeyId"); | |||
| String accessKeySecret = uploadAuth.getString("AccessKeySecret"); | |||
| String securityToken = uploadAuth.getString("SecurityToken"); | |||
| OSS client = new OSSClientBuilder().build(toLanEndpoint(endpoint), accessKeyId, accessKeySecret,securityToken); | |||
| return new OssUploadClient(bucket, toLanEndpoint(endpoint), fileName, client); | |||
| } | |||
| private static OssUploadClient initOssClient(RefreshUploadVideoResponse response) throws UnsupportedEncodingException { | |||
| final Base64.Decoder decoder = Base64.getDecoder(); | |||
| String uploadAddressStr = new String(decoder.decode(response.getUploadAddress().getBytes("UTF-8"))); | |||
| String uploadAuthStr = new String(decoder.decode(response.getUploadAuth().getBytes("UTF-8"))); | |||
| JSONObject uploadAuth = JSON.parseObject(uploadAuthStr); | |||
| JSONObject uploadAddress = JSON.parseObject(uploadAddressStr); | |||
| String bucket = uploadAddress.getString("Bucket"); | |||
| String endpoint = uploadAddress.getString("Endpoint"); | |||
| String fileName = uploadAddress.getString("FileName"); | |||
| String accessKeyId = uploadAuth.getString("AccessKeyId"); | |||
| String accessKeySecret = uploadAuth.getString("AccessKeySecret"); | |||
| String securityToken = uploadAuth.getString("SecurityToken"); | |||
| OSS client = new OSSClientBuilder().build(toLanEndpoint(endpoint), accessKeyId, accessKeySecret,securityToken); | |||
| return new OssUploadClient(bucket, toLanEndpoint(endpoint), fileName, client); | |||
| } | |||
| public static void uploadVideo(AliyunVideoConfig config,CreateUploadVideoResponse response,String localFile,RedisTemplate<String, Object> redisTemplate) throws UnsupportedEncodingException { | |||
| OssUploadClient ossClient = initOssClient(response); | |||
| // 创建PutObjectRequest对象。 | |||
| // 填写Bucket名称、Object完整路径和本地文件的完整路径。Object完整路径中不能包含Bucket名称。 | |||
| // 如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件。 | |||
| //PutObjectRequest putObjectRequest = new PutObjectRequest(ossClient.getBucket(), ossClient.getFileName(), new File(localFile)); | |||
| // 如果需要上传时设置存储类型和访问权限,请参考以下示例代码。 | |||
| // ObjectMetadata metadata = new ObjectMetadata(); | |||
| // metadata.setHeader(OSSHeaders.OSS_STORAGE_CLASS, StorageClass.Standard.toString()); | |||
| // metadata.setObjectAcl(CannedAccessControlList.Private); | |||
| // putObjectRequest.setMetadata(metadata); | |||
| // 上传文件。 | |||
| String videoId = response.getVideoId(); | |||
| try { | |||
| PutObjectResult result = ossClient.getOssClient().putObject(new PutObjectRequest(ossClient.getBucket(), ossClient.getFileName(), new File(localFile)). | |||
| <PutObjectRequest>withProgressListener(new PutObjectProgressListener(redisTemplate,response.getVideoId(),localFile))); | |||
| }catch(Exception e) { | |||
| String msg = e.getLocalizedMessage(); | |||
| if (msg.contains("InvalidAccessKeyId")) { | |||
| OssUploadClient ossClient1 = null; | |||
| try { | |||
| RefreshUploadVideoResponse refrshResoponse = refreshUploadVideo(config,response.getVideoId()); | |||
| ossClient1 = initOssClient(refrshResoponse); | |||
| ossClient1.getOssClient().putObject(new PutObjectRequest(ossClient1.getBucket(), ossClient1.getFileName(), new File(localFile)). | |||
| <PutObjectRequest>withProgressListener(new PutObjectProgressListener(redisTemplate,refrshResoponse.getVideoId(),localFile))); | |||
| videoId = refrshResoponse.getVideoId(); | |||
| } catch (Exception e1) { | |||
| UploadCacheHelper.cacheError(redisTemplate, response.getVideoId()); | |||
| log.error(" aliyun uploadVideo error."+ response.getVideoId(),e); | |||
| videoId = ""; | |||
| } | |||
| if (null != ossClient1) { | |||
| ossClient1.getOssClient().shutdown(); | |||
| } | |||
| }else { | |||
| UploadCacheHelper.cacheError(redisTemplate, response.getVideoId()); | |||
| log.error(" aliyun uploadVideo error."+ response.getVideoId(),e); | |||
| videoId = ""; | |||
| } | |||
| } | |||
| // 关闭OSSClient。 | |||
| ossClient.getOssClient().shutdown(); | |||
| } | |||
| /** | |||
| * 提交转码 | |||
| */ | |||
| public static SubmitTranscodeJobsResponse submitTranscodeJobs(AliyunVideoConfig config,String videoId,String templateId) throws Exception { | |||
| DefaultAcsClient client = initVodClient(config); | |||
| SubmitTranscodeJobsRequest request = new SubmitTranscodeJobsRequest(); | |||
| //需要转码的视频ID | |||
| request.setVideoId(videoId); | |||
| //转码模板ID | |||
| request.setTemplateGroupId(templateId); | |||
| return client.getAcsResponse(request); | |||
| } | |||
| public static RefreshUploadVideoResponse refreshUploadVideo(AliyunVideoConfig config,String videoId) throws Exception { | |||
| RefreshUploadVideoRequest request = new RefreshUploadVideoRequest(); | |||
| request.setVideoId("VideoId"); | |||
| request.setAcceptFormat(FormatType.JSON); | |||
| request.setSysReadTimeout(1000); | |||
| request.setSysConnectTimeout(1000); | |||
| DefaultAcsClient client = initVodClient(config); | |||
| return client.getAcsResponse(request); | |||
| } | |||
| //获取视频播放地址 | |||
| //https://help.aliyun.com/document_detail/61064.html?spm=a2c4g.11186623.6.1043.7c2d3838K6wQPZ | |||
| public static String getVedioUrl(AliyunVideoConfig config,String videoId) throws ClientException { | |||
| DefaultAcsClient client = initVodClient(config); | |||
| GetPlayInfoResponse response = new GetPlayInfoResponse(); | |||
| try { | |||
| GetPlayInfoRequest request = new GetPlayInfoRequest(); | |||
| request.setVideoId(videoId); | |||
| response = client.getAcsResponse(request); | |||
| List<GetPlayInfoResponse.PlayInfo> playInfoList = response.getPlayInfoList(); | |||
| //播放地址 | |||
| for (GetPlayInfoResponse.PlayInfo playInfo : playInfoList) { | |||
| return playInfo.getPlayURL(); | |||
| } | |||
| } catch (Exception e) { | |||
| log.error("getVedioUrl error.",e); | |||
| } | |||
| return null; | |||
| } | |||
| public static GetPlayInfoResponse getPlayInfoResponse(AliyunVideoConfig config, String videoId) throws ClientException { | |||
| DefaultAcsClient client = initVodClient(config); | |||
| GetPlayInfoResponse response = new GetPlayInfoResponse(); | |||
| try { | |||
| GetPlayInfoRequest request = new GetPlayInfoRequest(); | |||
| request.setVideoId(videoId); | |||
| request.setAuthTimeout(31536000l);//365天有效 | |||
| request.setOutputType("cdn"); | |||
| return client.getAcsResponse(request); | |||
| } catch (Exception e) { | |||
| log.error("getVedioUrl error.",e); | |||
| } | |||
| return null; | |||
| } | |||
| //查询转码任务详情 | |||
| //https://help.aliyun.com/document_detail/109342.html | |||
| public static GetTranscodeTaskResponse getTransTask(AliyunVideoConfig config,String taskId) throws ClientException { | |||
| DefaultAcsClient client = initVodClient(config); | |||
| try { | |||
| GetTranscodeTaskResponse response = new GetTranscodeTaskResponse(); | |||
| response = getTranscodeTask(client,taskId); | |||
| return response; | |||
| // //转码任务ID | |||
| // System.out.println("TranscodeTaskId = " + response.getTranscodeTask().getTranscodeTaskId()); | |||
| // //转码任务状态 | |||
| // System.out.println("TaskStatus = " + response.getTranscodeTask().getTaskStatus()); | |||
| // for (GetTranscodeTaskResponse.TranscodeTask.TranscodeJobInfo jobInfo : response.getTranscodeTask().getTranscodeJobInfoList()) { | |||
| // //转码作业ID | |||
| // System.out.println("TranscodeJobId = " + jobInfo.getTranscodeJobId()); | |||
| // //转码作业状态 | |||
| // System.out.println("TranscodeJobStatus = " + jobInfo.getTranscodeJobStatus()); | |||
| // //转码处理进度 | |||
| // System.out.println("TranscodeProgress = " + jobInfo.getTranscodeProgress()); | |||
| // //转码作业完成时间 | |||
| // System.out.println("CompleteTime = " + jobInfo.getCompleteTime()); | |||
| // | |||
| // } | |||
| } catch (Exception e) { | |||
| log.error("getTransTask error.",e); | |||
| } | |||
| return null; | |||
| // System.out.println("RequestId = " + response.getRequestId()); | |||
| } | |||
| private static GetTranscodeTaskResponse getTranscodeTask(DefaultAcsClient client,String taskId) throws Exception { | |||
| GetTranscodeTaskRequest request = new GetTranscodeTaskRequest(); | |||
| request.setTranscodeTaskId(taskId); | |||
| return client.getAcsResponse(request); | |||
| } | |||
| } | |||
| @@ -0,0 +1,16 @@ | |||
| package com.iformall.video.aliyun.sdk.server; | |||
| import com.aliyun.oss.OSS; | |||
| import lombok.AllArgsConstructor; | |||
| import lombok.Data; | |||
| @Data | |||
| @AllArgsConstructor | |||
| public class OssUploadClient { | |||
| private String bucket; | |||
| private String endpoint; | |||
| private String fileName; | |||
| private OSS ossClient; | |||
| } | |||
| @@ -0,0 +1,90 @@ | |||
| package com.iformall.video.aliyun.sdk.server; | |||
| import java.io.File; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.springframework.data.redis.core.RedisTemplate; | |||
| import com.aliyun.oss.event.ProgressEvent; | |||
| import com.aliyun.oss.event.ProgressEventType; | |||
| import com.aliyun.oss.event.ProgressListener; | |||
| public class PutObjectProgressListener implements ProgressListener{ | |||
| private String videoId = ""; | |||
| private String localFile = ""; | |||
| private long bytesWritten = 0; | |||
| private long totalBytes = -1; | |||
| private boolean succeed = false; | |||
| private RedisTemplate<String, Object> redisTemplate; | |||
| public PutObjectProgressListener(RedisTemplate<String, Object> redisTemplate,String videoId,String localFile) { | |||
| this.redisTemplate = redisTemplate; | |||
| this.videoId = videoId; | |||
| this.localFile = localFile; | |||
| } | |||
| @Override | |||
| public void progressChanged(ProgressEvent progressEvent) { | |||
| long bytes = progressEvent.getBytes(); | |||
| ProgressEventType eventType = progressEvent.getEventType(); | |||
| switch (eventType) { | |||
| case TRANSFER_STARTED_EVENT: | |||
| if (null != redisTemplate && (!StringUtils.isBlank(videoId))) { | |||
| UploadCacheHelper.cacheStart(redisTemplate, videoId); | |||
| } | |||
| //System.out.println("Start to upload......"); | |||
| break; | |||
| case REQUEST_CONTENT_LENGTH_EVENT: | |||
| this.totalBytes = bytes; | |||
| if (null != redisTemplate && (!StringUtils.isBlank(videoId))) { | |||
| UploadCacheHelper.setContentLength(redisTemplate, videoId, String.valueOf(this.totalBytes)); | |||
| } | |||
| //System.out.println(this.totalBytes + " bytes in total will be uploaded to OSS"); | |||
| break; | |||
| case REQUEST_BYTE_TRANSFER_EVENT: | |||
| this.bytesWritten += bytes; | |||
| if (this.totalBytes != -1) { | |||
| int percent = (int)(this.bytesWritten * 100.0 / this.totalBytes); | |||
| //System.out.println(bytes + " bytes have been written at this time, upload progress: " + percent + "%(" + this.bytesWritten + "/" + this.totalBytes + ")"); | |||
| } else { | |||
| //System.out.println(bytes + " bytes have been written at this time, upload ratio: unknown" + "(" + this.bytesWritten + "/...)"); | |||
| } | |||
| if (null != redisTemplate && (!StringUtils.isBlank(videoId))) { | |||
| UploadCacheHelper.cacheProgress(redisTemplate, videoId, String.valueOf(this.bytesWritten)); | |||
| } | |||
| break; | |||
| case TRANSFER_COMPLETED_EVENT: | |||
| this.succeed = true; | |||
| if (null != redisTemplate && (!StringUtils.isBlank(videoId))) { | |||
| UploadCacheHelper.cacheComplete(redisTemplate, videoId); | |||
| } | |||
| if (!StringUtils.isBlank(localFile)) { | |||
| File f = new File(localFile); | |||
| if (f.exists()) { | |||
| f.delete(); | |||
| } | |||
| } | |||
| //System.out.println("Succeed to upload, " + this.bytesWritten + " bytes have been transferred in total"); | |||
| break; | |||
| case TRANSFER_FAILED_EVENT: | |||
| //System.out.println("Failed to upload, " + this.bytesWritten + " bytes have been transferred"); | |||
| if (null != redisTemplate && (!StringUtils.isBlank(videoId))) { | |||
| UploadCacheHelper.cacheError(redisTemplate, videoId); | |||
| } | |||
| if (!StringUtils.isBlank(localFile)) { | |||
| File f = new File(localFile); | |||
| if (f.exists()) { | |||
| f.delete(); | |||
| } | |||
| } | |||
| break; | |||
| default: | |||
| break; | |||
| } | |||
| } | |||
| public boolean isSucceed() { | |||
| return succeed; | |||
| } | |||
| } | |||
| @@ -0,0 +1,83 @@ | |||
| package com.iformall.video.aliyun.sdk.server; | |||
| import java.util.concurrent.TimeUnit; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.iformall.video.entity.VideUploadResult; | |||
| import org.springframework.data.redis.core.RedisTemplate; | |||
| import org.springframework.data.redis.core.ValueOperations; | |||
| public class UploadCacheHelper { | |||
| private static String PRE = "video:upload:aliyun:progress:"; | |||
| private static String DETAIL = "video:upload:aliyun:detail:"; | |||
| public static void cacheStart(RedisTemplate<String, Object> template,String videoId) { | |||
| ValueOperations<String, Object> operations = template.opsForValue(); | |||
| operations.set(PRE+videoId, "begin", 24*3600,TimeUnit.SECONDS); | |||
| } | |||
| public static void cacheComplete(RedisTemplate<String, Object> template,String videoId) { | |||
| ValueOperations<String, Object> operations = template.opsForValue(); | |||
| operations.set(PRE+videoId, "complete", 24*3600,TimeUnit.SECONDS); | |||
| } | |||
| public static void cacheProgress(RedisTemplate<String, Object> template,String videoId,String bytes) { | |||
| ValueOperations<String, Object> operations = template.opsForValue(); | |||
| operations.set(PRE+videoId, bytes, 24*3600,TimeUnit.SECONDS); | |||
| } | |||
| public static void cacheError(RedisTemplate<String, Object> template,String videoId) { | |||
| ValueOperations<String, Object> operations = template.opsForValue(); | |||
| operations.set(PRE+videoId, "error", 24*3600,TimeUnit.SECONDS); | |||
| } | |||
| public static String getUploadProgress(RedisTemplate<String, Object> template,String videoId) { | |||
| if (template.hasKey(PRE+videoId)) { | |||
| ValueOperations<String, Object> operations = template.opsForValue(); | |||
| Object o = operations.get(PRE+videoId); | |||
| if (o instanceof String) { | |||
| return (String)o; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static void setContentLength(RedisTemplate<String, Object> template,String videoId,String length) { | |||
| ValueOperations<String, Object> operations = template.opsForValue(); | |||
| operations.set("video:upload:aliyun:contengLength:"+videoId, length, 24*3600,TimeUnit.SECONDS); | |||
| } | |||
| public static String getContentLength(RedisTemplate<String, Object> template,String videoId) { | |||
| if (template.hasKey("video:upload:aliyun:contengLength:"+videoId)) { | |||
| ValueOperations<String, Object> operations = template.opsForValue(); | |||
| Object o = operations.get("video:upload:aliyun:contengLength:"+videoId); | |||
| if (o instanceof String) { | |||
| return (String)o; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static void cacheVideoDetail(RedisTemplate<String, Object> template,String videoId, Object value) { | |||
| ValueOperations<String, Object> operations = template.opsForValue(); | |||
| operations.set(DETAIL+videoId, value, 24,TimeUnit.DAYS); | |||
| } | |||
| public static VideUploadResult getVideoDetail(RedisTemplate<String, Object> template, String videoId) { | |||
| String key = DETAIL+videoId; | |||
| if (template.hasKey(key)) { | |||
| ValueOperations<String, Object> operations = template.opsForValue(); | |||
| Object o = operations.get(key); | |||
| if (o instanceof VideUploadResult) { | |||
| return (VideUploadResult)o; | |||
| }else if(o instanceof String){ | |||
| return JSON.parseObject((String)o,VideUploadResult.class); | |||
| }else{ | |||
| return JSON.parseObject(JSON.toJSONString(o),VideUploadResult.class); | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -0,0 +1,50 @@ | |||
| package com.iformall.video.aliyun.thread; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.core.task.AsyncTaskExecutor; | |||
| import org.springframework.scheduling.annotation.EnableAsync; | |||
| import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | |||
| import com.iformall.video.aliyun.config.AliyunVideoConfig; | |||
| import lombok.Data; | |||
| import java.util.concurrent.Executor; | |||
| import java.util.concurrent.ThreadPoolExecutor; | |||
| import org.springframework.beans.factory.annotation.Value; | |||
| import org.springframework.boot.context.properties.ConfigurationProperties; | |||
| @Data | |||
| @Configuration | |||
| @EnableAsync | |||
| @ConfigurationProperties(prefix = "video.aliyun") | |||
| public class AliyunVedioThreadExecutorConfig { | |||
| private int corePoolSize; | |||
| private int maxPoolSize; | |||
| private int queueCapacity; | |||
| private String namePrefix; | |||
| @Bean(name = "asyncVideoServiceExecutor") | |||
| public Executor asyncVideoServiceExecutor() { | |||
| ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | |||
| //配置核心线程数 | |||
| executor.setCorePoolSize(corePoolSize); | |||
| //配置最大线程数 | |||
| executor.setMaxPoolSize(maxPoolSize); | |||
| //配置队列大小 | |||
| executor.setQueueCapacity(queueCapacity); | |||
| //配置线程池中的线程的名称前缀 | |||
| executor.setThreadNamePrefix(namePrefix); | |||
| // rejection-policy:当pool已经达到max size的时候,如何处理新任务 | |||
| // CALLER_RUNS:不在新线程中执行任务,而是有调用者所在的线程来执行 | |||
| executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); | |||
| //执行初始化 | |||
| executor.initialize(); | |||
| return executor; | |||
| } | |||
| } | |||
| @@ -0,0 +1,28 @@ | |||
| package com.iformall.video.aliyun.thread; | |||
| import org.springframework.stereotype.Service; | |||
| import com.aliyuncs.vod.model.v20170321.CreateUploadVideoResponse; | |||
| import com.iformall.video.aliyun.config.AliyunVideoConfig; | |||
| import com.iformall.video.aliyun.sdk.server.AliyunVedioServer; | |||
| import com.iformall.video.aliyun.sdk.server.UploadCacheHelper; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.springframework.data.redis.core.RedisTemplate; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| //https://blog.csdn.net/m0_37701381/article/details/81072774 | |||
| @Service | |||
| @Slf4j | |||
| public class AliyunVideoUploadThread { | |||
| @Async("asyncVideoServiceExecutor") | |||
| public void executeAysncTask(AliyunVideoConfig config,CreateUploadVideoResponse response,String localFile,RedisTemplate<String, Object> redisTemplate) throws InterruptedException { | |||
| try { | |||
| AliyunVedioServer.uploadVideo(config,response, localFile,redisTemplate); | |||
| } catch (Exception e) { | |||
| log.error("AliyunVideoUploadThread upload error."+response.getVideoId(),e); | |||
| UploadCacheHelper.cacheError(redisTemplate, response.getVideoId()); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,11 @@ | |||
| package com.iformall.video.entity; | |||
| import lombok.Data; | |||
| @Data | |||
| public class VideTransResult { | |||
| private String videoId; | |||
| private boolean success = false; | |||
| private String msg; | |||
| private String taskId; | |||
| } | |||
| @@ -0,0 +1,23 @@ | |||
| package com.iformall.video.entity; | |||
| import lombok.Data; | |||
| @Data | |||
| public class VideUploadResult { | |||
| private String status; | |||
| private String videoId; | |||
| private String videoUrl; | |||
| private Long height; | |||
| private Long Width; | |||
| private String coverURL;//视频封面 | |||
| private String duration;//视频时长 | |||
| private String title;//视频标题 | |||
| private Long size;//视频大小 b | |||
| private boolean success = false; | |||
| private String msg; | |||
| private boolean autoTrans;//是否自动转码 | |||
| } | |||