reghao 7 місяців тому
батько
коміт
0bc44afd86

+ 0 - 21
account/account-api/src/main/java/cn/reghao/tnb/account/api/dto/AccountAvatar.java

@@ -1,21 +0,0 @@
-package cn.reghao.tnb.account.api.dto;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import java.io.Serializable;
-
-/**
- * @author reghao
- * @date 2023-08-24 16:22:48
- */
-@Setter
-@Getter
-public class AccountAvatar implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private Long userId;
-    private String userIdStr;
-    private String screenName;
-    private String avatarUrl;
-}

+ 0 - 1
account/account-api/src/main/java/cn/reghao/tnb/account/api/iface/AccountQuery.java

@@ -13,7 +13,6 @@ public interface AccountQuery {
     Long getUserId(String username);
     AccountInfo getAccountInfo(long userId);
     List<AccountInfo> getAccountInfos(List<Long> userIds);
-    List<AccountAvatar> getAccountAvatars(List<Long> userIds);
     AccountInfo getByMobile(String mobile);
     AccountInfo getByUsername(String username);
     @Deprecated

+ 0 - 6
account/account-service/src/main/java/cn/reghao/tnb/account/app/db/mapper/UserAccountMapper.java

@@ -2,8 +2,6 @@ package cn.reghao.tnb.account.app.db.mapper;
 
 import cn.reghao.jutil.jdk.db.BaseMapper;
 import cn.reghao.jutil.jdk.db.Page;
-import cn.reghao.tnb.account.api.dto.AccountAvatar;
-import cn.reghao.tnb.account.api.dto.AccountInfo;
 import cn.reghao.tnb.account.api.dto.AccountInfo;
 import cn.reghao.tnb.account.app.model.dto.AccountDetail;
 import cn.reghao.tnb.account.app.model.po.UserAccount;
@@ -42,15 +40,11 @@ public interface UserAccountMapper extends BaseMapper<UserAccount> {
 
     AccountInfo findAccountInfo(long userId);
     List<AccountInfo> findAccountInfos(List<Long> list);
-    List<AccountAvatar> findAccountAvatars(List<Long> list);
     AccountInfo findAccountInfoByMobile(String mobile);
     AccountInfo findAccountInfoByEmail(String email);
     AccountInfo findAccountInfoByUsername(String username);
 
     int countByScreenName(String screenName);
-    UserAccount findByScreenName(String screenName);
     List<AccountInfo> findScreenNameByPage(Page page, String screenName);
     List<AccountInfo> findAccountInfoByPage(Page page);
-    @Deprecated
-    List<UserAccount> findNotUsedAccount(int size);
 }

+ 0 - 10
account/account-service/src/main/java/cn/reghao/tnb/account/app/db/repository/AccountRepository.java

@@ -1,7 +1,6 @@
 package cn.reghao.tnb.account.app.db.repository;
 
 import cn.reghao.jutil.jdk.db.Page;
-import cn.reghao.tnb.account.api.dto.AccountAvatar;
 import cn.reghao.tnb.account.api.dto.AccountInfo;
 import cn.reghao.tnb.account.app.db.mapper.UserAccountMapper;
 import cn.reghao.tnb.account.app.db.mapper.UserAccountRoleMapper;
@@ -16,7 +15,6 @@ import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Repository;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -92,14 +90,6 @@ public class AccountRepository {
         return userAccountMapper.findAccountInfos(userIds);
     }
 
-    public List<AccountAvatar> getAccountAvatars(List<Long> userIds) {
-        if (userIds.isEmpty()) {
-            return Collections.emptyList();
-        }
-
-        return userAccountMapper.findAccountAvatars(userIds);
-    }
-
     public AccountInfo getAccountInfoByMobile(String mobile) {
         AccountInfo accountInfo = userAccountMapper.findAccountInfoByMobile(mobile);
         return accountInfo;

+ 0 - 12
account/account-service/src/main/java/cn/reghao/tnb/account/app/rpc/AccountQueryImpl.java

@@ -108,18 +108,6 @@ public class AccountQueryImpl implements AccountQuery {
         return userId;
     }
 
-    @Override
-    public List<AccountAvatar> getAccountAvatars(List<Long> userIds) {
-        List<AccountAvatar> list = accountRepository.getAccountAvatars(userIds);
-        list.forEach(accountAvatar -> {
-            long userId = accountAvatar.getUserId();
-            accountAvatar.setUserIdStr(getUserIdStr(userId));
-            accountAvatar.setUserId(null);
-        });
-
-        return list;
-    }
-
     @Override
     public void updateAvatar(long userId, String avatarUrl) {
         accountRepository.updateUserAvatar(userId, avatarUrl);

+ 0 - 20
account/account-service/src/main/resources/mapper/UserAccountMapper.xml

@@ -123,14 +123,6 @@
             #{id}
         </foreach>
     </select>
-    <select id="findAccountAvatars" resultType="cn.reghao.tnb.account.api.dto.AccountAvatar">
-        select user_id,screen_name,avatar_url
-        from user_account
-        where user_id in
-        <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
-            #{id}
-        </foreach>
-    </select>
 
     <select id="count" resultType="java.lang.Integer">
         select count(*)
@@ -157,11 +149,6 @@
         from user_account
         where screen_name like concat('%',#{screenName},'%')
     </select>
-    <select id="findByScreenName" resultType="cn.reghao.tnb.account.app.model.po.UserAccount">
-        select *
-        from user_account
-        where screen_name=#{screenName}
-    </select>
     <select id="findScreenNameByPage" resultType="cn.reghao.tnb.account.api.dto.AccountInfo">
         select user_id,screen_name,avatar_url,username,mobile,email
         from user_account
@@ -171,11 +158,4 @@
         select user_id,screen_name,avatar_url,username,mobile,email
         from user_account
     </select>
-    <select id="findNotUsedAccount" resultType="cn.reghao.tnb.account.app.model.po.UserAccount">
-        select *
-        from user_account
-        where user_id > 10100 and user_id &lt;= 18000 and screen_name like 'tnb\_%'
-        order by user_id asc
-        limit #{size}
-    </select>
 </mapper>

+ 0 - 38
account/account-service/src/test/java/UserAccountTest.java

@@ -54,44 +54,6 @@ public class UserAccountTest {
         }
     }
 
-    /**
-     * 本地发布视频稿件时使用已创建但未使用的帐号
-     *
-     * @param
-     * @return
-     * @date 2025-07-05 23:07:787
-     */
-    @Test
-    public void create() {
-        String basePath = "/home/reghao/disk/1/vod/1/12.个人/";
-        File baseDir = new File(basePath);
-        int len = baseDir.listFiles().length;
-
-        List<UserAccount> list = userAccountMapper.findNotUsedAccount(len);
-        if (list.size() != len) {
-            return;
-        }
-
-        File[] subDirs = baseDir.listFiles();
-        for (int i = 0; i < len; i++) {
-            long userId = list.get(i).getUserId();
-            File subDir = subDirs[i];
-
-            /*String filename = subDir.getName();
-            UserAccount userAccount = userAccountMapper.findByUserId(userId);
-            String username = userAccount.getUsername();
-            String username1 = username.replace("_", "");
-            String screenName = filename;
-            userAccountMapper.updateUserProfile(userId, username1, screenName);
-
-            String password = "ecUgpUeIX2ub84EYPsiQ";
-            String salt = RandomString.getSalt(64);
-            String encodedPassword = passwordEncoder.encode(password + salt);
-            userAccountMapper.updateSetPassword(userId, encodedPassword, salt);*/
-            userId++;
-        }
-    }
-
     @Autowired
     OAuthAppService oAuthAppService;
     @Test

+ 0 - 41
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/controller/AdminVideoController.java

@@ -1,41 +0,0 @@
-package cn.reghao.tnb.content.app.vod.controller;
-
-import cn.reghao.jutil.jdk.db.PageList;
-import cn.reghao.jutil.web.WebResult;
-import cn.reghao.tnb.common.auth.AuthUser;
-import cn.reghao.tnb.content.api.iface.AdminVideoService;
-import cn.reghao.tnb.content.app.vod.model.po.VideoPost;
-import cn.reghao.tnb.content.app.vod.rpc.AdminVideoServiceImpl;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * @author reghao
- * @date 2025-08-19 07:38:01
- */
-@Tag(name = "视频管理接口")
-@RestController
-@RequestMapping("/api/content/admin/video")
-public class AdminVideoController {
-    private final AdminVideoServiceImpl adminVideoService;
-
-    public AdminVideoController(AdminVideoServiceImpl adminVideoService) {
-        this.adminVideoService = adminVideoService;
-    }
-
-    @AuthUser
-    @Operation(summary = "点赞视频", description = "N")
-    @PostMapping("/thumb/{videoId}")
-    public String thumbUpVideo(@PathVariable("videoId") String videoId) {
-        return WebResult.success();
-    }
-
-    @AuthUser
-    @Operation(summary = "获取所有的视频", description = "N")
-    @GetMapping("/all")
-    public String getVideoPosts(@RequestParam("nextId") int nextId) {
-        PageList<VideoPost> pageList = adminVideoService.getVideoPosts(nextId);
-        return WebResult.success(pageList);
-    }
-}

+ 0 - 9
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/rpc/AdminVideoServiceImpl.java

@@ -193,13 +193,4 @@ public class AdminVideoServiceImpl implements AdminVideoService {
             e.printStackTrace();
         }*/
     }
-
-    public PageList<VideoPost> getVideoPosts(int nextId) {
-        List<VideoPost> list = videoPostMapper.findAllById(pageSize, nextId);
-        if (!list.isEmpty()) {
-            nextId = list.get(list.size()-1).getId();
-        }
-
-        return PageList.pageList(""+nextId, list);
-    }
 }

+ 17 - 17
content/content-service/src/main/resources/application-dev.yml

@@ -1,28 +1,28 @@
 dubbo:
   registry:
-    address: zookeeper://localhost:2181
+    address: zookeeper://192.168.0.209:2181
 spring:
   cloud:
     discovery:
       enabled: true
   data:
     mongodb:
-      host: localhost
-      database: "tnb_content_rdb"
+      host: 192.168.0.209
+      database: "tnb_content_tdb"
       authentication-database: admin
-      username: dev
-      password: Dev@123456
+      username: test
+      password: Test@123456
   redis:
     database: 0
-    host: localhost
+    host: 192.168.0.209
     port: 6379
-    password: Dev@123456
+    password: Test@123456
   rabbitmq:
-    host: localhost
+    host: 192.168.0.209
     port: 5672
     virtual-host: /
-    username: dev
-    password: Dev@123456
+    username: test
+    password: Test@123456
   shardingsphere:
     datasource:
       names: master,slave
@@ -33,16 +33,16 @@ spring:
       master:
         type: com.zaxxer.hikari.HikariDataSource
         driver-class-name: com.mysql.cj.jdbc.Driver
-        jdbc-url: jdbc:mysql://localhost/tnb_content_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
-        username: dev
-        password: Dev@123456
+        jdbc-url: jdbc:mysql://192.168.0.209/tnb_content_tdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
+        username: test
+        password: Test@123456
       slave:
         type: com.zaxxer.hikari.HikariDataSource
         driver-class-name: com.mysql.cj.jdbc.Driver
-        jdbc-url: jdbc:mysql://localhost/tnb_content_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
-        username: dev
-        password: Dev@123456
+        jdbc-url: jdbc:mysql://192.168.0.209/tnb_content_tdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
+        username: test
+        password: Test@123456
 eureka:
   client:
     service-url:
-      defaultZone: http://localhost:6060/eureka/
+      defaultZone: http://192.168.0.210:6060/eureka/

+ 0 - 2
user/user-api/src/main/java/cn/reghao/tnb/user/api/iface/AdminUserService.java

@@ -1,7 +1,6 @@
 package cn.reghao.tnb.user.api.iface;
 
 import cn.reghao.jutil.jdk.db.PageList;
-import cn.reghao.tnb.account.api.dto.AccountAvatar;
 import cn.reghao.tnb.user.api.dto.UserInfo;
 import cn.reghao.tnb.user.api.dto.UserSearch;
 import cn.reghao.tnb.user.api.dto.VipPlanInfo;
@@ -14,6 +13,5 @@ import java.util.List;
  */
 public interface AdminUserService {
     PageList<UserInfo> getUserList(UserSearch userSearch);
-    List<AccountAvatar> getPublishUsers(int publishType);
     List<VipPlanInfo> getVipPlans();
 }

+ 0 - 56
user/user-service/src/main/java/cn/reghao/tnb/user/app/controller/AdminUserController.java

@@ -1,56 +0,0 @@
-package cn.reghao.tnb.user.app.controller;
-
-import cn.reghao.jutil.jdk.db.PageList;
-import cn.reghao.jutil.web.WebResult;
-import cn.reghao.tnb.account.api.dto.AccountAvatar;
-import cn.reghao.tnb.account.api.dto.CrawledUser;
-import cn.reghao.tnb.common.auth.AuthUser;
-import cn.reghao.tnb.user.api.dto.UserInfo;
-import cn.reghao.tnb.user.api.iface.AdminUserService;
-import cn.reghao.tnb.user.app.rpc.AdminUserServiceImpl;
-import cn.reghao.tnb.user.app.service.CrawledUserService;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import org.springframework.http.MediaType;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * @author reghao
- * @date 2025-08-19 07:35:20
- */
-@Tag(name = "用户管理接口")
-@RestController
-@RequestMapping("/api/user/admin")
-public class AdminUserController {
-    private final AdminUserServiceImpl adminUserService;
-
-    public AdminUserController(AdminUserServiceImpl adminUserService) {
-        this.adminUserService = adminUserService;
-    }
-
-    @AuthUser
-    @Operation(summary = "获取所有的用户", description = "N")
-    @GetMapping("/user/all")
-    public String getAllUsers(@RequestParam("nextId") int nextId) {
-        PageList<UserInfo> list = adminUserService.getUserList(nextId);
-        return WebResult.success(list);
-    }
-
-    @AuthUser
-    @Operation(summary = "获取所有的用户", description = "N")
-    @GetMapping("/user/avatar")
-    public String getAllUsers1() {
-        List<AccountAvatar> list = adminUserService.getPublishUsers(1);
-        return WebResult.success(list);
-    }
-
-    @AuthUser
-    @Operation(summary = "查找 bilibili 用户", description = "N")
-    @PostMapping(value = "/search", produces = MediaType.APPLICATION_JSON_VALUE)
-    public String searchUser(@RequestParam("username") String username) {
-        return WebResult.success();
-    }
-}

+ 0 - 7
user/user-service/src/main/java/cn/reghao/tnb/user/app/rpc/AdminUserServiceImpl.java

@@ -1,7 +1,6 @@
 package cn.reghao.tnb.user.app.rpc;
 
 import cn.reghao.jutil.jdk.db.PageList;
-import cn.reghao.tnb.account.api.dto.AccountAvatar;
 import cn.reghao.tnb.account.api.dto.AccountInfo;
 import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.content.api.iface.UserContentService;
@@ -75,12 +74,6 @@ public class AdminUserServiceImpl implements AdminUserService {
         return userInfo;
     }
 
-    @Override
-    public List<AccountAvatar> getPublishUsers(int publishType) {
-        List<Long> userIds = userContentService.getContentUser(publishType);
-        return accountQuery.getAccountAvatars(userIds);
-    }
-
     @Override
     public List<VipPlanInfo> getVipPlans() {
         List<VipPlan> list = userVipService.getVipPlans();

+ 7 - 7
user/user-service/src/main/resources/application-dev.yml

@@ -1,20 +1,20 @@
 dubbo:
   registry:
-    address: zookeeper://localhost:2181
+    address: zookeeper://192.168.0.209:2181
 spring:
   cloud:
     discovery:
       enabled: true
   redis:
     database: 0
-    host: localhost
+    host: 192.168.0.209
     port: 6379
-    password: Dev@123456
+    password: Test@123456
   datasource:
-    url: jdbc:mysql://localhost:3306/tnb_account_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
-    username: dev
-    password: Dev@123456
+    url: jdbc:mysql://192.168.0.209:3306/tnb_account_tdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
+    username: test
+    password: Test@123456
 eureka:
   client:
     service-url:
-      defaultZone: http://localhost:6060/eureka/
+      defaultZone: http://192.168.0.210:6060/eureka/