refactor: prefix Mi for all entities (#11719)

* wip

* wip

* wip

* wip

* Update RepositoryModule.ts

* wip

* wip

* wip

* Revert "wip"

This reverts commit c1c13b37d2.
This commit is contained in:
syuilo
2023-08-16 17:51:28 +09:00
committed by GitHub
parent 9264ca336b
commit 792622aead
229 changed files with 1990 additions and 1990 deletions

View File

@@ -7,8 +7,8 @@ import { Inject, Injectable } from '@nestjs/common';
import { DI } from '@/di-symbols.js';
import type { NotesRepository, UsersRepository } from '@/models/index.js';
import { IdentifiableError } from '@/misc/identifiable-error.js';
import type { LocalUser, RemoteUser, User } from '@/models/entities/User.js';
import type { Note } from '@/models/entities/Note.js';
import type { MiLocalUser, MiRemoteUser, MiUser } from '@/models/entities/User.js';
import type { MiNote } from '@/models/entities/Note.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js';
import { bindThis } from '@/decorators.js';
@@ -29,7 +29,7 @@ export class GetterService {
* Get note for API processing
*/
@bindThis
public async getNote(noteId: Note['id']) {
public async getNote(noteId: MiNote['id']) {
const note = await this.notesRepository.findOneBy({ id: noteId });
if (note == null) {
@@ -43,21 +43,21 @@ export class GetterService {
* Get user for API processing
*/
@bindThis
public async getUser(userId: User['id']) {
public async getUser(userId: MiUser['id']) {
const user = await this.usersRepository.findOneBy({ id: userId });
if (user == null) {
throw new IdentifiableError('15348ddd-432d-49c2-8a5a-8069753becff', 'No such user.');
}
return user as LocalUser | RemoteUser;
return user as MiLocalUser | MiRemoteUser;
}
/**
* Get remote user for API processing
*/
@bindThis
public async getRemoteUser(userId: User['id']) {
public async getRemoteUser(userId: MiUser['id']) {
const user = await this.getUser(userId);
if (!this.userEntityService.isRemoteUser(user)) {
@@ -71,7 +71,7 @@ export class GetterService {
* Get local user for API processing
*/
@bindThis
public async getLocalUser(userId: User['id']) {
public async getLocalUser(userId: MiUser['id']) {
const user = await this.getUser(userId);
if (!this.userEntityService.isLocalUser(user)) {