Browse Source

修复收藏绘画模型,绘画字段缺失

杨兴卓 1 month ago
parent
commit
eae7543905

+ 46 - 46
xyzc-common/xyzc-common-web/src/main/java/com/xyzc/common/web/security/config/CorsConfig.java

@@ -1,46 +1,46 @@
-package com.xyzc.common.web.security.config;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.cors.CorsConfiguration;
-import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
-import org.springframework.web.filter.CorsFilter;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-/**
- * 跨域配置
- *
- * @author 杨兴卓
- */
-@Configuration
-public class CorsConfig implements WebMvcConfigurer {
-
-    @Bean
-    public CorsFilter corsFilter() {
-        final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
-        final CorsConfiguration corsConfiguration = new CorsConfiguration();
-        corsConfiguration.setAllowCredentials(true);
-        corsConfiguration.addAllowedHeader("*");
-        corsConfiguration.addAllowedOriginPattern("*");
-        corsConfiguration.addAllowedMethod("*");
-        source.registerCorsConfiguration("/**", corsConfiguration);
-        return new CorsFilter(source);
-    }
-
-    @Bean
-    public WebMvcConfigurer corsConfigurer() {
-        return new WebMvcConfigurer() {
-            @Override
-            public void addCorsMappings(CorsRegistry registry) {
-                registry.addMapping("/**")
-                        .allowedOrigins("*")
-                        .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
-                        .allowedHeaders("*")
-                        .allowCredentials(true);
-            }
-        };
-    }
-
-
-}
+//package com.xyzc.common.web.security.config;
+//
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.web.cors.CorsConfiguration;
+//import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+//import org.springframework.web.filter.CorsFilter;
+//import org.springframework.web.servlet.config.annotation.CorsRegistry;
+//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+//
+///**
+// * 跨域配置
+// *
+// * @author 杨兴卓
+// */
+//@Configuration
+//public class CorsConfig implements WebMvcConfigurer {
+//
+//    @Bean
+//    public CorsFilter corsFilter() {
+//        final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+//        final CorsConfiguration corsConfiguration = new CorsConfiguration();
+//        corsConfiguration.setAllowCredentials(true);
+//        corsConfiguration.addAllowedHeader("*");
+//        corsConfiguration.addAllowedOriginPattern("*");
+//        corsConfiguration.addAllowedMethod("*");
+//        source.registerCorsConfiguration("/**", corsConfiguration);
+//        return new CorsFilter(source);
+//    }
+//
+//    @Bean
+//    public WebMvcConfigurer corsConfigurer() {
+//        return new WebMvcConfigurer() {
+//            @Override
+//            public void addCorsMappings(CorsRegistry registry) {
+//                registry.addMapping("/**")
+//                        .allowedOrigins("*")
+//                        .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
+//                        .allowedHeaders("*")
+//                        .allowCredentials(true);
+//            }
+//        };
+//    }
+//
+//
+//}

+ 0 - 5
xyzc-start/src/main/java/com/xyzc/start/controller/UserInfoController.java

@@ -2,16 +2,11 @@ package com.xyzc.start.controller;
 
 import cn.hutool.core.io.FileUtil;
 import com.xyzc.common.core.utils.Result;
-import com.xyzc.common.core.utils.StringUtils;
-import com.xyzc.common.core.utils.file.MimeTypeUtils;
-import com.xyzc.common.web.security.user.SecurityUser;
 import com.xyzc.resource.api.RemoteFileService;
-import com.xyzc.resource.api.domain.RemoteFile;
 import com.xyzc.start.constant.FuelDeduct;
 import com.xyzc.start.domain.bo.AgentCardSecretBo;
 import com.xyzc.start.domain.bo.BaseUserCollectBo;
 import com.xyzc.start.domain.bo.HobbyBo;
-import com.xyzc.start.domain.vo.AvatarVo;
 import com.xyzc.start.domain.vo.BaseUserFuelFlowVo;
 import com.xyzc.start.domain.vo.BaseUserVo;
 import com.xyzc.start.domain.vo.IndustryVo;

+ 6 - 1
xyzc-start/src/main/java/com/xyzc/start/domain/vo/AvatarVo.java

@@ -6,7 +6,7 @@ import java.io.Serial;
 import java.io.Serializable;
 
 /**
- * 用户头像信息
+ * 图片上传返回值
  *
  * @author Michelle.Chung
  */
@@ -21,4 +21,9 @@ public class AvatarVo implements Serializable {
      */
     private String imgUrl;
 
+    /**
+     * 图像 oss_id
+     */
+    private Long ossId;
+
 }

+ 17 - 1
xyzc-start/src/main/java/com/xyzc/start/domain/vo/DrawGraphicsCollectVo.java

@@ -1,11 +1,27 @@
 package com.xyzc.start.domain.vo;
 
+import com.xyzc.start.constant.BaseUserConst;
+import com.xyzc.start.domain.BaseUserCollect;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 @Data
 @EqualsAndHashCode(callSuper = true)
-public class DrawGraphicsCollectVo extends DrawGraphicsSquareVo{
+public class DrawGraphicsCollectVo extends DrawGraphicsSquareVo {
 
+    /**
+     * 收藏id
+     */
     private String collectId;
+
+    /**
+     * 收藏类型
+     */
+    private Integer type;
+
+
+    public void setType(Integer type) {
+        this.type = BaseUserConst.COLLECT_IMAGE;
+    }
+
 }

+ 21 - 0
xyzc-start/src/main/java/com/xyzc/start/domain/vo/DrawModelCollectVo.java

@@ -1,5 +1,6 @@
 package com.xyzc.start.domain.vo;
 
+import com.xyzc.start.constant.BaseUserConst;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -11,4 +12,24 @@ public class DrawModelCollectVo extends DrawModelVo{
      * 收藏id
      */
     private String collectId;
+
+    /**
+     * 是否收藏
+     */
+    private Integer isCollect;
+
+    /**
+     * 收藏类型
+     */
+
+    private Integer type;
+
+    /**
+     * 设置默认值
+     * @param type
+     */
+    public void setType(Integer type){
+        this.type = BaseUserConst.COLLECT_DRAW_MODEL;
+    }
+
 }

+ 9 - 2
xyzc-start/src/main/resources/mapper/WebStart/BaseUserCollectMapper.xml

@@ -36,16 +36,23 @@
     <select id="queryDrawModelById" resultType="com.xyzc.start.domain.vo.DrawModelCollectVo">
         SELECT xdm.id       AS id,
                xbuc.id      AS collect_id,
-               xdm.oss_id,
+               oss.url      AS oss_id,
                xdm.model_name,
                xdm.description,
-               xuu.ugc_nick AS nick_name
+               xuu.ugc_nick AS ugc_user_name,
+               oss2.url     AS ugc_user_avatar,
+               xdm.use_count AS use_count,
+               xbuc.is_collect AS is_collect,
+               xbuc.type    AS type
         FROM xy_draw_model xdm
                  LEFT JOIN xy_base_user_collect xbuc ON xdm.id = xbuc.collect_id
+                 LEFT JOIN sys_oss oss ON xdm.oss_id = oss.oss_id
             AND `type` = 1
                  LEFT JOIN xy_ugc_user xuu ON xbuc.base_user_id = xuu.id
+                 LEFT JOIN sys_oss oss2 ON xuu.avatar = oss2.oss_id
         WHERE xdm.id = xbuc.collect_id
           AND xbuc.base_user_id = #{userId}
+          AND xdm.del_flag = '0'
         ORDER BY xbuc.create_time DESC
         LIMIT 10
     </select>